1.首次测试修改调整

main
xuezhou 1 month ago
parent 460db9f6c6
commit d8e74162ac

@ -181,7 +181,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
northPane.add("8.2",dirtext); northPane.add("8.2",dirtext);
directory2 = new JButton("..."); directory2 = new JButton("...");
northPane.add("8.3",directory); northPane.add("8.3",directory2);
JPanel southpanel = new JPanel(new ButtonLayout()); JPanel southpanel = new JPanel(new ButtonLayout());
ok = new JButton("确定"); ok = new JButton("确定");
@ -420,7 +420,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
if(parent != null) { if(parent != null) {
System.out.println(parent.getClass()+parent.getProperty("bl_indented_title")); System.out.println(parent.getClass()+parent.getProperty("bl_indented_title"));
getparent(parent,sheet); getparent(parent,sheet,parent);
} }
if(op_nodesignmap.size() > 0) { if(op_nodesignmap.size() > 0) {
System.out.println("整个结构没有匹配的紧固件"); System.out.println("整个结构没有匹配的紧固件");
@ -509,7 +509,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
boolean hasdesign = false; boolean hasdesign = false;
for(AIFComponentContext designchild:design_children) { for(AIFComponentContext designchild:design_children) {
InterfaceAIFComponent designchildcom = designchild.getComponent(); InterfaceAIFComponent designchildcom = designchild.getComponent();
String bl_item_object_type = op.getProperty("bl_item_object_type"); String bl_item_object_type = designchildcom.getProperty("bl_item_object_type");
if("Design Part".equalsIgnoreCase(bl_item_object_type)) { if("Design Part".equalsIgnoreCase(bl_item_object_type)) {
hasdesign = true; hasdesign = true;
//获取符合的数据 //获取符合的数据
@ -773,6 +773,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
System.out.println("拧紧性质规则匹配"+resourceType);
break; break;
} }
} }
@ -815,6 +816,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
System.out.println("KCDS匹配"+resourceType);
break; break;
} }
} }
@ -873,6 +875,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
System.out.println("拧紧方式匹配"+resourceType);
break; break;
} }
} }
@ -943,6 +946,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
System.out.println("扭矩值匹配"+resourceType);
break; break;
} }
} }
@ -954,7 +958,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
commonKeys.retainAll(KCDSexcelname.keySet()); commonKeys.retainAll(KCDSexcelname.keySet());
commonKeys.retainAll(TightenMethodexcelname.keySet()); commonKeys.retainAll(TightenMethodexcelname.keySet());
commonKeys.retainAll(Torqueexcelname.keySet()); commonKeys.retainAll(Torqueexcelname.keySet());
System.out.println("四个 Map 都有的 key: " + commonKeys);
//读取工具excel数据 //读取工具excel数据
for(String name:commonKeys) { for(String name:commonKeys) {
if("电动工具".equals(name)){ if("电动工具".equals(name)){
@ -964,7 +968,7 @@ 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.containsKey(resourceName)) { 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("|", "-");
@ -1001,7 +1005,7 @@ 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.containsKey(resourceName)) { 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);
} }
} }
@ -1015,7 +1019,7 @@ 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.containsKey(resourceName)) { 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("|", "-");
@ -1047,13 +1051,13 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
else if("电池工具".equals(name)){ else if("电池工具".equals(name)){
for(String resourceType:batteryTool.keySet()) { for(String resourceName:batteryTool.keySet()) {
List<ToolBean> toolbeans = batteryTool.get(resourceType); List<ToolBean> toolbeans = batteryTool.get(resourceName);
for(ToolBean toolbean:toolbeans) { for(ToolBean toolbean:toolbeans) {
String range = toolbean.getRange(); String range = toolbean.getRange();
String outSize = toolbean.getOutSize(); String outSize = toolbean.getOutSize();
String resourceName = toolbean.getResourceName(); String resourceType = toolbean.getResourceType();
if(resourcename.containsKey(resourceName)) { 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("|", "-");
@ -1181,18 +1185,22 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
/** /**
* no_load:id * no_load:id
* */ * */
private void getparent(TCComponentBOMLine parent,Sheet sheet)throws Exception{ private void getparent(TCComponentBOMLine parent,Sheet sheet,TCComponentBOMLine oldparent)throws Exception{
if(parent != null && op_nodesignmap.size() > 0) {
if(op_nodesignmap.size() > 0) {
String parentid = parent.getProperty("bl_item_item_id"); String parentid = parent.getProperty("bl_item_item_id");
System.out.println("parentid"+parentid);
AIFComponentContext[] children = parent.getChildren(); AIFComponentContext[] children = parent.getChildren();
for (AIFComponentContext child : children) { for (AIFComponentContext child : children) {
InterfaceAIFComponent childcom = child.getComponent(); InterfaceAIFComponent childcom = child.getComponent();
String id = childcom.getProperty("bl_item_item_id"); String id = childcom.getProperty("bl_item_item_id");
System.out.println("子层级:"+id);
if(op_nodesignmap.size() == 0) { if(op_nodesignmap.size() == 0) {
break; break;
} }
if(no_load.containsKey(id)) { if(no_load.containsKey(id)) {
System.out.println("子层级处理过不再处理:"+id);
continue; continue;
} }
if(childcom instanceof TCComponentMfgBvrOperation) { if(childcom instanceof TCComponentMfgBvrOperation) {
@ -1215,7 +1223,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
boolean hasdesign = false; boolean hasdesign = false;
for(AIFComponentContext designchild:design_children) { for(AIFComponentContext designchild:design_children) {
InterfaceAIFComponent designchildcom = designchild.getComponent(); InterfaceAIFComponent designchildcom = designchild.getComponent();
String bl_item_object_type = op.getProperty("bl_item_object_type"); String bl_item_object_type = designchildcom.getProperty("bl_item_object_type");
if("Design Part".equalsIgnoreCase(bl_item_object_type)) { if("Design Part".equalsIgnoreCase(bl_item_object_type)) {
hasdesign = true; hasdesign = true;
//获取符合的数据 //获取符合的数据
@ -1479,6 +1487,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
System.out.println("拧紧性质规则匹配"+resourceType);
break; break;
} }
} }
@ -1521,6 +1530,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
System.out.println("KCDS匹配"+resourceType);
break; break;
} }
} }
@ -1579,6 +1589,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
System.out.println("拧紧方式匹配"+resourceType);
break; break;
} }
} }
@ -1649,6 +1660,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
System.out.println("扭矩值匹配"+resourceType);
break; break;
} }
} }
@ -1660,7 +1672,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
commonKeys.retainAll(KCDSexcelname.keySet()); commonKeys.retainAll(KCDSexcelname.keySet());
commonKeys.retainAll(TightenMethodexcelname.keySet()); commonKeys.retainAll(TightenMethodexcelname.keySet());
commonKeys.retainAll(Torqueexcelname.keySet()); commonKeys.retainAll(Torqueexcelname.keySet());
System.out.println("四个 Map 都有的 key: " + commonKeys);
//读取工具excel数据 //读取工具excel数据
for(String name:commonKeys) { for(String name:commonKeys) {
if("电动工具".equals(name)){ if("电动工具".equals(name)){
@ -1670,7 +1682,7 @@ 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.containsKey(resourceName)) { 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("|", "-");
@ -1707,7 +1719,7 @@ 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.containsKey(resourceName)) { 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);
} }
} }
@ -1721,7 +1733,7 @@ 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.containsKey(resourceName)) { 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("|", "-");
@ -1753,13 +1765,13 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
} }
else if("电池工具".equals(name)){ else if("电池工具".equals(name)){
for(String resourceType:batteryTool.keySet()) { for(String resourceName:batteryTool.keySet()) {
List<ToolBean> toolbeans = batteryTool.get(resourceType); List<ToolBean> toolbeans = batteryTool.get(resourceName);
for(ToolBean toolbean:toolbeans) { for(ToolBean toolbean:toolbeans) {
String range = toolbean.getRange(); String range = toolbean.getRange();
String outSize = toolbean.getOutSize(); String outSize = toolbean.getOutSize();
String resourceName = toolbean.getResourceName(); String resourceType = toolbean.getResourceType();
if(resourcename.containsKey(resourceName)) { 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("|", "-");
@ -1873,8 +1885,8 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
else if(childcom instanceof TCComponentMfgBvrProcessStation || childcom instanceof TCComponentMfgBvrProcessLine else if(childcom instanceof TCComponentMfgBvrProcessStation || childcom instanceof TCComponentMfgBvrProcessLine
|| childcom instanceof TCComponentMfgBvrPlantBOP) { || childcom instanceof TCComponentMfgBvrPlantBOP) {
System.out.println("往下找"+id);
getparent((TCComponentBOMLine)childcom,sheet); getparent((TCComponentBOMLine)childcom,sheet,null);
} }
if(op_nodesignmap.size() > 0) { if(op_nodesignmap.size() > 0) {
@ -1886,13 +1898,22 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
} }
// //
if(op_nodesignmap.size() > 0) { if(op_nodesignmap.size() > 0) {
if(!no_load.containsKey(parentid)) {
no_load.put(parentid, parentid); no_load.put(parentid, parentid);
if(parent.parent() != null) if(oldparent != null) {
getparent(parent.parent(),sheet); System.out.println("想上找"+parentid);
getparent(oldparent.parent(),sheet,oldparent.parent());
} }
} }
} }
}
}
//读取BOM表 //读取BOM表
private void readExcel(File excelfile,int start_rownum,int idcol2,int svppscol2,int fcccol2 private void readExcel(File excelfile,int start_rownum,int idcol2,int svppscol2,int fcccol2
,int fccdescol2,int dongtaicol,int kcdscol2) { ,int fccdescol2,int dongtaicol,int kcdscol2) {
@ -2207,7 +2228,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
tool.setResourceName(ResourceName); tool.setResourceName(ResourceName);
tool.setRange(Torque); tool.setRange(Torque);
tool.setResourceType(ResourceType); tool.setResourceType(ResourceType);
pneumaticTool.computeIfAbsent(ResourceName, key -> new ArrayList<>()).add(tool); pneumaticTool.computeIfAbsent(ResourceType, key -> new ArrayList<>()).add(tool);
} }
@ -2246,7 +2267,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
tool.setResourceName(ResourceName); tool.setResourceName(ResourceName);
tool.setRange(Torque); tool.setRange(Torque);
tool.setResourceType(ResourceType); tool.setResourceType(ResourceType);
manualTool.computeIfAbsent(ResourceName, key -> new ArrayList<>()).add(tool); manualTool.computeIfAbsent(ResourceType, key -> new ArrayList<>()).add(tool);
} }

Loading…
Cancel
Save