|
@@ -129,7 +129,7 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
eventAttachService.batchInsertEventAttachUnconfirmed(logId, daHuaOtherEventVO.getEventId(), pictureList, EVENT_LOG_FILE_SOURCE_1, DH_2);
|
|
eventAttachService.batchInsertEventAttachUnconfirmed(logId, daHuaOtherEventVO.getEventId(), pictureList, EVENT_LOG_FILE_SOURCE_1, DH_2);
|
|
|
|
|
|
//上报状态事件, 可视化响铃推送
|
|
//上报状态事件, 可视化响铃推送
|
|
- SpringUtils.getBean(RedisService.class).convertAndSend(SOCKET_PUSH_TOPIC, eventUnconfirmed);
|
|
|
|
|
|
+// SpringUtils.getBean(RedisService.class).convertAndSend(SOCKET_PUSH_TOPIC, eventUnconfirmed);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
logger.error("事件新增失败!输入参数:{}", daHuaOtherEventVO, e);
|
|
logger.error("事件新增失败!输入参数:{}", daHuaOtherEventVO, e);
|
|
@@ -180,7 +180,7 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
eventAttachService.batchInsertEventAttachUnconfirmed(logId, daHuaFireEventVO.getEventId(), Arrays.asList(messageInfo.getPicture().split(",")), EVENT_LOG_FILE_SOURCE_1, DH_1);
|
|
eventAttachService.batchInsertEventAttachUnconfirmed(logId, daHuaFireEventVO.getEventId(), Arrays.asList(messageInfo.getPicture().split(",")), EVENT_LOG_FILE_SOURCE_1, DH_1);
|
|
|
|
|
|
//上报状态事件, 可视化响铃推送
|
|
//上报状态事件, 可视化响铃推送
|
|
- SpringUtils.getBean(RedisService.class).convertAndSend(SOCKET_PUSH_TOPIC, eventUnconfirmed);
|
|
|
|
|
|
+// SpringUtils.getBean(RedisService.class).convertAndSend(SOCKET_PUSH_TOPIC, eventUnconfirmed);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
logger.error("事件新增失败!输入参数:{}", daHuaFireEventVO, e);
|
|
logger.error("事件新增失败!输入参数:{}", daHuaFireEventVO, e);
|
|
@@ -235,6 +235,9 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
return usualEventDetailById;
|
|
return usualEventDetailById;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 确认事件
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult confirm(EventInfo eventInfo) {
|
|
public AjaxResult confirm(EventInfo eventInfo) {
|
|
@@ -292,6 +295,9 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 无异常事件
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public AjaxResult usual(EventInfo eventInfo) {
|
|
public AjaxResult usual(EventInfo eventInfo) {
|
|
@@ -349,79 +355,107 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 签收事件
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public AjaxResult eventFlow(EventInfo eventInfo) {
|
|
|
|
|
|
+ public AjaxResult signFor(EventInfo eventInfo) {
|
|
if (lock.tryLock()) { //获取锁
|
|
if (lock.tryLock()) { //获取锁
|
|
try {
|
|
try {
|
|
//业务代码
|
|
//业务代码
|
|
- // SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
|
|
+// SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
SysUser sysUser = new SysUser();
|
|
SysUser sysUser = new SysUser();
|
|
sysUser.setUserId(1000L);
|
|
sysUser.setUserId(1000L);
|
|
sysUser.setDeptId(365L);
|
|
sysUser.setDeptId(365L);
|
|
sysUser.setDeptNames("四平市");
|
|
sysUser.setDeptNames("四平市");
|
|
sysUser.setNickName("测试用户");
|
|
sysUser.setNickName("测试用户");
|
|
|
|
|
|
- //日志消息体
|
|
|
|
- StringBuilder logContent = new StringBuilder();
|
|
|
|
- //日志状态
|
|
|
|
- StringBuilder logType = new StringBuilder();
|
|
|
|
|
|
+ // 插入事件日志
|
|
|
|
+ eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + "签收该事件", EVENT_LOG_TYPE_3, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), new Date());
|
|
|
|
|
|
- // 确认事件判断是否设置为重复或者误报
|
|
|
|
- if (EVENT_STATUS_98.equals(eventInfo.getEventStatus()) || EVENT_STATUS_99.equals(eventInfo.getEventStatus())) {
|
|
|
|
|
|
+ //签收时, 选择联动部门
|
|
|
|
+ gangedDeptList(eventInfo);
|
|
|
|
|
|
- // 判断是误报或者重复
|
|
|
|
- if (EVENT_STATUS_98.equals(eventInfo.getEventStatus())) {
|
|
|
|
- logContent.append("操作该事件误报");
|
|
|
|
- logType.append(EVENT_LOG_TYPE_98);
|
|
|
|
|
|
+ //更新主表状态
|
|
|
|
+ eventInfo.setEventStatus(EVENT_STATUS_3);
|
|
|
|
+ eventProcessMapper.updateEventProcess(eventInfo);
|
|
|
|
|
|
- } else {
|
|
|
|
- logContent.append("判断该事件为重复事件");
|
|
|
|
- logType.append(EVENT_LOG_TYPE_99);
|
|
|
|
- }
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("事件处置失败!输入参数:{}", eventInfo, e);
|
|
|
|
+ return AjaxResult.error();
|
|
|
|
+ } finally {
|
|
|
|
+ lock.unlock(); //释放锁
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return AjaxResult.error(EventEnum.METHOD_LOCKED.getDescribe()); //已锁
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
+ }
|
|
|
|
|
|
- EventInfoBO eventInfoBO = eventProcessMapper.selectEventProcessList(eventInfo).get(0);
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 办结事件
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public AjaxResult completed(EventInfo eventInfo) {
|
|
|
|
+ if (lock.tryLock()) { //获取锁
|
|
|
|
+ try {
|
|
|
|
+ //业务代码
|
|
|
|
+// SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
+ SysUser sysUser = new SysUser();
|
|
|
|
+ sysUser.setUserId(1000L);
|
|
|
|
+ sysUser.setDeptId(365L);
|
|
|
|
+ sysUser.setDeptNames("四平市");
|
|
|
|
+ sysUser.setNickName("测试用户");
|
|
|
|
|
|
- // 插入事件日志
|
|
|
|
- eventLogService.insertEventLog( eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + logContent, logType.toString(), EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), new Date());
|
|
|
|
|
|
+ // 插入事件日志
|
|
|
|
+ eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + "办结该事件", EVENT_LOG_TYPE_4, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), new Date());
|
|
|
|
|
|
- //将事件主体移动到无异常表
|
|
|
|
- eventInfoBO.setEventStatus(eventInfo.getEventStatus());
|
|
|
|
- eventProcessMapper.insertEventUsual(eventInfoBO);
|
|
|
|
|
|
+ //更新主表状态
|
|
|
|
+ eventInfo.setEventStatus(EVENT_STATUS_4);
|
|
|
|
+ eventProcessMapper.updateEventProcess(eventInfo);
|
|
|
|
|
|
- //删除待确认表
|
|
|
|
- eventProcessMapper.deleteEventProcess(eventInfoBO);
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("事件处置失败!输入参数:{}", eventInfo, e);
|
|
|
|
+ return AjaxResult.error();
|
|
|
|
+ } finally {
|
|
|
|
+ lock.unlock(); //释放锁
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return AjaxResult.error(EventEnum.METHOD_LOCKED.getDescribe()); //已锁
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
+ }
|
|
|
|
|
|
- } else {
|
|
|
|
- //正常流转事件
|
|
|
|
-
|
|
|
|
- //判断日志流转状态
|
|
|
|
- if (EVENT_STATUS_3.equals(eventInfo.getEventStatus())) {
|
|
|
|
- //签收
|
|
|
|
- logType.append(EVENT_LOG_TYPE_3);
|
|
|
|
- logContent.append("签收该事件");
|
|
|
|
- //签收时, 选择联动部门
|
|
|
|
- gangedDeptList(eventInfo);
|
|
|
|
- } else if (EVENT_STATUS_4.equals(eventInfo.getEventStatus())) {
|
|
|
|
- //办结
|
|
|
|
- logType.append(EVENT_LOG_TYPE_4);
|
|
|
|
- logContent.append("办结该事件");
|
|
|
|
- } else if (EVENT_STATUS_5.equals(eventInfo.getEventStatus())) {
|
|
|
|
- //归档
|
|
|
|
- logType.append(EVENT_LOG_TYPE_5);
|
|
|
|
- logContent.append("归档该事件");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 插入事件日志
|
|
|
|
- eventLogService.insertEventLog( eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + logContent, logType.toString(), EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), new Date());
|
|
|
|
-
|
|
|
|
- //更新主表状态
|
|
|
|
- eventProcessMapper.updateEventProcess(eventInfo);
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 审核办结事件
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public AjaxResult audit(EventInfo eventInfo) {
|
|
|
|
+ if (lock.tryLock()) { //获取锁
|
|
|
|
+ try {
|
|
|
|
+ //业务代码
|
|
|
|
+// SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
+ SysUser sysUser = new SysUser();
|
|
|
|
+ sysUser.setUserId(1000L);
|
|
|
|
+ sysUser.setDeptId(365L);
|
|
|
|
+ sysUser.setDeptNames("四平市");
|
|
|
|
+ sysUser.setNickName("测试用户");
|
|
|
|
+
|
|
|
|
+ // 插入事件日志
|
|
|
|
+ eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + "审核结果:" + eventInfo.getEventDescription(), EVENT_LOG_TYPE_5, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), new Date());
|
|
|
|
+
|
|
|
|
+ //更新主表状态
|
|
|
|
+ if(StringUtils.isBlank(eventInfo.getEventStatus())){
|
|
|
|
+ eventInfo.setEventStatus(EVENT_STATUS_5);
|
|
}
|
|
}
|
|
|
|
+ eventProcessMapper.updateEventProcess(eventInfo);
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- logger.error("事件签收失败!输入参数:{}", eventInfo.getEventId(), e);
|
|
|
|
- return AjaxResult.error("事件签收失败!");
|
|
|
|
|
|
+ logger.error("事件处置失败!输入参数:{}", eventInfo, e);
|
|
|
|
+ return AjaxResult.error();
|
|
} finally {
|
|
} finally {
|
|
lock.unlock(); //释放锁
|
|
lock.unlock(); //释放锁
|
|
}
|
|
}
|
|
@@ -431,9 +465,56 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 归档事件
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public AjaxResult archive(EventInfo eventInfo) {
|
|
|
|
+ if (lock.tryLock()) { //获取锁
|
|
|
|
+ try {
|
|
|
|
+ //业务代码
|
|
|
|
+// SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
+ SysUser sysUser = new SysUser();
|
|
|
|
+ sysUser.setUserId(1000L);
|
|
|
|
+ sysUser.setDeptId(365L);
|
|
|
|
+ sysUser.setDeptNames("四平市");
|
|
|
|
+ sysUser.setNickName("测试用户");
|
|
|
|
+
|
|
|
|
+ // 插入事件日志
|
|
|
|
+ eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + "归档该事件", EVENT_LOG_TYPE_6, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), new Date());
|
|
|
|
+
|
|
|
|
+ //更新主表状态
|
|
|
|
+ eventInfo.setEventStatus(EVENT_STATUS_6);
|
|
|
|
+ eventProcessMapper.updateEventProcess(eventInfo);
|
|
|
|
+
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("事件处置失败!输入参数:{}", eventInfo, e);
|
|
|
|
+ return AjaxResult.error();
|
|
|
|
+ } finally {
|
|
|
|
+ lock.unlock(); //释放锁
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return AjaxResult.error(EventEnum.METHOD_LOCKED.getDescribe()); //已锁
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 协同处理事件部门
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public AjaxResult gangedDeptList(EventInfo eventInfo) {
|
|
public AjaxResult gangedDeptList(EventInfo eventInfo) {
|
|
if (!eventInfo.getDeptIdList().isEmpty()) {
|
|
if (!eventInfo.getDeptIdList().isEmpty()) {
|
|
|
|
+ // SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
|
+ SysUser sysUser = new SysUser();
|
|
|
|
+ sysUser.setUserId(1000L);
|
|
|
|
+ sysUser.setDeptId(365L);
|
|
|
|
+ sysUser.setDeptNames("四平市");
|
|
|
|
+ sysUser.setNickName("测试用户");
|
|
|
|
+
|
|
|
|
+ eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + "添加协同部门", EVENT_LOG_TYPE_100, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), new Date());
|
|
|
|
+
|
|
List<CenterdataTAidevicedept> listDept = new ArrayList<>();
|
|
List<CenterdataTAidevicedept> listDept = new ArrayList<>();
|
|
eventInfo.getDeptIdList().forEach(deptId -> {
|
|
eventInfo.getDeptIdList().forEach(deptId -> {
|
|
listDept.add(new CenterdataTAidevicedept(deptId, ""));
|
|
listDept.add(new CenterdataTAidevicedept(deptId, ""));
|