修改日志推送逻辑
parent
468ea12025
commit
2da9a54c30
|
|
@ -89,10 +89,10 @@ public class SysUserAgri extends BaseEntity
|
|||
private Boolean disabled;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Long> idList;
|
||||
private List<String> imeiList;
|
||||
|
||||
public SysUserAgri(List<Long> idList) {
|
||||
this.idList = idList;
|
||||
public SysUserAgri(List<String> imeiList) {
|
||||
this.imeiList = imeiList;
|
||||
}
|
||||
|
||||
public SysUserAgri() {
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ public class AgriServiceImpl implements AgriService {
|
|||
if (CollectionUtils.isEmpty(offlineList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Long> idList
|
||||
= offlineList.stream().map(SysAgriInfo::getId).collect(Collectors.toList());
|
||||
List<String> imeiList
|
||||
= offlineList.stream().map(SysAgriInfo::getImei).collect(Collectors.toList());
|
||||
|
||||
List<SysUserAgri> agriUser
|
||||
= userAgriService.findAgriUser(new SysUserAgri(idList));
|
||||
= userAgriService.findAgriUser(new SysUserAgri(imeiList));
|
||||
if (CollectionUtils.isEmpty(agriUser)) {
|
||||
log.info("大棚未关联用户,暂停推送消息");
|
||||
return Collections.emptyList();
|
||||
|
|
|
|||
|
|
@ -180,10 +180,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sys_user_agri user_agri
|
||||
LEFT JOIN sys_user `u` ON user_agri.user_id = `u`.user_id and `u`.del_flag=0
|
||||
<where>
|
||||
<if test="idList != null and idList.size() > 0">
|
||||
<if test="imeiList != null and imeiList.size() > 0">
|
||||
user_agri.agri_id IN
|
||||
<foreach collection="idList" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
<foreach collection="imeiList" item="imei" open="(" separator="," close=")">
|
||||
#{imei}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="agriId != null "> and user_agri.agri_id = #{agriId}</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue