Commit 6a720178 LN

入库单未找到任务时返回失败

1 个父辈 f8b99238
...@@ -177,7 +177,7 @@ public class SpSpareNoController { ...@@ -177,7 +177,7 @@ public class SpSpareNoController {
} }
if (!spareNo.isExecuting()) { if (!spareNo.isExecuting()) {
return ResultBean.newErrorResult(-1, "", spareNoStr + "不是正在执行中,不允许放弃"); return ResultBean.newErrorResult(-1, "", spareNoStr + "入库单正在执行中,不允许放弃");
} }
spareNo.setSpareStatus(SpareNostatus.ABANDON_STATUS); spareNo.setSpareStatus(SpareNostatus.ABANDON_STATUS);
......
...@@ -315,14 +315,14 @@ public class SpareNoCache { ...@@ -315,14 +315,14 @@ public class SpareNoCache {
boxTypes.add("CM"); boxTypes.add("CM");
for (String type : for (String type :
boxTypes) { boxTypes) {
if(type==""){ if (type == "") {
emptyPos = storagePosManager.findEmptyBoxToPut(storageIdList, excludePosIds, dataCache.getCheckOutType(),baseNo.getWhCode().trim()); emptyPos = storagePosManager.findEmptyBoxToPut(storageIdList, excludePosIds, dataCache.getCheckOutType(), baseNo.getWhCode().trim());
}else{ } else {
int count = SpBoxUtil.GetBoxSubCount(type); int count = SpBoxUtil.GetBoxSubCount(type);
emptyPos = storagePosManager.findEmptyBoxToPutIn(storageIdList, excludePosIds, dataCache.getCheckOutType(), type, count,baseNo.getWhCode().trim()); emptyPos = storagePosManager.findEmptyBoxToPutIn(storageIdList, excludePosIds, dataCache.getCheckOutType(), type, count, baseNo.getWhCode().trim());
} }
emptyBox = emptyPos.getBarcode();
if (emptyPos != null) { if (emptyPos != null) {
emptyBox = emptyPos.getBarcode();
newPn.setBarcode(emptyBox.getBarcode() + "-" + (emptyBox.getSubCodeList() == null ? 1 : emptyBox.getSubCodeList().size())); newPn.setBarcode(emptyBox.getBarcode() + "-" + (emptyBox.getSubCodeList() == null ? 1 : emptyBox.getSubCodeList().size()));
// newPn = barcodeManager.save(newPn); // newPn = barcodeManager.save(newPn);
newPn = barcodeManager.saveBarcode(newPn); newPn = barcodeManager.saveBarcode(newPn);
...@@ -335,7 +335,7 @@ public class SpareNoCache { ...@@ -335,7 +335,7 @@ public class SpareNoCache {
emptyBox.setOut(false); emptyBox.setOut(false);
emptyBox.setStatus(BARCODE_STATUS.IN_STORE); emptyBox.setStatus(BARCODE_STATUS.IN_STORE);
emptyPos.setBarcode(emptyBox); emptyPos.setBarcode(emptyBox);
needOutPos.put(emptyPos.getPosName(),emptyPos); needOutPos.put(emptyPos.getPosName(), emptyPos);
log.info("入库单" + orderNo + ", Pn=" + pn + "," + type + "查找到有空格口料箱=" + emptyPos.getPosName() + ",料箱号=" + emptyBox.getBarcode() + ",格口号=" + newPn.getBarcode() + ",需要入库数量=" + detail.getInQty()); log.info("入库单" + orderNo + ", Pn=" + pn + "," + type + "查找到有空格口料箱=" + emptyPos.getPosName() + ",料箱号=" + emptyBox.getBarcode() + ",格口号=" + newPn.getBarcode() + ",需要入库数量=" + detail.getInQty());
break; break;
...@@ -348,7 +348,8 @@ public class SpareNoCache { ...@@ -348,7 +348,8 @@ public class SpareNoCache {
} }
//开始生成出库任务 //开始生成出库任务
int index = 1; int index = 0;
if(needOutPos.size()>0) {
for (StoragePos pos : needOutPos.values() for (StoragePos pos : needOutPos.values()
) { ) {
Barcode barcode = pos.getBarcode(); Barcode barcode = pos.getBarcode();
...@@ -377,10 +378,15 @@ public class SpareNoCache { ...@@ -377,10 +378,15 @@ public class SpareNoCache {
} }
index++; index++;
} }
}
//如果未找到任务,直接结束
else{
return "未找到可执行的任务";
}
} catch (Exception exception) { } catch (Exception exception) {
log.error("执行ReturnInventoryNo 出错: " + exception.toString()); log.error("执行ReturnInventoryNo 出错: " ,exception);
exception.printStackTrace(); exception.printStackTrace();
} }
return ""; return "";
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!