|
|
|
@ -53,10 +53,11 @@ public class BOMExportOperation extends AbstractAIFOperation {
|
|
|
|
|
private List<String> idlist = new ArrayList<String>();
|
|
|
|
|
private List<String> errList = new ArrayList<String>();
|
|
|
|
|
|
|
|
|
|
private String xuninum = "0";
|
|
|
|
|
private String xuninum = "1";
|
|
|
|
|
private String xuanzhongid = null;
|
|
|
|
|
|
|
|
|
|
private String item_id1 = "";//品号 item_id
|
|
|
|
|
private String rev_id1 = ""; //版本 item_revision_id
|
|
|
|
|
private String name1 = "";//名称 object_name
|
|
|
|
|
private String spec1 = "";//规格
|
|
|
|
|
private String unit1 = "";//单位 t2_unit
|
|
|
|
@ -86,7 +87,7 @@ public class BOMExportOperation extends AbstractAIFOperation {
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
System.out.println("开始获取BOM模板");
|
|
|
|
|
String puid = session.getPreferenceService().getStringValue("DFL_BOM_UID2");
|
|
|
|
|
String puid = session.getPreferenceService().getStringValue("DFL_BOM_UID");
|
|
|
|
|
System.out.println("puid======================"+puid);
|
|
|
|
|
if (puid == null||"".equals(puid)) {
|
|
|
|
|
MessageBox.post("首选项DFL_BOM_UID未配置,请联系管理员!!",
|
|
|
|
@ -180,26 +181,27 @@ public class BOMExportOperation extends AbstractAIFOperation {
|
|
|
|
|
}
|
|
|
|
|
//判断是否属于bomline
|
|
|
|
|
if(comp instanceof TCComponentBOMLine) {
|
|
|
|
|
//如果版本类型是外购件版本或者外协件版本则获取属性
|
|
|
|
|
//判断是否为无需传递的物料
|
|
|
|
|
if (!"Reference".equals(occType))
|
|
|
|
|
{
|
|
|
|
|
//如果版本类型是外购件版本或者外协件版本则获取属性
|
|
|
|
|
if("T2_outsourceRevision".equals(type) || "T2_OutBuyPartRevision".equals(type)) {
|
|
|
|
|
//序号+1
|
|
|
|
|
num++;
|
|
|
|
|
//判断是否为无需传递的物料
|
|
|
|
|
|
|
|
|
|
List<String> beanList1 = new ArrayList<String>();
|
|
|
|
|
|
|
|
|
|
//将遍历的对象强转类型为bomline
|
|
|
|
|
TCComponentBOMLine ziLine = (TCComponentBOMLine) comp;
|
|
|
|
|
|
|
|
|
|
getItemValue1(ziLine,level,num);
|
|
|
|
|
|
|
|
|
|
List<String> beanList1 = new ArrayList<String>();
|
|
|
|
|
|
|
|
|
|
double a = Double.valueOf(xuninum).doubleValue();
|
|
|
|
|
System.out.println("a--915======"+a);
|
|
|
|
|
double b = Double.valueOf(design_num1).doubleValue();
|
|
|
|
|
System.out.println("b--915======"+b);
|
|
|
|
|
double c = Double.valueOf(firstnum).doubleValue();
|
|
|
|
|
System.out.println("c--915======"+c);
|
|
|
|
|
// double c = Double.valueOf(firstnum).doubleValue();
|
|
|
|
|
// System.out.println("c--915======"+c);
|
|
|
|
|
double d = a*b;
|
|
|
|
|
design_num1 = ""+d;
|
|
|
|
|
System.out.println("design_num9.15======"+design_num1);
|
|
|
|
@ -207,6 +209,7 @@ public class BOMExportOperation extends AbstractAIFOperation {
|
|
|
|
|
//添加属性到字符串集合中
|
|
|
|
|
beanList1.add(xuhao2);
|
|
|
|
|
beanList1.add(item_id1);
|
|
|
|
|
beanList1.add(rev_id1);
|
|
|
|
|
beanList1.add(name1);
|
|
|
|
|
//beanList1.add(lev1); //不要层级
|
|
|
|
|
beanList1.add(spec1);
|
|
|
|
@ -240,7 +243,7 @@ public class BOMExportOperation extends AbstractAIFOperation {
|
|
|
|
|
if(include1 == panduan) {
|
|
|
|
|
String numString = null;
|
|
|
|
|
for(int k = 0 ; k<=beanList2.size() ; k++) {
|
|
|
|
|
numString = beanList2.get(5);
|
|
|
|
|
numString = beanList2.get(6);
|
|
|
|
|
System.out.println("数量9.18====="+numString);
|
|
|
|
|
}
|
|
|
|
|
double before = Double.valueOf(numString).doubleValue();
|
|
|
|
@ -248,7 +251,7 @@ public class BOMExportOperation extends AbstractAIFOperation {
|
|
|
|
|
double sum = before+add;
|
|
|
|
|
//String sum = ""+before+add;
|
|
|
|
|
System.out.println("9.18sum====="+sum);
|
|
|
|
|
beanList2.set(5, ""+sum);
|
|
|
|
|
beanList2.set(6, ""+sum);
|
|
|
|
|
list.set(j, beanList2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -690,7 +693,7 @@ public class BOMExportOperation extends AbstractAIFOperation {
|
|
|
|
|
else if(design_num1 == null || "".equals(design_num1) || " ".equals(design_num1)) {
|
|
|
|
|
design_num1 = comp.getStringProperty("bl_quantity");
|
|
|
|
|
if(design_num1 == null || "".equals(design_num1) || " ".equals(design_num1)) {
|
|
|
|
|
design_num1 = "0";
|
|
|
|
|
design_num1 = "1";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -703,10 +706,12 @@ public class BOMExportOperation extends AbstractAIFOperation {
|
|
|
|
|
weihao1 = comp.getStringProperty("T2_weihao");
|
|
|
|
|
importance1 = comp.getStringProperty("t2_BOMImportance");
|
|
|
|
|
item_id1 = rev.getStringProperty("item_id");
|
|
|
|
|
rev_id1 = rev.getStringProperty("item_revision_id");
|
|
|
|
|
name1 = rev.getStringProperty("object_name");
|
|
|
|
|
if("T2_outsourceRevision".equals(type)) {
|
|
|
|
|
xuhao1 = num ;
|
|
|
|
|
String classID = item_id1.substring(0, 2);
|
|
|
|
|
item_id1 = item_id1+rev_id1;
|
|
|
|
|
System.out.println("classID==============="+classID);
|
|
|
|
|
if("51".equals(classID) || "72".equals(classID) || "76".equals(classID)) {
|
|
|
|
|
|
|
|
|
|