| | |
| | | //List<NcNode> historyProgramPackageNodes = nodeService.getTryNodeHistory(pkgNode); |
| | | try { |
| | | moveNodeToCuredTree(pkgNode, flowProps);//, historyProgramPackageNodes |
| | | |
| | | //固化不锁定,后续还可能使用该固化程序 |
| | | //nodeService.lockSameNameOtherMachineGroupProgramPackage(pkgNode); |
| | | /* |
| | | nodeService.lambdaUpdate().eq(NcNode::getDrawingNo,pkgNode.getDrawingNo()) |
| | | .eq(NcNode::getProcessNo,pkgNode.getProcessNo()) |
| | | .eq(NcNode::getName,pkgNode.getName()) |
| | | .ne(NcNode::getMachineGroupCode,pkgNode.getMachineGroupCode()) |
| | | .eq(NcNode::getIsCured,1) |
| | | .set(NcNode::getIsLocked,NcNode.LOCKED) |
| | | .set(NcNode::getRemark,"回传固化同名程序锁定") |
| | | .update(); |
| | | */ |
| | | }catch(Exception e) { |
| | | log.error("固化流程完成异常",e); |
| | | throw new ServiceException("普通固化执行异常"+e.getMessage()); |
| | |
| | | oldProgramNode.setIsLastEdition(0); |
| | | //当前固化程序包名下的“其他文件”非程序文件。不设置为老版本,直接挪到固化树下,两个网络之间只交换程序文件,其他文件只能保留 |
| | | //其他文件,需要复制到新建的固化节点下(程序文件不复制) |
| | | /* |
| | | pfile = flowProgramFileService.getById(oldProgramNode.getFlowProgramFileId()); |
| | | if(!pfile.isProgram()) { |
| | | NcNode newFileNode = new NcNode(); |
| | |
| | | newFileNode.setIsLastEdition(1); |
| | | nodeService.save(newFileNode); |
| | | } |
| | | |
| | | */ |
| | | } |
| | | nodeService.updateBatchById(oriProgramNodes); |
| | | } |
| | | |
| | | /** |
| | | * 加入新的程序节点 |
| | | * @param cureNode 固化节点 |
| | | * @param processInstanceId 流程实例id |
| | | * @throws IOException |
| | | */ |
| | | void addNewProgramNode(NcNode cureNode,String processInstanceId) throws IOException { |
| | | Machine machine = machineService.getByCode(cureNode.getMachineCode()); |
| | | List<DictBiz> annoDicts = programAnnotationService.getAnnotionDictList(); |
| | |
| | | cureNode.upgradeVersionNumber(); |
| | | } |
| | | |
| | | //nodeService.save(cureNode); |
| | | |
| | | return cureNode; |
| | | } |
| | | /** |
| | |
| | | byte[] bytes = IOUtils.toByteArray(ins); |
| | | ByteArrayInputStream byteInputStream = new ByteArrayInputStream(bytes); |
| | | |
| | | //InputStream finishedStream = programAnnotationService.setGHAnnotation(byteInputStream,controlSystem,annoDicts); |
| | | List<DictBiz> annoDictList = programAnnotationService.getAnnotionDictList(); |
| | | AnnotationProperties annoProps = config.getConfigMap().get(controlSystem); |
| | | if(annoProps == null){ |
| | | annoProps = AnnotationProperties.getDefault(); |
| | | } |
| | | InputStream finishedStream =AnnotationUtil.setAnnotationAndGetInputStream(byteInputStream, "GH", annoProps.getStatusLineIndex(), controlSystem, annoDictList); |
| | | InputStream finishedStream =AnnotationUtil.setAnnotationAndGetInputStream(byteInputStream, AnnotationUtil.GH, annoProps.getStatusLineIndex(), controlSystem, annoDictList); |
| | | try(finishedStream) { |
| | | finishedStream.reset(); |
| | | BladeFile bfile = ossTemplate.putFile(flowProgramFile.getName(), finishedStream); |