| | |
| | | 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); |