diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_ANLA_CHANGEAction.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_ANLA_CHANGEAction.java index d768f0e..3a89f1c 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_ANLA_CHANGEAction.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_ANLA_CHANGEAction.java @@ -6,10 +6,16 @@ package com.weaver.seconddev.interfaces.workflow.action; import java.util.HashMap; import java.util.Map; + +import com.sap.conn.jco.JCoDestination; +import com.sap.conn.jco.JCoFunction; +import com.sap.conn.jco.JCoStructure; import com.weaver.common.i18n.tool.util.I18nContextUtil; import com.weaver.verupgrade.conn.CONN_TYPE; import java.lang.*; import java.util.*; + +import com.weaver.verupgrade.conn.RecordSetTrans; import com.weaver.verupgrade.workflow.request.RequestManager; import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface; import com.weaver.common.base.entity.result.WeaResult; @@ -58,8 +64,7 @@ public class ZOA_FICO_ANLA_CHANGEAction extends BaseBean implements Action, EsbS logger_14793b45.info(String.valueOf("ZOA_FICO_ANLA_CHANGEAction--工厂改后" + value)); } } - ZOA_FICO_ANLA_CHANGE change = new ZOA_FICO_ANLA_CHANGE(); - String[] returnStr = change.Getexecute(map); + String[] returnStr = Getexecute(map); if (returnStr != null && returnStr.length > 0) { String e_istat = String.valueOf(returnStr[0]); String e_message = String.valueOf(returnStr[1]); @@ -106,4 +111,60 @@ public class ZOA_FICO_ANLA_CHANGEAction extends BaseBean implements Action, EsbS } return map; } + + public String[] Getexecute(Map map) { + String[] retstr = new String[3]; + JCoDestination destination = SAPConn.getJCoDestination();; + try { + logger_14793b45.info("map--" + map); + RecordSetTrans recordsettrans = I18nContextUtil.getBean(RecordSetTrans.class); + recordsettrans.setAutoCommit(false); + JCoFunction jcofunction = destination.getRepository().getFunction("ZOA_FICO_ANLA_CHANGE"); + if (jcofunction == null) { + System.out.println("ZOA_FICO_ANLA_CHANGE not found in SAP."); + retstr[2] = "ZOA_FICO_ANLA_CHANGE not found in SAP."; + } else { + JCoStructure stru = jcofunction.getImportParameterList().getStructure("I_INPUT"); + // 资产描述 + stru.setValue("TXT50", map.get("ZCMSGH")); + // 附加资产描述 + stru.setValue("TXA50", map.get("FJZCMSGH")); + // 主资产号 + stru.setValue("ANLN1", map.get("ZCBHXZ")); + // 资产主号说明 + stru.setValue("ANLHTXT", map.get("ZCBHSMGH")); + // 序列号 + stru.setValue("SERNR", map.get("XLHGH")); + // 存货号 + stru.setValue("INVNR", map.get("CHHGH")); + // 成本中心 + stru.setValue("KOSTL", map.get("SYCBZXGH")); + // 成本中心对资产负责 + stru.setValue("KOSTLV", map.get("GLCBZXGH")); + // 内部订单 + stru.setValue("CAUFN", map.get("NBDDGH")); + // 工厂 + stru.setValue("WERKS", map.get("GS")); + logger_14793b45.info(String.valueOf("ZOA_FICO_ANLA_CHANGE--工厂改后:" + map.get("GS"))); + // 房间 + stru.setValue("RAUMN", map.get("ZRRGH")); + // 公司代码 + stru.setValue("BUKR", map.get("GS")); + jcofunction.getImportParameterList().setValue("I_INPUT", stru); + try { + jcofunction.execute(destination); + logger_14793b45.info("ZOA_FICO_ANLA_CHANGE--返回值:" + jcofunction.getExportParameterList().getValue("E_ISTAT").toString()); + logger_14793b45.info("ZOA_FICO_ANLA_CHANGE--返回值:" + jcofunction.getExportParameterList().getValue("E_MESSAGE").toString()); + retstr[0] = jcofunction.getExportParameterList().getValue("E_ISTAT").toString(); + retstr[1] = jcofunction.getExportParameterList().getValue("E_MESSAGE").toString(); + } catch (Exception exception1) { + retstr[2] = exception1.toString(); + } + } + return retstr; + } catch (Exception exception) { + retstr[2] = exception.getMessage(); + } + return retstr; + } } diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CREATIONAction.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CREATIONAction.java index b2b1d95..0e2cd32 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CREATIONAction.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CREATIONAction.java @@ -151,8 +151,8 @@ public class ZOA_FICO_COC_CREATIONAction extends BaseBean implements Action, Esb // 内部订单 stru.setValue("CAUFN", map.get("NBDDGH")); // 工厂 - stru.setValue("WERKS", map.get("GCGH")); - logger_8236b79b.info(String.valueOf("ZOA_FICO_ANLA_CHANGE--工厂改后:" + map.get("GCGH"))); + stru.setValue("WERKS", map.get("GS")); + logger_8236b79b.info(String.valueOf("ZOA_FICO_ANLA_CHANGE--工厂改后:" + map.get("GS"))); // 房间 stru.setValue("RAUMN", map.get("ZRRGH")); // 公司代码 @@ -160,6 +160,8 @@ public class ZOA_FICO_COC_CREATIONAction extends BaseBean implements Action, Esb jcofunction.getImportParameterList().setValue("I_INPUT", stru); try { jcofunction.execute(destination); + logger_8236b79b.info("ZOA_FICO_ANLA_CHANGE--返回值:" + jcofunction.getExportParameterList().getValue("E_ISTAT").toString()); + logger_8236b79b.info("ZOA_FICO_ANLA_CHANGE--返回值:" + jcofunction.getExportParameterList().getValue("E_MESSAGE").toString()); retstr[0] = jcofunction.getExportParameterList().getValue("E_ISTAT").toString(); retstr[1] = jcofunction.getExportParameterList().getValue("E_MESSAGE").toString(); } catch (Exception exception1) {