|
|
|
@ -100,7 +100,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
private Map<String,List<ToolBean>> manualTool = new HashMap<>();//excel手动工具
|
|
|
|
|
private Map<String,StandardPartBean> StandardPartMap = new HashMap<>();//excel标准件
|
|
|
|
|
private Map<String,List<SleeveBean>> SleeveMap = new HashMap<>();//excel套筒
|
|
|
|
|
private int times = 0;
|
|
|
|
|
// private int times = 0;
|
|
|
|
|
private int row_num = 1;
|
|
|
|
|
public AutoTransToolDialog(Frame fm,InterfaceAIFComponent target,TCSession session) {
|
|
|
|
|
super(fm);
|
|
|
|
@ -116,7 +116,12 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
KCDSrules.clear();
|
|
|
|
|
Torquerules.clear();
|
|
|
|
|
eleTool.clear();
|
|
|
|
|
times = 0;
|
|
|
|
|
batteryTool.clear();
|
|
|
|
|
pneumaticTool.clear();
|
|
|
|
|
manualTool.clear();
|
|
|
|
|
StandardPartMap.clear();
|
|
|
|
|
SleeveMap.clear();
|
|
|
|
|
// times = 0;
|
|
|
|
|
init();
|
|
|
|
|
}
|
|
|
|
|
private void init() {
|
|
|
|
@ -349,6 +354,18 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
op_nodesignmap.clear();
|
|
|
|
|
no_load.clear();
|
|
|
|
|
DesignPartBeanMap.clear();
|
|
|
|
|
processrules.clear();
|
|
|
|
|
autotoolrules.clear();
|
|
|
|
|
Tightenrules.clear();
|
|
|
|
|
TightenMethodrules.clear();
|
|
|
|
|
KCDSrules.clear();
|
|
|
|
|
Torquerules.clear();
|
|
|
|
|
eleTool.clear();
|
|
|
|
|
batteryTool.clear();
|
|
|
|
|
pneumaticTool.clear();
|
|
|
|
|
manualTool.clear();
|
|
|
|
|
StandardPartMap.clear();
|
|
|
|
|
SleeveMap.clear();
|
|
|
|
|
final int idcol2 = columnToNumber(idcol.toUpperCase());
|
|
|
|
|
final int svppscol2 = columnToNumber(svppscol.toUpperCase());
|
|
|
|
|
final int fcccol2 = columnToNumber(fcccol.toUpperCase());
|
|
|
|
@ -380,16 +397,13 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
headerRow.createCell(9).setCellValue("工具");
|
|
|
|
|
headerRow.createCell(10).setCellValue("工具套筒");
|
|
|
|
|
//读取自定义的表
|
|
|
|
|
if(times == 0) {
|
|
|
|
|
readRuleExcel(excelfile);
|
|
|
|
|
readElectricfile(electricfile,1);
|
|
|
|
|
readbatteryfile(batteryfile,1);
|
|
|
|
|
readpneumaticfile(pneumaticfile,1);
|
|
|
|
|
readmanualfile(manualfile,1);
|
|
|
|
|
readstdPartfile(standardpartfile,1);
|
|
|
|
|
readsleevefile(sleevefile,1);
|
|
|
|
|
times = 1;
|
|
|
|
|
}
|
|
|
|
|
readRuleExcel(excelfile);
|
|
|
|
|
readElectricfile(electricfile,1);
|
|
|
|
|
readbatteryfile(batteryfile,1);
|
|
|
|
|
readpneumaticfile(pneumaticfile,1);
|
|
|
|
|
readmanualfile(manualfile,1);
|
|
|
|
|
readstdPartfile(standardpartfile,1);
|
|
|
|
|
readsleevefile(sleevefile,1);
|
|
|
|
|
row_num = 1;
|
|
|
|
|
//读取EXCEL
|
|
|
|
|
readExcel(excel,2,idcol2,svppscol2,fcccol2,fccdescol2,dongtaicol2,kcdscol2);
|
|
|
|
@ -515,6 +529,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
hasdesign = true;
|
|
|
|
|
//获取符合的数据
|
|
|
|
|
Map<String,List<ToolBean>> Tool = new HashMap<>();
|
|
|
|
|
Map<String, List<ToolBean>> resourceTool = new HashMap<>();
|
|
|
|
|
//获取design
|
|
|
|
|
String designid = designchildcom.getProperty("bl_item_item_id");
|
|
|
|
|
if(idmap.containsKey(designid)) {
|
|
|
|
@ -534,11 +549,15 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
Cell designid_cell = row.createCell(1);
|
|
|
|
|
designid_cell.setCellValue(designid);
|
|
|
|
|
|
|
|
|
|
String key = designid+"|"+newname;
|
|
|
|
|
String key = designid;
|
|
|
|
|
System.out.println("看design是否匹配:"+key);
|
|
|
|
|
if(DesignPartBeanMap.containsKey(key)) {
|
|
|
|
|
System.out.println("找到匹配的,开始匹配规则");
|
|
|
|
|
DesignPartBean bean = DesignPartBeanMap.get(key);
|
|
|
|
|
String fccdes = bean.getFCCDES();
|
|
|
|
|
if(!newname.contains(fccdes)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String niuju = "";
|
|
|
|
|
String dongtai = bean.getDongtai();
|
|
|
|
|
if(dongtai.length() > 0) {
|
|
|
|
@ -719,7 +738,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Map<String, List<ToolBean>> resourceTool = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
if(!autotoolrule) {
|
|
|
|
|
|
|
|
|
|
Map<String,String> resourcename = new HashMap<>();
|
|
|
|
@ -1198,6 +1217,8 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
System.out.println("未找到匹配的");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Tool.clear();
|
|
|
|
|
resourceTool.clear();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!hasdesign) {
|
|
|
|
@ -1209,6 +1230,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
op_nodesignmap.put(bl_rev_object_name, op);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
idmap.clear();
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
@ -1267,6 +1289,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
hasdesign = true;
|
|
|
|
|
//获取符合的数据
|
|
|
|
|
Map<String,List<ToolBean>> Tool = new HashMap<>();
|
|
|
|
|
Map<String, List<ToolBean>> resourceTool = new HashMap<>();
|
|
|
|
|
//获取design
|
|
|
|
|
String designid = designchildcom.getProperty("bl_item_item_id");
|
|
|
|
|
if(idmap.containsKey(designid)) {
|
|
|
|
@ -1286,11 +1309,15 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
Cell designid_cell = row.createCell(1);
|
|
|
|
|
designid_cell.setCellValue(designid);
|
|
|
|
|
|
|
|
|
|
String key = designid+"|"+newname;
|
|
|
|
|
String key = designid;
|
|
|
|
|
System.out.println("看design是否匹配:"+key);
|
|
|
|
|
if(DesignPartBeanMap.containsKey(key)) {
|
|
|
|
|
System.out.println("找到匹配的,开始匹配规则");
|
|
|
|
|
DesignPartBean bean = DesignPartBeanMap.get(key);
|
|
|
|
|
String fccdes = bean.getFCCDES();
|
|
|
|
|
if(!newname.contains(fccdes)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String niuju = "";
|
|
|
|
|
String dongtai = bean.getDongtai();
|
|
|
|
|
if(dongtai.length() > 0) {
|
|
|
|
@ -1471,7 +1498,7 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Map<String, List<ToolBean>> resourceTool = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
if(!autotoolrule) {
|
|
|
|
|
|
|
|
|
|
Map<String,String> resourcename = new HashMap<>();
|
|
|
|
@ -1950,12 +1977,15 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
System.out.println("未找到匹配的");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Tool.clear();
|
|
|
|
|
resourceTool.clear();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(hasdesign) {
|
|
|
|
|
op_nodesignmap.remove(haskey);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
idmap.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -2005,13 +2035,15 @@ public class AutoTransToolDialog extends AbstractAIFDialog {
|
|
|
|
|
for(int i = start_rownum; i < count ;i++) {
|
|
|
|
|
Row row = sheet.getRow(i);
|
|
|
|
|
String id = ExcelUtil.getStringCellValue(row.getCell(idcol2-1));
|
|
|
|
|
if(id == null || id.length() == 0)
|
|
|
|
|
break;
|
|
|
|
|
String svpps = ExcelUtil.getStringCellValue(row.getCell(svppscol2-1));
|
|
|
|
|
String fcc = ExcelUtil.getStringCellValue(row.getCell(fcccol2-1));
|
|
|
|
|
String fccdes = ExcelUtil.getStringCellValue(row.getCell(fccdescol2-1));
|
|
|
|
|
String dongtai = ExcelUtil.getStringCellValue(row.getCell(dongtaicol-1));
|
|
|
|
|
String kcds = ExcelUtil.getStringCellValue(row.getCell(kcdscol2-1));
|
|
|
|
|
System.out.println("id:"+id+" svpps:"+svpps+" fcc:"+fcc+" fccdes:"+fccdes+" dongtai:"+dongtai+" kcds:"+kcds);
|
|
|
|
|
String key = id + "|"+fccdes;
|
|
|
|
|
String key = id;
|
|
|
|
|
if(!DesignPartBeanMap.containsKey(key)) {
|
|
|
|
|
DesignPartBean bean = new DesignPartBean();
|
|
|
|
|
bean.setDongtai(dongtai);
|
|
|
|
|