This commit is contained in:
zj
2026-01-06 15:11:28 +08:00
parent 087cdb0326
commit 33211a70de
4 changed files with 26 additions and 25 deletions

View File

@@ -71,6 +71,7 @@ public class ToErpServiceImpl implements IToErpService {
wipTransferDoc.setOwner_Emp_EMPLOYEE_CODE("EF08G");
String docNo = requestLogService.getRequestLogDoc(TO_ERP_URL,erpBill, basProduct.getProductId() , "获取工艺单号", "wms", "erp");
//String docNo="5147-2512290004";
if("".equals(docNo) || docNo == null) {
return AjaxResult.error();
}
@@ -90,11 +91,6 @@ public class ToErpServiceImpl implements IToErpService {
erpStdData.setParameter(objectErpParameter);
param.setStd_data(erpStdData);
RequestLog requestLog = requestLogService.getRequestLogGd(TO_ERP_URL, JSONUtil.toJsonStr(param), "创建工艺单","wms","erp");
// String post = requestLog.getResponseBody();
// ErpInterfaceParam bean = JSONUtil.toBean(post, ErpInterfaceParam.class);
// if ("0".equals(bean.getStd_data().getExecution().getCode())) {
// return AjaxResult.success();
// }
if(requestLog != null && "1".equals(requestLog.getIsSuccessful())){
return AjaxResult.success();
}else{

View File

@@ -112,8 +112,8 @@ public class ToWmsServiceImpl implements IToWmsService {
String ph = findFirst(PATTERNS.get("PH"), trayCode);
String nw = findFirst(PATTERNS.get("NW"), trayCode);
String gw = findFirst(PATTERNS.get("GW"), trayCode);;
// String productId = findFirst(PATTERNS.get("ITEM_CODE"), trayCode);
String productId = "KC01001000327";
String productId = findFirst(PATTERNS.get("ITEM_CODE"), trayCode);
//String productId = "KC01001000327";
String bm = findFirst(PATTERNS.get("@"), trayCode);
bm=bm.substring(0,bm.length()-1);
String[] decode = ProcodeUtils.decode(bm);

View File

@@ -126,7 +126,8 @@ public class RequestLogServiceImpl implements IRequestLogService {
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtils.sendPost(url, param, "application/json");
System.out.println(param);
log.info("调用WCS接口,请求参数:"+param);
log.info("调用WCS接口,返回信息:"+resStr);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
@@ -164,7 +165,8 @@ public class RequestLogServiceImpl implements IRequestLogService {
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtils.sendPostGd(url, param, "application/json");
System.out.println(param);
log.info("调用ERP创建工艺单,请求参数:"+param);
log.info("调用ERP创建工艺单,接口返回:"+resStr);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
@@ -208,7 +210,8 @@ public class RequestLogServiceImpl implements IRequestLogService {
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtils.sendPostOther(url, param, "application/json");
System.out.println(param);
log.info("调用ERP创建其他入出库单,请求参数:"+param);
log.info("调用ERP创建其他入出库单,接口返回:"+resStr);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
@@ -276,7 +279,8 @@ public class RequestLogServiceImpl implements IRequestLogService {
try {
String resStr = HttpUtils.sendPostDoc(url, param, "application/json");
System.out.println(param);
log.info("调用ERP获取工艺单号,请求参数:"+param);
log.info("调用ERP获取工艺单号,接口返回:"+resStr);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
@@ -340,7 +344,8 @@ public class RequestLogServiceImpl implements IRequestLogService {
try {
String resStr = HttpUtils.sendPostCode(url, param, "application/json");
System.out.println(param);
log.info("调用ERP获取订单条码,请求参数:"+param);
log.info("调用ERP获取订单条码,接口返回:"+resStr);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
@@ -371,7 +376,7 @@ public class RequestLogServiceImpl implements IRequestLogService {
basProductCode.setNW(JSONUtil.parseObj(docObj.toString()).get("ITEM_NET_WEIGHT").toString());
basProductCode.setGW(JSONUtil.parseObj(docObj.toString()).get("YQueryViewColumnElement_003").toString());
basProductCode.setType("1");
basProductCode.setSpare1(JSONUtil.parseObj(docObj.toString()).get("billNo").toString());
basProductCode.setSpare1(billNo);
basProductCode.setSpare2(JSONUtil.parseObj(docObj.toString()).get("YQueryViewColumnElement_004").toString());
basProductCode.setSpare3(JSONUtil.parseObj(docObj.toString()).get("YQueryViewColumnElement_005").toString());
basProductCode.setCreateTime(new Date());