| | |
| | | import com.ycl.domain.entity.ProjectProcess; |
| | | import com.ycl.factory.FlowServiceFactory; |
| | | import com.ycl.mapper.ProcessCodingMapper; |
| | | import com.ycl.mapper.ProcessLogMapper; |
| | | import com.ycl.mapper.ProjectInfoMapper; |
| | | import com.ycl.mapper.ProjectProcessMapper; |
| | | import com.ycl.service.ProcessCodingService; |
| | |
| | | private ProcessCodingMapper processCodingMapper; |
| | | @Autowired |
| | | private ProcessLogService processLogService; |
| | | @Autowired |
| | | private ProcessLogMapper processLogMapper; |
| | | |
| | | /** |
| | | * 赋码任务 |
| | | * 两个逻辑 改项目码、改节点颜色 |
| | |
| | | //当前正在运行的所有任务节点 |
| | | List<Task> taskList = taskService.createTaskQuery().active().list(); |
| | | if (CollectionUtils.isEmpty(taskList)) return; |
| | | //排除掉节点挂起的任务 |
| | | List<String> allHangupTask = processLogMapper.getAllHangup(); |
| | | taskList = taskList.stream() |
| | | .filter(task -> !allHangupTask.contains(task.getId())) |
| | | .collect(Collectors.toList()); |
| | | //TODO:筛选出流程实例id,用作项目挂起 |
| | | Set<String> proInsIds = taskList.stream() |
| | | .map(TaskInfo::getProcessInstanceId) |
| | |
| | | durationTime = subNodeHangupTime(hangupLogMap, task, durationTime); |
| | | |
| | | String status = GREEN; // 默认状态为绿色 |
| | | if (redTime != null && redTime !=0 && durationTime >= redTime) { |
| | | if (redTime != null && redTime != 0 && durationTime >= redTime) { |
| | | status = RED; // 如果超过红色时间阈值,则状态为红色 |
| | | } else if (yellowTime != null && yellowTime !=0 && durationTime >= yellowTime) { |
| | | } else if (yellowTime != null && yellowTime != 0 && durationTime >= yellowTime) { |
| | | status = YELLOW; // 否则,如果超过黄色时间阈值,则状态为黄色 |
| | | } |
| | | //处理办理期限 |
| | | String overtimeStatus = NORMAL; |
| | | if (overtime != null && overtime !=0 && durationTime >= overtime) { |
| | | if (overtime != null && overtime != 0 && durationTime >= overtime) { |
| | | overtimeStatus = OVERTIME; // 如果超过办理期限 |
| | | } |
| | | else if (overtime != null && overtime != 0 && durationTime >= (overtime - 12 * 60 * 60)) { |
| | | } else if (overtime != null && overtime != 0 && durationTime >= (overtime - 12 * 60 * 60)) { |
| | | overtimeStatus = WILLOVERTIME; // 如果临期(固定超时前12小时为临期) |
| | | } |
| | | // else if (overtime != null && overtime != 0 && durationDay >= (overtime - 60)) { |
| | |
| | | map.get(status).add(task.getProcessInstanceId()); |
| | | processCoding.setStatus(status); |
| | | processCoding.setOvertimeStatus(overtimeStatus); |
| | | processCoding.setStartTaskTime(task.getCreateTime()); |
| | | list.add(processCoding); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(),"赋码时间格式有误"); |
| | | log.error(e.getMessage(), "赋码时间格式有误"); |
| | | } |
| | | } |
| | | //更新项目码 |