1.修改匹配规则

目前工具组合输出了所有的组合,只需要输出一个工具加套筒,套筒从长度最短开始匹配,匹配到就停下
套筒长度为0的不考虑
四个条件的交集是电池工具,优先匹配枪式电池抢,如果枪式电池枪里没有符合条件的代码好像就不执行了,应该匹配剩余的电池工具
工序下有重复ID的紧固件,只需匹配一个
main
xuezhou 2 months ago
parent d8e74162ac
commit 03cc2a6f5b

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

Loading…
Cancel
Save