80 files update

webservice
calyrex 5 months ago
parent 6938998bbb
commit dfb9427eea

@ -0,0 +1,96 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-13
* @Description: ZOA_FICO_ANLA_CHECK
*/
@org.springframework.stereotype.Service("workflow_action_ZOA_FICO_ANLA_CHECK_ACTION")
@Slf4j
public class ZOA_FICO_ANLA_CHECK_ACTION implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
log.info("ZOA_FICO_ANLA_CHECK_ACTION execute start");
log.info("ZOA_FICO_ANLA_CHECK_ACTION execute params : " + requestInfoMap);
try {
String gdzcdm = null2String(requestInfoMap.get("gdzcdm")); //固定资产代码
String gsdm = null2String(requestInfoMap.get("gsdm")); //公司
String estatus = "E";
String emessage = "";
ZOA_FICO_ANLA_CHECK po=new ZOA_FICO_ANLA_CHECK();
Map<String,String> map = po.Getexecute(gdzcdm , gsdm);
if(map != null && map.size() > 0) {
estatus = map.get("estatus");
emessage = map.get("emessage");
Map<String, Object> result = new HashMap<>();
result.put("estatus", estatus);
result.put("emessage", emessage);
result.put("TXT50", "<![CDATA["+map.get("TXT50")+"]]>");
result.put("TXA50", "<![CDATA["+map.get("TXA50")+"]]>");
result.put("ANLN1", "<![CDATA["+map.get("ANLN1")+"]]>");
result.put("ANLHTXT", "<![CDATA["+map.get("ANLHTXT")+"]]>");
result.put("SERNR", "<![CDATA["+map.get("SERNR")+"]]>");
result.put("INVNR", "<![CDATA["+map.get("INVNR")+"]]>");
result.put("KOSTL", "<![CDATA["+map.get("KOSTL")+"]]>");
result.put("KOSTLV", "<![CDATA["+map.get("KOSTLV")+"]]>");
result.put("CAUFN", "<![CDATA["+map.get("CAUFN")+"]]>");
result.put("WERKS", "<![CDATA["+map.get("WERKS")+"]]>");
result.put("RAUMN", "<![CDATA["+map.get("RAUMN")+"]]>");
result.put("BUKRS", "<![CDATA["+map.get("BUKRS")+"]]>");
result.put("KTOGR", "<![CDATA["+map.get("KTOGR")+"]]>");
result.put("MENGE", "<![CDATA["+map.get("MENGE")+"]]>");
result.put("MEINS", "<![CDATA["+map.get("MEINS")+"]]>");
result.put("AKTIV", "<![CDATA["+map.get("AKTIV")+"]]>");
result.put("ZUGDT", "<![CDATA["+map.get("ZUGDT")+"]]>");
result.put("ZUJHR", "<![CDATA["+map.get("ZUJHR")+"]]>");
result.put("ZUPER", "<![CDATA["+map.get("ZUPER")+"]]>");
result.put("DEAKT", "<![CDATA["+map.get("DEAKT")+"]]>");
result.put("ORD41", "<![CDATA["+map.get("ORD41")+"]]>");
result.put("ORD42", "<![CDATA["+map.get("ORD42")+"]]>");
result.put("NDJAR", "<![CDATA["+map.get("NDJAR")+"]]>");
result.put("NDPER", "<![CDATA["+map.get("NDPER")+"]]>");
result.put("AFABG", "<![CDATA["+map.get("AFABG")+"]]>");
result.put("NDABJ", "<![CDATA["+map.get("NDABJ")+"]]>");
result.put("NDABP", "<![CDATA["+map.get("NDABP")+"]]>");
result.put("ANLKL", "<![CDATA["+map.get("ANLKL")+"]]>");
result.put("ANLN2", "<![CDATA["+map.get("ANLN2")+"]]>");
return WeaResult.success(result);
}else {
estatus = map.get("estatus");
emessage = map.get("emessage");
Map<String, Object> result = new HashMap<>();
result.put("estatus", estatus);
result.put("emessage", emessage);
return WeaResult.success(result);
}
}catch (Exception e){
log.error("ZOA_FICO_ANLA_CHECK_ACTION execute error : " , e);
return WeaResult.fail(500, "执行异常", e);
}
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

@ -0,0 +1,87 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-13
* @Description: ZOA_FICO_COC_CHECK
*/
@org.springframework.stereotype.Service("workflow_action_ZOA_FICO_COC_CHECK_ACTION ")
@Slf4j
public class ZOA_FICO_COC_CHECK_ACTION implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
log.info("ZOA_FICO_COC_CHECK_ACTION execute start");
log.info("ZOA_FICO_COC_CHECK_ACTION execute params : " + requestInfoMap);
try {
String cbzxdm = null2String(requestInfoMap.get("cbzxdm")); //成本中心代码
String estatus = "E";
String emessage = "";
ZOA_FICO_COC_CHECK po=new ZOA_FICO_COC_CHECK();
Map<String,String> map = po.Getexecute(cbzxdm);
if(map != null && map.size() > 0) {
estatus = map.get("estatus");
emessage = map.get("emessage");
Map<String,Object> result = new HashMap<>();
result.put("estatus",estatus);
result.put("emessage",emessage);
result.put("DATAB",null2String(map.get("DATAB")));
result.put("KTEXT",null2String(map.get("KTEXT")));
result.put("LTEXT",null2String(map.get("LTEXT")));
result.put("VERAK",null2String(map.get("VERAK")));
result.put("KOSAR",null2String(map.get("KOSAR")));
result.put("KHINR",null2String(map.get("KHINR")));
result.put("BUKRS",null2String(map.get("BUKRS")));
result.put("FKBER",null2String(map.get("FKBER")));
result.put("WAERS",null2String(map.get("WAERS")));
result.put("PRCTR",null2String(map.get("PRCTR")));
result.put("ZZWERKS",null2String(map.get("ZZWERKS")));
result.put("KOKRS",null2String(map.get("KOKRS")));
result.put("KOSTL",null2String(map.get("KOSTL")));
result.put("CCNAME",null2String(map.get("CCNAME")));
result.put("CBNAME",null2String(map.get("CBNAME")));
result.put("LRNAME",null2String(map.get("LRNAME")));
result.put("GCNAME",null2String(map.get("GCNAME")));
result.put("HBNAME",null2String(map.get("HBNAME")));
result.put("GSNAME",null2String(map.get("GSNAME")));
return WeaResult.success(result);
}else {
estatus = map.get("estatus");
emessage = map.get("emessage");
Map<String,Object> result = new HashMap<>();
result.put("estatus",estatus);
result.put("emessage",emessage);
return WeaResult.success(result);
}
}catch (Exception e){
log.error("ZOA_FICO_COC_CHECK_ACTION execute error : " , e);
return WeaResult.fail(500, "执行异常", e);
}
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

@ -0,0 +1,165 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.HashMap;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-13
* @Description:ZOA_FI_CUSTOMER_MAINTAIN
*/
@org.springframework.stereotype.Service("workflow_action_ZOA_FI_CUSTOMER_MAINTAIN_ACTION")
@Slf4j
public class ZOA_FI_CUSTOMER_MAINTAIN_ACTION implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
log.info("ZOA_FI_CUSTOMER_MAINTAIN_ACTION execute start");
log.info("ZOA_FI_CUSTOMER_MAINTAIN_ACTION execute params : " + requestInfoMap);
try {
String edit_flag = null2String(requestInfoMap.get("edit_flag")); //动作类型
String bukrs = null2String(requestInfoMap.get("bukrs")); //公司代码
String kunnr = null2String(requestInfoMap.get("kunnr")); //客户编号
String ktokd = null2String(requestInfoMap.get("ktokd")); //科目组
String anred = null2String(requestInfoMap.get("anred")); //称谓
String name1 = null2String(requestInfoMap.get("name1")); //名称
String sortl = null2String(requestInfoMap.get("sortl")); //简称-搜索项
String telf1 = null2String(requestInfoMap.get("telf1")); //电话
String smtp_addr = null2String(requestInfoMap.get("smtp_addr")); //邮件
String telf2 = null2String(requestInfoMap.get("telf2")); //手机
String telfx = null2String(requestInfoMap.get("telfx")); //传真
String land1 = null2String(requestInfoMap.get("land1")); //国家
String regio = null2String(requestInfoMap.get("regio")); //地区
String spras = null2String(requestInfoMap.get("spras")); //语言
String ort01 = null2String(requestInfoMap.get("ort01")); //城市
String stras = null2String(requestInfoMap.get("stras")); //地址
String pstlz = null2String(requestInfoMap.get("pstlz"));//邮政编号
String bankl = null2String(requestInfoMap.get("bankl")); //开户行行号
String banka = null2String(requestInfoMap.get("banka"));//开户行名称
String banks = null2String(requestInfoMap.get("banks"));//开户行国家
String koinh = null2String(requestInfoMap.get("koinh")); //开户行账号
String stcd5 = null2String(requestInfoMap.get("stcd5"));//纳税登记证代码
String akont = null2String(requestInfoMap.get("akont")); //统驭科目
String zterm = null2String(requestInfoMap.get("zterm"));//付款条件
String zuawa = null2String(requestInfoMap.get("zuawa")); //排序码
String zwels = null2String(requestInfoMap.get("zwels"));//付款方式
String frgrp = null2String(requestInfoMap.get("frgrp"));//批准组
String zahls = null2String(requestInfoMap.get("zahls")); //付款冻结
String estatus = "E";
String emessage = "";
String[] prdetail = new String[38];
prdetail[0] = edit_flag; //动作类型
prdetail[1] = bukrs; //公司代码
prdetail[2] = kunnr; //客户编号
prdetail[3] = ktokd; //科目组
prdetail[4] = anred; //称谓
prdetail[5] = name1; //名称
prdetail[6] = sortl; //简称-搜索项
prdetail[7] = telf1; //电话
prdetail[8] = smtp_addr; //邮件
prdetail[9] = telf2; //手机
prdetail[10] = telfx; //传真
prdetail[11] = land1; //国家
prdetail[12] = regio; //地区
prdetail[13] = spras; //语言
prdetail[14] = ort01; //城市
prdetail[15] = stras; //地址
prdetail[16] = pstlz;//邮政编号
prdetail[17] = bankl; //开户行行号
prdetail[18] = banka;//开户行名称
prdetail[19] = banks;//开户行国家
prdetail[20] = koinh; //开户行账号
prdetail[21] = stcd5;//纳税登记证代码
prdetail[22] = akont;//统驭科目
prdetail[23] = zterm;//付款条件
prdetail[24] = zuawa; //排序码
prdetail[25] = zwels;//付款方式
prdetail[26] = frgrp;//批准组
//付款冻结
if(zahls.equals("X")){
prdetail[27] = zahls;
}else{
prdetail[27] = "";
}
ZOA_FI_CUSTOMER_MAINTAIN po=new ZOA_FI_CUSTOMER_MAINTAIN();
String[][] fhz = po.Getexecute(prdetail);
if(fhz[0][0].equals("S")){
estatus = fhz[0][0];
}
emessage = fhz[0][1];
Map<String,Object> result = new HashMap<>();
result.put("estatus",estatus);
result.put("emessage",emessage);
result.put("kunnr",fhz[1][0]);
result.put("bukrs",fhz[1][1]);
result.put("ktokd",fhz[1][2]);
result.put("txt30",fhz[1][3]);
result.put("anred",fhz[1][4]);
result.put("name1",fhz[1][5]);
result.put("sortl",fhz[1][6]);
result.put("telf1",fhz[1][7]);
result.put("smtp_addr",fhz[1][8]);
result.put("telf2",fhz[1][9]);
result.put("telfx",fhz[1][10]);
result.put("land1",fhz[1][11]);
result.put("landx50",fhz[1][12]);
result.put("bland",fhz[1][13]);
result.put("bezei",fhz[1][14]);
result.put("spras",fhz[1][15]);
result.put("sptxt",fhz[1][16]);
result.put("ort01",fhz[1][17]);
result.put("stras",fhz[1][18]);
result.put("pstlz",fhz[1][19]);
result.put("bankl",fhz[1][20]);
result.put("banka",fhz[1][21]);
result.put("banks",fhz[1][22]);
result.put("landx",fhz[1][23]);
result.put("koinh",fhz[1][24]);
result.put("stcd5",fhz[1][25]);
result.put("akont",fhz[1][26]);
result.put("txt20",fhz[1][27]);
result.put("zterm",fhz[1][28]);
result.put("text1",fhz[1][29]);
result.put("zuawa",fhz[1][30]);
result.put("ttext",fhz[1][31]);
result.put("zwels",fhz[1][32]);
result.put("text2",fhz[1][33]);
result.put("frgrp",fhz[1][34]);
result.put("frgrt",fhz[1][35]);
result.put("zahls",fhz[1][36]);
return WeaResult.success(result);
}catch (Exception e){
log.error("ZOA_FI_CUSTOMER_MAINTAIN_ACTION execute error : " ,e);
return WeaResult.fail(500, "执行异常", e);
}
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

@ -1,9 +1,12 @@
package com.weaver.seconddev.interfaces.workflow.action; package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult; import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.interfaces.scfoa.GetApproveResult; import com.weaver.seconddev.interfaces.scfoa.GetApproveResult;
import com.weaver.verupgrade.conn.CONN_TYPE; import com.weaver.verupgrade.conn.CONN_TYPE;
import com.weaver.verupgrade.conn.RecordSet; import com.weaver.verupgrade.conn.RecordSet;
import com.weaver.verupgrade.general.BaseBean;
import com.weaver.verupgrade.interfaces.workflow.action.Action;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo; import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -16,23 +19,25 @@ import java.util.Map;
/** /**
* @Author: calyrex * @Author: calyrex
* @CreateTime: 2025-01-10 * @CreateTime: 2025-01-10
* @Description: * @Description:ZOA_FI_VENDOR_MAINTAIN
*/ */
@org.springframework.stereotype.Service("workflow_action_ZOA_FI_VENDOR_MAINTAIN_ACTION") @org.springframework.stereotype.Service("workflow_action_ZOA_FI_VENDOR_MAINTAIN_ACTION")
public class ZOA_FI_VENDOR_MAINTAIN_ACTION { public class ZOA_FI_VENDOR_MAINTAIN_ACTION implements EsbServerlessRpcRemoteInterface {
// 对应E9的请求信息对象 // 对应E9的请求信息对象
@Autowired
private RequestInfo requestInfoTemp;
@Autowired @Autowired
private GetApproveResult mGetResult; private RequestInfo requestInfoTemp;
private static final Logger logger_d39bef7 = LoggerFactory.getLogger(ZOA_FI_VENDOR_MAINTAIN_ACTION.class); private static final Logger logger_d39bef7 = LoggerFactory.getLogger(ZOA_FI_VENDOR_MAINTAIN_ACTION.class);
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) { public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
logger_d39bef7.info("ZOA_FI_VENDOR_MAINTAIN_ACTION start"); logger_d39bef7.info("ZOA_FI_VENDOR_MAINTAIN_ACTION start");
logger_d39bef7.info("requestInfoMap:{}", requestInfoMap); logger_d39bef7.info("requestInfoMap:{}", requestInfoMap);
// Long requestIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("requestid", -1)));
// Long userIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("userid", -1)));
// RequestInfo requestinfo = requestInfoTemp.getRequestInfo(requestIdTemp, userIdTemp);
try { try {
String edit_flag = null2String(requestInfoMap.get("edit_flag")); String edit_flag = null2String(requestInfoMap.get("edit_flag"));
String bukrs = null2String(requestInfoMap.get("bukrs"));//公司代码 String bukrs = null2String(requestInfoMap.get("bukrs"));//公司代码

@ -0,0 +1,146 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoParameterList;
import com.sap.conn.jco.JCoRepository;
import com.sap.conn.jco.JCoTable;
import java.io.PrintStream;
import com.weaver.common.i18n.tool.util.I18nContextUtil;
import java.util.*;
import com.weaver.verupgrade.workflow.request.RequestManager;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.common.base.entity.result.WeaResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import java.util.Map;
import java.util.HashMap;
import com.weaver.verupgrade.conn.RecordSetTrans;
import com.weaver.verupgrade.interfaces.workflow.action.Action;
@org.springframework.stereotype.Service("workflow_action_ZOA_MM_MA_DUPLICATE")
public class ZOA_MM_MA_DUPLICATE implements Action, EsbServerlessRpcRemoteInterface {
// 对应E9的请求信息对象
@Autowired
private RequestInfo requestInfoTemp;
public static final org.slf4j.Logger logger_5b21e2d = LoggerFactory.getLogger(ZOA_MM_MA_DUPLICATE.class);
private JCoDestination destination;
private int cursorindex;
private int dataconts;
private JCoTable datas;
private String[][] retstr;
public ZOA_MM_MA_DUPLICATE() {
new SAPConn();
this.destination = SAPConn.getJCoDestination();
this.cursorindex = -1;
this.dataconts = 0;
this.datas = null;
this.retstr = null;
}
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
Map<String, Object> weaverResultMap = new HashMap<>();
Long requestIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("requestid", -1)));
Long userIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("userid", -1)));
RequestInfo paramRequestInfo = requestInfoTemp.getRequestInfo(requestIdTemp, userIdTemp);
try {
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", "1", paramRequestInfo.getRequestManager()));
} catch (Exception e) {
e.printStackTrace();
logger_5b21e2d.error("ZOA_MM_MA_DUPLICATE e: {}", e.getMessage());
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), requestInfoTemp.getRequestManager())), paramRequestInfo.getRequestManager()));
}
}
public String[][] Getexecute(String[][] paramString) {
this.retstr = paramString;
try {
RecordSetTrans localRecordSetTrans = I18nContextUtil.getBean(RecordSetTrans.class);
localRecordSetTrans.setAutoCommit(false);
JCoFunction localJCoFunction = this.destination.getRepository().getFunction("ZOA_MM_MA_DUPLICATE");
if (localJCoFunction == null) {
System.out.println("ZOA_MM_MA_DUPLICATE not found in SAP.");
this.retstr[0][1] = "ZOA_MM_MA_DUPLICATE not found in SAP.";
} else {
JCoTable localJCoTable = localJCoFunction.getTableParameterList().getTable("T_INOUT");
for (int i = 1; i < paramString.length; i++) {
if (paramString[i][0].equals("aaaa")) {
continue;
} else {
localJCoTable.appendRow();
localJCoTable.setValue("INDEX", paramString[i][0]);
localJCoTable.setValue("MATKL", paramString[i][1]);
localJCoTable.setValue("WGBEZ", paramString[i][2]);
localJCoTable.setValue("MATNR", paramString[i][3]);
localJCoTable.setValue("MAKTX", paramString[i][4]);
localJCoTable.setValue("T01", paramString[i][5]);
localJCoTable.setValue("T02", paramString[i][6]);
localJCoTable.setValue("T03", paramString[i][7]);
localJCoTable.setValue("T04", paramString[i][8]);
localJCoTable.setValue("T05", paramString[i][9]);
localJCoTable.setValue("T06", paramString[i][10]);
localJCoTable.setValue("T07", paramString[i][11]);
localJCoTable.setValue("T08", paramString[i][12]);
localJCoTable.setValue("T09", paramString[i][13]);
localJCoTable.setValue("T10", paramString[i][14]);
localJCoTable.setValue("T11", paramString[i][15]);
localJCoTable.setValue("T12", paramString[i][16]);
localJCoTable.setValue("T13", paramString[i][17]);
localJCoTable.setValue("T14", paramString[i][18]);
localJCoTable.setValue("T15", paramString[i][19]);
}
}
try {
localJCoFunction.execute(this.destination);
this.retstr[0][0] = localJCoFunction.getExportParameterList().getValue("E_STATUS").toString();
this.retstr[0][1] = localJCoFunction.getExportParameterList().getValue("E_MESSAGE").toString();
JCoTable localJCoTable1 = localJCoFunction.getTableParameterList().getTable("T_INOUT");
int z = -1;
for (int j = 1; j < retstr.length; j++) {
if (retstr[j][0].equals("aaaa")) {
continue;
} else {
z = z + 1;
localJCoTable1.setRow(z);
this.retstr[j][3] = localJCoTable1.getString("MATNR").trim();
this.retstr[j][4] = localJCoTable1.getString("MAKTX").trim();
this.retstr[j][20] = localJCoTable1.getString("STATUS").trim();
this.retstr[j][21] = localJCoTable1.getString("MESSAGE").trim();
}
}
} catch (Exception localException2) {
this.retstr[0][1] = localException2.toString();
}
}
return this.retstr;
} catch (Exception localException1) {
this.retstr[0][1] = localException1.getMessage();
return this.retstr;
}
}
Map<String, Object> getResultMapForAction(Map<String, Object> map, String key, Object value, RequestManager requestManager) {
if (key != null && !key.isEmpty()) {
map.put(key, value);
}
String msgContent = requestManager.getMessagecontent();
if (msgContent != null && !msgContent.isEmpty()) {
map.put("msgContent", msgContent);
}
String msgId = requestManager.getMessageid();
if (msgId != null && !msgId.isEmpty()) {
map.put("msgId", msgId);
}
return map;
}
}

@ -0,0 +1,204 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import com.weaver.seconddev.interfaces.workflow.action.*;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-13
* @Description: ZOA_MM_MA_DUPLICATE
*/
@org.springframework.stereotype.Service("workflow_action_ZOA_MM_MA_DUPLICATE_ACTION")
@Slf4j
public class ZOA_MM_MA_DUPLICATE_ACTION implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
log.info("ZOA_MM_MA_DUPLICATE_ACTION execute start");
log.info("ZOA_MM_MA_DUPLICATE_ACTION execute params : " + params);
try {
String index = null2String(params.get("index"));
String wlzbh = null2String(params.get("wlzbh"));
String wlzms = null2String(params.get("wlzms"));
String wlbm = null2String(params.get("wlbm"));
String wlms = null2String(params.get("wlms"));
String t1 = null2String(params.get("t1"));
String t2 = null2String(params.get("t2"));
String t3 = null2String(params.get("t3"));
String t4 = null2String(params.get("t4"));
String t5 = null2String(params.get("t5"));
String t6 = null2String(params.get("t6"));
String t7 = null2String(params.get("t7"));
String t8 = null2String(params.get("t8"));
String t9 = null2String(params.get("t9"));
String t10 = null2String(params.get("t10"));
String t11 = null2String(params.get("t11"));
String t12 = null2String(params.get("t12"));
String t13 = null2String(params.get("t13"));
String t14 = null2String(params.get("t14"));
String t15 = null2String(params.get("t15"));
String estatus = "";
String emessage = "";
String[][] prdetail = null;
String aa = "@~&#";
int i = wlzbh.split(aa).length;
prdetail = new String[i+1][22];
int x =0;
for(int y=0;y<i;y++){
x = x + 1;
if(y < index.split(aa).length){
prdetail[x][0] = index.split(aa)[y];
}else{
prdetail[x][0] = "";
}
if(y < wlzbh.split(aa).length){
prdetail[x][1] = wlzbh.split(aa)[y];
}else{
prdetail[x][1] = "";
}
if(y < wlzms.split(aa).length){
prdetail[x][2] = wlzms.split(aa)[y];
}else{
prdetail[x][2] = "";
}
if(y < wlbm.split(aa).length){
prdetail[x][3] = wlbm.split(aa)[y];
}else{
prdetail[x][3] = "";
}
if(y < wlms.split(aa).length){
prdetail[x][4] = wlms.split(aa)[y];
}else{
prdetail[x][4] = "";
}
if(y < t1.split(aa).length){
prdetail[x][5] = t1.split(aa)[y];
}else{
prdetail[x][5] = "";
}
if(y < t2.split(aa).length){
prdetail[x][6] = t2.split(aa)[y];
}else{
prdetail[x][6] = "";
}
if(y < t3.split(aa).length){
prdetail[x][7] = t3.split(aa)[y];
}else{
prdetail[x][7] = "";
}
if(y < t4.split(aa).length){
prdetail[x][8] = t4.split(aa)[y];
}else{
prdetail[x][8] = "";
}
if(y < t5.split(aa).length){
prdetail[x][9] = t5.split(aa)[y];
}else{
prdetail[x][9] = "";
}
if(y < t6.split(aa).length){
prdetail[x][10] = t6.split(aa)[y];
}else{
prdetail[x][10] = "";
}
if(y < t7.split(aa).length){
prdetail[x][11] = t7.split(aa)[y];
}else{
prdetail[x][11] = "";
}
if(y < t8.split(aa).length){
prdetail[x][12] = t8.split(aa)[y];
}else{
prdetail[x][12] = "";
}
if(y < t9.split(aa).length){
prdetail[x][13] = t9.split(aa)[y];
}else{
prdetail[x][13] = "";
}
if(y < t10.split(aa).length){
prdetail[x][14] = t10.split(aa)[y];
}else{
prdetail[x][14] = "";
}
if(y < t11.split(aa).length){
prdetail[x][15] = t11.split(aa)[y];
}else{
prdetail[x][15] = "";
}
if(y < t12.split(aa).length){
prdetail[x][16] = t12.split(aa)[y];
}else{
prdetail[x][16] = "";
}
if(y < t13.split(aa).length){
prdetail[x][17] = t13.split(aa)[y];
}else{
prdetail[x][17] = "";
}
if(y < t14.split(aa).length){
prdetail[x][18] = t14.split(aa)[y];
}else{
prdetail[x][18] = "";
}
if(y < t15.split(aa).length){
prdetail[x][19] = t15.split(aa)[y];
}else{
prdetail[x][19] = "";
}
prdetail[x][20] = "";
prdetail[x][21] = "";
}
ZOA_MM_MA_DUPLICATE po=new ZOA_MM_MA_DUPLICATE();
String[][] fhz = po.Getexecute(prdetail);
estatus = fhz[0][0];
emessage = fhz[0][1];
Map<String,Object> result = new HashMap<>();
result.put("estatus",estatus);
result.put("emessage",emessage);
List<Map<String,Object>> item = new ArrayList<>();
for(int y=0;y<i;y++){
Map<String,Object> itemMap = new HashMap<>();
x = x + 1;
itemMap.put("index",fhz[x][0]);
itemMap.put("matnr",fhz[x][3]);
itemMap.put("maktx","<![CDATA["+fhz[x][4].replaceAll("&","and")+"]]>");
itemMap.put("status",fhz[x][20]);
itemMap.put("message",fhz[x][21]);
item.add(itemMap);
}
result.put("item",item);
}catch (Exception e){
log.error("ZOA_MM_MA_DUPLICATE_ACTION execute error",e);
return WeaResult.fail(500, "执行异常", e);
}
return WeaResult.success();
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

@ -0,0 +1,142 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoTable;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.common.i18n.tool.util.I18nContextUtil;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.verupgrade.conn.RecordSetTrans;
import com.weaver.verupgrade.interfaces.workflow.action.Action;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import com.weaver.verupgrade.workflow.request.RequestManager;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
@org.springframework.stereotype.Service("workflow_action_ZOA_MM_MA_STORE")
public class ZOA_MM_MA_STORE implements Action, EsbServerlessRpcRemoteInterface {
// 对应E9的请求信息对象
@Autowired
private RequestInfo requestInfoTemp;
public static final org.slf4j.Logger logger_4cb9b303 = LoggerFactory.getLogger(ZOA_MM_MA_STORE.class);
private JCoDestination destination;
private int cursorindex;
private int dataconts;
private JCoTable datas;
private String[][] retstr;
public ZOA_MM_MA_STORE() {
new SAPConn();
this.destination = SAPConn.getJCoDestination();
this.cursorindex = -1;
this.dataconts = 0;
this.datas = null;
this.retstr = null;
}
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
Map<String, Object> weaverResultMap = new HashMap<>();
Long requestIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("requestid", -1)));
Long userIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("userid", -1)));
RequestInfo paramRequestInfo = requestInfoTemp.getRequestInfo(requestIdTemp, userIdTemp);
try {
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", "1", paramRequestInfo.getRequestManager()));
} catch (Exception e) {
e.printStackTrace();
logger_4cb9b303.error("ZOA_MM_MA_STORE e: {}", e.getMessage());
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), paramRequestInfo.getRequestManager())), paramRequestInfo.getRequestManager()));
}
}
public String[][] Getexecute(String[][] paramString) {
this.retstr = paramString;
try {
RecordSetTrans localRecordSetTrans = I18nContextUtil.getBean(RecordSetTrans.class);
localRecordSetTrans.setAutoCommit(false);
JCoFunction localJCoFunction = this.destination.getRepository().getFunction("ZOA_MM_MA_STORE");
if (localJCoFunction == null) {
System.out.println("ZOA_MM_MA_STORE not found in SAP.");
this.retstr[0][1] = "ZOA_MM_MA_STORE not found in SAP.";
} else {
JCoTable localJCoTable = localJCoFunction.getTableParameterList().getTable("T_INOUT");
for (int i = 1; i < paramString.length; i++) {
if (paramString[i][0].equals("aaaa")) {
continue;
} else {
localJCoTable.appendRow();
localJCoTable.setValue("INDEX", paramString[i][0]);
localJCoTable.setValue("MATKL", paramString[i][1]);
localJCoTable.setValue("WGBEZ", paramString[i][2]);
localJCoTable.setValue("MATNR", paramString[i][3]);
localJCoTable.setValue("MAKTX", paramString[i][4]);
localJCoTable.setValue("T01", paramString[i][5]);
localJCoTable.setValue("T02", paramString[i][6]);
localJCoTable.setValue("T03", paramString[i][7]);
localJCoTable.setValue("T04", paramString[i][8]);
localJCoTable.setValue("T05", paramString[i][9]);
localJCoTable.setValue("T06", paramString[i][10]);
localJCoTable.setValue("T07", paramString[i][11]);
localJCoTable.setValue("T08", paramString[i][12]);
localJCoTable.setValue("T09", paramString[i][13]);
localJCoTable.setValue("T10", paramString[i][14]);
localJCoTable.setValue("T11", paramString[i][15]);
localJCoTable.setValue("T12", paramString[i][16]);
localJCoTable.setValue("T13", paramString[i][17]);
localJCoTable.setValue("T14", paramString[i][18]);
localJCoTable.setValue("T15", paramString[i][19]);
}
}
try {
localJCoFunction.execute(this.destination);
this.retstr[0][0] = localJCoFunction.getExportParameterList().getValue("E_STATUS").toString();
this.retstr[0][1] = localJCoFunction.getExportParameterList().getValue("E_MESSAGE").toString();
JCoTable localJCoTable1 = localJCoFunction.getTableParameterList().getTable("T_INOUT");
int z = -1;
for (int j = 1; j < retstr.length; j++) {
if (retstr[j][0].equals("aaaa")) {
continue;
} else {
z = z + 1;
localJCoTable1.setRow(z);
this.retstr[j][3] = localJCoTable1.getString("MATNR").trim();
this.retstr[j][4] = localJCoTable1.getString("MAKTX").trim();
this.retstr[j][20] = localJCoTable1.getString("STATUS").trim();
this.retstr[j][21] = localJCoTable1.getString("MESSAGE").trim();
}
}
} catch (Exception localException2) {
this.retstr[0][1] = localException2.toString();
}
}
return this.retstr;
} catch (Exception localException1) {
this.retstr[0][1] = localException1.getMessage();
return this.retstr;
}
}
Map<String, Object> getResultMapForAction(Map<String, Object> map, String key, Object value, RequestManager requestManager) {
if (key != null && !key.isEmpty()) {
map.put(key, value);
}
String msgContent = requestManager.getMessagecontent();
if (msgContent != null && !msgContent.isEmpty()) {
map.put("msgContent", msgContent);
}
String msgId = requestManager.getMessageid();
if (msgId != null && !msgId.isEmpty()) {
map.put("msgId", msgId);
}
return map;
}
}

@ -0,0 +1,201 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-13
* @Description: ZOA_MM_MA_STORE
*/
@org.springframework.stereotype.Service("workflow_action_ZOA_MM_MA_STORE_ACTION")
@Slf4j
public class ZOA_MM_MA_STORE_ACTION implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
log.info("ZOA_MM_MA_STORE_ACTION execute start");
log.info("ZOA_MM_MA_STORE_ACTION execute params : " + params);
try {
String index = null2String(params.get("index"));
String wlzbh = null2String(params.get("wlzbh"));
String wlzms = null2String(params.get("wlzms"));
String wlbm = null2String(params.get("wlbm"));
String wlms = null2String(params.get("wlms"));
String t1 = null2String(params.get("t1"));
String t2 = null2String(params.get("t2"));
String t3 = null2String(params.get("t3"));
String t4 = null2String(params.get("t4"));
String t5 = null2String(params.get("t5"));
String t6 = null2String(params.get("t6"));
String t7 = null2String(params.get("t7"));
String t8 = null2String(params.get("t8"));
String t9 = null2String(params.get("t9"));
String t10 = null2String(params.get("t10"));
String t11 = null2String(params.get("t11"));
String t12 = null2String(params.get("t12"));
String t13 = null2String(params.get("t13"));
String t14 = null2String(params.get("t14"));
String t15 = null2String(params.get("t15"));
String estatus = "";
String emessage = "";
String[][] prdetail = null;
String aa = "@~&#";
int i = wlzbh.split(aa).length;
prdetail = new String[i+1][22];
int x =0;
for(int y=0;y<i;y++){
x = x + 1;
if(y < index.split(aa).length){
prdetail[x][0] = index.split(aa)[y];
}else{
prdetail[x][0] = "";
}
if(y < wlzbh.split(aa).length){
prdetail[x][1] = wlzbh.split(aa)[y];
}else{
prdetail[x][1] = "";
}
if(y < wlzms.split(aa).length){
prdetail[x][2] = wlzms.split(aa)[y];
}else{
prdetail[x][2] = "";
}
if(y < wlbm.split(aa).length){
prdetail[x][3] = wlbm.split(aa)[y];
}else{
prdetail[x][3] = "";
}
if(y < wlms.split(aa).length){
prdetail[x][4] = wlms.split(aa)[y];
}else{
prdetail[x][4] = "";
}
if(y < t1.split(aa).length){
prdetail[x][5] = t1.split(aa)[y];
}else{
prdetail[x][5] = "";
}
if(y < t2.split(aa).length){
prdetail[x][6] = t2.split(aa)[y];
}else{
prdetail[x][6] = "";
}
if(y < t3.split(aa).length){
prdetail[x][7] = t3.split(aa)[y];
}else{
prdetail[x][7] = "";
}
if(y < t4.split(aa).length){
prdetail[x][8] = t4.split(aa)[y];
}else{
prdetail[x][8] = "";
}
if(y < t5.split(aa).length){
prdetail[x][9] = t5.split(aa)[y];
}else{
prdetail[x][9] = "";
}
if(y < t6.split(aa).length){
prdetail[x][10] = t6.split(aa)[y];
}else{
prdetail[x][10] = "";
}
if(y < t7.split(aa).length){
prdetail[x][11] = t7.split(aa)[y];
}else{
prdetail[x][11] = "";
}
if(y < t8.split(aa).length){
prdetail[x][12] = t8.split(aa)[y];
}else{
prdetail[x][12] = "";
}
if(y < t9.split(aa).length){
prdetail[x][13] = t9.split(aa)[y];
}else{
prdetail[x][13] = "";
}
if(y < t10.split(aa).length){
prdetail[x][14] = t10.split(aa)[y];
}else{
prdetail[x][14] = "";
}
if(y < t11.split(aa).length){
prdetail[x][15] = t11.split(aa)[y];
}else{
prdetail[x][15] = "";
}
if(y < t12.split(aa).length){
prdetail[x][16] = t12.split(aa)[y];
}else{
prdetail[x][16] = "";
}
if(y < t13.split(aa).length){
prdetail[x][17] = t13.split(aa)[y];
}else{
prdetail[x][17] = "";
}
if(y < t14.split(aa).length){
prdetail[x][18] = t14.split(aa)[y];
}else{
prdetail[x][18] = "";
}
if(y < t15.split(aa).length){
prdetail[x][19] = t15.split(aa)[y];
}else{
prdetail[x][19] = "";
}
prdetail[x][20] = "";
prdetail[x][21] = "";
}
ZOA_MM_MA_STORE po=new ZOA_MM_MA_STORE();
String[][] fhz = po.Getexecute(prdetail);
estatus = fhz[0][0];
emessage = fhz[0][1];
Map<String,Object> result = new HashMap<>();
result.put("estatus",estatus);
result.put("emessage",emessage);
List<Map<String,Object>> item = new ArrayList<>();
for(int y=0;y<i;y++){
Map<String,Object> itemMap = new HashMap<>();
x = x + 1;
itemMap.put("index",fhz[x][0]);
itemMap.put("matnr",fhz[x][3]);
itemMap.put("maktx",fhz[x][4]);
itemMap.put("status",fhz[x][20]);
itemMap.put("message",fhz[x][21]);
item.add(itemMap);
}
result.put("item",item);
return WeaResult.success(result);
}catch (Exception e){
log.error("ZOA_MM_MA_STORE_ACTION execute error", e);
return WeaResult.fail(500, "执行异常", e);
}
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

@ -0,0 +1,146 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoParameterList;
import com.sap.conn.jco.JCoRepository;
import com.sap.conn.jco.JCoTable;
import java.io.PrintStream;
import com.weaver.common.i18n.tool.util.I18nContextUtil;
import java.util.*;
import com.weaver.verupgrade.workflow.request.RequestManager;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.common.base.entity.result.WeaResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import java.util.Map;
import java.util.HashMap;
import com.weaver.verupgrade.conn.RecordSetTrans;
import com.weaver.verupgrade.interfaces.workflow.action.Action;
@org.springframework.stereotype.Service("workflow_action_ZOA_MM_MA_VALIDITY")
public class ZOA_MM_MA_VALIDITY implements Action, EsbServerlessRpcRemoteInterface {
// 对应E9的请求信息对象
@Autowired
private RequestInfo requestInfoTemp;
public static final org.slf4j.Logger logger_e2f735b0 = LoggerFactory.getLogger(ZOA_MM_MA_VALIDITY.class);
private JCoDestination destination;
private int cursorindex;
private int dataconts;
private JCoTable datas;
private String[][] retstr;
public ZOA_MM_MA_VALIDITY() {
new SAPConn();
this.destination = SAPConn.getJCoDestination();
this.cursorindex = -1;
this.dataconts = 0;
this.datas = null;
this.retstr = null;
}
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
Map<String, Object> weaverResultMap = new HashMap<>();
Long requestIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("requestid", -1)));
Long userIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("userid", -1)));
RequestInfo paramRequestInfo = requestInfoTemp.getRequestInfo(requestIdTemp, userIdTemp);
try {
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", "1", paramRequestInfo.getRequestManager()));
} catch (Exception e) {
e.printStackTrace();
logger_e2f735b0.error("ZOA_MM_MA_VALIDITY e: {}", e.getMessage());
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), paramRequestInfo.getRequestManager())), paramRequestInfo.getRequestManager()));
}
}
public String[][] Getexecute(String[][] paramString) {
this.retstr = paramString;
try {
RecordSetTrans localRecordSetTrans = I18nContextUtil.getBean(RecordSetTrans.class);
localRecordSetTrans.setAutoCommit(false);
JCoFunction localJCoFunction = this.destination.getRepository().getFunction("ZOA_MM_MA_VALIDITY");
if (localJCoFunction == null) {
System.out.println("ZOA_MM_MA_VALIDITY not found in SAP.");
this.retstr[0][1] = "ZOA_MM_MA_VALIDITY not found in SAP.";
} else {
JCoTable localJCoTable = localJCoFunction.getTableParameterList().getTable("T_INOUT");
for (int i = 1; i < paramString.length; i++) {
if (paramString[i][0].equals("aaaa")) {
continue;
} else {
localJCoTable.appendRow();
localJCoTable.setValue("INDEX", paramString[i][0]);
localJCoTable.setValue("MATKL", paramString[i][1]);
localJCoTable.setValue("WGBEZ", paramString[i][2]);
localJCoTable.setValue("MATNR", paramString[i][3]);
localJCoTable.setValue("MAKTX", paramString[i][4]);
localJCoTable.setValue("T01", paramString[i][5]);
localJCoTable.setValue("T02", paramString[i][6]);
localJCoTable.setValue("T03", paramString[i][7]);
localJCoTable.setValue("T04", paramString[i][8]);
localJCoTable.setValue("T05", paramString[i][9]);
localJCoTable.setValue("T06", paramString[i][10]);
localJCoTable.setValue("T07", paramString[i][11]);
localJCoTable.setValue("T08", paramString[i][12]);
localJCoTable.setValue("T09", paramString[i][13]);
localJCoTable.setValue("T10", paramString[i][14]);
localJCoTable.setValue("T11", paramString[i][15]);
localJCoTable.setValue("T12", paramString[i][16]);
localJCoTable.setValue("T13", paramString[i][17]);
localJCoTable.setValue("T14", paramString[i][18]);
localJCoTable.setValue("T15", paramString[i][19]);
}
}
try {
localJCoFunction.execute(this.destination);
this.retstr[0][0] = localJCoFunction.getExportParameterList().getValue("E_STATUS").toString();
this.retstr[0][1] = localJCoFunction.getExportParameterList().getValue("E_MESSAGE").toString();
JCoTable localJCoTable1 = localJCoFunction.getTableParameterList().getTable("T_INOUT");
int z = -1;
for (int j = 1; j < retstr.length; j++) {
if (retstr[j][0].equals("aaaa")) {
continue;
} else {
z = z + 1;
localJCoTable1.setRow(z);
this.retstr[j][3] = localJCoTable1.getString("MATNR").trim();
this.retstr[j][4] = localJCoTable1.getString("MAKTX").trim();
this.retstr[j][20] = localJCoTable1.getString("STATUS").trim();
this.retstr[j][21] = localJCoTable1.getString("MESSAGE").trim();
}
}
} catch (Exception localException2) {
this.retstr[0][1] = localException2.toString();
}
}
return this.retstr;
} catch (Exception localException1) {
this.retstr[0][1] = localException1.getMessage();
return this.retstr;
}
}
Map<String, Object> getResultMapForAction(Map<String, Object> map, String key, Object value, RequestManager requestManager) {
if (key != null && !key.isEmpty()) {
map.put(key, value);
}
String msgContent = requestManager.getMessagecontent();
if (msgContent != null && !msgContent.isEmpty()) {
map.put("msgContent", msgContent);
}
String msgId = requestManager.getMessageid();
if (msgId != null && !msgId.isEmpty()) {
map.put("msgId", msgId);
}
return map;
}
}

@ -0,0 +1,236 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-13
* @Description: ZOA_MM_MA_VALIDITY
*/
@org.springframework.stereotype.Service("workflow_action_ZOA_MM_MA_VALIDITY_ACTION")
@Slf4j
public class ZOA_MM_MA_VALIDITY_ACTION implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
log.info("ZOA_MM_MA_VALIDITY_ACTION execute start");
log.info("ZOA_MM_MA_VALIDITY_ACTION execute params : " + params);
try {
String index = full2HalfWidth(null2String(params.get("index")));
String wlzbh = full2HalfWidth(null2String(params.get("wlzbh")));
String wlzms = null2String(params.get("wlzms"));
String wlbm = full2HalfWidth(null2String(params.get("wlbm")));
String wlms = full2HalfWidth(null2String(params.get("wlms")));
System.out.println("ZOA_MM_MA_VALIDITY:"+wlms);
String t1 = full2HalfWidth(null2String(params.get("t1")));
String t2 = full2HalfWidth(null2String(params.get("t2")));
String t3 = full2HalfWidth(null2String(params.get("t3")));
String t4 = full2HalfWidth(null2String(params.get("t4")));
String t5 = full2HalfWidth(null2String(params.get("t5")));
String t6 = full2HalfWidth(null2String(params.get("t6")));
String t7 = full2HalfWidth(null2String(params.get("t7")));
String t8 = full2HalfWidth(null2String(params.get("t8")));
String t9 = full2HalfWidth(null2String(params.get("t9")));
String t10 = full2HalfWidth(null2String(params.get("t10")));
String t11 = full2HalfWidth(null2String(params.get("t11")));
String t12 = full2HalfWidth(null2String(params.get("t12")));
String t13 = full2HalfWidth(null2String(params.get("t13")));
String t14 = full2HalfWidth(null2String(params.get("t14")));
String t15 = full2HalfWidth(null2String(params.get("t15")));
String estatus = "";
String emessage = "";
String[][] prdetail = null;
String aa = "@~&#";
int i = wlzbh.split(aa).length;
prdetail = new String[i+1][22];
int x =0;
for(int y=0;y<i;y++){
x = x + 1;
if(y < index.split(aa).length){
prdetail[x][0] = index.split(aa)[y];
}else{
prdetail[x][0] = "";
}
if(y < wlzbh.split(aa).length){
prdetail[x][1] = wlzbh.split(aa)[y];
}else{
prdetail[x][1] = "";
}
if(y < wlzms.split(aa).length){
prdetail[x][2] = wlzms.split(aa)[y];
}else{
prdetail[x][2] = "";
}
if(y < wlbm.split(aa).length){
prdetail[x][3] = wlbm.split(aa)[y];
}else{
prdetail[x][3] = "";
}
if(y < wlms.split(aa).length){
prdetail[x][4] = wlms.split(aa)[y];
}else{
prdetail[x][4] = "";
}
if(y < t1.split(aa).length){
prdetail[x][5] = t1.split(aa)[y];
}else{
prdetail[x][5] = "";
}
if(y < t2.split(aa).length){
prdetail[x][6] = t2.split(aa)[y];
}else{
prdetail[x][6] = "";
}
if(y < t3.split(aa).length){
prdetail[x][7] = t3.split(aa)[y];
}else{
prdetail[x][7] = "";
}
if(y < t4.split(aa).length){
prdetail[x][8] = t4.split(aa)[y];
}else{
prdetail[x][8] = "";
}
if(y < t5.split(aa).length){
prdetail[x][9] = t5.split(aa)[y];
}else{
prdetail[x][9] = "";
}
if(y < t6.split(aa).length){
prdetail[x][10] = t6.split(aa)[y];
}else{
prdetail[x][10] = "";
}
if(y < t7.split(aa).length){
prdetail[x][11] = t7.split(aa)[y];
}else{
prdetail[x][11] = "";
}
if(y < t8.split(aa).length){
prdetail[x][12] = t8.split(aa)[y];
}else{
prdetail[x][12] = "";
}
if(y < t9.split(aa).length){
prdetail[x][13] = t9.split(aa)[y];
}else{
prdetail[x][13] = "";
}
if(y < t10.split(aa).length){
prdetail[x][14] = t10.split(aa)[y];
}else{
prdetail[x][14] = "";
}
if(y < t11.split(aa).length){
prdetail[x][15] = t11.split(aa)[y];
}else{
prdetail[x][15] = "";
}
if(y < t12.split(aa).length){
prdetail[x][16] = t12.split(aa)[y];
}else{
prdetail[x][16] = "";
}
if(y < t13.split(aa).length){
prdetail[x][17] = t13.split(aa)[y];
}else{
prdetail[x][17] = "";
}
if(y < t14.split(aa).length){
prdetail[x][18] = t14.split(aa)[y];
}else{
prdetail[x][18] = "";
}
if(y < t15.split(aa).length){
prdetail[x][19] = t15.split(aa)[y];
}else{
prdetail[x][19] = "";
}
prdetail[x][20] = "";
prdetail[x][21] = "";
}
ZOA_MM_MA_VALIDITY po=new ZOA_MM_MA_VALIDITY();
String[][] fhz = po.Getexecute(prdetail);
estatus = fhz[0][0];
emessage = fhz[0][1];
Map<String,Object> result = new HashMap<>();
result.put("estatus",estatus);
result.put("emessage",emessage);
List<Map<String, Object>> item = new ArrayList<>();
for (int y = 0; y < i; y++) {
Map<String, Object> itemMap = new HashMap<>();
x = x + 1;
itemMap.put("index", fhz[x][0]);
itemMap.put("matnr", fhz[x][3]);
itemMap.put("maktx", "<![CDATA[" + fhz[x][4].replaceAll("&", "and") + "]]>");
itemMap.put("status", fhz[x][20]);
itemMap.put("message", "<![CDATA["+fhz[x][21]+"]]>");
item.add(itemMap);
}
result.put("item",item);
return WeaResult.success(result);
}catch (Exception e){
log.error("ZOA_MM_MA_VALIDITY_ACTION execute error", e);
return WeaResult.fail(500, "执行异常", e);
}
}
public String full2HalfWidth(String str) {
String outStr = "";
if(str.contains("")){
String Tstr = "";
byte[] b = null;
if (str != null) {
for (int i = 0; i < str.trim().length(); i++) {
try {
Tstr = str.substring(i, i + 1);
b = Tstr.getBytes("unicode");
} catch (Exception e) {
e.printStackTrace();
}
if (b[2] == -1) {
b[3] = (byte) (b[3] + 32);
b[2] = 0;
try {
outStr = outStr + new String(b, "unicode");
} catch (Exception e) {
e.printStackTrace();
}
} else {
outStr = outStr + Tstr;
}
}
}
}else{
outStr = str;
}
return outStr;
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}
Loading…
Cancel
Save