calyrex 2.18

ht
calyrex 2 months ago
parent 0fad6c2fca
commit 9d7fe0a4c3

@ -63,6 +63,11 @@ public class ZOA_MM_MA_VALIDITY implements Action, EsbServerlessRpcRemoteInterfa
}
public String[][] Getexecute(String[][] paramString) {
for (int i = 1; i < paramString.length; i++) {
for (int j = 0; j < paramString[i].length; j++) {
logger_e2f735b0.error("ZOA_MM_MA_VALIDITY paramString["+i+"]["+j+"]--" + paramString[i][j]);
}
}
this.retstr = paramString;
try {
RecordSetTrans localRecordSetTrans = I18nContextUtil.getBean(RecordSetTrans.class);
@ -83,6 +88,7 @@ public class ZOA_MM_MA_VALIDITY implements Action, EsbServerlessRpcRemoteInterfa
localJCoTable.setValue("WGBEZ", paramString[i][2]);
localJCoTable.setValue("MATNR", paramString[i][3]);
localJCoTable.setValue("MAKTX", paramString[i][4]);
logger_e2f735b0.error("ZOA_MM_MA_VALIDITY paramString["+i+"][5]--" + paramString[i][5]);
localJCoTable.setValue("T01", paramString[i][5]);
localJCoTable.setValue("T02", paramString[i][6]);
localJCoTable.setValue("T03", paramString[i][7]);
@ -120,11 +126,13 @@ public class ZOA_MM_MA_VALIDITY implements Action, EsbServerlessRpcRemoteInterfa
}
} catch (Exception localException2) {
this.retstr[0][1] = localException2.toString();
logger_e2f735b0.error("Exception--", localException2);
}
}
return this.retstr;
} catch (Exception localException1) {
this.retstr[0][1] = localException1.getMessage();
logger_e2f735b0.error("Exception--", localException1);
return this.retstr;
}
}

@ -9,10 +9,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: calyrexi
* @Author: calyrex
* @CreateTime: 2025-02-17
* @Description:ZOA_MM_MA_DUPLICATEAPI
*/
@ -163,21 +166,30 @@ public class ZOA_MM_MA_DUPLICATE_CONTROLLER {
ZOA_MM_MA_DUPLICATE po = new ZOA_MM_MA_DUPLICATE();
String[][] fhz = po.Getexecute(prdetail);
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER fhz--"+ Arrays.toString(fhz));
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER i--"+ i);
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER x--"+ x);
estatus = fhz[0][0];
emessage = fhz[0][1];
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER estatus--"+estatus);
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER emessage--"+emessage);
Map<String, Object> result = new HashMap<>();
result.put("estatus", estatus);
result.put("emessage", emessage);
x = 0;
List<Map<String, Object>> item = new ArrayList<>();
for (int y = 0; y < i; y++) {
Map<String, Object> itemMap = new HashMap<>();
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER fhz[x][0]--"+ fhz[x][0]);
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER fhz[x][0]--"+ fhz[x][3]);
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("maktx", fhz[x][4].replaceAll("&", "and"));
itemMap.put("status", fhz[x][20]);
itemMap.put("message", fhz[x][21]);
item.add(itemMap);

@ -0,0 +1,217 @@
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 com.weaver.seconddev.interfaces.workflow.action.ZOA_MM_MA_STORE;
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_DUPLICATEAPI
*/
@Slf4j
@RestController
@RequestMapping({"/papi/secondev/workflow/controller" })
public class ZOA_MM_MA_STORE_CONTROLLER {
@GetMapping("/ZOA_MM_MA_STORE")
public WeaResult<String> run(@RequestParam Map<String,Object> params) {
log.error("ZOA_MM_MA_STORE_CONTROLLER execute start");
log.error("ZOA_MM_MA_STORE_CONTROLLER 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);
log.error("ZOA_MM_MA_STORE_CONTROLLER i--"+ i);
log.error("ZOA_MM_MA_STORE_CONTROLLER x--"+ x);
estatus = fhz[0][0];
emessage = fhz[0][1];
log.error("ZOA_MM_MA_STORE_CONTROLLER estatus--"+estatus);
log.error("ZOA_MM_MA_STORE_CONTROLLER emessage--"+emessage);
Map<String, Object> result = new HashMap<>();
result.put("estatus", estatus);
result.put("emessage", emessage);
x = 0;
List<Map<String, Object>> item = new ArrayList<>();
for (int y = 0; y < i; y++) {
Map<String, Object> itemMap = new HashMap<>();
log.error("ZOA_MM_MA_STORE_CONTROLLER fhz[x][0]--"+ fhz[x][0]);
log.error("ZOA_MM_MA_STORE_CONTROLLER fhz[x][0]--"+ fhz[x][3]);
x = x + 1;
itemMap.put("index", fhz[x][0]);
itemMap.put("matnr", fhz[x][3]);
itemMap.put("maktx", fhz[x][4].replaceAll("&", "and"));
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_STORE_CONTROLLER execute error",e);
return WeaResult.fail(500, "ZOA_MM_MA_STORE_CONTROLLER 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;
}
}

@ -31,8 +31,8 @@ public class ZOA_MM_MA_VALIDITY_CONTROLLER {
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")));
log.error("ZOA_MM_MA_VALIDITY_CONTROLLER t1--" + t1);
String t2 = full2HalfWidth(null2String(params.get("t2")));
String t3 = full2HalfWidth(null2String(params.get("t3")));
String t4 = full2HalfWidth(null2String(params.get("t4")));
@ -163,22 +163,32 @@ public class ZOA_MM_MA_VALIDITY_CONTROLLER {
ZOA_MM_MA_VALIDITY po = new ZOA_MM_MA_VALIDITY();
String[][] fhz = po.Getexecute(prdetail);
log.error("ZOA_MM_MA_VALIDITY_CONTROLLER fhz--"+ Arrays.toString(fhz));
estatus = fhz[0][0];
emessage = fhz[0][1];
log.error("ZOA_MM_MA_VALIDITY_CONTROLLER i--"+ i);
log.error("ZOA_MM_MA_VALIDITY_CONTROLLER x--"+ x);
JSONObject result = new JSONObject();
result.put("estatus", estatus);
result.put("emessage", emessage);
log.error("ZOA_MM_MA_VALIDITY_CONTROLLER estatus--"+estatus);
log.error("ZOA_MM_MA_VALIDITY_CONTROLLER emessage--"+emessage);
List<Map<String, Object>> item = new ArrayList<>();
x = 0;
for (int y = 0; y < i; y++) {
Map<String, Object> itemMap = new HashMap<>();
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER fhz[x][0]--"+ fhz[x][0]);
log.error("ZOA_MM_MA_DUPLICATE_CONTROLLER fhz[x][3]--"+ fhz[x][3]);
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("maktx", fhz[x][4].replaceAll("&", "and"));
itemMap.put("status", fhz[x][20]);
itemMap.put("message", "<![CDATA[" + fhz[x][21] + "]]>");
itemMap.put("message", fhz[x][21]);
item.add(itemMap);
}
result.put("item", item);
@ -232,4 +242,5 @@ public class ZOA_MM_MA_VALIDITY_CONTROLLER {
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

Loading…
Cancel
Save