From 89e2ec3f3f2dc863f69626142d0100853c021aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Sat, 14 Mar 2026 21:11:29 +0800 Subject: [PATCH] =?UTF-8?q?PDA=E5=A4=8D=E6=A0=B8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShiftManageApplicationService.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/shiftManage/ShiftManageApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/shiftManage/ShiftManageApplicationService.java index b37b23248..261ea7177 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/shiftManage/ShiftManageApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/shiftManage/ShiftManageApplicationService.java @@ -741,6 +741,22 @@ public class ShiftManageApplicationService { if (CollectionUtils.isEmpty(shiftMoveMaterialQuantityList)){ continue; } + // 兼容:容器移位通常只有一个目标库位,若部分子项未传 newStorageLocationId,从同组第一个有值的子项复制 + ShiftMoveMaterialQuantityPO firstWithTarget = shiftMoveMaterialQuantityList.stream() + .filter(c -> c.getNewStorageLocationId() != null && c.getNewStorageLocationId() > 0) + .findFirst().orElse(null); + if (firstWithTarget != null) { + shiftMoveMaterialQuantityList.forEach(c -> { + if (c.getNewStorageLocationId() == null || c.getNewStorageLocationId() <= 0) { + c.setNewStorageLocationId(firstWithTarget.getNewStorageLocationId()); + c.setNewStorageSectionId(firstWithTarget.getNewStorageSectionId()); + c.setNewStorageCode(firstWithTarget.getNewStorageCode()); + c.setNewStorageName(firstWithTarget.getNewStorageName()); + c.setNewStorageLocationCode(firstWithTarget.getNewStorageLocationCode()); + c.setNewStorageLocationName(firstWithTarget.getNewStorageLocationName()); + } + }); + } shiftMoveMaterialQuantityList.forEach(shiftMoveMaterialQuantityPO -> { Long newStorageLocationId = shiftMoveMaterialQuantityPO.getNewStorageLocationId(); if (newStorageLocationId == null || newStorageLocationId <= 0) {