calyrex 2.18
parent
0fad6c2fca
commit
9d7fe0a4c3
@ -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_DUPLICATE的API调用
|
||||||
|
*/
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue