| | |
| | | }else if(programPackageNode.hasCured()){ |
| | | status = "GH"; |
| | | } |
| | | List<Dict> annotationList = programAnnotationService.getAnnotionList(); |
| | | //List<Dict> annotationList = programAnnotationService.getAnnotionList(); |
| | | for (NcNode node : programNodes) { |
| | | String filePathInZip = packageFolder + node.getName(); |
| | | programFile = this.flowProgramFileService.getById(node.getFlowProgramFileId()); |
| | | if(programFile.isProgram()) {//程序文件,才会加入压缩包 |
| | | InputStream inputStream = ossTemplate.statFileStream(programFile.getOssName()); |
| | | InputStream addedIns1 = addSendDirAnnotation(inputStream, machine, annotationList); |
| | | InputStream addedIns2 = addProgramStatusAnnotation(addedIns1, status, machine, annotationList); |
| | | //InputStream addedIns1 = addSendDirAnnotation(inputStream, machine, annotationList); |
| | | //InputStream addedIns2 = addProgramStatusAnnotation(addedIns1, status, machine, annotationList); |
| | | String sendDir = machine.getProgSendDir()==null? StringUtil.EMPTY:machine.getProgSendDir(); |
| | | InputStream addedIns2 = programAnnotationService.setSendDirAndStatusAnnotation(sendDir,status,inputStream,machine.getMachineGroupCode()); |
| | | this.addInputStreamToZip(zipOut, addedIns2, filePathInZip); |
| | | } |
| | | } |
| | |
| | | * @param inputStream |
| | | * @return |
| | | */ |
| | | /* |
| | | InputStream addSendDirAnnotation(InputStream inputStream,Machine machine,List<Dict> annotationList) throws IOException { |
| | | //检测第二行是否是路径 |
| | | String annotationText = programAnnotationService.generateAnnotation(machine.getProgSendDir()==null? StringUtil.EMPTY:machine.getProgSendDir(),machine.getMachineGroupCode(),annotationList); |
| | | |
| | | //TODO 改判断行内容 |
| | | return FileContentUtil.insertLine(inputStream,1,annotationText); |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 添加程序专改的注释 |
| | |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | /* |
| | | InputStream addProgramStatusAnnotation(InputStream inputStream,String status,Machine machine,List<Dict> annotationList) throws IOException { |
| | | String annoText= programAnnotationService.generateAnnotation(status,machine.getMachineGroupCode(),annotationList); |
| | | |
| | | return FileContentUtil.insertLine(inputStream,2,annoText); |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 判断一行文本是否是注释 |
| | |
| | | * @param annotationList |
| | | * @return |
| | | */ |
| | | /* |
| | | boolean isAnnotation(String line,List<Dict> annotationList){ |
| | | boolean isAnno = false; |
| | | |
| | | return isAnno; |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | |