Browse Source

#告警修改

zhongwei
yang_shj 1 year ago
parent
commit
117acc2b09
  1. 7
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/MessageServiceImpl.java
  2. 1
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java

7
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/MessageServiceImpl.java

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

1
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java

@ -3,7 +3,6 @@ package com.hnac.hzims.alarm.monitor.listener;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.message.fegin.IMessageClient;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.queue.annotation.RedisQueue;

Loading…
Cancel
Save