| | |
| | | |
| | | /** |
| | | * 将节点和历史节点挪动到固化的同级节点下 |
| | | * @param pkgNode 要固化的节点 |
| | | * @param pkgNode1 要固化的节点 |
| | | * @param historyProgramPackageNodes 程序包名 历史节点 |
| | | */ |
| | | void moveNodeToCuredTree(NcNode pkgNode1,List<NcNode> historyProgramPackageNodes, FlowProgramProperties programProperties) throws IOException { |
| | |
| | | newProgNode.setFlowProgramFileId(flowProgramFile.getId()); |
| | | newProgNode.setIsCured(1); |
| | | |
| | | setGhAnnotation(flowProgramFile,machine.getMachineGroupCode(),annoDicts); |
| | | setGhAnnotation(flowProgramFile,machine.getControlSystem(),annoDicts); |
| | | |
| | | nodeService.save(newProgNode); |
| | | } |
| | |
| | | * @param flowProgramFile oss 文件 |
| | | * |
| | | */ |
| | | void setGhAnnotation(FlowProgramFile flowProgramFile,String machineGroup,List<DictBiz> annoDicts) throws IOException { |
| | | void setGhAnnotation(FlowProgramFile flowProgramFile,String controlSystem,List<DictBiz> annoDicts) throws IOException { |
| | | String ossName = flowProgramFile.getOssName(); |
| | | // |
| | | try(InputStream ins = ossTemplate.statFileStream(ossName);){ |
| | | byte[] bytes = IOUtils.toByteArray(ins); |
| | | ByteArrayInputStream byteInputStream = new ByteArrayInputStream(bytes); |
| | | |
| | | InputStream finishedStream = programAnnotationService.setGHAnnotation(byteInputStream,machineGroup,annoDicts); |
| | | InputStream finishedStream = programAnnotationService.setGHAnnotation(byteInputStream,controlSystem,annoDicts); |
| | | |
| | | try(finishedStream) { |
| | | finishedStream.reset(); |