修改日志推送逻辑

master
lld 2026-04-01 21:07:48 +08:00
parent 468ea12025
commit 2da9a54c30
3 changed files with 9 additions and 9 deletions

View File

@ -89,10 +89,10 @@ public class SysUserAgri extends BaseEntity
private Boolean disabled; private Boolean disabled;
@TableField(exist = false) @TableField(exist = false)
private List<Long> idList; private List<String> imeiList;
public SysUserAgri(List<Long> idList) { public SysUserAgri(List<String> imeiList) {
this.idList = idList; this.imeiList = imeiList;
} }
public SysUserAgri() { public SysUserAgri() {

View File

@ -35,11 +35,11 @@ public class AgriServiceImpl implements AgriService {
if (CollectionUtils.isEmpty(offlineList)) { if (CollectionUtils.isEmpty(offlineList)) {
return Collections.emptyList(); return Collections.emptyList();
} }
List<Long> idList List<String> imeiList
= offlineList.stream().map(SysAgriInfo::getId).collect(Collectors.toList()); = offlineList.stream().map(SysAgriInfo::getImei).collect(Collectors.toList());
List<SysUserAgri> agriUser List<SysUserAgri> agriUser
= userAgriService.findAgriUser(new SysUserAgri(idList)); = userAgriService.findAgriUser(new SysUserAgri(imeiList));
if (CollectionUtils.isEmpty(agriUser)) { if (CollectionUtils.isEmpty(agriUser)) {
log.info("大棚未关联用户,暂停推送消息"); log.info("大棚未关联用户,暂停推送消息");
return Collections.emptyList(); return Collections.emptyList();

View File

@ -180,10 +180,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sys_user_agri user_agri sys_user_agri user_agri
LEFT JOIN sys_user `u` ON user_agri.user_id = `u`.user_id and `u`.del_flag=0 LEFT JOIN sys_user `u` ON user_agri.user_id = `u`.user_id and `u`.del_flag=0
<where> <where>
<if test="idList != null and idList.size() > 0"> <if test="imeiList != null and imeiList.size() > 0">
user_agri.agri_id IN user_agri.agri_id IN
<foreach collection="idList" item="id" open="(" separator="," close=")"> <foreach collection="imeiList" item="imei" open="(" separator="," close=")">
#{id} #{imei}
</foreach> </foreach>
</if> </if>
<if test="agriId != null "> and user_agri.agri_id = #{agriId}</if> <if test="agriId != null "> and user_agri.agri_id = #{agriId}</if>