Commit f12fc94b LN

1.API002失败时没有ng消息。

2.如果api001验证成功,查找库位号的时候发现料在库位里面,直接更新状态,不能重复添加。
1 个父辈 04970fa9
...@@ -417,12 +417,12 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -417,12 +417,12 @@ public class RobotBoxHandler extends BaseDeviceHandler {
resultMap.put("msg", errorMsg); resultMap.put("msg", errorMsg);
} else { } else {
String apiBarcode="";
try { try {
Barcode barcode = codeResolve.resolveOneValideBarcode(code); Barcode barcode = codeResolve.resolveOneValideBarcode(code);
boolean expiredateVerify = dataCache.getExpiredateVerify(); boolean expiredateVerify = dataCache.getExpiredateVerify();
if (!expiredateVerify) { if (!expiredateVerify) {
if (barcode.getExpireDate() != null && System.currentTimeMillis() > barcode.getExpireDate().getTime()) { if (barcode.getExpireDate() != null && System.currentTimeMillis() > barcode.getExpireDate().getTime()) {
// throw new ValidateException("smfcore.error.barcode.expired", "物料已过期,无法入库.");
//已有入库任务,返回NG,标记原来的入库任务 //已有入库任务,返回NG,标记原来的入库任务
resultMap.put("result", "107"); resultMap.put("result", "107");
errorMsg = "[" + barcode.getBarcode() + "]" + MessageUtils.getText("smfcore.error.barcode.expired", new Locale("en", "US"), "物料已过期,无法入库"); errorMsg = "[" + barcode.getBarcode() + "]" + MessageUtils.getText("smfcore.error.barcode.expired", new Locale("en", "US"), "物料已过期,无法入库");
...@@ -602,7 +602,7 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -602,7 +602,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
} }
barcode= ApiCheck(rfid,barcode ); barcode= ApiCheck(rfid,barcode );
apiBarcode=barcode.getBarcode();
if(barcode.isToXray()){ if(barcode.isToXray()){
log.info("物料["+barcode.getBarcode()+"]需要先去点料" ); log.info("物料["+barcode.getBarcode()+"]需要先去点料" );
...@@ -699,13 +699,16 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -699,13 +699,16 @@ public class RobotBoxHandler extends BaseDeviceHandler {
} }
} }
} catch (ValidateException ve) { } catch (ValidateException ve) {
errorMsg = ve.getMessage();
errorMsg= MessageUtils.getText(ve.getMsgKey(),ve.getMsgParam(),new Locale("en","US"),ve.getDefaultMsg()); errorMsg= MessageUtils.getText(ve.getMsgKey(),ve.getMsgParam(),new Locale("en","US"),ve.getDefaultMsg());
if(ObjectUtil.isEmpty(apiBarcode)){
log.info("Failed to find empty storage space:" + errorMsg+",update state");
loadingUtil.updateItemState(apiBarcode,"", INITEM_STATUS.API001NG,errorMsg);
}else{
log.info("Failed to find empty storage space:" + errorMsg); log.info("Failed to find empty storage space:" + errorMsg);
Barcode barcode = new Barcode(); Barcode barcode = new Barcode();
barcode.setBarcode(code); barcode.setBarcode(code);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg); loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg);
}
resultMap.put("result", "105"); resultMap.put("result", "105");
resultMap.put("msg", errorMsg); resultMap.put("msg", errorMsg);
......
...@@ -341,7 +341,12 @@ public class MicronApi { ...@@ -341,7 +341,12 @@ public class MicronApi {
resultMap.put(s.getSerialNum(), errMsg); resultMap.put(s.getSerialNum(), errMsg);
} }
} }
}else{ }
else if(ObjectUtil.isNotEmpty(errMsg)){
log.info("API002 ,接口通信失败:"+errMsg);
return resultMap;
}
else{
log.info("API002 ,接口通信失败"); log.info("API002 ,接口通信失败");
throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API002"}); throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API002"});
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!