| | |
| | | import org.flowable.task.api.Task; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | 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.basesetting.machine.entity.Machine; |
| | | import org.springblade.mdm.basesetting.machine.service.MachineService; |
| | | import org.springblade.mdm.commons.service.ParamService; |
| | | 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.FlowCommonService; |
| | | import org.springblade.mdm.flow.service.FlowProgramFileService; |
| | | import org.springblade.mdm.flow.service.FlowProgramProperties; |
| | | import org.springblade.system.feign.IUserClient; |
| | | import org.springblade.system.pojo.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Autowired |
| | | private FlowCommonService flowCommonService; |
| | | @Autowired |
| | | private UserCommonService userCommonService; |
| | | @Autowired |
| | | private MachineService machineService; |
| | | |
| | | @Transactional |
| | |
| | | throw new ServiceException("请指定流程下一步处理人"); |
| | | } |
| | | |
| | | // 非空判断 |
| | | if (Func.isEmpty(variables)) { |
| | | variables = Kv.create(); |
| | | } |
| | | |
| | | if(task.getTaskDefinitionKey().equals("programmingTask") ) {//编制节点 |
| | | //记录实际编程员 |
| | | variables.put(FlowVariableContants.ACT_PROGRAMMER,Func.toStr(AuthUtil.getUserId())); |
| | |
| | | if(this.needUploadProgramFile(props.getMachineCode())) { |
| | | flowProgramFileService.checkProgramFiles(processInstanceId, FlowContants.Y.equals(operateResult)); |
| | | } |
| | | }else if(task.getTaskDefinitionKey().equals("teamLeaderTask")){ |
| | | if(FlowContants.Y.equals(operateResult)) { |
| | | runtimeService.setVariable(task.getExecutionId(),FlowContants.PROGRAMMER_NAME,userCommonService.getUserNameById(Func.toLong(variables.get("assignee")))); |
| | | } |
| | | |
| | | } |
| | | 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()); |
| | | |
| | | |
| | |
| | | variables.remove(FlowContants.PROCESS_EDITION);//不要升版了 |
| | | |
| | | if("confirmIsUseableTask".equals(task.getTaskDefinitionKey())){ |
| | | |
| | | variables.put(FlowContants.CURE_PROGRAM_USEABLE,operateResult); |
| | | |
| | | } |
| | | taskService.complete(taskId, variables); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否需要上传文件(车床不需要) |
| | | * @param machineCode 机床编码 |