| | |
| | | @Override |
| | | public void completeTask(String taskId, String processInstanceId, String comment, Map<String, Object> variables) { |
| | | Task task = currentTask(taskId); |
| | | |
| | | // 非空判断 |
| | | if (Func.isEmpty(variables)) { |
| | | variables = Kv.create(); |
| | | } |
| | | String operateResult = this.getApproveResult(variables); |
| | | |
| | | FlowProgramProperties props = flowCommonService.getProgramProperties(processInstanceId); |
| | | if(!variables.containsKey("assignee")) { |
| | | throw new ServiceException("请指定流程下一步处理人"); |
| | | } |
| | | |
| | | // 非空判断 |
| | | if (Func.isEmpty(variables)) { |
| | | variables = Kv.create(); |
| | | } |
| | | |
| | | if(task.getTaskDefinitionKey().equals("programmingTask") ) {//编制节点 |
| | |
| | | runtimeService.setVariable(task.getExecutionId(),FlowContants.PROGRAMMER_NAME,userCommonService.getUserNameById(Func.toLong(variables.get("assignee")))); |
| | | } |
| | | }else if(task.getTaskDefinitionKey().equals("check")){ |
| | | runtimeService.setVariable(task.getExecutionId(),FlowVariableContants.ACT_CHECKER,Func.toLong(variables.get("assignee"))); |
| | | variables.put(FlowVariableContants.ACT_CHECKER,Func.toStr(AuthUtil.getUserId())); |
| | | }else if(task.getTaskDefinitionKey().equals("approveTask")){ |
| | | runtimeService.setVariable(task.getExecutionId(),FlowVariableContants.ACT_SENIOR,Func.toLong(variables.get("assignee"))); |
| | | variables.put(FlowVariableContants.ACT_SENIOR,Func.toStr(AuthUtil.getUserId())); |
| | | } |
| | | variables.remove("programOnMachine");//其他节点,忽略现场编程标记 |
| | | if (StringUtil.isNoneBlank(processInstanceId, comment)) { |