Commit 90e9e111 LN

重复入库处理修改

1 个父辈 9e5d72a7
......@@ -366,7 +366,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
Barcode barcode = new Barcode();
barcode.setBarcode(code);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,lineMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,lineMsg);
resultMap.put("result", "100");
resultMap.put("msg", lineMsg);
......@@ -413,7 +413,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
Barcode barcode = new Barcode();
barcode.setBarcode(code);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,errorMsg);
resultMap.put("msg", errorMsg);
} else {
......@@ -423,13 +423,13 @@ public class RobotBoxHandler extends BaseDeviceHandler {
boolean expiredateVerify = dataCache.getExpiredateVerify();
if (!expiredateVerify) {
if (barcode.getExpireDate() != null && System.currentTimeMillis() > barcode.getExpireDate().getTime()) {
//已有入库任务,返回NG,标记原来的入库任务
//过期无法入库
resultMap.put("result", "107");
errorMsg = "[" + barcode.getBarcode() + "]" + MessageUtils.getText("smfcore.error.barcode.expired", new Locale("en", "US"), "物料已过期,无法入库");
resultMap.put("msg", errorMsg);
log.error("物料[" + barcode.getBarcode() + "]已过期,无法入库");
loadingUtil.AddInListItem(rfid, barcode, "", INITEM_STATUS.API001NG, errorMsg);
loadingUtil.AddInListItem(rfid, barcode, "", INITEM_STATUS.NG, errorMsg);
return resultMap;
......@@ -483,7 +483,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
errorMsg = "Serial No.(S)[" + barcode.getBarcode() + "] already have storage task";
resultMap.put("msg", errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,errorMsg);
//判断原任务是否需要NG
Integer barcodeSet=dataCache.getCache(Constants.CACHE_SAME_BARCODE_SETTINGS);
......@@ -492,6 +492,9 @@ public class RobotBoxHandler extends BaseDeviceHandler {
dataLog.setNgReel(true);
log.info("获取[" + code + "]的入库库位,条码已有入库任务posname[" + dataLog.getPosName() + "],标记入库任务为NG,入库后自动出库");
taskService.updateQueueTask(dataLog);
//更改旧任务NG
String msg="Repeat Inbound";
loadingUtil.updateItemState(dataLog.getBarcode(),dataLog.getPosName(),INITEM_STATUS.NG,msg);
}else{
log.info("获取[" + code + "]的入库库位,条码已有入库任务posname[" + dataLog.getPosName() + "],CACHE_SAME_BARCODE_SETTINGS="+barcodeSet+",当前物料NG,已入库的任务继续完成");
}
......@@ -517,8 +520,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
resultMap.put("result", "98");
resultMap.put("msg", errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,errorMsg);
resultMap.put("posId", dataLog.getPosName());
resultMap.put("plateW", barcode.getPlateSize());
resultMap.put("plateH", barcode.getHeight());
......@@ -552,7 +554,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
resultMap.put("result", "108");
errorMsg = "Serial No.(S)[" + barcode.getBarcode() + "] already have task =["+dataLog.getInOutType()+"] ["+dataLog.getStatus()+"]";
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,errorMsg);
resultMap.put("msg", errorMsg);
log.info("获取[" + code + "]的入库库位,条码已有入库任务posname[" + dataLog.getPosName() + "],的入库任务,任务状态["+dataLog.getStatus()+"],直接NG");
......@@ -562,7 +564,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
resultMap.put("result", "108");
errorMsg = "Serial No.(S)[" + barcode.getBarcode() + "] already have task =["+dataLog.getInOutType()+"] ["+dataLog.getStatus()+"]";
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,errorMsg);
resultMap.put("msg", errorMsg);
log.info("获取[" + code + "]的入库库位,条码已有入库任务posname[" + dataLog.getPosName() + "],的出库任务,任务状态["+dataLog.getStatus()+"],直接NG");
......@@ -695,19 +697,19 @@ public class RobotBoxHandler extends BaseDeviceHandler {
// errorMsg = "[" + barcode.getBarcode() + "]未找到可用的[" + barcode.getPlateSize() + "x" + barcode.getHeight() + "]仓位";
errorMsg = "[" + barcode.getBarcode() + "]Not found available[" + size + "]Position";
resultMap.put("msg", errorMsg);
loadingUtil.updateItemState(barcode.getBarcode(),"",INITEM_STATUS.API001NG,errorMsg);
loadingUtil.updateItemState(barcode.getBarcode(),"",INITEM_STATUS.NG,errorMsg);
}
}
} catch (ValidateException ve) {
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);
loadingUtil.updateItemState(apiBarcode,"", INITEM_STATUS.NG,errorMsg);
}else{
log.info("Failed to find empty storage space:" + errorMsg);
Barcode barcode = new Barcode();
barcode.setBarcode(code);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,errorMsg);
}
resultMap.put("result", "105");
......@@ -733,7 +735,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
Barcode barcode = new Barcode();
barcode.setBarcode(code);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.API001NG,errorMsg);
loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.NG,errorMsg);
resultMap.put("result", "105");
resultMap.put("msg", errorMsg);
......
......@@ -7,6 +7,8 @@ public class INITEM_STATUS {
/**Api001验证失败*/
public static String API001NG="API001NG";
/**其他入库验证NG*/
public static String NG="NG";
/**入库中*/
public static String PutIn="PutIn";
......
......@@ -100,7 +100,7 @@ public class InListItem extends BasePo implements Serializable {
public boolean isEnd() {
return state.equalsIgnoreCase(INITEM_STATUS.Success) || state.equalsIgnoreCase(INITEM_STATUS.Cancel)
|| state.equalsIgnoreCase(INITEM_STATUS.API001NG);
|| state.equalsIgnoreCase(INITEM_STATUS.API001NG) ||state.equalsIgnoreCase(INITEM_STATUS.NG);
}
......@@ -114,7 +114,7 @@ public class InListItem extends BasePo implements Serializable {
}
public boolean isNg() {
return state.equalsIgnoreCase(INITEM_STATUS.API001NG);
return state.equalsIgnoreCase(INITEM_STATUS.API001NG)|| state.equalsIgnoreCase(INITEM_STATUS.NG);
}
public boolean isFailure() {
......
......@@ -131,7 +131,7 @@ public class LoadingUtil {
String mtype = MicronDataCache.GetReelType(barcode.getPlateSize(), barcode.getHeight());
log.info("为入库单[" + inList.getName() + "]增加一条入库信息:barcode[" + barcode.getBarcode() + "],mtype[" + mtype + "],pn[" + barcode.getPartNumber() + "],rfid[" + rfid + "],posName[" + posName + "],s[" + state + "]");
log.info("为入库单[" + inList.getName() + "]增加一条入库信息:barcode[" + barcode.getBarcode() + "],mtype[" + mtype + "],pn[" + barcode.getPartNumber() + "],rfid[" + rfid + "],posName[" + posName + "],s[" + state + "]["+ngMsg+"]");
InListItem item = InListItem.newMItem(inList.getName(), barcode, rfid, posName, state, mtype);
if (inList.getEndRfidList() != null && inList.getEndRfidList().contains(rfid)) {
......@@ -188,19 +188,24 @@ public class LoadingUtil {
inList.getInListItems()) {
if (item.getRi().equals(barcode)) {
if (ObjectUtil.isNotEmpty(posName)) {
item.setPosName(posName);
}
if(item.isEnd()){
log.error(" 库单[" + inList.getName() + "]:条码 [" + item.getRi() + "]库位[" + item.getPosName() + "]当前状态="+ item.getState()+",不更改状态=" + s);
}else{
if (StringUtils.isNotBlank(ngMsg)){
item.setNgMsg(ngMsg);
}
if (ObjectUtil.isNotEmpty(posName)) {
item.setPosName(posName);
}
update = true;
item.setState(s);
item = inListItemManager.save(item);
result = item;
log.info(" 更新入库单[" + inList.getName() + "]:条码 [" + item.getRi() + "]库位[" + item.getPosName() + "]的状态=" + s);
if (StringUtils.isNotBlank(ngMsg)){
item.setNgMsg(ngMsg);
}
update = true;
item.setState(s);
item = inListItemManager.save(item);
result = item;
log.info(" 更新入库单[" + inList.getName() + "]:条码 [" + item.getRi() + "]库位[" + item.getPosName() + "]的状态=" + s);
}
}
inListItems.add(item);
}
......@@ -349,10 +354,10 @@ public class LoadingUtil {
for (InListItem item :
inList.getInListItems()) {
if (item.getRfid().equals(rfid)) {
if (item.getState() == INITEM_STATUS.Success || item.getState() == INITEM_STATUS.API001NG) {
if (item.getState() == INITEM_STATUS.Success || item.isNg()) {
} else {
String newS = INITEM_STATUS.Fail;
String msg="";
String msg=resultMap.get("msg");
if (resultMap.containsKey(item.getRi())) {
String reStr=resultMap.get(item.getRi());
Boolean result = reStr.equalsIgnoreCase("true");
......@@ -361,6 +366,7 @@ public class LoadingUtil {
}
if (result) {
newS = INITEM_STATUS.Success;
msg="";
}else{
if(ObjectUtil.isEmpty(reStr)){
msg=resultMap.get("msg");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!