diff --git a/com.sq.customization/src/com/sq/customization/dialogs/AutoTransToolDialog.java b/com.sq.customization/src/com/sq/customization/dialogs/AutoTransToolDialog.java index 7ab1348..ec7b3c9 100644 --- a/com.sq.customization/src/com/sq/customization/dialogs/AutoTransToolDialog.java +++ b/com.sq.customization/src/com/sq/customization/dialogs/AutoTransToolDialog.java @@ -507,6 +507,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String bl_indented_title = op.getProperty("bl_indented_title"); AIFComponentContext[] design_children = op.getChildren(); boolean hasdesign = false; + Map idmap = new HashMap<>(); for(AIFComponentContext designchild:design_children) { InterfaceAIFComponent designchildcom = designchild.getComponent(); String bl_item_object_type = designchildcom.getProperty("bl_item_object_type"); @@ -516,6 +517,12 @@ public class AutoTransToolDialog extends AbstractAIFDialog { Map> Tool = new HashMap<>(); //获取design String designid = designchildcom.getProperty("bl_item_item_id"); + if(idmap.containsKey(designid)) { + continue; + } + else { + idmap.put(designid, designid); + } String newname = bl_rev_object_name.replaceAll("预紧", "") .replaceAll("终紧", "") .replaceAll("紧固", "") @@ -712,6 +719,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog { } } } + Map> resourceTool = new HashMap<>(); if(!autotoolrule) { Map resourcename = new HashMap<>(); @@ -968,35 +976,37 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String range = toolbean.getRange(); String outSize = toolbean.getOutSize(); String resourceName = toolbean.getResourceName(); - if(resourcename.size() == 0 || (resourcename.size() > 0 && resourcename.containsKey(resourceName))) { - boolean isWithinRange = false; - if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { - range = range.replace("|", "-"); - String newrange = RangeCalculator.adjustRange(range); - - String newniuju = niuju; - if(bl_rev_object_name.contains("预紧")) { - newniuju = RangeAdjuster.adjustRange(niuju); - } - System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); - isWithinRange = RangChecker.isWithinRange(newniuju, newrange); - if(isWithinRange) { - System.out.println("新扭矩和新扭矩范围匹配"); - } - else { - System.out.println("新扭矩和新扭矩范围不匹配"); - } - } - else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { - System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); - isWithinRange = true; + + + boolean isWithinRange = false; + if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { + range = range.replace("|", "-"); + String newrange = RangeCalculator.adjustRange(range); + + String newniuju = niuju; + if(bl_rev_object_name.contains("预紧")) { + newniuju = RangeAdjuster.adjustRange(niuju); } + System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); + isWithinRange = RangChecker.isWithinRange(newniuju, newrange); if(isWithinRange) { - System.out.println("后续和套筒匹配"); - Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + System.out.println("新扭矩和新扭矩范围匹配"); + } + else { + System.out.println("新扭矩和新扭矩范围不匹配"); + } + } + else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { + System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); + isWithinRange = true; + } + if(isWithinRange) { + System.out.println("后续和套筒匹配"); + Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + if(resourcename.size() > 0 && resourcename.containsKey(resourceName)) { + resourceTool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); } } - } } } @@ -1005,8 +1015,9 @@ public class AutoTransToolDialog extends AbstractAIFDialog { List toolbeans = eleTool.get(resourceType); for(ToolBean toolbean:toolbeans) { String resourceName = toolbean.getResourceName(); - if(resourcename.size() == 0 || (resourcename.size() > 0 && resourcename.containsKey(resourceName))) { - Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + if((resourcename.size() > 0 && resourcename.containsKey(resourceName))) { + resourceTool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); } } // Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).addAll(toolbeans); @@ -1019,32 +1030,33 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String range = toolbean.getRange(); String outSize = toolbean.getOutSize(); String resourceName = toolbean.getResourceName(); - if(resourcename.size() == 0 || (resourcename.size() > 0 && resourcename.containsKey(resourceName))) { - boolean isWithinRange = false; - if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { - range = range.replace("|", "-"); - String newrange = RangeCalculator.adjustRange(range); - - String newniuju = niuju; - if(bl_rev_object_name.contains("预紧")) { - newniuju = RangeAdjuster.adjustRange(niuju); - } - System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); - isWithinRange = RangChecker.isWithinRange(newniuju, newrange); - if(isWithinRange) { - System.out.println("新扭矩和新扭矩范围匹配"); - } - else { - System.out.println("新扭矩和新扭矩范围不匹配"); - } - } - else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { - System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); - isWithinRange = true; + boolean isWithinRange = false; + if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { + range = range.replace("|", "-"); + String newrange = RangeCalculator.adjustRange(range); + + String newniuju = niuju; + if(bl_rev_object_name.contains("预紧")) { + newniuju = RangeAdjuster.adjustRange(niuju); } + System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); + isWithinRange = RangChecker.isWithinRange(newniuju, newrange); if(isWithinRange) { - System.out.println("后续和套筒匹配"); - Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + System.out.println("新扭矩和新扭矩范围匹配"); + } + else { + System.out.println("新扭矩和新扭矩范围不匹配"); + } + } + else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { + System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); + isWithinRange = true; + } + if(isWithinRange) { + System.out.println("后续和套筒匹配"); + Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + if((resourcename.size() > 0 && resourcename.containsKey(resourceName))) { + resourceTool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); } } } @@ -1057,34 +1069,36 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String range = toolbean.getRange(); String outSize = toolbean.getOutSize(); String resourceType = toolbean.getResourceType(); - if(resourcename.size() == 0 || (resourcename.size() > 0 && resourcename.containsKey(resourceName))) { - boolean isWithinRange = false; - if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { - range = range.replace("|", "-"); - String newrange = RangeCalculator.adjustRange(range); - - String newniuju = niuju; - if(bl_rev_object_name.contains("预紧")) { - newniuju = RangeAdjuster.adjustRange(niuju); - } - System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); - isWithinRange = RangChecker.isWithinRange(newniuju, newrange); - if(isWithinRange) { - System.out.println("新扭矩和新扭矩范围匹配"); - } - else { - System.out.println("新扭矩和新扭矩范围不匹配"); - } - } - else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { - System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); - isWithinRange = true; + boolean isWithinRange = false; + if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { + range = range.replace("|", "-"); + String newrange = RangeCalculator.adjustRange(range); + + String newniuju = niuju; + if(bl_rev_object_name.contains("预紧")) { + newniuju = RangeAdjuster.adjustRange(niuju); } + System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); + isWithinRange = RangChecker.isWithinRange(newniuju, newrange); if(isWithinRange) { - System.out.println("后续和套筒匹配"); - Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + System.out.println("新扭矩和新扭矩范围匹配"); + } + else { + System.out.println("新扭矩和新扭矩范围不匹配"); + } + } + else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { + System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); + isWithinRange = true; + } + if(isWithinRange) { + System.out.println("后续和套筒匹配"); + Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + if((resourcename.size() > 0 && resourcename.containsKey(resourceName))) { + resourceTool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); } } + } } } @@ -1098,6 +1112,21 @@ public class AutoTransToolDialog extends AbstractAIFDialog { System.out.println("resourcetype:"+resourcetype+" outsize:"+outsize); } } + System.out.println("有限匹配的资源名称工具有哪些"); + for(String resourcetype:resourceTool.keySet()) { + List toolsbean = resourceTool.get(resourcetype); + for(ToolBean toolbean:toolsbean) { + String outsize = toolbean.getOutSize(); + System.out.println("resourcetype:"+resourcetype+" outsize:"+outsize); + } + } + Map> needTool = null; + if(resourceTool.size() > 0) { + needTool = resourceTool; + } + else { + needTool = Tool; + } //匹配标准件 System.out.println("匹配标准件designid:"+designid); if(StandardPartMap.containsKey(designid)) { @@ -1119,9 +1148,14 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String inputsize = sleevebean.getInputSize(); String length = sleevebean.getLength(); String resourceType = sleevebean.getResourceType(); + boolean haspipei = false; + if(length == null || length.length() == 0) { + continue; + } + //后续工具与套筒匹配 - for(String resourcetype:Tool.keySet()) { - List toolsbean = Tool.get(resourcetype); + for(String resourcetype:needTool.keySet()) { + List toolsbean = needTool.get(resourcetype); // Cell toolresourceType_cell = row.createCell(8); // toolresourceType_cell.setCellValue(resourcetype); boolean has = false; @@ -1146,9 +1180,13 @@ public class AutoTransToolDialog extends AbstractAIFDialog { if(has) { // Cell resourceType_cell = row.createCell(9); // resourceType_cell.setCellValue(resourceType); + haspipei = true; break; } } + if(haspipei) { + break; + } } all_cell.setCellValue(all); } @@ -1221,6 +1259,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog { if(found) { AIFComponentContext[] design_children = op.getChildren(); boolean hasdesign = false; + Map idmap = new HashMap<>(); for(AIFComponentContext designchild:design_children) { InterfaceAIFComponent designchildcom = designchild.getComponent(); String bl_item_object_type = designchildcom.getProperty("bl_item_object_type"); @@ -1230,6 +1269,12 @@ public class AutoTransToolDialog extends AbstractAIFDialog { Map> Tool = new HashMap<>(); //获取design String designid = designchildcom.getProperty("bl_item_item_id"); + if(idmap.containsKey(designid)) { + continue; + } + else { + idmap.put(designid, designid); + } String newname = bl_rev_object_name.replaceAll("预紧", "") .replaceAll("终紧", "") .replaceAll("紧固", "") @@ -1426,6 +1471,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog { } } } + Map> resourceTool = new HashMap<>(); if(!autotoolrule) { Map resourcename = new HashMap<>(); @@ -1682,35 +1728,37 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String range = toolbean.getRange(); String outSize = toolbean.getOutSize(); String resourceName = toolbean.getResourceName(); - if(resourcename.size() == 0 || (resourcename.size() > 0 && resourcename.containsKey(resourceName))) { - boolean isWithinRange = false; - if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { - range = range.replace("|", "-"); - String newrange = RangeCalculator.adjustRange(range); - - String newniuju = niuju; - if(bl_rev_object_name.contains("预紧")) { - newniuju = RangeAdjuster.adjustRange(niuju); - } - System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); - isWithinRange = RangChecker.isWithinRange(newniuju, newrange); - if(isWithinRange) { - System.out.println("新扭矩和新扭矩范围匹配"); - } - else { - System.out.println("新扭矩和新扭矩范围不匹配"); - } - } - else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { - System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); - isWithinRange = true; + + + boolean isWithinRange = false; + if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { + range = range.replace("|", "-"); + String newrange = RangeCalculator.adjustRange(range); + + String newniuju = niuju; + if(bl_rev_object_name.contains("预紧")) { + newniuju = RangeAdjuster.adjustRange(niuju); } + System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); + isWithinRange = RangChecker.isWithinRange(newniuju, newrange); if(isWithinRange) { - System.out.println("后续和套筒匹配"); - Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + System.out.println("新扭矩和新扭矩范围匹配"); + } + else { + System.out.println("新扭矩和新扭矩范围不匹配"); + } + } + else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { + System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); + isWithinRange = true; + } + if(isWithinRange) { + System.out.println("后续和套筒匹配"); + Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + if(resourcename.size() > 0 && resourcename.containsKey(resourceName)) { + resourceTool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); } } - } } } @@ -1719,8 +1767,9 @@ public class AutoTransToolDialog extends AbstractAIFDialog { List toolbeans = eleTool.get(resourceType); for(ToolBean toolbean:toolbeans) { String resourceName = toolbean.getResourceName(); - if(resourcename.size() == 0 || (resourcename.size() > 0 && resourcename.containsKey(resourceName))) { - Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + if((resourcename.size() > 0 && resourcename.containsKey(resourceName))) { + resourceTool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); } } // Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).addAll(toolbeans); @@ -1733,32 +1782,33 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String range = toolbean.getRange(); String outSize = toolbean.getOutSize(); String resourceName = toolbean.getResourceName(); - if(resourcename.size() == 0 || (resourcename.size() > 0 && resourcename.containsKey(resourceName))) { - boolean isWithinRange = false; - if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { - range = range.replace("|", "-"); - String newrange = RangeCalculator.adjustRange(range); - - String newniuju = niuju; - if(bl_rev_object_name.contains("预紧")) { - newniuju = RangeAdjuster.adjustRange(niuju); - } - System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); - isWithinRange = RangChecker.isWithinRange(newniuju, newrange); - if(isWithinRange) { - System.out.println("新扭矩和新扭矩范围匹配"); - } - else { - System.out.println("新扭矩和新扭矩范围不匹配"); - } - } - else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { - System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); - isWithinRange = true; + boolean isWithinRange = false; + if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { + range = range.replace("|", "-"); + String newrange = RangeCalculator.adjustRange(range); + + String newniuju = niuju; + if(bl_rev_object_name.contains("预紧")) { + newniuju = RangeAdjuster.adjustRange(niuju); } + System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); + isWithinRange = RangChecker.isWithinRange(newniuju, newrange); if(isWithinRange) { - System.out.println("后续和套筒匹配"); - Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + System.out.println("新扭矩和新扭矩范围匹配"); + } + else { + System.out.println("新扭矩和新扭矩范围不匹配"); + } + } + else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { + System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); + isWithinRange = true; + } + if(isWithinRange) { + System.out.println("后续和套筒匹配"); + Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + if((resourcename.size() > 0 && resourcename.containsKey(resourceName))) { + resourceTool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); } } } @@ -1771,34 +1821,36 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String range = toolbean.getRange(); String outSize = toolbean.getOutSize(); String resourceType = toolbean.getResourceType(); - if(resourcename.size() == 0 || (resourcename.size() > 0 && resourcename.containsKey(resourceName))) { - boolean isWithinRange = false; - if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { - range = range.replace("|", "-"); - String newrange = RangeCalculator.adjustRange(range); - - String newniuju = niuju; - if(bl_rev_object_name.contains("预紧")) { - newniuju = RangeAdjuster.adjustRange(niuju); - } - System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); - isWithinRange = RangChecker.isWithinRange(newniuju, newrange); - if(isWithinRange) { - System.out.println("新扭矩和新扭矩范围匹配"); - } - else { - System.out.println("新扭矩和新扭矩范围不匹配"); - } - } - else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { - System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); - isWithinRange = true; + boolean isWithinRange = false; + if(range!= null && range.length() > 0 && niuju != null && niuju.length() > 0) { + range = range.replace("|", "-"); + String newrange = RangeCalculator.adjustRange(range); + + String newniuju = niuju; + if(bl_rev_object_name.contains("预紧")) { + newniuju = RangeAdjuster.adjustRange(niuju); } + System.out.print("判断BOM表中扭矩是否符合:"+niuju+"新扭矩:"+newniuju+" 扭矩范围:"+range+" 新扭矩范围:"+newrange+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" "); + isWithinRange = RangChecker.isWithinRange(newniuju, newrange); if(isWithinRange) { - System.out.println("后续和套筒匹配"); - Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + System.out.println("新扭矩和新扭矩范围匹配"); + } + else { + System.out.println("新扭矩和新扭矩范围不匹配"); + } + } + else if((range == null || range.length() == 0) && (niuju == null || niuju.length() == 0)) { + System.out.print("判断BOM表中扭矩是否符合:"+niuju+" 扭矩范围:"+range+" 资源型号:"+resourceType+" 输出尺寸:"+outSize+" 匹配扭矩"); + isWithinRange = true; + } + if(isWithinRange) { + System.out.println("后续和套筒匹配"); + Tool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); + if((resourcename.size() > 0 && resourcename.containsKey(resourceName))) { + resourceTool.computeIfAbsent(resourceType, key2 -> new ArrayList<>()).add(toolbean); } } + } } } @@ -1812,6 +1864,21 @@ public class AutoTransToolDialog extends AbstractAIFDialog { System.out.println("resourcetype:"+resourcetype+" outsize:"+outsize); } } + System.out.println("有限匹配的资源名称工具有哪些"); + for(String resourcetype:resourceTool.keySet()) { + List toolsbean = resourceTool.get(resourcetype); + for(ToolBean toolbean:toolsbean) { + String outsize = toolbean.getOutSize(); + System.out.println("resourcetype:"+resourcetype+" outsize:"+outsize); + } + } + Map> needTool = null; + if(resourceTool.size() > 0) { + needTool = resourceTool; + } + else { + needTool = Tool; + } //匹配标准件 System.out.println("匹配标准件designid:"+designid); if(StandardPartMap.containsKey(designid)) { @@ -1833,9 +1900,14 @@ public class AutoTransToolDialog extends AbstractAIFDialog { String inputsize = sleevebean.getInputSize(); String length = sleevebean.getLength(); String resourceType = sleevebean.getResourceType(); + boolean haspipei = false; + if(length == null || length.length() == 0) { + continue; + } + //后续工具与套筒匹配 - for(String resourcetype:Tool.keySet()) { - List toolsbean = Tool.get(resourcetype); + for(String resourcetype:needTool.keySet()) { + List toolsbean = needTool.get(resourcetype); // Cell toolresourceType_cell = row.createCell(8); // toolresourceType_cell.setCellValue(resourcetype); boolean has = false; @@ -1860,9 +1932,13 @@ public class AutoTransToolDialog extends AbstractAIFDialog { if(has) { // Cell resourceType_cell = row.createCell(9); // resourceType_cell.setCellValue(resourceType); + haspipei = true; break; } } + if(haspipei) { + break; + } } all_cell.setCellValue(all); }