Commit 68fe39ee LN

入库时需要先验证物料是否已在库存中

1 个父辈 1244eeb7
......@@ -334,6 +334,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
//返回 106=唯一码已有入库任务
//返回 107=物料已过期,无法入库
//返回 108=库位被锁定,暂停入库,重新获取库位号
//返回 96=已在库位中,NG
//返回108=已有待完成的出入库任务,直接NG
//返回110=接口验证失败,需要去XRay重新点料
......@@ -435,6 +436,30 @@ public class RobotBoxHandler extends BaseDeviceHandler {
}
}
//如果已在库位中,直接NG
Integer barcodeSet = dataCache.getCache(Constants.CACHE_SAME_BARCODE_SETTINGS);
StoragePos hasPos = storagePosManager.getByBarcode(barcode.getBarcode());
if (hasPos != null) {
Storage storage = dataCache.getStorageById(hasPos.getStorageId());
if (barcodeSet == null || barcodeSet == 1) {
//如果已在库位中,那么自动将该库位的物料出库
log.info(" 物料"+barcode.getBarcode()+"已在库位中, CACHE_SAME_BARCODE_SETTINGS=1,自动出库已在库位中的物料[" + barcode.getBarcode() + "],设置ngReel=true");
taskService.checkout(storage, hasPos, true, true, "", "");
} else {
log.info(" 物料"+barcode.getBarcode()+"已在库位中, CACHE_SAME_BARCODE_SETTINGS=2,标记库位[" + hasPos.getPosName() + "]中的物料[" + barcode.getBarcode() + "]为ngReel=NG");
hasPos.getBarcode().updateAppendData("ngReel", true);
storagePosManager.save(hasPos);
}
errorMsg=MessageUtils.getText("smfcore.error.barcode.exist", new String[]{barcode.getBarcode(), storage.getName(), hasPos.getPosName()}, MessageUtils.getDefaultLocal(),"[{0}}]已在{1}}[{2}}]中");
resultMap.put("result", "96");
resultMap.put("msg", errorMsg);
loadingUtil.AddInListItem(rfid, barcode, "", INITEM_STATUS.NG, errorMsg);
return resultMap;
}
try {
if(ObjectUtil.isNotEmpty(preCid)) {
......@@ -486,7 +511,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,errorMsg);
//判断原任务是否需要NG
Integer barcodeSet=dataCache.getCache(Constants.CACHE_SAME_BARCODE_SETTINGS);
// Integer barcodeSet=dataCache.getCache(Constants.CACHE_SAME_BARCODE_SETTINGS);
if(barcodeSet==null||barcodeSet==1) {
//原任务标记NG
dataLog.setNgReel(true);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!