| | |
| | | private final ISysDeptService deptService; |
| | | private final ProcessLogService processLogService; |
| | | private final ISysDictTypeService dictTypeService; |
| | | private final ProcessConfigInfoService processConfigInfoService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | if (processLogService.taskIsHangup(task.getId(), task.getProcessInstanceId())) { |
| | | taskVO.setTaskStatus(TaskStatusEnum.HANGUP); |
| | | } |
| | | |
| | | // 计算办理时间 |
| | | ProcessCoding processCoding = processCodingService.getByTaskId(task.getId()); |
| | | if (processCoding != null) { |
| | | if (StringUtils.isNotBlank(processCoding.getOvertime())) { |
| | | Long overtime = getTime(processCoding.getOvertime()); |
| | | |
| | | long durationTime = ((new Date()).getTime() - processCoding.getStartTaskTime().getTime()) / 1000; |
| | | |
| | | taskVO.setRemainingTime((overtime - durationTime) / 3600 + "小时"); |
| | | } else { |
| | | taskVO.setRemainingTime("-"); |
| | | } |
| | | } |
| | | this.distinctVo(taskVO); |
| | | vos.add(taskVO); |
| | | } |
| | |
| | | result.put("taskList", vos); |
| | | } |
| | | |
| | | private Long getTime(String timeStr) { |
| | | Long time = null; |
| | | if (StringUtils.isNotBlank(timeStr)) { |
| | | String[] timeArr = timeStr.split("-"); |
| | | // 解析天数和小时数 |
| | | int days = Integer.parseInt(timeArr[0]); |
| | | int hours = 0; |
| | | if (timeArr.length > 1) { |
| | | hours = Integer.parseInt(timeArr[1]); |
| | | } |
| | | time = (days * 24L + hours) * 3600L; |
| | | // //分-秒 |
| | | // time= (days * 60L) + hours; |
| | | } |
| | | return time; |
| | | } |
| | | |
| | | @Override |
| | | public void getAllTodoTask(String taskName, int pageSize, int pageNum, Result result) { |
| | | TaskQuery taskQuery = taskService.createTaskQuery() |