diff --git a/lxapp/app/products/mes/md/cs/SAP_Supimport.jsp b/lxapp/app/products/mes/md/cs/SAP_Supimport.jsp index 6a79dc7..f4596ac 100644 --- a/lxapp/app/products/mes/md/cs/SAP_Supimport.jsp +++ b/lxapp/app/products/mes/md/cs/SAP_Supimport.jsp @@ -52,7 +52,7 @@ var jres = $.str2json(result); if (jres.code == "1") { //操作成功 alert(jres.desc); - $.notify("rc_po_edit");//触发用户添加成功消息 + $.notify("supmaint_query");//触发供应商添加成功消息 _close(); }else{ alert(jres.desc); diff --git a/lxapp/app/products/mes/st/rc/SAP_Workimport.jsp b/lxapp/app/products/mes/st/rc/SAP_Workimport.jsp index 73efcc5..6dbcd70 100644 --- a/lxapp/app/products/mes/st/rc/SAP_Workimport.jsp +++ b/lxapp/app/products/mes/st/rc/SAP_Workimport.jsp @@ -52,7 +52,7 @@ var jres = $.str2json(result); if (jres.code == "1") { //操作成功 alert(jres.desc); - $.notify("rc_po_edit");//触发用户添加成功消息 + $.notify("bs_workgroup_edit");//触发用户添加成功消息 _close(); }else{ alert(jres.desc); diff --git a/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapJCoInterface.java b/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapJCoInterface.java index 8c0c7c8..3fa2945 100644 --- a/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapJCoInterface.java +++ b/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapJCoInterface.java @@ -2,6 +2,9 @@ package com.noblelift.imp.products.mes.service.ifs.sap; import java.io.File; import java.io.IOException; + +import org.wdk.core.bean.WDKLogger; + import com.sap.conn.jco.JCoDestination; import com.sap.conn.jco.JCoDestinationManager; import com.sap.conn.jco.JCoException; @@ -18,7 +21,7 @@ public class SapJCoInterface public static JCoDestination myConnection; private static JCoRepository repository; - + private static WDKLogger logger = new WDKLogger("SapJCoInterface"); public static JCoRepository getRepository() throws JCoException { @@ -43,8 +46,9 @@ public class SapJCoInterface } myConnection = JCoDestinationManager.getDestination(configFileName); - + logger.debug("SapJCoInterface myConnection成功:"+myConnection.toString()); repository = myConnection.getRepository(); + logger.debug("SapJCoInterface repository成功:"+repository.toString()); } } } diff --git a/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapToWmsServiceImpl.java b/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapToWmsServiceImpl.java index f10c025..cba25b0 100644 --- a/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapToWmsServiceImpl.java +++ b/lxservice/com/noblelift/imp/products/mes/service/ifs/sap/SapToWmsServiceImpl.java @@ -40,7 +40,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_PO_INFO"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_PO_INFO"); JCoParameterList input = function.getImportParameterList(); // 是否有物料号的po @@ -210,7 +210,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_WO_INFO"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_WO_INFO"); JCoParameterList input = function.getImportParameterList(); // 生產訂單號碼 input.setValue("P_AUFNR", p_aufnr); @@ -295,7 +295,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_MATERIAL_ISSUELIST"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_MATERIAL_ISSUELIST"); JCoParameterList input = function.getImportParameterList(); input.setValue("P_BUKRS", form.getString("p_bukrs")); @@ -425,7 +425,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_MATERIAL_SHORTLIST"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_MATERIAL_SHORTLIST"); function.execute(SapJCoInterface.myConnection); } catch (JCoException e) { @@ -505,7 +505,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { logger.debug("getMaterialStock-------if之后try之前"); JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_MATERIAL_STOCK"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_MATERIAL_STOCK"); JCoParameterList input = function.getImportParameterList(); JCoTable ZS_MATNR = input.getTable("ZS_MATNR"); @@ -686,7 +686,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_MATERIAL"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_MATERIAL"); JCoParameterList input = function.getImportParameterList(); if (!(matnr_begin.isEmpty() || matnr_end.isEmpty())) { @@ -891,7 +891,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_MATERIAL_INFO"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_MATERIAL_INFO"); JCoParameterList input = function.getImportParameterList(); input.setValue("P_MATNR", p_matnr); @@ -956,7 +956,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_VENDOR_INFO"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_VENDOR_INFO"); JCoParameterList input = function.getImportParameterList(); // ----from to JCoTable ZS_ERDAT = input.getTable("ZS_ERDAT"); @@ -1059,7 +1059,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { JCoFunction function = null; JCoParameterList tablelist = null; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_MATERIAL_STOCK_MOVE"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_MATERIAL_STOCK_MOVE"); }catch(Exception e) { for (int i = 0; i < allrows.size(); i++) { @@ -1186,7 +1186,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { JCoFunction function = null; JCoParameterList tablelist = null; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_MATERIAL_STOCK_UPDATE"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_MATERIAL_STOCK_UPDATE"); tablelist = function.getTableParameterList(); }catch(Exception e) { e.printStackTrace(); @@ -1405,7 +1405,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { logger.debug("WOPost------------回传开关已开!"); } try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_WO_POST"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_WO_POST"); tablelist = function.getTableParameterList(); }catch(Exception e) { for (int i = 0; i < allrows.size(); i++) { @@ -1780,7 +1780,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_WO_COMPONENT"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_WO_COMPONENT"); JCoParameterList input = function.getImportParameterList(); // 生產訂單號碼 input.setValue("IN_AUFNR", aufnr); @@ -1897,7 +1897,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { } JCoFunction function = null; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_WO_SEND"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_WO_SEND"); }catch(Exception e) { JSONObject joi = new JSONObject(); @@ -2011,8 +2011,10 @@ public class SapToWmsServiceImpl implements SapToWmsService { if (flag.equals("1")) { JCoFunction function; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_GET_WORKCENTER"); - + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_GET_WORKCENTER"); + + logger.debug("JCO function [ZFSWMS_GET_WORKCENTER]:"+function.toString() ); + JCoParameterList input = function.getImportParameterList(); JCoTable IN_ERDAT = input.getTable("IN_ERDAT"); IN_ERDAT.appendRow(); @@ -2051,7 +2053,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { // SAP组盘表 String IF_SAP_WorkGroup = "IF_SAP_WorkGroup"; - WQLObject wo_IssueBillUrgent = WQLObject.getWQLObject(IF_SAP_WorkGroup); + WQLObject wo_SAP_WorkGroup = WQLObject.getWQLObject(IF_SAP_WorkGroup); WQLObject ST_BS_WorkGroup = WQLObject.getWQLObject("ST_BS_WorkGroup"); for (int i = 0; i < tblexport.getNumRows(); i++) { tblexport.setRow(i); @@ -2061,11 +2063,11 @@ public class SapToWmsServiceImpl implements SapToWmsService { joi.put("id", id); String ARBPL = tblexport.getString("ARBPL"); String KTEXT = tblexport.getString("KTEXT"); - JSONObject group = wo_IssueBillUrgent.query("ARBPL = '" + ARBPL + "'").uniqueResult(0); + JSONObject group = wo_SAP_WorkGroup.query("ARBPL = '" + ARBPL + "'").uniqueResult(0); if (group == null) { joi.put("ARBPL", ARBPL); joi.put("KTEXT", KTEXT); - wo_IssueBillUrgent.insert(joi); + wo_SAP_WorkGroup.insert(joi); row.put("group_uuid", id); row.put("group_name", ARBPL); @@ -2079,13 +2081,14 @@ public class SapToWmsServiceImpl implements SapToWmsService { row.put("SYSUPDATEDATE", WDK.getDateTime()); ST_BS_WorkGroup.insert(row); } else { - group.put("KTEXT", tblexport.getString("KTEXT")); - wo_IssueBillUrgent.update(joi); + group.put("ktext", tblexport.getString("KTEXT")); + wo_SAP_WorkGroup.update(joi); row = ST_BS_WorkGroup.query("group_uuid = '" + group.optString("id") + "'").uniqueResult(0); - row.put("simple_name", KTEXT); - row.put("SYSUPDATORUUID", "0000"); - row.put("SYSUPDATEDATE", WDK.getDateTime()); - ST_BS_WorkGroup.update(row); + HashMap map = new HashMap<>(); + map.put("simple_name", KTEXT); + map.put("sysupdatoruuid", "0000"); + map.put("sysupdatedate", WDK.getDateTime()); + ST_BS_WorkGroup.update(map, "group_uuid=?", new String[] {row.optString("id")}); } } } @@ -2104,7 +2107,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { JCoFunction function = null; JCoParameterList tablelist = null; try { - function = SapJCoInterface.getRepository().getFunction("ZWMS_PO_POST"); + function = SapJCoInterface.getRepository().getFunction("ZFSWMS_PO_POST"); }catch(Exception e) { for (int i = 0; i < allrows.size(); i++) {