diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CHECK.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CHECK.java index 80487ed..fa1de91 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CHECK.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_FICO_COC_CHECK.java @@ -123,12 +123,12 @@ public class ZOA_FICO_COC_CHECK implements Action, EsbServerlessRpcRemoteInterfa } } } catch (Exception e1) { - logger_6a128882.error(String.valueOf("error1:" + e1.getMessage())); + logger_6a128882.error("error1:" , e1); map.put("emessage", e1.getMessage()); } } } catch (Exception e2) { - logger_6a128882.error(String.valueOf("error2:" + e2.getMessage())); + logger_6a128882.error("error2:" , e2); map.put("emessage", e2.getMessage()); } 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 index 0548260..5a7ed79 100644 --- 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 @@ -1,5 +1,6 @@ package com.weaver.seconddev.interfaces.workflow.action; +import com.alibaba.fastjson.JSONObject; import com.weaver.common.base.entity.result.WeaResult; import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface; import com.weaver.verupgrade.soa.workflow.request.RequestInfo; @@ -168,7 +169,7 @@ public class ZOA_MM_MA_DUPLICATE_ACTION implements EsbServerlessRpcRemoteInterfa estatus = fhz[0][0]; emessage = fhz[0][1]; - Map result = new HashMap<>(); + JSONObject result = new JSONObject(); result.put("estatus",estatus); result.put("emessage",emessage); List> item = new ArrayList<>(); diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/controller/ZOA_MM_MA_DUPLICATE_CONTROLLER.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/controller/ZOA_MM_MA_DUPLICATE_CONTROLLER.java new file mode 100644 index 0000000..69a1ee3 --- /dev/null +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/controller/ZOA_MM_MA_DUPLICATE_CONTROLLER.java @@ -0,0 +1,204 @@ +package com.weaver.seconddev.interfaces.workflow.controller; + +import com.alibaba.fastjson.JSONObject; +import com.weaver.common.base.entity.result.WeaResult; +import com.weaver.seconddev.interfaces.workflow.action.ZOA_MM_MA_DUPLICATE; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author: calyrex + * @CreateTime: 2025-02-17 + * @Description:ZOA_MM_MA_DUPLICATE的API调用 + */ + +@Slf4j +@RestController +@RequestMapping({"/papi/secondev/workflow/controller" }) +public class ZOA_MM_MA_DUPLICATE_CONTROLLER { + @GetMapping("/ZOA_FICO_COC_CHECK") + public WeaResult run(@RequestParam Map params) { + log.error("ZOA_MM_MA_DUPLICATE_ACTION execute start"); + log.error("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 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", fhz[x][21]); + item.add(itemMap); + } + result.put("item", item); + return WeaResult.success(JSONObject.toJSONString(result)); + }catch (Exception e){ + log.error("ZOA_MM_MA_DUPLICATE_ACTION execute error",e); + return WeaResult.fail(500, "ZOA_MM_MA_DUPLICATE_ACTION execute error " +e, 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; + } +}