处理推送消息为null的情况
This commit is contained in:
@@ -2,6 +2,7 @@ package org.dromara.sis.domain.bo.alarm;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.dromara.sis.domain.enums.EventSmallTypeEnum;
|
||||
|
||||
/**
|
||||
* 任务指派参数
|
||||
@@ -62,4 +63,7 @@ public class AlarmAssignmentBo {
|
||||
* 任务指派操作人员部门id
|
||||
*/
|
||||
private Long modifyDeptId;
|
||||
|
||||
private EventSmallTypeEnum smallType;
|
||||
|
||||
}
|
||||
|
@@ -246,11 +246,11 @@ public class EventAlarmReportServiceImpl implements IEventAlarmReportService {
|
||||
private void handleAlarm(String deviceIp, byte[] img, Integer level, EventSmallTypeEnum smallType, String desc) {
|
||||
// 生成告警记录
|
||||
SisAlarmEvents alarmRecord = alarmEventsService.createAlarmRecord(deviceIp, level, smallType, desc, List.of(img));
|
||||
autoAssign(alarmRecord.getId(), deviceIp);
|
||||
autoAssign(alarmRecord.getId(), deviceIp, smallType);
|
||||
}
|
||||
|
||||
|
||||
private void autoAssign(Long alarmId, String deviceIp) {
|
||||
private void autoAssign(Long alarmId, String deviceIp, EventSmallTypeEnum smallType) {
|
||||
SaTokenContextMockUtil.setMockContext(() -> {
|
||||
// 如果当前设备区域存在排班人员,那么惊醒自动指派操作
|
||||
List<RemoteAttendanceUserGroupVo> userGroupVos = remoteAttendanceService.queryAttendByCurrDateAndDeviceIp(new Date(), deviceIp);
|
||||
|
@@ -330,7 +330,7 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
|
||||
log.info("事件处理信息写入完成,result= {}", insert);
|
||||
// 进行消息推送
|
||||
String title = "视频预警";
|
||||
String content = "您有一条" + sisAlarmEvents.getSolveName() + "预警数据";
|
||||
String content = "您有一条" + bo.getSmallType().getDesc() + "预警数据";
|
||||
webSocketMessageService.pushMobileMessage(List.of(bo.getSolveId()), WebSocketMsgType.ALARM_MSG, title, content, JSONObject.toJSONString(sisAlarmEvents));
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user