|
|
@ -6,10 +6,16 @@ package com.weaver.seconddev.interfaces.workflow.action;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
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.common.i18n.tool.util.I18nContextUtil;
|
|
|
|
import com.weaver.verupgrade.conn.CONN_TYPE;
|
|
|
|
import com.weaver.verupgrade.conn.CONN_TYPE;
|
|
|
|
import java.lang.*;
|
|
|
|
import java.lang.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.weaver.verupgrade.conn.RecordSetTrans;
|
|
|
|
import com.weaver.verupgrade.workflow.request.RequestManager;
|
|
|
|
import com.weaver.verupgrade.workflow.request.RequestManager;
|
|
|
|
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
|
|
|
|
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
|
|
|
|
import com.weaver.common.base.entity.result.WeaResult;
|
|
|
|
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));
|
|
|
|
logger_14793b45.info(String.valueOf("ZOA_FICO_ANLA_CHANGEAction--工厂改后" + value));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ZOA_FICO_ANLA_CHANGE change = new ZOA_FICO_ANLA_CHANGE();
|
|
|
|
String[] returnStr = Getexecute(map);
|
|
|
|
String[] returnStr = change.Getexecute(map);
|
|
|
|
|
|
|
|
if (returnStr != null && returnStr.length > 0) {
|
|
|
|
if (returnStr != null && returnStr.length > 0) {
|
|
|
|
String e_istat = String.valueOf(returnStr[0]);
|
|
|
|
String e_istat = String.valueOf(returnStr[0]);
|
|
|
|
String e_message = String.valueOf(returnStr[1]);
|
|
|
|
String e_message = String.valueOf(returnStr[1]);
|
|
|
@ -106,4 +111,60 @@ public class ZOA_FICO_ANLA_CHANGEAction extends BaseBean implements Action, EsbS
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return map;
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String[] Getexecute(Map<String, String> 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;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|