Commit 6a720178 LN

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

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