| | |
| | | public class ReplaceFlowService { |
| | | private final NcNodeService nodeService; |
| | | private final RuntimeService runtimeService; |
| | | private final TaskService taskService; |
| | | private final IdentityService identityService; |
| | | private final FlowProgramFileService flowProgramFileService; |
| | | private final ReplaceProgramFileService replaceProgramFileService; |
| | |
| | | |
| | | vars.put(FlowContants.PRODUCT_MODEL,programPackage.getProductModel()); |
| | | vars.put(NODE_ID, startVO.getNodeId()); |
| | | |
| | | vars.put("comment", startVO.getComment()); |
| | | identityService.setAuthenticatedUserId(String.valueOf(AuthUtil.getUserId()));//设置流程发起人 |
| | | ProcessInstance inst = runtimeService.startProcessInstanceByKey(FlowContants.REPLACE_PROCESS_KEY,startVO.getNodeId()+"",vars); |
| | | //replaceProgramFileService.lambdaUpdate().eq(ReplaceProgramFile::getTempId,startVO.getTempId()).set(ReplaceProgramFile::getProcessInstanceId,inst.getProcessInstanceId()); |
| | | |
| | | /* |
| | | Task startTask = taskService.createTaskQuery() |
| | | .processInstanceId(inst.getId()) |
| | | .singleResult(); |
| | | |
| | | // 添加评论 |
| | | taskService.addComment(startTask.getId(), inst.getProcessInstanceId(),startVO.getComment()); |
| | | */ |
| | | flowProgramFileService.lambdaUpdate() |
| | | .eq(FlowProgramFile::getProcessInstanceId,startVO.getTempInstanceId()) |
| | | .set(FlowProgramFile::getProcessInstanceId,inst.getProcessInstanceId()).update(); |
| | | |
| | | /* |
| | | List<ReplaceProgramFile> repFiles = replaceProgramFileService.lambdaQuery().eq(ReplaceProgramFile::getTempId,startVO.getTempId()).list(); |
| | | |
| | | for(ReplaceProgramFile repFile : repFiles) { |
| | | FlowProgramFile flowProgramFile = new FlowProgramFile(); |
| | | BeanUtils.copyProperties(repFile, flowProgramFile); |
| | | flowProgramFile.setProgramName(programPackge.getName()); |
| | | |
| | | EntityUtil.clearBaseProperties(flowProgramFile); |
| | | flowProgramFile.setProcessInstanceId(inst.getId()); |
| | | flowProgramFile.setIsCured(0); |
| | | |
| | | flowProgramFileService.save(flowProgramFile); |
| | | } |
| | | |
| | | //暂时注释,测试方便 |
| | | replaceProgramFileService.deleteByTempId(startVO.getTempId()); |
| | | |
| | | */ |
| | | //return inst.getProcessInstanceId(); |
| | | } |
| | | |
| | | |
| | |
| | | throw new ServiceException("程序文件不可为空文件"); |
| | | } |
| | | FlowProgramProperties progProps = new FlowProgramProperties(); |
| | | //set |
| | | progProps.setDrawingNo(uploadVO.getDrawingNo()); |
| | | progProps.setProcessNo(uploadVO.getProcessNo()); |
| | | progProps.setProcessEdition(uploadVO.getProcessEdition()); |
| | | |
| | | ProgramFileNameCheckUtil.checkFilename(file.getOriginalFilename(),progProps); |
| | | |
| | | String programName = NcNodeService.genProgramName(progProps.getDrawingNo(),progProps.getProcessNo()); |