| | |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.mdm.commons.service.UserCommonService; |
| | | import org.springblade.mdm.flow.constants.FlowContants; |
| | | import org.springblade.mdm.flow.service.FlowCommonService; |
| | | import org.springblade.mdm.flow.service.FlowProgramFileService; |
| | | import org.springblade.mdm.flow.service.FlowProgramProperties; |
| | | import org.springblade.mdm.program.service.NcNodeAutoCreateService; |
| | | import org.springblade.mdm.program.service.NcNodeService; |
| | | import org.springblade.mdm.flow.constants.FlowVariableContants; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @Service("tempFlowCompleteService") |
| | | public class TempFlowCompleteService extends AbstractFlowCompleteService { |
| | | @Autowired |
| | | private FlowProgramFileService flowProgramFileService; |
| | | @Autowired |
| | | private NcNodeService ncNodeService; |
| | | @Autowired |
| | | private FlowCommonService flowCommonService; |
| | | |
| | | private UserCommonService userCommonService; |
| | | @Transactional |
| | | @Override |
| | | public void completeTask(String taskId, String processInstanceId, String comment, Map<String, Object> variables) { |
| | | Task task = currentTask(taskId); |
| | | String operateResult = this.getApproveResult(variables); |
| | | |
| | | |
| | | if (StringUtil.isNoneBlank(processInstanceId, comment)) { |
| | | taskService.addComment(taskId, processInstanceId, comment); |
| | | } |
| | |
| | | if (Func.isEmpty(variables)) { |
| | | variables = Kv.create(); |
| | | } |
| | | variables.put(FlowContants.LAST_STEP_USER_NICKNAME, AuthUtil.getNickName()); |
| | | |
| | | if(!variables.containsKey("assignee")) { |
| | | throw new ServiceException("请指定流程下一步处理人"); |
| | | } |
| | | addApproveRecord(taskId,comment,variables); |
| | | String operateResult = this.getApproveResult(variables); |
| | | variables.put(FlowContants.LAST_STEP_USER_NICKNAME, AuthUtil.getNickName()); |
| | | |
| | | if(task.getTaskDefinitionKey().equals("appendProgrammingTask") ) {//编制节点 |
| | | //记录实际编程员 |
| | | variables.put(FlowVariableContants.ACT_PROGRAMMER,Func.toStr(AuthUtil.getUserId())); |
| | | |
| | | }else if(task.getTaskDefinitionKey().equals("appendCheckTask")){ |
| | | variables.put(FlowVariableContants.ACT_CHECKER,Func.toStr(AuthUtil.getUserId())); |
| | | }else if(task.getTaskDefinitionKey().equals("appendApproveTask")){ |
| | | variables.put(FlowVariableContants.ACT_SENIOR,Func.toStr(AuthUtil.getUserId())); |
| | | } |
| | | |
| | | |
| | | taskService.complete(taskId, variables); |
| | | } |