Commit 279f3b69 zshaohui

单据领料修改

1 个父辈 c3faa96a
......@@ -1248,21 +1248,21 @@ public class LiteOrderCache {
int taskReelCount = 0;
//如果是hold的,判断有没有符合的条件
List<StoragePos> storagePosList = new ArrayList<>();
if (isHold) {
List<StoragePos> holdPosList = new ArrayList<>();
List<String> holdPosIdList = new ArrayList<>();
for (LiteOrderItem orderItem : cacheOrder.getOrderItems()) {
List<FetchHoldInfoResult> resultList = LuxsanApi.fetchHoldInfo(new FetchHoldInfoRequest(CommonUtil.plantCode, orderItem.getSrcWarehouse(), orderItem.getPn()));
if (resultList != null && !resultList.isEmpty()) {
List<String> palletIdList = resultList.stream().map(FetchHoldInfoResult::getPALLET_ID).collect(Collectors.toList());
List<Criteria> orCriterialList = Lists.newArrayList();
orCriterialList.add(Criteria.where("barcode.barcode").in(palletIdList));
orCriterialList.add(Criteria.where("barcode.palletId").is(palletIdList));
orCriterialList.add(Criteria.where("barcode.palletId").in(palletIdList));
Criteria c = new Criteria().orOperator(orCriterialList);
List<StoragePos> posList = storagePosManager.findByQuery(new Query(c));
if (posList != null && !posList.isEmpty()){
if (posList != null && !posList.isEmpty()) {
for (StoragePos pos : posList) {
storagePosList.add(pos);
}
holdPosList.add(pos);
holdPosIdList.add(pos.getId());
}
}
}
......@@ -1270,6 +1270,7 @@ public class LiteOrderCache {
for (LiteOrderItem orderItem : cacheOrder.getOrderItems()) {
String partNumber = orderItem.getPn();
......@@ -1286,13 +1287,14 @@ public class LiteOrderCache {
StoragePos pos = null;
String loc = TaskLocUtil.MW;
if (isHold) {
if (storagePosList != null && !storagePosList.isEmpty()) {
for (StoragePos storagePos : storagePosList) {
if (holdPosList != null && !holdPosList.isEmpty()) {
for (StoragePos storagePos : holdPosList) {
if (excludePosIds.contains(storagePos.getId())) {
continue;
}
if (partNumber.equals(storagePos.getBarcode().getPartNumber())) {
if (orderItem.getSrcWarehouse().equals(storagePos.getBarcode().getWarehouseCode())) {
Barcode barcode = storagePos.getBarcode();
if (partNumber.equals(barcode.getPartNumber())) {
if (orderItem.getSrcWarehouse().equals(barcode.getWarehouseCode())) {
pos = storagePos;
break;
}
......@@ -1300,6 +1302,7 @@ public class LiteOrderCache {
}
}
} else {
excludePosIds.addAll(holdPosIdList);
pos = storagePosManager.findPartNumberInStorages(storageIdList, partNumber, excludePosIds, checkoutType, orderItem.getBrand(),orderItem.getSrcWarehouse());
}
if (pos == null) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!