yangys
2025-09-06 a5f944c2bc0107e5df936937f1c33e5e03eb8fed
blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/service/DNCSendBackService.java
@@ -60,7 +60,6 @@
   private final BladeRedis bladeRedis;
   private final FlowCommonService flowCommonService;
   private final DncBackFileService dncBackFileService;
   private final ProgramFlowStatusQueryService programFlowStatusQueryService;
   private final MachineService machineService;
   private final ParamService paramService;
   /**
@@ -143,7 +142,7 @@
            }
            progData.setProgramName(packageName);
            String statusLine = "";
            String statusLine;
            Optional<String> optFilename = fileEntryNameList.stream().filter(n -> n.startsWith(entryName)).findFirst();
            if(optFilename.isPresent()){
               entry = zipFile.getEntry(optFilename.get());
@@ -162,18 +161,17 @@
               }else{
                  //查询是否车床,是车床可以放过,按试切处理
                  programPackageNode = ncNodeService.getLastEditionTryingProgramPackage(packageName,processEdition);
                  Machine machine = machineService.getByCode(programPackageNode.getMachineCode());
                  String chechuangVal = paramService.turninngValue();
                  if(StringUtils.equals(machine.getMachineSpec(),chechuangVal)){
                     //车床
                     ProgramAnnotation pa = programAnnotationService.getProgramAnnotationFormat(machine.getMachineGroupCode(),annotionDictList);
                     statusLine = pa.addAnnotation(ProgramAnnotationService.SQ);
                  }else {
                     //非车床无状态,直接报错
                     throw new ServiceException("未找到程序文件中的状态注释");
                  if(programPackageNode!=null){
                     Machine machine = machineService.getByCode(programPackageNode.getMachineCode());
                     String chechuangVal = paramService.turninngValue();
                     if(StringUtils.equals(machine.getMachineSpec(),chechuangVal)){
                        //车床
                        ProgramAnnotation pa = programAnnotationService.getProgramAnnotationFormat(machine.getControlSystem(),annotionDictList);
                        statusLine = pa.addAnnotation(ProgramAnnotationService.SQ);
                     }
                  }
               }
               if(programPackageNode != null) {
                  progData.setId(programPackageNode.getId());
                  progData.setProgramNo(programPackageNode.getProgramNo());
@@ -190,10 +188,10 @@
                  progData.setFiles(programFiles);
                  list.add(progData);
               }else{
                  throw new ServiceException("找不到程序包名:"+packageName+statusLine);
                  throw new ServiceException("找不到程序包名:"+packageName);
               }
            }else{
               throw new ServiceException(entryName+"包下未找到文件"+statusLine);
               throw new ServiceException(entryName+"包下未找到文件");
            }
         }
@@ -269,7 +267,6 @@
         //根据内部文件,读取和分析程序包和程序文件数据
         List<String> dirList = entryNameList.stream().filter(s -> s.endsWith("/")).toList();
         for(String dir : dirList){
            //String programPackageName1 = StringUtils.removeEnd(dir,"/");
            String folderName = StringUtils.removeEnd(dir,"/");
            PackageAndProcessEdition pkgAndEdition = parseProgramPackageFromFolderName(folderName);