|
@@ -13,6 +13,7 @@ import com.ruoyi.system.api.RemoteDeptService;
|
|
import com.ruoyi.system.api.RemoteFileService;
|
|
import com.ruoyi.system.api.RemoteFileService;
|
|
import com.ruoyi.system.api.domain.SysDept;
|
|
import com.ruoyi.system.api.domain.SysDept;
|
|
import com.ruoyi.system.api.domain.SysUser;
|
|
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.base.service.impl.BaseServiceImpl;
|
|
import com.sooka.sponest.event.eventAttach.domain.EventAttach;
|
|
import com.sooka.sponest.event.eventAttach.domain.EventAttach;
|
|
import com.sooka.sponest.event.eventAttach.service.EventAttachService;
|
|
import com.sooka.sponest.event.eventAttach.service.EventAttachService;
|
|
@@ -100,8 +101,9 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
|
|
|
/**
|
|
/**
|
|
* 事件中心 - 综合查询 - 详情
|
|
* 事件中心 - 综合查询 - 详情
|
|
|
|
+ *
|
|
* @author limeng
|
|
* @author limeng
|
|
- * */
|
|
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public EventInfoBO getCompositeEventDetail(EventInfo eventInfo) {
|
|
public EventInfoBO getCompositeEventDetail(EventInfo eventInfo) {
|
|
EventInfoBO eventInfoBO = new EventInfoBO();
|
|
EventInfoBO eventInfoBO = new EventInfoBO();
|
|
@@ -226,7 +228,7 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void insertSensorEvent(SensorEventVo sensorEventVo) {
|
|
public void insertSensorEvent(SensorEventVo sensorEventVo) {
|
|
- List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).listForCommandCenter(sensorEventVo.getSensorId(), "1", "1").getData();
|
|
|
|
|
|
+ List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).getAideviceDeptListByCode(sensorEventVo.getSensorId(), "1", "1").getData();
|
|
if (StringUtils.isEmpty(listDept)) {
|
|
if (StringUtils.isEmpty(listDept)) {
|
|
logger.info("无法匹配相关部门!传感器为:{}", sensorEventVo.getReportor());
|
|
logger.info("无法匹配相关部门!传感器为:{}", sensorEventVo.getReportor());
|
|
return;
|
|
return;
|
|
@@ -287,88 +289,88 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
@DataScopeMutiDept(deptAlias = "d")
|
|
@DataScopeMutiDept(deptAlias = "d")
|
|
public List<EventInfoBO> selectUnConfirmedList(EventInfo eventInfo) {
|
|
public List<EventInfoBO> selectUnConfirmedList(EventInfo eventInfo) {
|
|
setSookaDataBase(eventInfo);
|
|
setSookaDataBase(eventInfo);
|
|
- List<EventInfoBO> eventInfoBOS = eventProcessMapper.selectUnConfirmedList(eventInfo);
|
|
|
|
- listSetPath(eventInfoBOS);
|
|
|
|
- return eventInfoBOS;
|
|
|
|
|
|
+ List<EventInfoBO> unconfirmedList = eventProcessMapper.selectUnConfirmedList(eventInfo);
|
|
|
|
+ listSetPath(unconfirmedList);
|
|
|
|
+ listSetEventStatusLabel(unconfirmedList);
|
|
|
|
+ return unconfirmedList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public EventInfo getUnconfirmedEventDetail(EventInfo eventInfo) {
|
|
public EventInfo getUnconfirmedEventDetail(EventInfo eventInfo) {
|
|
- EventInfo unconfirmedEventDetailById = eventProcessMapper.getUnconfirmedEventDetail(eventInfo);
|
|
|
|
- detailSetPath(unconfirmedEventDetailById.getEventLogList());
|
|
|
|
- return unconfirmedEventDetailById;
|
|
|
|
|
|
+ EventInfo unconfirmedEventDetail = eventProcessMapper.getUnconfirmedEventDetail(eventInfo);
|
|
|
|
+ detailSetPath(unconfirmedEventDetail.getEventLogList());
|
|
|
|
+ detailSetStatus(unconfirmedEventDetail);
|
|
|
|
+ return unconfirmedEventDetail;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@DataScopeMutiDept(deptAlias = "d")
|
|
@DataScopeMutiDept(deptAlias = "d")
|
|
public List<EventInfoBO> selectEventProcessList(EventInfo eventInfo) {
|
|
public List<EventInfoBO> selectEventProcessList(EventInfo eventInfo) {
|
|
setSookaDataBase(eventInfo);
|
|
setSookaDataBase(eventInfo);
|
|
- List<EventInfoBO> eventInfoBOS = eventProcessMapper.selectEventProcessList(eventInfo);
|
|
|
|
- listSetPath(eventInfoBOS);
|
|
|
|
- return eventInfoBOS;
|
|
|
|
|
|
+ List<EventInfoBO> processList = eventProcessMapper.selectEventProcessList(eventInfo);
|
|
|
|
+ listSetPath(processList);
|
|
|
|
+ listSetEventStatusLabel(processList);
|
|
|
|
+ return processList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public EventInfo getProcessEventDetail(EventInfo eventInfo) {
|
|
public EventInfo getProcessEventDetail(EventInfo eventInfo) {
|
|
- EventInfo confirmedEventDetailById = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
|
|
- detailSetPath(confirmedEventDetailById.getEventLogList());
|
|
|
|
- return confirmedEventDetailById;
|
|
|
|
|
|
+ EventInfo processEventDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
|
|
+ detailSetPath(processEventDetail.getEventLogList());
|
|
|
|
+ detailSetStatus(processEventDetail);
|
|
|
|
+ return processEventDetail;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@DataScopeMutiDept(deptAlias = "d")
|
|
@DataScopeMutiDept(deptAlias = "d")
|
|
public List<EventInfoBO> selectUsualList(EventInfo eventInfo) {
|
|
public List<EventInfoBO> selectUsualList(EventInfo eventInfo) {
|
|
setSookaDataBase(eventInfo);
|
|
setSookaDataBase(eventInfo);
|
|
- List<EventInfoBO> eventInfoBOS = eventProcessMapper.selectUsualList(eventInfo);
|
|
|
|
- listSetPath(eventInfoBOS);
|
|
|
|
- return eventInfoBOS;
|
|
|
|
|
|
+ List<EventInfoBO> usualList = eventProcessMapper.selectUsualList(eventInfo);
|
|
|
|
+ listSetPath(usualList);
|
|
|
|
+ listSetEventStatusLabel(usualList);
|
|
|
|
+ return usualList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public EventInfo getUsualEventDetail(EventInfo eventInfo) {
|
|
public EventInfo getUsualEventDetail(EventInfo eventInfo) {
|
|
- EventInfo usualEventDetailById = eventProcessMapper.getUsualEventDetail(eventInfo);
|
|
|
|
- detailSetPath(usualEventDetailById.getEventLogList());
|
|
|
|
- return usualEventDetailById;
|
|
|
|
|
|
+ EventInfo usualEventDetail = eventProcessMapper.getUsualEventDetail(eventInfo);
|
|
|
|
+ detailSetPath(usualEventDetail.getEventLogList());
|
|
|
|
+ detailSetStatus(usualEventDetail);
|
|
|
|
+ return usualEventDetail;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 确认事件
|
|
* 确认事件
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @DataScopeMutiDept(deptAlias = "d")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult confirm(EventInfo eventInfo) {
|
|
public AjaxResult confirm(EventInfo eventInfo) {
|
|
if (lock.tryLock()) { //获取锁
|
|
if (lock.tryLock()) { //获取锁
|
|
try {
|
|
try {
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
//业务代码
|
|
//业务代码
|
|
- SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
- if (null == sysUser) {
|
|
|
|
|
|
+ if (null == loginUser) {
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ SysUser sysUser = loginUser.getSysUser();
|
|
|
|
+ setSookaDataBase(eventInfo);
|
|
//查询事件
|
|
//查询事件
|
|
List<EventInfoBO> unconfirmedEventList = eventProcessMapper.selectUnConfirmedList(eventInfo);
|
|
List<EventInfoBO> unconfirmedEventList = eventProcessMapper.selectUnConfirmedList(eventInfo);
|
|
if (unconfirmedEventList.isEmpty()) {
|
|
if (unconfirmedEventList.isEmpty()) {
|
|
return AjaxResult.error(EventEnum.EVENT_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.EVENT_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
|
|
- //获取事件详情
|
|
|
|
- EventInfoBO unconfirmedEventDetail = unconfirmedEventList.get(0);
|
|
|
|
- if (!EVENT_STATUS_1.equals(unconfirmedEventDetail.getEventStatus())) {
|
|
|
|
|
|
+ //获取事件信息
|
|
|
|
+ EventInfoBO unconfirmedEventInfo = unconfirmedEventList.get(0);
|
|
|
|
+ if (!EVENT_STATUS_1.equals(unconfirmedEventInfo.getEventStatus())) {
|
|
return AjaxResult.error(EventEnum.EVENT_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.EVENT_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
|
|
- // 验证是否配置摄像头通道
|
|
|
|
- CenterdataTCamera centerdataTCamera = SpringUtils.getBean(RemoteMonitorService.class).getInfoByChannelCode(unconfirmedEventDetail.getCameraCode()).getData();
|
|
|
|
- if (StringUtils.isNull(centerdataTCamera)) {
|
|
|
|
- logger.error("无法匹配相关设备!ChannelSn:{}", unconfirmedEventDetail.getCameraCode());
|
|
|
|
- return AjaxResult.error(EventEnum.CAMERA_NOT_FOUND.getDescribe());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 验证是否配置指挥中心
|
|
|
|
- List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).listForCommandCenter(unconfirmedEventDetail.getCameraCode(), "1", "0").getData();
|
|
|
|
|
|
+ // 根据deviceCode获取行管局集合
|
|
|
|
+ List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).getAideviceDeptListByCode(unconfirmedEventInfo.getCameraCode(), "1", "0").getData();
|
|
if (StringUtils.isEmpty(listDept)) {
|
|
if (StringUtils.isEmpty(listDept)) {
|
|
- logger.info("无法匹配相关部门!摄像头编号为:{}", centerdataTCamera.getCameraCode());
|
|
|
|
- return AjaxResult.error(EventEnum.DEPT_NOT_FOUND.getDescribe());
|
|
|
|
|
|
+ logger.info("无法匹配相关部门!摄像头编号为:{}", unconfirmedEventInfo.getCameraCode());
|
|
}
|
|
}
|
|
|
|
|
|
//插入行管局部门
|
|
//插入行管局部门
|
|
@@ -378,14 +380,20 @@ 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());
|
|
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(unconfirmedEventDetail.getAttachList(), eventInfo.getEventId());
|
|
|
|
|
|
+ moveAttach(unconfirmedEventInfo.getAttachList(), eventInfo.getEventId());
|
|
|
|
|
|
//设置事件状态为确认事件
|
|
//设置事件状态为确认事件
|
|
- unconfirmedEventDetail.setEventStatus(EVENT_STATUS_2);
|
|
|
|
|
|
+ unconfirmedEventInfo.setEventStatus(EVENT_STATUS_2);
|
|
|
|
+
|
|
|
|
+ //如果确认的是火情事件, 需要设置事件类型;
|
|
|
|
+ if (StringUtils.isNotEmpty(eventInfo.getNewEventType())) {
|
|
|
|
+ unconfirmedEventInfo.setEventType(eventInfo.getNewEventType());
|
|
|
|
+ }
|
|
|
|
+
|
|
//将事件主体移动到确认表
|
|
//将事件主体移动到确认表
|
|
- eventProcessMapper.insertEventProcess(unconfirmedEventDetail);
|
|
|
|
|
|
+ eventProcessMapper.insertEventProcess(unconfirmedEventInfo);
|
|
//删除待确认表
|
|
//删除待确认表
|
|
- eventProcessMapper.deleteEventUnconfirmed(unconfirmedEventDetail);
|
|
|
|
|
|
+ eventProcessMapper.deleteEventUnconfirmed(unconfirmedEventInfo);
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
logger.error("事件处置失败!输入参数:{}", eventInfo, e);
|
|
logger.error("事件处置失败!输入参数:{}", eventInfo, e);
|
|
@@ -403,24 +411,30 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
* 无异常事件
|
|
* 无异常事件
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @DataScopeMutiDept(deptAlias = "d")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult usual(EventInfo eventInfo) {
|
|
public AjaxResult usual(EventInfo eventInfo) {
|
|
if (lock.tryLock()) { //获取锁
|
|
if (lock.tryLock()) { //获取锁
|
|
try {
|
|
try {
|
|
//业务代码
|
|
//业务代码
|
|
- SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
- if (null == sysUser) {
|
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
+ //业务代码
|
|
|
|
+ if (null == loginUser) {
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
+ SysUser sysUser = loginUser.getSysUser();
|
|
|
|
+
|
|
|
|
+ EventInfo queryParam = new EventInfo(eventInfo.getEventId());
|
|
|
|
+ setSookaDataBase(queryParam);
|
|
|
|
|
|
//设置标识, 判断待确认或已确认
|
|
//设置标识, 判断待确认或已确认
|
|
boolean flag = true;
|
|
boolean flag = true;
|
|
// 根据事件 ID 查询事件未确认列表
|
|
// 根据事件 ID 查询事件未确认列表
|
|
- List<EventInfoBO> eventInfoBOS = eventProcessMapper.selectUnConfirmedList(new EventInfo(eventInfo.getEventId()));
|
|
|
|
|
|
+ List<EventInfoBO> eventInfoBOS = eventProcessMapper.selectUnConfirmedList(queryParam);
|
|
|
|
|
|
// 如果事件未确认列表为空,则查询事件确认列表
|
|
// 如果事件未确认列表为空,则查询事件确认列表
|
|
if (eventInfoBOS.isEmpty()) {
|
|
if (eventInfoBOS.isEmpty()) {
|
|
- eventInfoBOS = eventProcessMapper.selectEventProcessList(new EventInfo(eventInfo.getEventId()));
|
|
|
|
|
|
+ eventInfoBOS = eventProcessMapper.selectEventProcessList(queryParam);
|
|
|
|
|
|
//设置标识为false, 证明时确认表中的事件. 则不需要移动附件
|
|
//设置标识为false, 证明时确认表中的事件. 则不需要移动附件
|
|
flag = false;
|
|
flag = false;
|
|
@@ -471,15 +485,18 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
* 签收事件
|
|
* 签收事件
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @DataScopeMutiDept(deptAlias = "d")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult signFor(EventInfo eventInfo) {
|
|
public AjaxResult signFor(EventInfo eventInfo) {
|
|
if (lock.tryLock()) { //获取锁
|
|
if (lock.tryLock()) { //获取锁
|
|
try {
|
|
try {
|
|
//业务代码
|
|
//业务代码
|
|
- SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
- if (null == sysUser) {
|
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
+ //业务代码
|
|
|
|
+ if (null == loginUser) {
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
+ SysUser sysUser = loginUser.getSysUser();
|
|
|
|
|
|
eventInfo.setEventStatus(EVENT_STATUS_2);
|
|
eventInfo.setEventStatus(EVENT_STATUS_2);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
@@ -513,15 +530,18 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
* 办结事件
|
|
* 办结事件
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @DataScopeMutiDept(deptAlias = "d")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult completed(EventInfo eventInfo) {
|
|
public AjaxResult completed(EventInfo eventInfo) {
|
|
if (lock.tryLock()) { //获取锁
|
|
if (lock.tryLock()) { //获取锁
|
|
try {
|
|
try {
|
|
//业务代码
|
|
//业务代码
|
|
- SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
- if (null == sysUser) {
|
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
+ //业务代码
|
|
|
|
+ if (null == loginUser) {
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
+ SysUser sysUser = loginUser.getSysUser();
|
|
|
|
|
|
eventInfo.setEventStatus(EVENT_STATUS_3);
|
|
eventInfo.setEventStatus(EVENT_STATUS_3);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
@@ -552,15 +572,20 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
* 审核办结事件
|
|
* 审核办结事件
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @DataScopeMutiDept(deptAlias = "d")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult audit(EventInfo eventInfo) {
|
|
public AjaxResult audit(EventInfo eventInfo) {
|
|
if (lock.tryLock()) { //获取锁
|
|
if (lock.tryLock()) { //获取锁
|
|
try {
|
|
try {
|
|
//业务代码
|
|
//业务代码
|
|
- SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
- if (null == sysUser) {
|
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
+ //业务代码
|
|
|
|
+ if (null == loginUser) {
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
+ SysUser sysUser = loginUser.getSysUser();
|
|
|
|
+
|
|
|
|
+ String setEventStatus = eventInfo.getEventStatus();
|
|
|
|
|
|
eventInfo.setEventStatus(EVENT_STATUS_4);
|
|
eventInfo.setEventStatus(EVENT_STATUS_4);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
@@ -572,8 +597,10 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + "审核结果:" + eventInfo.getEventDescription(), EVENT_LOG_TYPE_5, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), DateUtils.getNowDate());
|
|
eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + "审核结果:" + eventInfo.getEventDescription(), EVENT_LOG_TYPE_5, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), DateUtils.getNowDate());
|
|
|
|
|
|
//更新主表状态
|
|
//更新主表状态
|
|
- if (StringUtils.isBlank(eventInfo.getEventStatus())) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(setEventStatus)) {
|
|
eventInfo.setEventStatus(EVENT_STATUS_5);
|
|
eventInfo.setEventStatus(EVENT_STATUS_5);
|
|
|
|
+ } else {
|
|
|
|
+ eventInfo.setEventStatus(setEventStatus);
|
|
}
|
|
}
|
|
eventProcessMapper.updateEventProcess(eventInfo);
|
|
eventProcessMapper.updateEventProcess(eventInfo);
|
|
|
|
|
|
@@ -593,16 +620,20 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
* 归档事件
|
|
* 归档事件
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @DataScopeMutiDept(deptAlias = "d")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult archive(EventInfo eventInfo) {
|
|
public AjaxResult archive(EventInfo eventInfo) {
|
|
if (lock.tryLock()) { //获取锁
|
|
if (lock.tryLock()) { //获取锁
|
|
try {
|
|
try {
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
+
|
|
//业务代码
|
|
//业务代码
|
|
- SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
- if (null == sysUser) {
|
|
|
|
|
|
+ if (null == loginUser) {
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ SysUser sysUser = loginUser.getSysUser();
|
|
|
|
+
|
|
eventInfo.setEventStatus(EVENT_STATUS_5);
|
|
eventInfo.setEventStatus(EVENT_STATUS_5);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
if (null == eventProcessDetail) {
|
|
if (null == eventProcessDetail) {
|
|
@@ -634,10 +665,12 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
@Override
|
|
@Override
|
|
public AjaxResult cooperateDeptList(EventInfo eventInfo) {
|
|
public AjaxResult cooperateDeptList(EventInfo eventInfo) {
|
|
if (!eventInfo.getDeptIdList().isEmpty()) {
|
|
if (!eventInfo.getDeptIdList().isEmpty()) {
|
|
- SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
- if (null == sysUser) {
|
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
+ //业务代码
|
|
|
|
+ if (null == loginUser) {
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
+ SysUser sysUser = loginUser.getSysUser();
|
|
|
|
|
|
|
|
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
|
|
@@ -664,42 +697,70 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
@Override
|
|
@Override
|
|
public AjaxResult insertProcessEvent(EventInfo eventInfo) {
|
|
public AjaxResult insertProcessEvent(EventInfo eventInfo) {
|
|
try {
|
|
try {
|
|
- SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
- if (null == sysUser) {
|
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
+ //业务代码
|
|
|
|
+ if (null == loginUser) {
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
+ SysUser sysUser = loginUser.getSysUser();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ StringBuilder logSource = new StringBuilder();
|
|
|
|
+ StringBuilder logFileSource = new StringBuilder();
|
|
|
|
+ //判断上报来源
|
|
|
|
+ if(REPORTING_SOURCE_1.equals(eventInfo.getReportSource())){
|
|
|
|
+ //如果是AI, 日志和附件来源同样设置为AI
|
|
|
|
+ logSource.append(EVENT_LOG_SOURCE_1);
|
|
|
|
+ logFileSource.append(EVENT_LOG_FILE_SOURCE_1);
|
|
|
|
+ }else if(REPORTING_SOURCE_2.equals(eventInfo.getReportSource())){
|
|
|
|
+ //如果是PC, 日志和附件来源同样设置为PC
|
|
|
|
+ logSource.append(EVENT_LOG_SOURCE_2);
|
|
|
|
+ logFileSource.append(EVENT_LOG_FILE_SOURCE_2);
|
|
|
|
+ }else if(REPORTING_SOURCE_3.equals(eventInfo.getReportSource())){
|
|
|
|
+ //如果是PC, 日志和附件来源同样设置为PC
|
|
|
|
+ logSource.append(EVENT_LOG_SOURCE_3);
|
|
|
|
+ logFileSource.append(EVENT_LOG_FILE_SOURCE_3);
|
|
|
|
+ }else{
|
|
|
|
+ //不是三种方式, 返回未知来源事件.
|
|
|
|
+ return AjaxResult.error(EventEnum.SOURCE_NOT_FOUND.getDescribe());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Date nowDate = DateUtils.getNowDate();
|
|
|
|
|
|
//设置事件Id
|
|
//设置事件Id
|
|
eventInfo.setEventId(IdUtils.fastSimpleUUID());
|
|
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);
|
|
|
|
|
|
- // 验证是否配置摄像头通道
|
|
|
|
- CenterdataTCamera centerdataTCamera = SpringUtils.getBean(RemoteMonitorService.class).getInfoByChannelCode(eventInfo.getCameraCode()).getData();
|
|
|
|
- if (StringUtils.isNull(centerdataTCamera)) {
|
|
|
|
- logger.error("无法匹配相关设备!ChannelSn:{}", eventInfo.getCameraCode());
|
|
|
|
- return AjaxResult.error(EventEnum.CAMERA_NOT_FOUND.getDescribe());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 验证是否配置指挥中心
|
|
|
|
- List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).listForCommandCenter(eventInfo.getCameraCode(), "1", "0").getData();
|
|
|
|
- if (StringUtils.isEmpty(listDept)) {
|
|
|
|
- logger.info("无法匹配相关部门!摄像头编号为:{}", centerdataTCamera.getCameraCode());
|
|
|
|
|
|
+ List<CenterdataTAidevicedept> listDept = new ArrayList<>();
|
|
|
|
+ if(!eventInfo.getDeptIdList().isEmpty()){
|
|
|
|
+ eventInfo.getDeptIdList().forEach(deptId->{
|
|
|
|
+ listDept.add(new CenterdataTAidevicedept(deptId, ""));
|
|
|
|
+ });
|
|
|
|
+ //插入行管局部门
|
|
|
|
+ eventDeptService.insertEventDept(eventInfo.getEventId(), listDept);
|
|
|
|
+ }else{
|
|
return AjaxResult.error(EventEnum.DEPT_NOT_FOUND.getDescribe());
|
|
return AjaxResult.error(EventEnum.DEPT_NOT_FOUND.getDescribe());
|
|
}
|
|
}
|
|
|
|
|
|
- //插入行管局部门
|
|
|
|
- eventDeptService.insertEventDept(eventInfo.getEventId(), listDept);
|
|
|
|
-
|
|
|
|
// 插入事件日志
|
|
// 插入事件日志
|
|
- String logId = eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + EventEnum.EVENT_CONFIRM.getDescribe(), EVENT_LOG_TYPE_2, EVENT_LOG_SOURCE_2, String.valueOf(sysUser.getUserId()), DateUtils.getNowDate());
|
|
|
|
|
|
+ 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);
|
|
|
|
|
|
//存储附件
|
|
//存储附件
|
|
if (!eventInfo.getPictureList().isEmpty()) {
|
|
if (!eventInfo.getPictureList().isEmpty()) {
|
|
List<EventAttach> attachList = new ArrayList<>();
|
|
List<EventAttach> attachList = new ArrayList<>();
|
|
for (int i = 0; i < eventInfo.getPictureList().size(); i++) {
|
|
for (int i = 0; i < eventInfo.getPictureList().size(); i++) {
|
|
- attachList.add(new EventAttach(logId, eventInfo.getEventId(), eventInfo.getPictureList().get(i), EVENT_LOG_FILE_SOURCE_2, FILE_URL, i));
|
|
|
|
|
|
+ attachList.add(new EventAttach(logId, eventInfo.getEventId(), eventInfo.getPictureList().get(i), logFileSource.toString(), FILE_URL, i));
|
|
}
|
|
}
|
|
moveAttach(attachList, eventInfo.getEventId());
|
|
moveAttach(attachList, eventInfo.getEventId());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //写入主表
|
|
|
|
+ eventProcessMapper.insertEventProcess(eventInfo);
|
|
|
|
+
|
|
return AjaxResult.success("创建成功");
|
|
return AjaxResult.success("创建成功");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return AjaxResult.error(e.getMessage());
|
|
return AjaxResult.error(e.getMessage());
|
|
@@ -749,4 +810,26 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
eventAttachService.insertCompensationByEventId(eventId, DateUtils.getTime());
|
|
eventAttachService.insertCompensationByEventId(eventId, DateUtils.getTime());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void listSetEventStatusLabel(List<EventInfoBO> eventInfoBOS) {
|
|
|
|
+ Map<String, String> eventStatusMap = getEventStatusMap();
|
|
|
|
+ eventInfoBOS.forEach(eventInfoBO -> {
|
|
|
|
+ eventInfoBO.setEventStatus(MapUtils.getString(eventStatusMap, eventInfoBO.getEventStatus()));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void detailSetStatus(EventInfo eventInfo) {
|
|
|
|
+ Map<String, String> eventStatusMap = getEventStatusMap();
|
|
|
|
+ eventInfo.setEventStatus(MapUtils.getString(eventStatusMap, eventInfo.getEventStatus()));
|
|
|
|
+
|
|
|
|
+ if (!eventInfo.getEventLogList().isEmpty()) {
|
|
|
|
+ Map<String, String> operationTypeMap = getOperationTypeMap();
|
|
|
|
+ Map<String, String> operationSourceMap = getOperationSourceMap();
|
|
|
|
+ eventInfo.getEventLogList().forEach(logInfo -> {
|
|
|
|
+ logInfo.setOperationType(MapUtils.getString(operationTypeMap, logInfo.getOperationType()));
|
|
|
|
+ logInfo.setOperationSource(MapUtils.getString(operationSourceMap, logInfo.getOperationSource()));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|