Commit 0e1f94f9 LN

同条码入库功能修改

1 个父辈 7a944d7c
...@@ -207,6 +207,22 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -207,6 +207,22 @@ public class BaseDeviceHandler implements IDeviceHandler {
for (DataLog task : taskService.getQueueTasks()) { for (DataLog task : taskService.getQueueTasks()) {
if (task.getBarcode().equals(barcodeSave.getBarcode())) { if (task.getBarcode().equals(barcodeSave.getBarcode())) {
//同条码,且同料仓的入库任务 //同条码,且同料仓的入库任务
if(task.isPutInTask()){
//判断原任务是否需要NG
Integer barcodeSet=dataCache.getCache(Constants.CACHE_SAME_BARCODE_SETTINGS);
if(barcodeSet==null||barcodeSet==1) {
//原任务标记NG
task.setNgReel(true);
log.info("获取[" + barcodeSave.getBarcode() + "]的入库库位,条码已有入库任务posname[" + task.getPosName() + "],标记入库任务为NG,入库后自动出库");
taskService.updateQueueTask(task);
}else{
log.info("获取[" + barcodeSave.getBarcode() + "]的入库库位,条码已有入库任务posname[" + task.getPosName() + "],CACHE_SAME_BARCODE_SETTINGS="+barcodeSet+",当前物料NG,已入库的任务继续完成");
}
throw new ValidateException("smfcore.error.barcode.hastask","Serial No.(S)[0] already have storage task", new String[]{barcodeSave.getBarcode()});
// errorMsg = "Serial No.(S)[" + barcode.getBarcode() + "] already have storage task";
// return resultMap;
}
if (task.isPutInTask() && task.getCid().equals(statusBean.getCid())) { if (task.isPutInTask() && task.getCid().equals(statusBean.getCid())) {
putInTask = task; putInTask = task;
} else { } else {
...@@ -398,7 +414,7 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -398,7 +414,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
public Barcode verifyBarcodePutIn(List<Storage> storageList, Barcode barcodeSave) throws ValidateException { public Barcode verifyBarcodePutIn(List<Storage> storageList, Barcode barcodeSave) throws ValidateException {
if (barcodeSave == null) { if (barcodeSave == null) {
throw new ValidateException("条码无效", "无效的条码" ); throw new ValidateException("条码无效", "无效的条码");
} }
Date expireDate = barcodeSave.getExpireDate(); Date expireDate = barcodeSave.getExpireDate();
...@@ -420,39 +436,65 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -420,39 +436,65 @@ public class BaseDeviceHandler implements IDeviceHandler {
} }
} }
if(!canPutIn){ if (!canPutIn) {
throw new ValidateException("smfcore.error.barcode.wrongSize","尺寸[{0}]不符", new String[]{w + "x" + h}); throw new ValidateException("smfcore.error.barcode.wrongSize", "尺寸[{0}]不符", new String[]{w + "x" + h});
} }
if (barcodeSave.getAmount() <= 0) { if (barcodeSave.getAmount() <= 0) {
throw new ValidateException("smfcore.error.barcode.wrongQty", "条码[{0}]对应的数量<=0为: {1}" , new String[]{barcodeSave.getBarcode(), barcodeSave.getAmount() + ""}); throw new ValidateException("smfcore.error.barcode.wrongQty", "条码[{0}]对应的数量<=0为: {1}", new String[]{barcodeSave.getBarcode(), barcodeSave.getAmount() + ""});
} }
// if(barcodeSave.getPlateSize() <=0 || barcodeSave.getHeight() <= 0){ // if(barcodeSave.getPlateSize() <=0 || barcodeSave.getHeight() <= 0){
// throw new ValidateException("无法入库,请先设置料盘尺寸"); // throw new ValidateException("无法入库,请先设置料盘尺寸");
// } // }
//判斷配置
Integer barcodeSet = dataCache.getCache(Constants.CACHE_SAME_BARCODE_SETTINGS);
StoragePos pos = storagePosManager.getByBarcode(barcodeSave.getBarcode()); StoragePos pos = storagePosManager.getByBarcode(barcodeSave.getBarcode());
if (pos != null) { if (pos != null) {
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
throw new ValidateException("smfcore.error.barcode.inStorage", "[ " + barcodeSave.getBarcode() + "]已在" + storage.getName() + "[" + pos.getPosName() + "]中", new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()}); if (barcodeSet == null || barcodeSet == 1) {
//如果已在库位中,那么自动将该库位的物料出库
log.info("CACHE_SAME_BARCODE_SETTINGS=1,自动出库已在库位中的物料[" + barcodeSave.getBarcode() + "],设置ngReel=true");
taskService.checkout(storage, pos, true, true, "", "");
} else {
log.info("CACHE_SAME_BARCODE_SETTINGS=2,标记库位[" + pos.getPosName() + "]中的物料[" + barcodeSave.getBarcode() + "]为ngReel=NG");
pos.getBarcode().updateAppendData("ngReel", true);
storagePosManager.save(pos);
}
throw new ValidateException("smfcore.error.barcode.exist", "[{0}}]已在{1}}[{2}}]中", new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()});
} }
// if (pos != null) {
// Storage storage = dataCache.getStorageById(pos.getStorageId());
// throw new ValidateException("smfcore.error.barcode.inStorage", "[ " + barcodeSave.getBarcode() + "]已在" + storage.getName() + "[" + pos.getPosName() + "]中", new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()});
// }
for (DataLog task : taskService.getQueueTasks()) { for (DataLog task : taskService.getQueueTasks()) {
if(task.isFinished()||task.isCancel()){ if (task.isFinished() || task.isCancel()) {
continue; continue;
} }
if (task.isPutInTask()) { if (task.isPutInTask()) {
if (task.getBarcode().equals(barcodeSave.getBarcode())) { if (task.getBarcode().equals(barcodeSave.getBarcode())) {
//同一个条码的入库任务 // //同一个条码的入库任务
for (Storage storage : storageList) { // for (Storage storage : storageList) {
if (task.getStorageId().equals(storage.getId())) { // if (task.getStorageId().equals(storage.getId())) {
return barcodeSave; // return barcodeSave;
} // }
// }
// log.error("料盘["+barcodeSave.getBarcode()+"]的入库操作["+task.getPosName()+"]未完成,无法执行入库操作");
// throw new ValidateException("smfcore.error.barcode.taskNotEnd", "料盘[{0}]的操作未完成,无法执行入库操作", new String[]{barcodeSave.getBarcode()});
if (barcodeSet == null || barcodeSet == 1) {
//原任务标记NG
task.setNgReel(true);
log.info("获取[" + barcodeSave.getBarcode() + "]的入库库位,条码已有入库任务posname[" + task.getPosName() + "],标记入库任务为NG,入库后自动出库");
taskService.updateQueueTask(task);
} else {
log.info("获取[" + barcodeSave.getBarcode() + "]的入库库位,条码已有入库任务posname[" + task.getPosName() + "],CACHE_SAME_BARCODE_SETTINGS=" + barcodeSet + ",当前物料NG,已入库的任务继续完成");
} }
log.error("料盘["+barcodeSave.getBarcode()+"]的入库操作["+task.getPosName()+"]未完成,无法执行入库操作"); throw new ValidateException("smfcore.error.barcode.hastask", "Serial No.(S)[0] already have storage task", new String[]{barcodeSave.getBarcode()});
throw new ValidateException("smfcore.error.barcode.taskNotEnd", "料盘[{0}]的操作未完成,无法执行入库操作", new String[]{barcodeSave.getBarcode()});
} }
} }
} }
......
...@@ -358,6 +358,7 @@ smfcore.api.error=api.error: error={0},message={1},detial={2} ...@@ -358,6 +358,7 @@ smfcore.api.error=api.error: error={0},message={1},detial={2}
smfcore.api.toXray={0}\u9700\u8981\u53BB\u70B9\u6599 smfcore.api.toXray={0}\u9700\u8981\u53BB\u70B9\u6599
smfcore.paretoChart=\u5E15\u7D2F\u6258\u56FE smfcore.paretoChart=\u5E15\u7D2F\u6258\u56FE
smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1 smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1
smfcore.error.barcode.hastask=\u6761\u7801[0]\u5DF2\u6709\u5165\u5E93\u4EFB\u52A1
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0} #smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1} #smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F #smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
......
...@@ -356,4 +356,5 @@ smfcore.api.fail={0} Failed to get data ...@@ -356,4 +356,5 @@ smfcore.api.fail={0} Failed to get data
smfcore.micron.apiClose=Not yet open smfcore.micron.apiClose=Not yet open
smfcore.api.toXray={0}Need to Xray smfcore.api.toXray={0}Need to Xray
smfcore.paretoChart=Pareto chart smfcore.paretoChart=Pareto chart
smfcore.selfAudit.hasOutTask=The location [{0}] already has a release task
\ No newline at end of file \ No newline at end of file
smfcore.selfAudit.hasOutTask=The location [{0}] already has a release task
smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task
\ No newline at end of file \ No newline at end of file
...@@ -351,4 +351,5 @@ smfcore.micron.nodata=\u672A\u627E\u5230\u4FE1\u606F ...@@ -351,4 +351,5 @@ smfcore.micron.nodata=\u672A\u627E\u5230\u4FE1\u606F
smfcore.api.fail={0} Failed to get data smfcore.api.fail={0} Failed to get data
smfcore.micron.apiClose=Not yet open smfcore.micron.apiClose=Not yet open
smfcore.paretoChart=\u30D1\u30EC\u30FC\u30C8\u56F3 smfcore.paretoChart=\u30D1\u30EC\u30FC\u30C8\u56F3
smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1
\ No newline at end of file \ No newline at end of file
smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1
smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task
\ No newline at end of file \ No newline at end of file
...@@ -351,4 +351,5 @@ smfcore.micron.nodata=\u672A\u627E\u5230\u4FE1\u606F ...@@ -351,4 +351,5 @@ smfcore.micron.nodata=\u672A\u627E\u5230\u4FE1\u606F
smfcore.api.fail={0} \u83B7\u53D6\u6570\u636E\u5931\u8D25 smfcore.api.fail={0} \u83B7\u53D6\u6570\u636E\u5931\u8D25
smfcore.micron.apiClose=API\u529F\u80FD\u672A\u5F00\u653E smfcore.micron.apiClose=API\u529F\u80FD\u672A\u5F00\u653E
smfcore.paretoChart=\u5E15\u7D2F\u6258\u56FE smfcore.paretoChart=\u5E15\u7D2F\u6258\u56FE
smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1
\ No newline at end of file \ No newline at end of file
smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1
smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task
\ No newline at end of file \ No newline at end of file
...@@ -336,6 +336,7 @@ smfcore.selfAudit.notExist=\u672A\u627E\u5230\u6279\u6B21\u865F[{0}]\u7684\u76E4 ...@@ -336,6 +336,7 @@ smfcore.selfAudit.notExist=\u672A\u627E\u5230\u6279\u6B21\u865F[{0}]\u7684\u76E4
smfcore.selfAudit.hasEnd=[{0}]\u76E4\u9EDE\u5DF2\u5B8C\u6210 smfcore.selfAudit.hasEnd=[{0}]\u76E4\u9EDE\u5DF2\u5B8C\u6210
smfcore.selfAudit.notFind=\u672A\u627E\u5230\u76E4\u9EDE\u4FE1\u606F smfcore.selfAudit.notFind=\u672A\u627E\u5230\u76E4\u9EDE\u4FE1\u606F
smfcore.selfAudit.pause=\u76E4\u9EDE{0}\u5DF2\u66AB\u505C smfcore.selfAudit.pause=\u76E4\u9EDE{0}\u5DF2\u66AB\u505C
smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task
smfcore.updatePass.hasNoAccess=\u6C92\u6709\u64CD\u4F5C\u6B0A\u9650 smfcore.updatePass.hasNoAccess=\u6C92\u6709\u64CD\u4F5C\u6B0A\u9650
smfcore.selfAudit.noPos=\u76E4\u9EDE{0}\u672A\u627E\u5230\u5EAB\u4F4D\u865F smfcore.selfAudit.noPos=\u76E4\u9EDE{0}\u672A\u627E\u5230\u5EAB\u4F4D\u865F
smfcore.task.updatePutInFail=\u5165\u5EAB\u4EFB\u52D9{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72C0\u614B\u70BA{2} smfcore.task.updatePutInFail=\u5165\u5EAB\u4EFB\u52D9{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72C0\u614B\u70BA{2}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!