erp修改
This commit is contained in:
@@ -27,7 +27,7 @@ public class ItemList071 implements Serializable {
|
|||||||
@Schema(description = "计量单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "计量单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private String entry_uom;
|
private String entry_uom;
|
||||||
|
|
||||||
@Schema(description = "采购订单号(采购订单收货时需要)", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "采购订单号(采购订单收货时需要:sap订单号)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private String po_number;
|
private String po_number;
|
||||||
|
|
||||||
@Schema(description = "采购订单行号(采购订单收货时需要)", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "采购订单行号(采购订单收货时需要)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ import org.springframework.web.client.RestTemplate;
|
|||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.*;
|
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.*;
|
||||||
import static dm.jdbc.util.DriverUtil.log;
|
import static dm.jdbc.util.DriverUtil.log;
|
||||||
@@ -70,7 +68,7 @@ public class ErpConfig {
|
|||||||
throw exception(ERP_NOT_EXISTS);
|
throw exception(ERP_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> resMap = new ConcurrentHashMap<>();
|
Map<String, Object> resMap = new HashMap<>();
|
||||||
JSONObject jsonResponse = JSON.parseObject(responseBody);
|
JSONObject jsonResponse = JSON.parseObject(responseBody);
|
||||||
if (jsonResponse == null) {
|
if (jsonResponse == null) {
|
||||||
throw exception(ERP_NOT_JSON_EXISTS);
|
throw exception(ERP_NOT_JSON_EXISTS);
|
||||||
@@ -82,7 +80,7 @@ public class ErpConfig {
|
|||||||
if (succeed && "S".equals(dataObject.getString("E_FLAG"))) {
|
if (succeed && "S".equals(dataObject.getString("E_FLAG"))) {
|
||||||
String flag = "S";
|
String flag = "S";
|
||||||
JSONArray E_RESP = dataObject.containsKey("E_DATA") ? dataObject.getJSONArray("E_DATA") : null;
|
JSONArray E_RESP = dataObject.containsKey("E_DATA") ? dataObject.getJSONArray("E_DATA") : null;
|
||||||
String E_MSG = dataObject.containsKey("E_MSG") ? dataObject.getString("E_MSG") : "";
|
String E_MSG = dataObject.containsKey("E_MSG") ? dataObject.getString("E_MSG") : null;
|
||||||
resMap.put("E_RESP", E_RESP);
|
resMap.put("E_RESP", E_RESP);
|
||||||
resMap.put("resStr", E_MSG);
|
resMap.put("resStr", E_MSG);
|
||||||
resMap.put("flag", flag);
|
resMap.put("flag", flag);
|
||||||
@@ -147,12 +145,16 @@ public class ErpConfig {
|
|||||||
throw exception(ERP_NOT_JSON_EXISTS);
|
throw exception(ERP_NOT_JSON_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> resMap = new ConcurrentHashMap<>();
|
Map<String, String> resMap = new HashMap<>();
|
||||||
boolean succeed = jsonResponse.getBoolean("succeed");
|
boolean succeed = jsonResponse.getBoolean("succeed");
|
||||||
JSONObject data = jsonResponse.getJSONObject("data");
|
JSONObject data = jsonResponse.getJSONObject("data");
|
||||||
|
String msg = jsonResponse.getString("msg");
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
|
resMap.put("E_RESP", null);
|
||||||
|
resMap.put("resStr", msg);
|
||||||
|
resMap.put("flag", "E");
|
||||||
log.error("SAP接口返回值为空," + jsonResponse.getString("msg"));
|
log.error("SAP接口返回值为空," + jsonResponse.getString("msg"));
|
||||||
throw exception(ERP_NOT_EXISTS);
|
//throw exception(ERP_NOT_EXISTS);
|
||||||
} else if (succeed && "S".equals(data.getString("E_FLAG"))) {
|
} else if (succeed && "S".equals(data.getString("E_FLAG"))) {
|
||||||
String flag = "S";
|
String flag = "S";
|
||||||
String E_RESP = data.containsKey("E_RESP") ? data.getString("E_RESP") : null;
|
String E_RESP = data.containsKey("E_RESP") ? data.getString("E_RESP") : null;
|
||||||
|
|||||||
Reference in New Issue
Block a user