消息推送调整

This commit is contained in:
xy
2024-09-03 13:41:41 +08:00
parent c9e6f43729
commit 81286c33cb

View File

@@ -100,14 +100,16 @@ public class SendEventUtils {
//设备自身事件 不推送给用户,推送给业务管理
users = getAdminUser();
if (CollectionUtil.isNotEmpty(users)){
noticeUserDto.setPushClientId(Collections.singletonList(users.get(0).getDevCode()));
noticeUserDto.setTitle("设备事件");
//记录需要通知的用户和事件关系
CsEventUserPO csEventUser = new CsEventUserPO();
csEventUser.setUserId(users.get(0).getId());
csEventUser.setStatus(0);
csEventUser.setEventId(id);
result.add(csEventUser);
for (User user : users){
noticeUserDto.setPushClientId(Collections.singletonList(user.getDevCode()));
noticeUserDto.setTitle("设备事件");
//记录需要通知的用户和事件关系
CsEventUserPO csEventUser = new CsEventUserPO();
csEventUser.setUserId(user.getId());
csEventUser.setStatus(0);
csEventUser.setEventId(id);
result.add(csEventUser);
}
}
break;
case "2":
@@ -164,15 +166,17 @@ public class SendEventUtils {
users = getAdminUser();
if (CollectionUtil.isNotEmpty(users)){
eventName = epdFeignClient.findByName(eventName).getData().getShowName();
noticeUserDto.setPushClientId(Collections.singletonList(users.get(0).getDevCode()));
//记录需要通知的用户和事件关系
users.forEach(item->{
CsEventUserPO csEventUser = new CsEventUserPO();
csEventUser.setUserId(item.getId());
csEventUser.setStatus(0);
csEventUser.setEventId(id);
result.add(csEventUser);
});
for (User user : users){
noticeUserDto.setPushClientId(Collections.singletonList(user.getDevCode()));
//记录需要通知的用户和事件关系
users.forEach(item->{
CsEventUserPO csEventUser = new CsEventUserPO();
csEventUser.setUserId(item.getId());
csEventUser.setStatus(0);
csEventUser.setEventId(id);
result.add(csEventUser);
});
}
}
break;
case "2":
@@ -303,7 +307,7 @@ public class SendEventUtils {
}
}
if (CollectionUtil.isNotEmpty(result)){
users = userFeignClient.getUserByIdList(result).getData();
users = userFeignClient.appuserByIdList(result).getData();
}
return users;
}
@@ -319,7 +323,7 @@ public class SendEventUtils {
.map(AppInfoSet::getUserId).collect(Collectors.toList());
}
if (CollectionUtil.isNotEmpty(result)){
users = userFeignClient.getUserByIdList(result).getData();
users = userFeignClient.appuserByIdList(result).getData();
}
return users;
}