| | |
| | | import org.springblade.mdm.commons.service.UserCommonService; |
| | | import org.springblade.mdm.flow.constants.FlowContants; |
| | | import org.springblade.mdm.flow.constants.FlowVariableContants; |
| | | import org.springblade.mdm.flow.service.ApproveRecordService; |
| | | import org.springblade.mdm.flow.service.FlowCommonService; |
| | | import org.springblade.mdm.flow.service.FlowProgramFileService; |
| | | import org.springblade.mdm.flow.vo.BatchDispatchVO; |
| | | import org.springblade.mdm.program.service.NcNodeAutoCreateService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | */ |
| | | @Service |
| | | public class BatchDispatchService { |
| | | |
| | | @Autowired |
| | | private ApproveRecordService approveRecordService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | |
| | | if (StringUtil.isNoneBlank(processInstanceId, comment)) { |
| | | taskService.addComment(taskId, processInstanceId, comment); |
| | | } |
| | | approveRecordService.saveApproveRecords(task,FlowContants.Y,comment); |
| | | |
| | | taskService.complete(taskId, variables); |
| | | } |
| | |
| | | if (StringUtil.isNoneBlank(processInstanceId, batchDispatchVO.getComment())) { |
| | | taskService.addComment(taskId, processInstanceId, batchDispatchVO.getComment()); |
| | | } |
| | | approveRecordService.saveApproveRecords(task,FlowContants.Y,batchDispatchVO.getComment()); |
| | | |
| | | //最后一步完成 |
| | | taskService.complete(taskId, variables); |
| | |
| | | ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().includeProcessVariables() |
| | | .processInstanceId(processInstanceId) |
| | | .singleResult(); |
| | | Object programmer = processInstance.getProcessVariables().get(FlowContants.PROGRAMMER); |
| | | Object programmer = processInstance.getProcessVariables().get(FlowVariableContants.PROGRAMMER); |
| | | if(programmer == null){ |
| | | throw new ServiceException(processInstance.getProcessVariables().get(FlowContants.TITLE)+":未找到编程人员"); |
| | | throw new ServiceException(processInstance.getProcessVariables().get(FlowVariableContants.TITLE)+":未找到编程人员"); |
| | | } |
| | | return programmer; |
| | | } |
| | |
| | | .singleResult(); |
| | | Object actProgrammer = processInstance.getProcessVariables().get(FlowVariableContants.ACT_PROGRAMMER); |
| | | if(actProgrammer == null){ |
| | | throw new ServiceException(processInstance.getProcessVariables().get(FlowContants.TITLE)+":未找到编程人员"); |
| | | throw new ServiceException(processInstance.getProcessVariables().get(FlowVariableContants.TITLE)+":未找到编程人员"); |
| | | } |
| | | return actProgrammer; |
| | | } |