| | |
| | | private final FlowProgramFileService flowProgramFileService; |
| | | private final HistoryService historyService; |
| | | private final TaskDispatchService taskDispatchService; |
| | | private final MachineAnnotationConfig annotationConfig; |
| | | |
| | | private final AnnotationProcessorHelper annotationProcessorHelper; |
| | | /** |
| | | * 导出dnc压缩包 |
| | |
| | | |
| | | /** |
| | | * 将程序包和下属文件加入压缩包 |
| | | * @param zipOut |
| | | * @param approved |
| | | * @param zipOut zip文件输出流 |
| | | * @param approved 审批完成记录 |
| | | */ |
| | | private void addProgramPackageToZip(ZipOutputStream zipOut, NcProgramApproved approved) throws IOException{ |
| | | NcNodeHis packageNodeHis = ncNodeHisService.getById(approved.getNcNodeId()); |
| | |
| | | InputStream inputStream = ossTemplate.statFileStream(programFile.getOssName()); |
| | | String sendDir = machine.getProgSendDir()==null? StringUtil.EMPTY:machine.getProgSendDir(); |
| | | |
| | | //AnnotationProcessor annoProcessor = ProcessorHelper.getProcessor(machine.getControlSystem(),annotationConfig); |
| | | AnnotationProcessor annoProcessor = this.annotationProcessorHelper.getProcessor(machine.getControlSystem()); |
| | | AnnotationData annoData = new AnnotationData(); |
| | | annoData.setSendPath(sendDir); |
| | |
| | | annoData.setDeviation(programPackageNode.getDeviation()); |
| | | annoData.setFilename(programFile.getName()); |
| | | |
| | | InputStream addedInsFinal = annoProcessor.putAnnotation(annoData,inputStream); |
| | | if(StringUtils.startsWith(programPackageNode.getParentIds(),"0,4")) { |
| | | //试切补充,特殊标记状态 |
| | | annoData.setProgramStatus(AnnotationUtil.TMP); |
| | | } |
| | | InputStream addedInsFinal = annoProcessor.putAnnotation(annoData, inputStream); |
| | | addedInsFinal.reset(); |
| | | |
| | | this.addInputStreamToZip(zipOut, addedInsFinal, filePathInZip); |
| | | } |
| | | } |