| | |
| | | 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); |