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