|
|
@ -53,14 +53,14 @@ public class MessageServiceImpl implements MessageService { |
|
|
|
boolean support = alarmConfigService.isSupport(entity.getStationId(), entity.getAlarmSource(), entity.getAlarmType(), AlarmConstants.IS_PLATFORM_MESSAGE); |
|
|
|
boolean support = alarmConfigService.isSupport(entity.getStationId(), entity.getAlarmSource(), entity.getAlarmType(), AlarmConstants.IS_PLATFORM_MESSAGE); |
|
|
|
R<StationEntity> stationByCode = stationClient.getStationByCode(entity.getStationId()); |
|
|
|
R<StationEntity> stationByCode = stationClient.getStationByCode(entity.getStationId()); |
|
|
|
if (!stationByCode.isSuccess() && ObjectUtils.isEmpty(stationByCode.getData())) { |
|
|
|
if (!stationByCode.isSuccess() && ObjectUtils.isEmpty(stationByCode.getData())) { |
|
|
|
log.error("消息发送失败:站点code获取失败",entity); |
|
|
|
log.error("消息发送失败:站点code获取失败 : {}",entity); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Long dept = stationByCode.getData().getCreateDept(); |
|
|
|
Long dept = stationByCode.getData().getCreateDept(); |
|
|
|
// 获取站点用户
|
|
|
|
// 获取站点用户
|
|
|
|
R<List<User>> result = userClient.userListByDeptId(dept); |
|
|
|
R<List<User>> result = userClient.userListByDeptId(dept); |
|
|
|
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) { |
|
|
|
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) { |
|
|
|
log.error("消息发送失败:用户获取失败",entity); |
|
|
|
log.error("消息发送失败:用户获取失败 : {}",entity); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (support) { |
|
|
|
if (support) { |
|
|
@ -68,8 +68,7 @@ public class MessageServiceImpl implements MessageService { |
|
|
|
message.setBusinessClassify("warning"); |
|
|
|
message.setBusinessClassify("warning"); |
|
|
|
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey()); |
|
|
|
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey()); |
|
|
|
message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription()); |
|
|
|
message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription()); |
|
|
|
// todo
|
|
|
|
message.setTaskId(Long.valueOf(entity.getAlarmId())); |
|
|
|
// message.setTaskId(entity.getAlarmId());
|
|
|
|
|
|
|
|
message.setTenantId("200000"); |
|
|
|
message.setTenantId("200000"); |
|
|
|
message.setContent(entity.getAlarmContext()); |
|
|
|
message.setContent(entity.getAlarmContext()); |
|
|
|
message.setDeptId(dept); |
|
|
|
message.setDeptId(dept); |
|
|
|