| | |
| | | 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.total(vos.size()); |
| | | } |
| | | 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 |
| | |
| | | jsonData.setAfterHandlerIds(afterHandlerIds); |
| | | jsonData.setAfterHandlerType(form.getPeopleType()); |
| | | // 发布转办事件 |
| | | publisher.publishEvent(new TaskLogEvent(this, null,SecurityUtils.getUserId(), form.getProjectId(), form.getProcessInsId(), task.getId(), task.getName(),ProcessLogEventTypeEnum.DELEGATE, jsonData)); |
| | | publisher.publishEvent(new TaskLogEvent(this, null, SecurityUtils.getUserId(), form.getProjectId(), form.getProcessInsId(), task.getId(), task.getName(), ProcessLogEventTypeEnum.DELEGATE, jsonData)); |
| | | |
| | | return Result.ok("转办成功"); |
| | | } |
| | |
| | | Task task = taskService.createTaskQuery().taskId(form.getTaskId()).processInstanceId(form.getProcessInsId()).singleResult(); |
| | | if (Objects.nonNull(task)) { |
| | | // 添加跳过日志 |
| | | publisher.publishEvent(new TaskLogEvent(this, null,SecurityUtils.getUserId(), form.getProjectId(), form.getProcessInsId(), form.getTaskId(), task.getName(),ProcessLogEventTypeEnum.JUMP, new JumpData(form.getDesc()))); |
| | | publisher.publishEvent(new TaskLogEvent(this, null, SecurityUtils.getUserId(), form.getProjectId(), form.getProcessInsId(), form.getTaskId(), task.getName(), ProcessLogEventTypeEnum.JUMP, new JumpData(form.getDesc()))); |
| | | // 查出该任务绑定的表单 |
| | | |
| | | Map<String, Object> data = new HashMap<>(1); |
| | |
| | | } |
| | | dataList.add(jsonData); |
| | | //添加督办日志 |
| | | publisher.publishEvent(new TaskLogEvent(this, processLog.getId(), processLog.getUserId(), form.getProjectId(), form.getProcessInsId(), form.getTaskId(), task.getName(),ProcessLogEventTypeEnum.SUPERVISE, dataList)); |
| | | publisher.publishEvent(new TaskLogEvent(this, processLog.getId(), processLog.getUserId(), form.getProjectId(), form.getProcessInsId(), form.getTaskId(), task.getName(), ProcessLogEventTypeEnum.SUPERVISE, dataList)); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | |
| | |
| | | task.getName(), |
| | | ProcessLogEventTypeEnum.HANGUP, |
| | | new HangupData(form.getReason()) |
| | | )); |
| | | )); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | |
| | |
| | | newV.put(task.getTaskDefinitionKey() + "&" + key, form.getVariables().get(key)); |
| | | //字典里有就放入流程变量中 |
| | | if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(dictList) && dictList.contains(key)) { |
| | | processVariables.put(key,form.getVariables().get(key)); |
| | | processVariables.put(key, form.getVariables().get(key)); |
| | | } |
| | | } |
| | | } |
| | | if( !processVariables.isEmpty() ) { |
| | | if (!processVariables.isEmpty()) { |
| | | taskService.setVariables(form.getTaskId(), processVariables); |
| | | } |
| | | |