diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_ANLA_CHECK_ACTION.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_ANLA_CHECK_ACTION.java new file mode 100644 index 0000000..189ba56 --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_ANLA_CHECK_ACTION.java @@ -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> execute(Map 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 map = po.Getexecute(gdzcdm , gsdm); + if(map != null && map.size() > 0) { + estatus = map.get("estatus"); + emessage = map.get("emessage"); + Map result = new HashMap<>(); + result.put("estatus", estatus); + result.put("emessage", emessage); + result.put("TXT50", ""); + result.put("TXA50", ""); + result.put("ANLN1", ""); + result.put("ANLHTXT", ""); + result.put("SERNR", ""); + result.put("INVNR", ""); + result.put("KOSTL", ""); + result.put("KOSTLV", ""); + result.put("CAUFN", ""); + result.put("WERKS", ""); + result.put("RAUMN", ""); + result.put("BUKRS", ""); + result.put("KTOGR", ""); + result.put("MENGE", ""); + result.put("MEINS", ""); + result.put("AKTIV", ""); + result.put("ZUGDT", ""); + result.put("ZUJHR", ""); + result.put("ZUPER", ""); + result.put("DEAKT", ""); + result.put("ORD41", ""); + result.put("ORD42", ""); + result.put("NDJAR", ""); + result.put("NDPER", ""); + result.put("AFABG", ""); + result.put("NDABJ", ""); + result.put("NDABP", ""); + result.put("ANLKL", ""); + result.put("ANLN2", ""); + return WeaResult.success(result); + }else { + estatus = map.get("estatus"); + emessage = map.get("emessage"); + Map 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; + } +} diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CHECK_ACTION.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CHECK_ACTION.java new file mode 100644 index 0000000..825e8be --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CHECK_ACTION.java @@ -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> execute(Map 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 map = po.Getexecute(cbzxdm); + if(map != null && map.size() > 0) { + estatus = map.get("estatus"); + emessage = map.get("emessage"); + Map 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 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; + } + +} diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FI_CUSTOMER_MAINTAIN_ACTION.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FI_CUSTOMER_MAINTAIN_ACTION.java new file mode 100644 index 0000000..14e2c52 --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FI_CUSTOMER_MAINTAIN_ACTION.java @@ -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> execute(Map 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 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; + } +} diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FI_VENDOR_MAINTAIN_ACTION.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FI_VENDOR_MAINTAIN_ACTION.java index 5e7de19..3abe7e9 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FI_VENDOR_MAINTAIN_ACTION.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FI_VENDOR_MAINTAIN_ACTION.java @@ -1,9 +1,12 @@ 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.seconddev.interfaces.scfoa.GetApproveResult; import com.weaver.verupgrade.conn.CONN_TYPE; 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 org.apache.commons.lang.StringUtils; import org.slf4j.Logger; @@ -16,23 +19,25 @@ import java.util.Map; /** * @Author: calyrex * @CreateTime: 2025-01-10 - * @Description: + * @Description:ZOA_FI_VENDOR_MAINTAIN的动作流调用 */ @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的请求信息对象 - @Autowired - private RequestInfo requestInfoTemp; @Autowired - private GetApproveResult mGetResult; + private RequestInfo requestInfoTemp; private static final Logger logger_d39bef7 = LoggerFactory.getLogger(ZOA_FI_VENDOR_MAINTAIN_ACTION.class); + @Override public WeaResult> execute(Map requestInfoMap) { logger_d39bef7.info("ZOA_FI_VENDOR_MAINTAIN_ACTION start"); 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 { String edit_flag = null2String(requestInfoMap.get("edit_flag")); String bukrs = null2String(requestInfoMap.get("bukrs"));//公司代码 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_DUPLICATE.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_DUPLICATE.java new file mode 100644 index 0000000..f17d36f --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_DUPLICATE.java @@ -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> execute(Map requestInfoMap) { + Map 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 getResultMapForAction(Map 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; + } +} diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_DUPLICATE_ACTION.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_DUPLICATE_ACTION.java new file mode 100644 index 0000000..3353a8f --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_DUPLICATE_ACTION.java @@ -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> execute(Map 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 result = new HashMap<>(); + result.put("estatus",estatus); + result.put("emessage",emessage); + List> item = new ArrayList<>(); + for(int y=0;y itemMap = new HashMap<>(); + x = x + 1; + itemMap.put("index",fhz[x][0]); + itemMap.put("matnr",fhz[x][3]); + itemMap.put("maktx",""); + 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; + } +} diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_STORE.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_STORE.java new file mode 100644 index 0000000..c5f981b --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_STORE.java @@ -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> execute(Map requestInfoMap) { + Map 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 getResultMapForAction(Map 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; + } +} diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_STORE_ACTION.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_STORE_ACTION.java new file mode 100644 index 0000000..6b242bc --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_STORE_ACTION.java @@ -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> execute(Map 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 result = new HashMap<>(); + result.put("estatus",estatus); + result.put("emessage",emessage); + List> item = new ArrayList<>(); + for(int y=0;y 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; + } +} diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_VALIDITY.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_VALIDITY.java new file mode 100644 index 0000000..8201d30 --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_VALIDITY.java @@ -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> execute(Map requestInfoMap) { + Map 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 getResultMapForAction(Map 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; + } +} diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_VALIDITY_ACTION.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_VALIDITY_ACTION.java new file mode 100644 index 0000000..06eebc1 --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_MA_VALIDITY_ACTION.java @@ -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> execute(Map 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 result = new HashMap<>(); + result.put("estatus",estatus); + result.put("emessage",emessage); + List> item = new ArrayList<>(); + for (int y = 0; y < i; y++) { + Map itemMap = new HashMap<>(); + x = x + 1; + itemMap.put("index", fhz[x][0]); + itemMap.put("matnr", fhz[x][3]); + itemMap.put("maktx", ""); + itemMap.put("status", fhz[x][20]); + itemMap.put("message", ""); + 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("OR")){ + 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; + } +}