yangys
2025-09-18 a3048fa6fa72fa3cc5da2c43c59bd000e00c9599
blade-service/blade-mdm/src/main/java/org/springblade/mdm/machinefile/service/NcProgramExportInnerService.java
@@ -97,6 +97,14 @@
      zipOut.closeEntry();
   }
   /**
    * 给导出文件增加注释,涉密网要用
    * @param inputStream
    * @param filename
    * @param machineCode
    * @return
    * @throws IOException
    */
   InputStream setAnnotations(InputStream inputStream,String filename,String machineCode) throws IOException {
      Machine machine = this.machineService.getByCode(machineCode);
      AnnotationProcessor annoProcessor = ProcessorHelper.getProcessor(machine.getControlSystem(),annoConfig);
@@ -109,12 +117,17 @@
      ByteArrayInputStream bais = new ByteArrayInputStream(IOUtils.toByteArray(inputStream));
      String statusLine = FileContentUtil.readLineAt(bais,annoProps.getStatusLineIndex());
      String status = programAnnotationService.removeAnnotation(machine.getControlSystem(),statusLine);
      if(StringUtils.equalsAny(status,"SQ","GH","PL")){
      String text = programAnnotationService.removeAnnotation(machine.getControlSystem(),statusLine);
      if(AnnotationUtil.isStatusContent(text)){
         //是3种状态之一
         annoData.setProgramStatus(text);
      }else{
         //没有按试切处理
         annoData.setProgramStatus(AnnotationUtil.SQ);
      }
      bais.reset();
      annoData.setProgramStatus("3");
      //
      return annoProcessor.putAnnotation(annoData,bais);
   }
}