| | |
| | | return AjaxResult.error("项目流程未绑定"); |
| | | } |
| | | |
| | | Map<String, Object> processVariables = new HashMap<>(); |
| | | //查出字典中需要注入的字段信息 |
| | | // 查出字典中需要注入的字段信息 |
| | | List<String> dictList = sysDictDService.selectDictDataByType("flow_variables").stream().map(SysDictData::getDictValue).collect(Collectors.toList()); |
| | | Map<String, Object> newV = new HashMap<>(2); |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(variables)) { |
| | | for (String key : variables.keySet()) { |
| | | newV.put(task.getTaskDefinitionKey() + "&" + key, variables.get(key)); |
| | | //字典里有就放入流程变量中 |
| | | // 字典里有就不做处理 |
| | | if (!CollectionUtils.isEmpty(dictList) && dictList.contains(key)) { |
| | | if ("money".equals(key)) { |
| | | // 万元转元 |
| | | Object w = variables.get(key); |
| | | BigDecimal y = new BigDecimal(w.toString()).multiply(new BigDecimal(10000)); |
| | | processVariables.put(key, y); |
| | | } else { |
| | | processVariables.put(key,variables.get(key)); |
| | | } |
| | | newV.put(key,variables.get(key)); |
| | | } |
| | | } |
| | | } |
| | | //添加流程变量 |
| | | if(!processVariables.isEmpty()) taskService.setVariables(taskId,processVariables); |
| | | taskService.addComment(taskId, task.getProcessInstanceId(), FlowComment.SUBMIT.getType(), "完成提交"); |
| | | if (DelegationState.PENDING.equals(task.getDelegationState())) { |
| | | taskService.resolveTask(taskId, newV); |
| | |
| | | if (node.getCurrent()) { |
| | | return Boolean.TRUE; |
| | | } |
| | | HistoricTaskInstance beforeTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(finalProcessInsId).finished().taskDefinitionKey(node.getBeforeNodeDefId()).singleResult(); |
| | | return Objects.nonNull(beforeTask); |
| | | List<HistoricTaskInstance> beforeTasks = historyService.createHistoricTaskInstanceQuery() |
| | | .processInstanceId(finalProcessInsId) |
| | | .finished() |
| | | .taskDefinitionKey(node.getBeforeNodeDefId()) |
| | | .orderByTaskCreateTime() |
| | | .desc() |
| | | .list(); |
| | | return CollectionUtils.isNotEmpty(beforeTasks) && Objects.nonNull(beforeTasks.get(0)); |
| | | }).collect(Collectors.toList()); |
| | | List<DoFormDetailVO> vos = beforeNodes.stream().map(node -> { |
| | | if (node.getCurrent()) { |
| | |
| | | if (node.getCurrent()) { |
| | | return Boolean.TRUE; |
| | | } |
| | | HistoricTaskInstance beforeTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(task.getProcessInstanceId()).finished().taskDefinitionKey(node.getBeforeNodeDefId()).singleResult(); |
| | | return Objects.nonNull(beforeTask); |
| | | List<HistoricTaskInstance> beforeTaskList = historyService.createHistoricTaskInstanceQuery() |
| | | .processInstanceId(task.getProcessInstanceId()) |
| | | .finished() |
| | | .taskDefinitionKey(node.getBeforeNodeDefId()) |
| | | .orderByTaskCreateTime() |
| | | .desc() |
| | | .list(); |
| | | return CollectionUtils.isNotEmpty(beforeTaskList) && Objects.nonNull(beforeTaskList.get(0)); |
| | | }).collect(Collectors.toList()); |
| | | List<DoFormDetailVO> vos = dataList.stream().map(node -> { |
| | | if (node.getCurrent()) { |