Commit 752f40e5 LN

重复入库处理修改

1 个父辈 90e9e111
......@@ -179,6 +179,8 @@ public class MicronApi {
barcode.setToXray(true);
}
return barcode;
// 2023-08-29 14:45:35.971 INFO [HttpHelper.java:339] - Request to [http://istio-ingressgateway-istio-system.apps.ose-dev45.micron.com/material/validation/label] response: code=500,responseContent={
// "transactionId": "2810c627-d3b6-4200-ba7c-f8e3eddf47f6",
// "error": 102,
......@@ -187,7 +189,7 @@ public class MicronApi {
// }
} else {
String errmsg=result.getResult("description");
String errmsg=result.getResult("description",false);
if(ObjectUtil.isEmpty(errmsg)){
errmsg=errorMsg;
}
......@@ -198,14 +200,13 @@ public class MicronApi {
throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API001"});
}
return barcode;
} catch (ApiException e) {
throw e;
} catch (Exception e) {
log.error(url + "出错", e);
}
return barcode;
return null;
}
private static String getDErrorMsg(MicronResult result) throws ApiException {
......
......@@ -58,9 +58,11 @@ public class MicronResult implements Serializable {
public <T> T getResult(String key,boolean needCheck) throws ApiException {
if (ObjectUtil.isEmpty(responseData)) {
throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API"});
// return null;
if (ObjectUtil.isEmpty(responseData) ) {
if(needCheck){
throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API"});
}
return null;
}
if (resultMap == null) {
resultMap = JsonUtil.toMap(responseData);
......@@ -81,6 +83,8 @@ public class MicronResult implements Serializable {
}
}else if(resultMap==null){
return null;
}
if (key != null && !key.isEmpty()) {
Object value = resultMap.get(key);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!