|
@@ -16,6 +16,7 @@ import com.ruoyi.system.api.domain.SysUser;
|
|
|
import com.ruoyi.system.api.model.LoginUser;
|
|
|
import com.sooka.sponest.event.base.service.impl.BaseServiceImpl;
|
|
|
import com.sooka.sponest.event.eventAttach.domain.EventAttach;
|
|
|
+import com.sooka.sponest.event.eventAttach.mapper.EventAttachMapper;
|
|
|
import com.sooka.sponest.event.eventAttach.service.EventAttachService;
|
|
|
import com.sooka.sponest.event.eventDept.service.EventDeptService;
|
|
|
import com.sooka.sponest.event.eventLog.domain.EventLog;
|
|
@@ -23,6 +24,7 @@ import com.sooka.sponest.event.eventLog.service.EventLogService;
|
|
|
import com.sooka.sponest.event.eventMessage.domain.*;
|
|
|
import com.sooka.sponest.event.eventProcess.domain.BO.EventInfoBO;
|
|
|
import com.sooka.sponest.event.eventProcess.domain.EventInfo;
|
|
|
+import com.sooka.sponest.event.eventProcess.domain.VO.EventProcess;
|
|
|
import com.sooka.sponest.event.eventProcess.domain.VO.EventUnconfirmed;
|
|
|
import com.sooka.sponest.event.eventProcess.mapper.EventProcessMapper;
|
|
|
import com.sooka.sponest.event.eventProcess.service.EventProcessService;
|
|
@@ -71,6 +73,9 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
@Resource
|
|
|
private RemoteFileService fileService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private EventAttachMapper eventAttachMapper;
|
|
|
+
|
|
|
private final Lock lock = new ReentrantLock(true); // 公平锁
|
|
|
|
|
|
/**
|
|
@@ -360,15 +365,15 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
}
|
|
|
|
|
|
//获取事件信息
|
|
|
- EventInfoBO unconfirmedEventInfo = unconfirmedEventList.get(0);
|
|
|
- if (!EVENT_STATUS_1.equals(unconfirmedEventInfo.getEventStatus())) {
|
|
|
+ EventInfoBO eventInfoBO = unconfirmedEventList.get(0);
|
|
|
+ if (!EVENT_STATUS_1.equals(eventInfoBO.getEventStatus())) {
|
|
|
return AjaxResult.error(EventEnum.EVENT_NOT_FOUND.getDescribe());
|
|
|
}
|
|
|
|
|
|
// 根据deviceCode获取行管局集合
|
|
|
- List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).getAideviceDeptListByCode(unconfirmedEventInfo.getCameraCode(), "1", "0").getData();
|
|
|
+ List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).getAideviceDeptListByCode(eventInfoBO.getCameraCode(), "1", "0").getData();
|
|
|
if (StringUtils.isEmpty(listDept)) {
|
|
|
- logger.info("无法匹配相关部门!摄像头编号为:{}", unconfirmedEventInfo.getCameraCode());
|
|
|
+ logger.info("无法匹配相关部门!摄像头编号为:{}", eventInfoBO.getCameraCode());
|
|
|
}
|
|
|
|
|
|
//插入行管局部门
|
|
@@ -378,20 +383,21 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + EventEnum.EVENT_CONFIRM.getDescribe(), EVENT_LOG_TYPE_2, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), DateUtils.getNowDate());
|
|
|
|
|
|
//下载附件到本地
|
|
|
- moveAttach(unconfirmedEventInfo.getAttachList(), eventInfo.getEventId());
|
|
|
+ moveAttach(eventInfoBO.getAttachList(), eventInfo.getEventId());
|
|
|
|
|
|
//设置事件状态为确认事件
|
|
|
- unconfirmedEventInfo.setEventStatus(EVENT_STATUS_2);
|
|
|
+ eventInfoBO.setEventStatus(EVENT_STATUS_2);
|
|
|
|
|
|
//如果确认的是火情事件, 需要设置事件类型;
|
|
|
if (StringUtils.isNotEmpty(eventInfo.getNewEventType())) {
|
|
|
- unconfirmedEventInfo.setEventType(eventInfo.getNewEventType());
|
|
|
+ eventInfoBO.setEventType(eventInfo.getNewEventType());
|
|
|
}
|
|
|
|
|
|
//将事件主体移动到确认表
|
|
|
- eventProcessMapper.insertEventProcess(unconfirmedEventInfo);
|
|
|
+ eventInfoBO.setTableName("event_process");
|
|
|
+ eventProcessMapper.insertEventInfo(eventInfoBO);
|
|
|
//删除待确认表
|
|
|
- eventProcessMapper.deleteEventUnconfirmed(unconfirmedEventInfo);
|
|
|
+ eventProcessMapper.deleteEventUnconfirmed(eventInfoBO);
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
logger.error("事件处置失败!输入参数:{}", eventInfo, e);
|
|
@@ -455,7 +461,8 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
|
|
|
//将事件主体移动到无异常表
|
|
|
eventInfoBO.setEventStatus(eventInfo.getEventStatus());
|
|
|
- eventProcessMapper.insertEventUsual(eventInfoBO);
|
|
|
+ eventInfoBO.setTableName("event_usual");
|
|
|
+ eventProcessMapper.insertEventInfo(eventInfoBO);
|
|
|
//下载附件到本地
|
|
|
if (flag) {
|
|
|
moveAttach(eventInfoBO.getAttachList(), eventInfo.getEventId());
|
|
@@ -692,8 +699,8 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public AjaxResult insertProcessEvent(EventInfo eventInfo) {
|
|
|
- if (eventInfo == null) {
|
|
|
+ public AjaxResult insertProcessEvent(EventProcess eventProcess) {
|
|
|
+ if (eventProcess == null) {
|
|
|
return AjaxResult.error("参数不可为空");
|
|
|
}
|
|
|
try {
|
|
@@ -707,15 +714,15 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
StringBuilder logSource = new StringBuilder();
|
|
|
StringBuilder logFileSource = new StringBuilder();
|
|
|
//判断上报来源
|
|
|
- if(REPORTING_SOURCE_1.equals(eventInfo.getReportSource())){
|
|
|
+ if(REPORTING_SOURCE_1.equals(eventProcess.getReportSource())){
|
|
|
// AI来源
|
|
|
logSource.append(EVENT_LOG_SOURCE_1);
|
|
|
logFileSource.append(EVENT_LOG_FILE_SOURCE_1);
|
|
|
- }else if(REPORTING_SOURCE_2.equals(eventInfo.getReportSource())){
|
|
|
+ }else if(REPORTING_SOURCE_2.equals(eventProcess.getReportSource())){
|
|
|
// PC端来源
|
|
|
logSource.append(EVENT_LOG_SOURCE_2);
|
|
|
logFileSource.append(EVENT_LOG_FILE_SOURCE_2);
|
|
|
- }else if(REPORTING_SOURCE_3.equals(eventInfo.getReportSource())){
|
|
|
+ }else if(REPORTING_SOURCE_3.equals(eventProcess.getReportSource())){
|
|
|
// 手机端来源
|
|
|
logSource.append(EVENT_LOG_SOURCE_3);
|
|
|
logFileSource.append(EVENT_LOG_FILE_SOURCE_3);
|
|
@@ -727,36 +734,36 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
Date nowDate = DateUtils.getNowDate();
|
|
|
|
|
|
//设置事件Id
|
|
|
- eventInfo.setEventId(IdUtils.fastSimpleUUID());
|
|
|
- eventInfo.setEventStatus(EVENT_STATUS_2);
|
|
|
- eventInfo.setReporter(sysUser.getNickName());
|
|
|
- eventInfo.setReportTime(nowDate);
|
|
|
- eventInfo.setCreateBy(String.valueOf(sysUser.getUserId()));
|
|
|
- eventInfo.setCreateTime(nowDate);
|
|
|
+ eventProcess.setEventId(IdUtils.fastSimpleUUID());
|
|
|
+ eventProcess.setEventStatus(EVENT_STATUS_2);
|
|
|
+ eventProcess.setReporter(sysUser.getNickName());
|
|
|
+ eventProcess.setReportTime(nowDate);
|
|
|
+ eventProcess.setCreateBy(String.valueOf(sysUser.getUserId()));
|
|
|
+ eventProcess.setCreateTime(nowDate);
|
|
|
|
|
|
List<CenterdataTAidevicedept> listDept = new ArrayList<>();
|
|
|
- if(!eventInfo.getDeptIdList().isEmpty()){
|
|
|
- eventInfo.getDeptIdList().forEach(deptId-> listDept.add(new CenterdataTAidevicedept(deptId, "")));
|
|
|
+ if(!eventProcess.getDeptIdList().isEmpty()){
|
|
|
+ eventProcess.getDeptIdList().forEach(deptId-> listDept.add(new CenterdataTAidevicedept(deptId, "")));
|
|
|
//插入行管局部门
|
|
|
- eventDeptService.insertEventDept(eventInfo.getEventId(), listDept);
|
|
|
+ eventDeptService.insertEventDept(eventProcess.getEventId(), listDept);
|
|
|
}else{
|
|
|
return AjaxResult.error(EventEnum.DEPT_NOT_FOUND.getDescribe());
|
|
|
}
|
|
|
|
|
|
// 插入事件日志
|
|
|
- String logId = eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + EventEnum.EVENT_USER_INSERT.getDescribe(), EVENT_LOG_TYPE_2, logSource.toString(), String.valueOf(sysUser.getUserId()), nowDate);
|
|
|
+ String logId = eventLogService.insertEventLog(eventProcess.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + EventEnum.EVENT_USER_INSERT.getDescribe(), EVENT_LOG_TYPE_2, logSource.toString(), String.valueOf(sysUser.getUserId()), nowDate);
|
|
|
|
|
|
//存储附件
|
|
|
- if (!eventInfo.getPictureList().isEmpty()) {
|
|
|
+ if (!eventProcess.getPictureList().isEmpty()) {
|
|
|
List<EventAttach> attachList = new ArrayList<>();
|
|
|
- for (int i = 0; i < eventInfo.getPictureList().size(); i++) {
|
|
|
- attachList.add(new EventAttach(logId, eventInfo.getEventId(), eventInfo.getPictureList().get(i), logFileSource.toString(), FILE_URL, i));
|
|
|
+ for (int i = 0; i < eventProcess.getPictureList().size(); i++) {
|
|
|
+ attachList.add(new EventAttach(logId, eventProcess.getEventId(), eventProcess.getPictureList().get(i), logFileSource.toString(), FILE_URL, i));
|
|
|
}
|
|
|
- moveAttach(attachList, eventInfo.getEventId());
|
|
|
+ eventAttachMapper.batchInsertEventAttachProcess(attachList);
|
|
|
}
|
|
|
|
|
|
//写入主表
|
|
|
- eventProcessMapper.insertEventProcess(eventInfo);
|
|
|
+ eventProcessMapper.insertEventInfo(eventProcess);
|
|
|
|
|
|
return AjaxResult.success("事件新增成功!");
|
|
|
} catch (Exception e) {
|