Commit d8f273dd LN

1

1 个父辈 614d16c2
...@@ -179,7 +179,7 @@ public class SpareNoCache { ...@@ -179,7 +179,7 @@ public class SpareNoCache {
return "已在执行中"; return "已在执行中";
} }
log.info("开始执行 入库单 [" +orderNo + "] "); log.info("开始执行 入库单 [" + orderNo + "] ");
List<StoragePos> needOutPos = new ArrayList<>(); List<StoragePos> needOutPos = new ArrayList<>();
List<String> storageIdList = new ArrayList<>(); List<String> storageIdList = new ArrayList<>();
...@@ -187,6 +187,8 @@ public class SpareNoCache { ...@@ -187,6 +187,8 @@ public class SpareNoCache {
storageIdList.add(storage.getId()); storageIdList.add(storage.getId());
} }
//先查找pn存在的箱子
List<SpareNoDetail> noPnDetial = new ArrayList<>();
for (SpareNoDetail detail : baseNo.getDetailList()) { for (SpareNoDetail detail : baseNo.getDetailList()) {
String pn = detail.getPartno(); String pn = detail.getPartno();
...@@ -202,7 +204,7 @@ public class SpareNoCache { ...@@ -202,7 +204,7 @@ public class SpareNoCache {
if (subBarcode.getPartNumber().equals(pn)) { if (subBarcode.getPartNumber().equals(pn)) {
subBarcode.setOut(false); subBarcode.setOut(false);
subBarcode.updateExtraData("needInNum", detail.getInQty() + ""); subBarcode.updateExtraData("needInNum", detail.getInQty() + "");
log.info("入库单" + orderNo+ ", Pn=" + pn + ",查找到库位号=" + pos.getPosName() + ",料箱号=" + boxBarcode.getBarcode() + ",格口号=" + subBarcode.getBarcode() + ",需要入库数量=" + detail.getInQty()); log.info("入库单" + orderNo + ", Pn=" + pn + ",查找到库位号=" + pos.getPosName() + ",料箱号=" + boxBarcode.getBarcode() + ",格口号=" + subBarcode.getBarcode() + ",需要入库数量=" + detail.getInQty());
} }
} }
boxBarcode.setOut(false); boxBarcode.setOut(false);
...@@ -210,7 +212,15 @@ public class SpareNoCache { ...@@ -210,7 +212,15 @@ public class SpareNoCache {
needOutPos.add(pos); needOutPos.add(pos);
} else { } else {
noPnDetial.add(detail);
}
}
//PN不存在,需要查找空箱
for (SpareNoDetail detail : noPnDetial) {
String pn = detail.getPartno();
Barcode newPn = new Barcode(); Barcode newPn = new Barcode();
newPn.setPn(pn); newPn.setPn(pn);
newPn.setAmount(0); newPn.setAmount(0);
...@@ -237,10 +247,10 @@ public class SpareNoCache { ...@@ -237,10 +247,10 @@ public class SpareNoCache {
List<Barcode> subL = emptyBox.getSubCodeList(); List<Barcode> subL = emptyBox.getSubCodeList();
subL.add(newPn); subL.add(newPn);
emptyBox.setSubCodeList(subL); emptyBox.setSubCodeList(subL);
log.info("入库单" + orderNo + ", Pn=" + pn + ",使用料箱的空格口=" + pos.getPosName() + ",料箱号=" + emptyBox.getBarcode() + ",格口号=" + newPn.getBarcode() + ",需要入库数量=" + detail.getInQty()); log.info("入库单" + orderNo + ", Pn=" + pn + ",使用料箱的空格口=" + emptyPos.getPosName() + ",料箱号=" + emptyBox.getBarcode() + ",格口号=" + newPn.getBarcode() + ",需要入库数量=" + detail.getInQty());
} else { } else {
excludePosIds = taskService.excludePosIds(); Collection<String> excludePosIds = taskService.excludePosIds();
//寻找一个空格口 //寻找一个空格口
List<String> boxTypes = new ArrayList<>(); List<String> boxTypes = new ArrayList<>();
boxTypes.add("CS"); boxTypes.add("CS");
...@@ -251,7 +261,7 @@ public class SpareNoCache { ...@@ -251,7 +261,7 @@ public class SpareNoCache {
int count = SpBoxUtil.GetBoxSubCount(type); int count = SpBoxUtil.GetBoxSubCount(type);
emptyPos = storagePosManager.findEmptyBoxToPutIn(storageIdList, pn, excludePosIds, dataCache.getCheckOutType(), type, count); emptyPos = storagePosManager.findEmptyBoxToPutIn(storageIdList, pn, excludePosIds, dataCache.getCheckOutType(), type, count);
emptyBox = emptyPos.getBarcode(); emptyBox = emptyPos.getBarcode();
if (pos != null) { if (emptyPos != null) {
newPn.setBarcode(emptyBox.getBarcode() + "-" + emptyBox.getSubCodeList().size()); newPn.setBarcode(emptyBox.getBarcode() + "-" + emptyBox.getSubCodeList().size());
newPn = barcodeManager.saveBarcode(newPn); newPn = barcodeManager.saveBarcode(newPn);
List<Barcode> subL = emptyBox.getSubCodeList(); List<Barcode> subL = emptyBox.getSubCodeList();
...@@ -259,8 +269,8 @@ public class SpareNoCache { ...@@ -259,8 +269,8 @@ public class SpareNoCache {
emptyBox.setSubCodeList(subL); emptyBox.setSubCodeList(subL);
emptyBox.setOut(false); emptyBox.setOut(false);
emptyBox.setStatus(BARCODE_STATUS.IN_STORE); emptyBox.setStatus(BARCODE_STATUS.IN_STORE);
needOutPos.add(pos); needOutPos.add(emptyPos);
log.info("入库单" + orderNo + ", Pn=" + pn + "," + type + "查找到有空格口料箱=" + pos.getPosName() + ",料箱号=" + emptyBox.getBarcode() + ",格口号=" + newPn.getBarcode() + ",需要入库数量=" + detail.getInQty()); log.info("入库单" + orderNo + ", Pn=" + pn + "," + type + "查找到有空格口料箱=" + emptyPos.getPosName() + ",料箱号=" + emptyBox.getBarcode() + ",格口号=" + newPn.getBarcode() + ",需要入库数量=" + detail.getInQty());
break; break;
} else { } else {
...@@ -268,8 +278,6 @@ public class SpareNoCache { ...@@ -268,8 +278,6 @@ public class SpareNoCache {
} }
} }
}
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!