| | |
| | | private final BladeRedis bladeRedis; |
| | | private final FlowCommonService flowCommonService; |
| | | private final DncBackFileService dncBackFileService; |
| | | private final ProgramFlowStatusQueryService programFlowStatusQueryService; |
| | | private final MachineService machineService; |
| | | private final ParamService paramService; |
| | | /** |
| | |
| | | } |
| | | |
| | | 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()); |
| | |
| | | }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()); |
| | |
| | | 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+"包下未找到文件"); |
| | | } |
| | | |
| | | } |
| | |
| | | //根据内部文件,读取和分析程序包和程序文件数据 |
| | | 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); |