no-bomasyn
陈翼晖 1 year ago
parent 9995f40661
commit 229291a55a

@ -1,3 +1,7 @@
ERROR_NOT_CHANGE=\u8BF7\u9009\u62E9\u66F4\u6539\u901A\u77E5\u5355\u5BF9\u8C61
<<<<<<< HEAD
ERROR_NO_CHANGE=\u672A\u627E\u5230\u53D8\u66F4\u524D\u540E\u5BF9\u8C61,\u65E0\u6CD5\u63D0\u53D6\u5DEE\u5F02\u9879\uFF01
SUCC_CHANGE=\u63D0\u53D6\u5B8C\u6210
=======
ERROR_NO_CHANGE=\u672A\u627E\u5230\u53D8\u66F4\u524D\u540E\u5BF9\u8C61,\u65E0\u6CD5\u63D0\u53D6\u5DEE\u5F02\u9879\uFF01
>>>>>>> 65c5903c8f3927b85b3c68d928802214a146ec48

@ -74,7 +74,11 @@ public class ExtractDiffComd extends KCommand {
return;
}
readChangeDesign(oldComponents, newComponents, tar);
<<<<<<< HEAD
MessageBox.post(resource.getString("SUCC_CHANGE"), "", 2);
=======
>>>>>>> 65c5903c8f3927b85b3c68d928802214a146ec48
} catch (TCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@ -150,10 +154,16 @@ public class ExtractDiffComd extends KCommand {
ChangeDesignBean changeDesignBean = itemChangeMap.get(keyItem);
TCComponentItemRevision oldDesgin = changeDesignBean.getOldDesgin();
Map<String, PBomBean> materialOld = getMaterialByDesign(oldDesgin);
<<<<<<< HEAD
System.out.println("materialOld===>" + materialOld.toString());
TCComponentItemRevision newDesgin = changeDesignBean.getNewDesgin();
Map<String, PBomBean> materialNew = getMaterialByDesign(newDesgin);
=======
TCComponentItemRevision newDesgin = changeDesignBean.getNewDesgin();
Map<String, PBomBean> materialNew = getMaterialByDesign(newDesgin);
System.out.println("materialOld===>" + materialOld.toString());
>>>>>>> 65c5903c8f3927b85b3c68d928802214a146ec48
System.out.println("materialNew===>" + materialNew.toString());
// ±È½Ï±ä¸üǰºóÎïÁÏBOM
for (String materialNo : materialOld.keySet()) {
@ -317,8 +327,11 @@ public class ExtractDiffComd extends KCommand {
if (pbomMap.containsKey(materialNo)) {
PBomBean pBomBean = pbomMap.get(materialNo);
// ÊÇ·ñPBOM
<<<<<<< HEAD
System.out.println("matnrProps[1]===>" + matnrProps[1]);
System.out.println("matnrProps[2]===>" + matnrProps[2] + "pBomBean.getpRevision()"+pBomBean.getpRevision());
=======
>>>>>>> 65c5903c8f3927b85b3c68d928802214a146ec48
if (matnrProps[1].equals(Util.ZT_VAL_PBOM) && matnrProps[2].compareTo(pBomBean.getpRevision()) > 0) {
pBomBean.setpMaterial(represent);
pBomBean.setpRevision(matnrProps[2]);

@ -1,3 +1,7 @@
ERROR_NOT_CHANGE=\u8BF7\u9009\u62E9\u66F4\u6539\u901A\u77E5\u5355\u5BF9\u8C61
<<<<<<< HEAD
ERROR_NO_CHANGE=\u672A\u627E\u5230\u53D8\u66F4\u524D\u540E\u5BF9\u8C61,\u65E0\u6CD5\u63D0\u53D6\u5DEE\u5F02\u9879\uFF01
SUCC_CHANGE=\u63D0\u53D6\u5B8C\u6210
=======
ERROR_NO_CHANGE=\u672A\u627E\u5230\u53D8\u66F4\u524D\u540E\u5BF9\u8C61,\u65E0\u6CD5\u63D0\u53D6\u5DEE\u5F02\u9879\uFF01
>>>>>>> 65c5903c8f3927b85b3c68d928802214a146ec48

@ -33,11 +33,50 @@ import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData
//import plm.xi.com.chintelectric.DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM;
public class BomUtilWh {
public static final String DATABASE_TC = "database_tc";
public static final String logSql = "insert into CHINT_BOM_TO_SAP_DETIALS (code,batchnumber,plmsendstatus,plmsendstarttime,factory,productmaterialno,pitemid,puid,materialno,wbsno,plmstatus) VALUES (?,?,'PLM开始传递',SYSDATE,?,?,?,?,?,?,'未处理') ";
public static final String WLLIST = "WLLIST";
public static final String WLCONTENTS = "WLCONTENTS";
public static final String WH_FACOTRY = "M060";
public static final String PARENTTCID = "PARENTTCID";
public static final String PARENTWLBM = "PARENTWLBM";
public static final String SPLIT_MSG = "/";
public static final String UID = "UID";
/**
* BOMDETAILS
*
* @param document XML Element INTERGRATIONLIST WLLIST WLCONTENTS BOM
* @param code CODE
* @param productNos
* @function
*/
public static void logXmlMsg(Document interGrationList, String code, String productNos, String batchNo,
String wbsNo, TCSession session) {
String strs[] = session.getPreferenceService().getStringValues(DATABASE_TC);
SqlUtil.getTCDataConnection(strs);
try {
Element rootElement = interGrationList.getRootElement();
// 物料信息
Element element = rootElement.element(WLLIST);
List<Element> elements = element.elements(WLCONTENTS);
for (Element content : elements) {
// 记录TCid UID 物料编码
String tcId = content.elementText(PARENTTCID);
String[] split = tcId.split(SPLIT_MSG);
String parentMantrNo = content.elementText(PARENTWLBM);
String uid = content.elementText(UID);
SqlUtil.write(logSql,
new String[] { code, batchNo, WH_FACOTRY, productNos, split[0], uid, parentMantrNo, wbsNo });
}
} catch (Exception e) {
e.printStackTrace();
} finally {
SqlUtil.freeAll();
}
}
private static ArrayList<String> lists2 = new ArrayList<String>(){{
add("PDF");
add("MS WordX");add("MS ExcelX");add("MS Excel");add("MS Word");
}};
private static ArrayList<String> lists2=new ArrayList<String>(){{add("PDF");add("MS WordX");add("MS ExcelX");add("MS Excel");add("MS Word");}};
// public static String getXML(String parameters){
// String soapXML = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" "
// + "xmlns:web=\"http://webservice.core.intf.mes.xinhua.com/\"> "
@ -105,10 +144,12 @@ public class BomUtilWh {
ls.add(dsList2);
return ls;
}
// 获取二级工序 BOPLIST BOPCONTENTS
public static void getProcess(TCComponentMEProcessRevision rev, TCComponentItemRevision partRev,
TCSession session, String now, String txtPath, String groupName,
Map<String, TCComponent> gy_meops, List<TCComponentMEProcessRevision> needTCM_meops,Element BOPLIST,Element SONLIST,Integer valueOf) throws Exception {
public static void getProcess(TCComponentMEProcessRevision rev, TCComponentItemRevision partRev, TCSession session,
String now, String txtPath, String groupName, Map<String, TCComponent> gy_meops,
List<TCComponentMEProcessRevision> needTCM_meops, Element BOPLIST, Element SONLIST, Integer valueOf)
throws Exception {
String zt2_MaterialNo = partRev.getProperty("zt2_MaterialNo");
if (KUtil.isTCM(rev))
@ -124,7 +165,8 @@ public class BomUtilWh {
TCComponentBOPWindowType bopWindowType = (TCComponentBOPWindowType) session.getTypeComponent("BOPWindow");
TCComponentBOPWindow window = (TCComponentBOPWindow) bopWindowType.create(null);
TCComponentBOMLine topLine = window.setWindowTopLine(rev.getItem(), rev, null, null);
String[] properties = rev.getProperties(new String[] {"item_id","item_revision_id","object_name","zt2_Source"} );
String[] properties = rev
.getProperties(new String[] { "item_id", "item_revision_id", "object_name", "zt2_Source" });
Element BOPCONTENTS = BOPLIST.addElement("BOPCONTENTS");
String boptcId = properties[0] + "/" + properties[1];
String bopName = properties[2];
@ -154,7 +196,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -169,14 +212,15 @@ public class BomUtilWh {
Element KJJDLIST = BOPCONTENTS.addElement("KJJDLIST");
readOneGx(expandPSDatas, partRev, now, bomLineTree, KJJDLIST, SONLIST, valueOf);
window.closeBOPWindow();
}
public static void readOneGx(ExpandPSData[] expandPSDatas,TCComponentItemRevision partRev,
String now,Map<String, ExpandPSData[]> bomLineTree,Element KJJDLIST,Element SONLIST,Integer valueOf) throws Exception {
public static void readOneGx(ExpandPSData[] expandPSDatas, TCComponentItemRevision partRev, String now,
Map<String, ExpandPSData[]> bomLineTree, Element KJJDLIST, Element SONLIST, Integer valueOf)
throws Exception {
List<FlowBean> flowBeans = new ArrayList<>();
List<TCComponentBOMLine> startLines = SAPUtil.getFlowStarts(expandPSDatas);
String p_uom = partRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase();
@ -221,11 +265,14 @@ public class BomUtilWh {
getGXInfo(bean, i, partRev, p_uom, now, bomLineTree, KJJDLIST, SONLIST, valueOf);
// ind = ind+1;
// }
//getGXInfo(bean, i, partRev, p_uom, now,bomLineTree,KJJDLIST,SONLIST, valueOf);
// getGXInfo(bean, i, partRev, p_uom, now,bomLineTree,KJJDLIST,SONLIST,
// valueOf);
}
}
public static void readTowGx(ExpandPSData[] expandPSDatas, TCComponentItemRevision partRev, String now,
Map<String, ExpandPSData[]> bomLineTree,Element OPLIST,Element SONLIST,Integer valueOf) throws Exception {
Map<String, ExpandPSData[]> bomLineTree, Element OPLIST, Element SONLIST, Integer valueOf)
throws Exception {
List<FlowBean> flowBeans = new ArrayList<>();
List<TCComponentBOMLine> startLines = SAPUtil.getFlowStarts(expandPSDatas);
String p_uom = partRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase();
@ -275,10 +322,11 @@ public class BomUtilWh {
}
}
}
// 读取二级工序 并行工序无后续
public static void getGXInfo2Comb(FlowBean bean, int index,
TCComponentItemRevision partRev, String p_uom, String now,Map<String, ExpandPSData[]> bomLineTree,
Element OPLIST,Element SONLIST,Integer valueOf,TCComponentBOMLine gxLine) throws Exception {
public static void getGXInfo2Comb(FlowBean bean, int index, TCComponentItemRevision partRev, String p_uom,
String now, Map<String, ExpandPSData[]> bomLineTree, Element OPLIST, Element SONLIST, Integer valueOf,
TCComponentBOMLine gxLine) throws Exception {
// DT_PROCESSROUTE_S4_REQLISTITEMSITEM item = new DT_PROCESSROUTE_S4_REQLISTITEMSITEM();
String plnal = "1";
String plnfl = String.format("%06d", index);
@ -333,9 +381,11 @@ public class BomUtilWh {
// }
// }
TCComponentItemRevision gxRev = gxLine.getItemRevision();
String[] properties2 = gxLine.getProperties(new String[] {"zt2_ControlCode","bl_ZT2_FirstOPRevision_zt2_ArtificialTime"
,"bl_ZT2_FirstOPRevision_zt2_MachineTime","bl_ZT2_FirstOPRevision_zt2_ReadinessTime","bl_ZT2_FirstOPRevision_zt2_ProCycle"});
String[] properties = gxRev.getProperties(new String[] {"item_id","item_revision_id","zt2_WorkCenter","object_name","zt2_ClassificationCode"});
String[] properties2 = gxLine.getProperties(new String[] { "zt2_ControlCode",
"bl_ZT2_FirstOPRevision_zt2_ArtificialTime", "bl_ZT2_FirstOPRevision_zt2_MachineTime",
"bl_ZT2_FirstOPRevision_zt2_ReadinessTime", "bl_ZT2_FirstOPRevision_zt2_ProCycle" });
String[] properties = gxRev.getProperties(new String[] { "item_id", "item_revision_id", "zt2_WorkCenter",
"object_name", "zt2_ClassificationCode" });
// DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM sub = new DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM();
// subItems.add(sub);
String kjjdId = properties[0] + "/" + properties[1];
@ -385,14 +435,15 @@ public class BomUtilWh {
if (remark.equals("ZT2_FuLiao") || remark.equals("辅料")) {
type = "2";
Element SONCONTENTS = SONLIST.addElement("SONCONTENTS");
String[] properties3 = itemRevOfBOMLine.getProperties(new String[] {"item_id","item_revision_id",
"zt2_MaterialNo","zt2_Quantity"});
String[] properties3 = itemRevOfBOMLine.getProperties(
new String[] { "item_id", "item_revision_id", "zt2_MaterialNo", "zt2_Quantity" });
SONCONTENTS.addElement("TCID").setText(properties3[0] + "/" + properties3[1]);
SONCONTENTS.addElement("WLBM").setText(properties3[2]);
SONCONTENTS.addElement("DATUV").setText(now);
String zysapmenge = getZYSAPMENGE(itemRevOfBOMLine, null, bomLine, false, "1", new StringBuffer());
SONCONTENTS.addElement("QUE").setText(zysapmenge);
SONCONTENTS.addElement("QUIT").setText(itemRevOfBOMLine.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("QUIT")
.setText(itemRevOfBOMLine.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("SORTF");
valueOf = valueOf + 10;
SONCONTENTS.addElement("SEQID").setText(valueOf.toString());
@ -416,7 +467,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -449,7 +501,8 @@ public class BomUtilWh {
fileType = "xlsx";
}
String fileUid = dataset.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -461,7 +514,6 @@ public class BomUtilWh {
}
}
Element OPGXZYZDSFILELIST = OPCONTENTS.addElement("OPGXZYZDSFILELIST");
TCComponentItem procGuidBook = (TCComponentItem) gxRev.getRelatedComponent("ZT2_ProcGuidBookRelation");
System.out.println("gxRev===========>" + gxRev + "procGuidBook======>" + procGuidBook);
@ -488,7 +540,8 @@ public class BomUtilWh {
fileType = "xlsx";
}
String fileUid = dataset.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -511,13 +564,15 @@ public class BomUtilWh {
// item.setSUBITEMS(subItems.toArray(new DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM[] {}));
// return item;
}
// 读取质量检验项
public static void getZljyxInfo2(Element OPCHECKCONTENTS, TCComponentItemRevision gxRev) {
// 质量检验项关系文件夹
try {
TCComponent[] quantityChecks = gxRev.getRelatedComponents("ZT2_QualityCheckRelation");
if (quantityChecks.length > 0) {
String[] properties3 = gxRev.getProperties(new String[] {"item_id","item_revision_id","object_name"});
String[] properties3 = gxRev
.getProperties(new String[] { "item_id", "item_revision_id", "object_name" });
OPCHECKCONTENTS.addElement("PARENTTCID").setText(properties3[0] + "/" + properties3[1]);
OPCHECKCONTENTS.addElement("PARENTNAME").setText(properties3[2]);
OPCHECKCONTENTS.addElement("OTHER1").setText("OTHER1");
@ -529,10 +584,10 @@ public class BomUtilWh {
List<QCheckBean> beans = new ArrayList<QCheckBean>();
for (TCComponent zt2_QCheck : zt2_QChecks) {
// 质量检验项信息
String[] properties = zt2_QCheck.getProperties(new String[] {"zt2_code","zt2_jjxbh","zt2_jyxmc","zt2_jyxsjjg"
,"zt2_bzgcsxbh","zt2_bzgcsx","zt2_bzgcxxbh","zt2_bzgczxx"});
beans.add(new QCheckBean(properties[0],properties[1],
properties[2],properties[3],properties[4],properties[5],properties[6],properties[7]));
String[] properties = zt2_QCheck.getProperties(new String[] { "zt2_code", "zt2_jjxbh", "zt2_jyxmc",
"zt2_jyxsjjg", "zt2_bzgcsxbh", "zt2_bzgcsx", "zt2_bzgcxxbh", "zt2_bzgczxx" });
beans.add(new QCheckBean(properties[0], properties[1], properties[2], properties[3], properties[4],
properties[5], properties[6], properties[7]));
}
Collections.sort(beans, new Comparator<QCheckBean>() {
@ -560,10 +615,11 @@ public class BomUtilWh {
}
}
// 读取二级工序
public static void getGXInfo2(FlowBean bean, int index,
TCComponentItemRevision partRev, String p_uom, String now,Map<String, ExpandPSData[]> bomLineTree,
Element OPLIST,Element SONLIST,Integer valueOf) throws Exception {
public static void getGXInfo2(FlowBean bean, int index, TCComponentItemRevision partRev, String p_uom, String now,
Map<String, ExpandPSData[]> bomLineTree, Element OPLIST, Element SONLIST, Integer valueOf)
throws Exception {
// DT_PROCESSROUTE_S4_REQLISTITEMSITEM item = new DT_PROCESSROUTE_S4_REQLISTITEMSITEM();
String plnal = "1";
String plnfl = String.format("%06d", index);
@ -618,9 +674,11 @@ public class BomUtilWh {
}
}
TCComponentItemRevision gxRev = gxLine.getItemRevision();
String[] properties2 = gxLine.getProperties(new String[] {"zt2_ControlCode","bl_ZT2_FirstOPRevision_zt2_ArtificialTime"
,"bl_ZT2_FirstOPRevision_zt2_MachineTime","bl_ZT2_FirstOPRevision_zt2_ReadinessTime","bl_ZT2_FirstOPRevision_zt2_ProCycle"});
String[] properties = gxRev.getProperties(new String[] {"item_id","item_revision_id","zt2_WorkCenter","object_name","zt2_ClassificationCode"});
String[] properties2 = gxLine.getProperties(new String[] { "zt2_ControlCode",
"bl_ZT2_FirstOPRevision_zt2_ArtificialTime", "bl_ZT2_FirstOPRevision_zt2_MachineTime",
"bl_ZT2_FirstOPRevision_zt2_ReadinessTime", "bl_ZT2_FirstOPRevision_zt2_ProCycle" });
String[] properties = gxRev.getProperties(new String[] { "item_id", "item_revision_id", "zt2_WorkCenter",
"object_name", "zt2_ClassificationCode" });
// DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM sub = new DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM();
// subItems.add(sub);
String kjjdId = properties[0] + "/" + properties[1];
@ -670,14 +728,15 @@ public class BomUtilWh {
if (remark.equals("ZT2_FuLiao") || remark.equals("辅料")) {
type = "2";
Element SONCONTENTS = SONLIST.addElement("SONCONTENTS");
String[] properties3 = itemRevOfBOMLine.getProperties(new String[] {"item_id","item_revision_id",
"zt2_MaterialNo","zt2_Quantity"});
String[] properties3 = itemRevOfBOMLine.getProperties(
new String[] { "item_id", "item_revision_id", "zt2_MaterialNo", "zt2_Quantity" });
SONCONTENTS.addElement("TCID").setText(properties3[0] + "/" + properties3[1]);
SONCONTENTS.addElement("WLBM").setText(properties3[2]);
SONCONTENTS.addElement("DATUV").setText(now);
String zysapmenge = getZYSAPMENGE(itemRevOfBOMLine, null, bomLine, false, "1", new StringBuffer());
SONCONTENTS.addElement("QUE").setText(zysapmenge);
SONCONTENTS.addElement("QUIT").setText(itemRevOfBOMLine.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("QUIT").setText(
itemRevOfBOMLine.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("SORTF");
valueOf = valueOf + 10;
SONCONTENTS.addElement("SEQID").setText(valueOf.toString());
@ -701,7 +760,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -734,7 +794,8 @@ public class BomUtilWh {
fileType = "xlsx";
}
String fileUid = dataset.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -746,7 +807,6 @@ public class BomUtilWh {
}
}
Element OPGXZYZDSFILELIST = OPCONTENTS.addElement("OPGXZYZDSFILELIST");
TCComponentItem procGuidBook = (TCComponentItem) gxRev.getRelatedComponent("ZT2_ProcGuidBookRelation");
System.out.println("gxRev===========>" + gxRev + "procGuidBook======>" + procGuidBook);
@ -773,7 +833,8 @@ public class BomUtilWh {
fileType = "xlsx";
}
String fileUid = dataset.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -796,10 +857,11 @@ public class BomUtilWh {
// item.setSUBITEMS(subItems.toArray(new DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM[] {}));
// return item;
}
// 读取一级工序
public static void getGXInfoComb(FlowBean bean, int index,
TCComponentItemRevision partRev, String p_uom, String now,Map<String, ExpandPSData[]> bomLineTree,
Element KJJDLIST,Element SONLIST,Integer valueOf,TCComponentBOMLine gxLine) throws Exception {
public static void getGXInfoComb(FlowBean bean, int index, TCComponentItemRevision partRev, String p_uom,
String now, Map<String, ExpandPSData[]> bomLineTree, Element KJJDLIST, Element SONLIST, Integer valueOf,
TCComponentBOMLine gxLine) throws Exception {
// DT_PROCESSROUTE_S4_REQLISTITEMSITEM item = new DT_PROCESSROUTE_S4_REQLISTITEMSITEM();
String plnal = "1";
String plnfl = String.format("%06d", index);
@ -841,9 +903,11 @@ public class BomUtilWh {
boolean inBx = bean.flow_split == null;
TCComponentItemRevision gxRev = gxLine.getItemRevision();
String[] properties2 = gxLine.getProperties(new String[] {"zt2_ControlCode","bl_ZT2_FirstOPRevision_zt2_ArtificialTime",
"bl_ZT2_FirstOPRevision_zt2_MachineTime","bl_ZT2_FirstOPRevision_zt2_ReadinessTime","bl_ZT2_FirstOPRevision_zt2_ProCycle"});
String[] properties = gxRev.getProperties(new String[] {"item_id","item_revision_id","zt2_WorkCenter","object_name","zt2_ClassificationCode"});
String[] properties2 = gxLine.getProperties(new String[] { "zt2_ControlCode",
"bl_ZT2_FirstOPRevision_zt2_ArtificialTime", "bl_ZT2_FirstOPRevision_zt2_MachineTime",
"bl_ZT2_FirstOPRevision_zt2_ReadinessTime", "bl_ZT2_FirstOPRevision_zt2_ProCycle" });
String[] properties = gxRev.getProperties(new String[] { "item_id", "item_revision_id", "zt2_WorkCenter",
"object_name", "zt2_ClassificationCode" });
// DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM sub = new DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM();
// subItems.add(sub);
String kjjdId = properties[0] + "/" + properties[1];
@ -886,7 +950,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -900,10 +965,11 @@ public class BomUtilWh {
readTowGx(bomLineTree.get(gxLine.getUid()), gxRev, now, bomLineTree, OPLIST, SONLIST, valueOf);
// }
}
// 读取一级工序
public static void getGXInfo(FlowBean bean, int index,
TCComponentItemRevision partRev, String p_uom, String now,Map<String, ExpandPSData[]> bomLineTree,
Element KJJDLIST,Element SONLIST,Integer valueOf) throws Exception {
public static void getGXInfo(FlowBean bean, int index, TCComponentItemRevision partRev, String p_uom, String now,
Map<String, ExpandPSData[]> bomLineTree, Element KJJDLIST, Element SONLIST, Integer valueOf)
throws Exception {
// DT_PROCESSROUTE_S4_REQLISTITEMSITEM item = new DT_PROCESSROUTE_S4_REQLISTITEMSITEM();
String plnal = "1";
String plnfl = String.format("%06d", index);
@ -958,9 +1024,11 @@ public class BomUtilWh {
}
}
TCComponentItemRevision gxRev = gxLine.getItemRevision();
String[] properties2 = gxLine.getProperties(new String[] {"zt2_ControlCode","bl_ZT2_FirstOPRevision_zt2_ArtificialTime",
"bl_ZT2_FirstOPRevision_zt2_MachineTime","bl_ZT2_FirstOPRevision_zt2_ReadinessTime","bl_ZT2_FirstOPRevision_zt2_ProCycle"});
String[] properties = gxRev.getProperties(new String[] {"item_id","item_revision_id","zt2_WorkCenter","object_name","zt2_ClassificationCode"});
String[] properties2 = gxLine.getProperties(new String[] { "zt2_ControlCode",
"bl_ZT2_FirstOPRevision_zt2_ArtificialTime", "bl_ZT2_FirstOPRevision_zt2_MachineTime",
"bl_ZT2_FirstOPRevision_zt2_ReadinessTime", "bl_ZT2_FirstOPRevision_zt2_ProCycle" });
String[] properties = gxRev.getProperties(new String[] { "item_id", "item_revision_id", "zt2_WorkCenter",
"object_name", "zt2_ClassificationCode" });
// DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM sub = new DT_PROCESSROUTE_S4_REQLISTITEMSITEMSUBITEMSSUBITEM();
// subItems.add(sub);
String kjjdId = properties[0] + "/" + properties[1];
@ -1003,7 +1071,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId);
FILECONTENTS.addElement("FILENAME").setText(fileName);
FILECONTENTS.addElement("FILETYPE").setText(fileType);
@ -1017,6 +1086,7 @@ public class BomUtilWh {
readTowGx(bomLineTree.get(gxLine.getUid()), gxRev, now, bomLineTree, OPLIST, SONLIST, valueOf);
}
}
public static void readGXFlow(TCComponentBOMLine gxLine, List<FlowBean> flowBeans, FlowBean currentFlow,
boolean isMainFlow) throws Exception {
TCComponent[] suc = gxLine.getReferenceListProperty("Mfg0successors");
@ -1046,6 +1116,7 @@ public class BomUtilWh {
}
readGXFlow((TCComponentBOMLine) suc[0], flowBeans, currentFlow, false);
}
// WBSList
public static void getWbsMsg2(TCComponentItemRevision pRev, String groupId, List<String> wbsList, Element WBSLIST) {
@ -1072,6 +1143,7 @@ public class BomUtilWh {
}
}
// WBSList
public static void getWbsMsg(TCComponentItemRevision pRev, String groupId, List<String> wbsList, Element WBSLIST) {
@ -1098,11 +1170,13 @@ public class BomUtilWh {
}
}
// 遍历产成品BOM 单层 没有BOM 和 文件跳过
public static void expandAllBomPartBj(Map<String, ExpandPSData[]> expands, TCComponentBOMLine pBomLine,
TCComponentItemRevision pRev,String groupName,List<String> wbsList,TCSession session,String now
,List<TCComponentMEProcessRevision> needTCM_meops,Map<String, TCComponent> gy_meops,
Element INTERGRATIONLIST,StringBuffer errMessage,List<TCComponentItem> cppRevision,String txtPath,Map<String, TCComponentItemRevision> material_revs) {
TCComponentItemRevision pRev, String groupName, List<String> wbsList, TCSession session, String now,
List<TCComponentMEProcessRevision> needTCM_meops, Map<String, TCComponent> gy_meops,
Element INTERGRATIONLIST, StringBuffer errMessage, List<TCComponentItem> cppRevision, String txtPath,
Map<String, TCComponentItemRevision> material_revs) {
try {
String uid = pBomLine.getUid();
@ -1133,7 +1207,8 @@ public class BomUtilWh {
}
Element WLCONTENTS = WLLIST.addElement("WLCONTENTS"); // 文件信息
Element TCID = WLCONTENTS.addElement("TCID");
String[] properties = pRev.getProperties(new String[] {"item_id","item_revision_id","zt2_MaterialNo","zt2_Quantity","zt2_State"});
String[] properties = pRev.getProperties(
new String[] { "item_id", "item_revision_id", "zt2_MaterialNo", "zt2_Quantity", "zt2_State" });
TCID.setText(properties[0] + "/" + properties[1]);
@ -1152,7 +1227,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
// <ID>图号</ID>(文件载体item_id)
// <NAME>图纸名称</NAME>(文件载体object_name
@ -1173,7 +1249,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
// <ID>图号</ID>(文件载体item_id)
// <NAME>图纸名称</NAME>(文件载体object_name
@ -1195,10 +1272,11 @@ public class BomUtilWh {
BOMCONTENTS.addElement("STLAN").setText("1");
BOMCONTENTS.addElement("STLAL").setText("1"); // <QUANTITY>基本数量</QUANTITY>
BOMCONTENTS.addElement("QUANTITY").setText(properties[3]);
BOMCONTENTS.addElement("QUIT").setText(pRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
BOMCONTENTS.addElement("QUIT")
.setText(pRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
Element SONLIST = BOMCONTENTS.addElement("SONLIST");
// 获取工艺信息 BOPLIST BOPCONTENTS ()二级工序下的辅料放到子件
String maxSeq = "";
String maxSeq = "10";
System.out.println("=========getProcess over========" + pRev);
for (int i = 0; i < expandPSDatas.length; i++) {
Element SONCONTENTS = SONLIST.addElement("SONCONTENTS");
@ -1215,7 +1293,8 @@ public class BomUtilWh {
String zysapmenge = getZYSAPMENGE(rev2, null, line2, false, "1", errMessage);
SONCONTENTS.addElement("QUE").setText(zysapmenge);
SONCONTENTS.addElement("QUIT").setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("QUIT")
.setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("SORTF").setText("");
SONCONTENTS.addElement("SEQID").setText(line2.getProperty("bl_sequence_no"));
SONCONTENTS.addElement("POSTP").setText("L");
@ -1230,8 +1309,8 @@ public class BomUtilWh {
if (!KUtil.isEmpty(properties2[2])) {
material_revs.put(properties2[2], rev2);
}
expandAllBomPart(expands,line2,rev2,groupName,wbsList,
session,now,needTCM_meops,gy_meops,INTERGRATIONLIST,errMessage, txtPath,material_revs);
expandAllBomPart(expands, line2, rev2, groupName, wbsList, session, now, needTCM_meops, gy_meops,
INTERGRATIONLIST, errMessage, txtPath, material_revs);
// if (!KUtil.isEmpty(zt2_materialNo)) {
// material_revs.put(zt2_materialNo, part2Rev);
@ -1242,8 +1321,8 @@ public class BomUtilWh {
Integer valueOf = Integer.valueOf(maxSeq);
if (pRev != null && meops.length > 0) {
TXTUtil.writeTXT(txtPath, "物料[" + pRev + "]工艺信息:" + meops[0].getComponent());
getProcess((TCComponentMEProcessRevision) meops[0].getComponent(), pRev, session, now,
"", groupName, gy_meops, needTCM_meops,BOPLIST,SONLIST,valueOf);
getProcess((TCComponentMEProcessRevision) meops[0].getComponent(), pRev, session, now, "",
groupName, gy_meops, needTCM_meops, BOPLIST, SONLIST, valueOf);
}
}
@ -1253,12 +1332,12 @@ public class BomUtilWh {
}
}
// 遍历产成品BOM 单层 没有BOM 和 文件跳过
public static void expandAllBomPartBjOne(Map<String, ExpandPSData[]> expands, TCComponentBOMLine pBomLine,
TCComponentItemRevision pRev,String groupName,List<String> wbsList,TCSession session,String now
,List<TCComponentMEProcessRevision> needTCM_meops,Map<String, TCComponent> gy_meops,
Element INTERGRATIONLIST,StringBuffer errMessage,List<TCComponentItem> cppRevision,String txtPath,Map<String, TCComponentItemRevision> material_revs) {
TCComponentItemRevision pRev, String groupName, List<String> wbsList, TCSession session, String now,
List<TCComponentMEProcessRevision> needTCM_meops, Map<String, TCComponent> gy_meops,
Element INTERGRATIONLIST, StringBuffer errMessage, List<TCComponentItem> cppRevision, String txtPath,
Map<String, TCComponentItemRevision> material_revs) {
try {
String uid = pBomLine.getUid();
@ -1289,7 +1368,8 @@ public class BomUtilWh {
}
Element WLCONTENTS = WLLIST.addElement("WLCONTENTS"); // 文件信息
Element TCID = WLCONTENTS.addElement("TCID");
String[] properties = pRev.getProperties(new String[] {"item_id","item_revision_id","zt2_MaterialNo","zt2_Quantity","zt2_State"});
String[] properties = pRev.getProperties(
new String[] { "item_id", "item_revision_id", "zt2_MaterialNo", "zt2_Quantity", "zt2_State" });
TCID.setText(properties[0] + "/" + properties[1]);
@ -1308,7 +1388,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
// <ID>图号</ID>(文件载体item_id)
// <NAME>图纸名称</NAME>(文件载体object_name
@ -1329,7 +1410,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
// <ID>图号</ID>(文件载体item_id)
// <NAME>图纸名称</NAME>(文件载体object_name
@ -1351,10 +1433,11 @@ public class BomUtilWh {
BOMCONTENTS.addElement("STLAN").setText("1");
BOMCONTENTS.addElement("STLAL").setText("1"); // <QUANTITY>基本数量</QUANTITY>
BOMCONTENTS.addElement("QUANTITY").setText(properties[3]);
BOMCONTENTS.addElement("QUIT").setText(pRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
BOMCONTENTS.addElement("QUIT")
.setText(pRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
Element SONLIST = BOMCONTENTS.addElement("SONLIST");
// 获取工艺信息 BOPLIST BOPCONTENTS ()二级工序下的辅料放到子件
String maxSeq = "";
String maxSeq = "10";
System.out.println("=========getProcess over========" + pRev);
for (int i = 0; i < expandPSDatas.length; i++) {
Element SONCONTENTS = SONLIST.addElement("SONCONTENTS");
@ -1371,7 +1454,8 @@ public class BomUtilWh {
String zysapmenge = getZYSAPMENGE(rev2, null, line2, false, "1", errMessage);
SONCONTENTS.addElement("QUE").setText(zysapmenge);
SONCONTENTS.addElement("QUIT").setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("QUIT")
.setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("SORTF").setText("");
SONCONTENTS.addElement("SEQID").setText(line2.getProperty("bl_sequence_no"));
SONCONTENTS.addElement("POSTP").setText("L");
@ -1390,8 +1474,8 @@ public class BomUtilWh {
Integer valueOf = Integer.valueOf(maxSeq);
if (pRev != null && meops.length > 0) {
TXTUtil.writeTXT(txtPath, "物料[" + pRev + "]工艺信息:" + meops[0].getComponent());
getProcess((TCComponentMEProcessRevision) meops[0].getComponent(), pRev, session, now,
"", groupName, gy_meops, needTCM_meops,BOPLIST,SONLIST,valueOf);
getProcess((TCComponentMEProcessRevision) meops[0].getComponent(), pRev, session, now, "",
groupName, gy_meops, needTCM_meops, BOPLIST, SONLIST, valueOf);
}
}
@ -1403,14 +1487,14 @@ public class BomUtilWh {
public static boolean checkMatnr(StringBuffer errMessage, TCComponentItemRevision matnrRev) throws TCException {
TCProperty[] tcProperties = matnrRev.getTCProperties(new String[] {"zt2_SZFactory","zt2_SZProcuretype","zt2_SZSealedornot"});
TCProperty[] tcProperties = matnrRev
.getTCProperties(new String[] { "zt2_SZFactory", "zt2_SZProcuretype", "zt2_SZSealedornot" });
try {
String[] properties = matnrRev.getProperties(new String[] { "item_id", "zt2_State", "object_name" });
String zt2_State = properties[1];// matnrRev.getStringProperty("zt2_State");
// System.out.println("properties[4]===>"+zt2_State);
if (zt2_State.equals("封存") || zt2_State.equals("D1")) {
errMessage.append("物料:").append(properties[0]).append("/")
.append(properties[2]).append("已封存,无法传递SAP");
errMessage.append("物料:").append(properties[0]).append("/").append(properties[2]).append("已封存,无法传递SAP");
}
Boolean flag = false;
String[] zt2_SZFactory = tcProperties[0].getStringArrayValue();
@ -1420,18 +1504,18 @@ public class BomUtilWh {
if (zt2_SZFactory[num].equals("M060")) {
flag = true;
if (zt2_SZProcuretype.length > num && zt2_SZProcuretype[num].equals("/")) {
errMessage.append("物料:").append(properties[0]).append("/")
.append(properties[2]).append("物料不可用,无法传递SAP\n");
errMessage.append("物料:").append(properties[0]).append("/").append(properties[2])
.append("物料不可用,无法传递SAP\n");
}
if (zt2_SZSealedornot.length > num && zt2_SZSealedornot[num].equals("Y")) {
errMessage.append("物料:").append(properties[0]).append("/")
.append(properties[2]).append("已封存,无法传递SAP\n");
errMessage.append("物料:").append(properties[0]).append("/").append(properties[2])
.append("已封存,无法传递SAP\n");
}
}
}
if (!flag) {
errMessage.append("物料:").append(properties[0]).append("/")
.append(properties[2]).append("没有维护物料视图,无法传递SAP\n");
errMessage.append("物料:").append(properties[0]).append("/").append(properties[2])
.append("没有维护物料视图,无法传递SAP\n");
}
return false;
} catch (Exception e) {
@ -1443,9 +1527,10 @@ public class BomUtilWh {
// 遍历产成品BOM 单层 没有BOM 和 文件跳过
public static void expandAllBomPart(Map<String, ExpandPSData[]> expands, TCComponentBOMLine pBomLine,
TCComponentItemRevision pRev,String groupName,List<String> wbsList,TCSession session,String now
,List<TCComponentMEProcessRevision> needTCM_meops,Map<String, TCComponent> gy_meops,
Element INTERGRATIONLIST,StringBuffer errMessage,String txtPath,Map<String, TCComponentItemRevision> material_revs) {
TCComponentItemRevision pRev, String groupName, List<String> wbsList, TCSession session, String now,
List<TCComponentMEProcessRevision> needTCM_meops, Map<String, TCComponent> gy_meops,
Element INTERGRATIONLIST, StringBuffer errMessage, String txtPath,
Map<String, TCComponentItemRevision> material_revs) {
try {
String uid = pBomLine.getUid();
@ -1469,7 +1554,8 @@ public class BomUtilWh {
}
Element WLCONTENTS = WLLIST.addElement("WLCONTENTS"); // 文件信息
Element TCID = WLCONTENTS.addElement("TCID");
String[] properties = pRev.getProperties(new String[] {"item_id","item_revision_id","zt2_MaterialNo","zt2_Quantity","zt2_State"});
String[] properties = pRev.getProperties(
new String[] { "item_id", "item_revision_id", "zt2_MaterialNo", "zt2_Quantity", "zt2_State" });
TCID.setText(properties[0] + "/" + properties[1]);
@ -1488,7 +1574,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
// <ID>图号</ID>(文件载体item_id)
// <NAME>图纸名称</NAME>(文件载体object_name
@ -1509,7 +1596,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
// <ID>图号</ID>(文件载体item_id)
// <NAME>图纸名称</NAME>(文件载体object_name
@ -1531,11 +1619,13 @@ public class BomUtilWh {
BOMCONTENTS.addElement("STLAN").setText("1");
BOMCONTENTS.addElement("STLAL").setText("1"); // <QUANTITY>基本数量</QUANTITY>
BOMCONTENTS.addElement("QUANTITY").setText(properties[3]);
BOMCONTENTS.addElement("QUIT").setText(pRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
BOMCONTENTS.addElement("QUIT")
.setText(pRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
Element SONLIST = BOMCONTENTS.addElement("SONLIST");
// 获取工艺信息 BOPLIST BOPCONTENTS ()二级工序下的辅料放到子件
String maxSeq = "";
System.out.println("=========getProcess over========"+pRev+"expandPSDatas==>"+expandPSDatas.length);
String maxSeq = "10";
System.out
.println("=========getProcess over========" + pRev + "expandPSDatas==>" + expandPSDatas.length);
for (int i = 0; i < expandPSDatas.length; i++) {
Element SONCONTENTS = SONLIST.addElement("SONCONTENTS");
ExpandPSData exPsData = expandPSDatas[i];
@ -1558,7 +1648,8 @@ public class BomUtilWh {
String zysapmenge = getZYSAPMENGE(rev2, null, line2, false, "1", errMessage);
SONCONTENTS.addElement("QUE").setText(zysapmenge);
SONCONTENTS.addElement("QUIT").setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("QUIT")
.setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("SORTF").setText("");
SONCONTENTS.addElement("SEQID").setText(line2.getProperty("bl_sequence_no"));
SONCONTENTS.addElement("POSTP").setText("L");
@ -1573,8 +1664,8 @@ public class BomUtilWh {
if (!KUtil.isEmpty(properties2[2])) {
material_revs.put(properties2[2], rev2);
}
expandAllBomPart(expands,line2,rev2,groupName,wbsList,session,now,
needTCM_meops,gy_meops,INTERGRATIONLIST,errMessage,txtPath,material_revs);
expandAllBomPart(expands, line2, rev2, groupName, wbsList, session, now, needTCM_meops, gy_meops,
INTERGRATIONLIST, errMessage, txtPath, material_revs);
}
AIFComponentContext[] meops = pRev.whereReferencedByTypeRelation(new String[] { "MEProcessRevision" },
@ -1582,8 +1673,8 @@ public class BomUtilWh {
Integer valueOf = Integer.valueOf(maxSeq);
if (pRev != null && meops.length > 0) {
TXTUtil.writeTXT(txtPath, "物料[" + pRev + "]工艺信息:" + meops[0].getComponent());
getProcess((TCComponentMEProcessRevision) meops[0].getComponent(), pRev, session, now,
"", groupName, gy_meops, needTCM_meops,BOPLIST,SONLIST,valueOf);
getProcess((TCComponentMEProcessRevision) meops[0].getComponent(), pRev, session, now, "",
groupName, gy_meops, needTCM_meops, BOPLIST, SONLIST, valueOf);
}
}
@ -1611,8 +1702,8 @@ public class BomUtilWh {
Element SONCONTENTS = SONLIST.addElement("SONCONTENTS");
TCComponentItemRevision rev2 = SAPUtil.getSAPPart(line2, session, groupName, errMessage);
String[] properties2 = rev2.getProperties(new String[] {"item_id","item_revision_id",
"zt2_MaterialNo","zt2_Quantity","zt2_State"});
String[] properties2 = rev2.getProperties(
new String[] { "item_id", "item_revision_id", "zt2_MaterialNo", "zt2_Quantity", "zt2_State" });
checkMatnr(errMessage, rev2);
// System.out.println("properties[4]===>"+properties2[4]);
// if(properties2[4].equals("封存")||properties2[4].equals("D1")) {
@ -1624,7 +1715,8 @@ public class BomUtilWh {
String zysapmenge = getZYSAPMENGE(rev2, null, line2, false, "1", errMessage);
SONCONTENTS.addElement("QUE").setText(zysapmenge);
SONCONTENTS.addElement("QUIT").setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("QUIT")
.setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("SORTF").setText("");
SONCONTENTS.addElement("SEQID").setText(line2.getProperty("bl_sequence_no"));
SONCONTENTS.addElement("POSTP").setText("L");
@ -1634,7 +1726,8 @@ public class BomUtilWh {
// if(i==expandPSDatas.length-1) {
// maxSeq = line2.getProperty("bl_sequence_no");
// }
// if(!designRev.getType().contains("ZT2_Design3D") || !thList.contains(itemId.split("-")[0])) {
// if(!designRev.getType().contains("ZT2_Design3D") ||
// !thList.contains(itemId.split("-")[0])) {
// continue;
// }
// if (rev2.getProperty("zt2_SapState").equals("已传"))
@ -1654,9 +1747,10 @@ public class BomUtilWh {
// 遍历产成品BOM 单层 没有BOM 和 文件跳过
public static void expandAllBomPartKj(Map<String, ExpandPSData[]> expands, TCComponentBOMLine tzBomLine,
TCComponentItemRevision pRev,String groupName,List<String> wbsList,TCSession session,String now
,List<TCComponentMEProcessRevision> needTCM_meops,Map<String, TCComponent> gy_meops,
Element INTERGRATIONLIST,StringBuffer errMessage,String txtPath,Map<String, TCComponentItemRevision> material_revs,List<String> thList) {
TCComponentItemRevision pRev, String groupName, List<String> wbsList, TCSession session, String now,
List<TCComponentMEProcessRevision> needTCM_meops, Map<String, TCComponent> gy_meops,
Element INTERGRATIONLIST, StringBuffer errMessage, String txtPath,
Map<String, TCComponentItemRevision> material_revs, List<String> thList) {
try {
String uid = tzBomLine.getUid();
@ -1680,7 +1774,8 @@ public class BomUtilWh {
}
Element WLCONTENTS = WLLIST.addElement("WLCONTENTS"); // 文件信息
Element TCID = WLCONTENTS.addElement("TCID");
String[] properties = pRev.getProperties(new String[] {"item_id","item_revision_id","zt2_MaterialNo","zt2_Quantity","zt2_State"});
String[] properties = pRev.getProperties(
new String[] { "item_id", "item_revision_id", "zt2_MaterialNo", "zt2_Quantity", "zt2_State" });
TCID.setText(properties[0] + "/" + properties[1]);
@ -1699,7 +1794,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
// <ID>图号</ID>(文件载体item_id)
// <NAME>图纸名称</NAME>(文件载体object_name
@ -1720,7 +1816,8 @@ public class BomUtilWh {
String fileName = ds.getProperty("object_name");
String fileType = "文件";
String fileUid = ds.getUid();
System.out.println("fileId==>"+fileId+"fileName==>"+fileName+"fileType==>"+fileType+"fileUid==>"+fileUid);
System.out.println("fileId==>" + fileId + "fileName==>" + fileName + "fileType==>" + fileType
+ "fileUid==>" + fileUid);
FILECONTENTS.addElement("FILEID").setText(fileId + "/" + fileRevId);
// <ID>图号</ID>(文件载体item_id)
// <NAME>图纸名称</NAME>(文件载体object_name
@ -1742,7 +1839,8 @@ public class BomUtilWh {
BOMCONTENTS.addElement("STLAN").setText("1");
BOMCONTENTS.addElement("STLAL").setText("1"); // <QUANTITY>基本数量</QUANTITY>
BOMCONTENTS.addElement("QUANTITY").setText(properties[3]);
BOMCONTENTS.addElement("QUIT").setText(pRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
BOMCONTENTS.addElement("QUIT")
.setText(pRev.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
Element SONLIST = BOMCONTENTS.addElement("SONLIST");
// 获取工艺信息 BOPLIST BOPCONTENTS ()二级工序下的辅料放到子件
// String maxSeq = "";
@ -1753,7 +1851,8 @@ public class BomUtilWh {
TCComponentBOMLine line2 = exPsData.bomLine;
TCComponentItemRevision designRev = exPsData.itemRevOfBOMLine;
if (designRev.getType().equals("ZT2_XNZJBRevision")) {
//虚拟组件包削层逻辑String now,StringBuffer errMessage,Element SONLIST,TCSession session,String groupName
// 虚拟组件包削层逻辑String now,StringBuffer errMessage,Element SONLIST,TCSession
// session,String groupName
ExpandPSData[] expandPSDatas2 = expands.get(line2.getUid());
xnzjbXcMsg(expandPSDatas2, now, errMessage, SONLIST, session, groupName, expands);
continue;
@ -1775,7 +1874,8 @@ public class BomUtilWh {
String zysapmenge = getZYSAPMENGE(rev2, null, line2, false, "1", errMessage);
SONCONTENTS.addElement("QUE").setText(zysapmenge);
SONCONTENTS.addElement("QUIT").setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("QUIT")
.setText(rev2.getItem().getTCProperty("zt2_unit").getStringValue().toUpperCase());
SONCONTENTS.addElement("SORTF").setText("");
SONCONTENTS.addElement("SEQID").setText(line2.getProperty("bl_sequence_no"));
SONCONTENTS.addElement("POSTP").setText("L");
@ -1799,8 +1899,8 @@ public class BomUtilWh {
if (!KUtil.isEmpty(properties2[2])) {
material_revs.put(properties2[2], rev2);
}
expandAllBomPartKj(expands,line2,rev2,groupName,wbsList,session,now,
needTCM_meops,gy_meops,INTERGRATIONLIST,errMessage,txtPath,material_revs,thList);
expandAllBomPartKj(expands, line2, rev2, groupName, wbsList, session, now, needTCM_meops, gy_meops,
INTERGRATIONLIST, errMessage, txtPath, material_revs, thList);
}

@ -192,6 +192,10 @@ public class BomSendSapController {
comp = new MyProgressBarCompent("", "正在进行项目BOM传递......");
StringBuffer errMessageAll = new StringBuffer("");
StringBuffer sendMessageAll = new StringBuffer("");
//2024 1 22新增逻辑往CHINT_BOM_TO_SAP_SUM
project.getProperty("zt2_WBSNo");
//产成品BOM组织时除了产成品不同其他相同 BOM结构是一样的
for(PartBean bean : selectedParts) {
Document document = DocumentHelper.parseText(getXML());
@ -230,7 +234,9 @@ public class BomSendSapController {
win.close();
}else {
// new BomSendSapOp(session,document.asXML(),txtPath,gy_meops).executeOperation();
sendMessageAll.append(name(txtPath,document.asXML()));
//记录XML信息到CHINT_BOM_TO_SAP_DETIALS
sendMessageAll.append(SendToSap(txtPath,document.asXML()));
win.close();
}
TCComponentDataset dataset = TXTUtil.createDataset(txtPath, txtName, session);
@ -276,7 +282,7 @@ public class BomSendSapController {
return selectedParts;
}
public StringBuffer name(String txtPath,String wsdlString) throws IOException {
public StringBuffer SendToSap(String txtPath,String wsdlString) throws IOException {
// new BomSendSapOp(session,document.asXML(),txtPath,gy_meops).executeOperation();
TXTUtil.writeTXT(txtPath, "----------------BOM传递数据--------------");
TXTUtil.writeTXT(txtPath, wsdlString);

Loading…
Cancel
Save