From f9fb210047651f78cf7b8aa91e98ecb0647ebee8 Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Fri, 27 Feb 2026 13:59:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E4=BD=8D=E5=AE=8C=E6=88=90=E5=90=8E?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E4=B8=8A=E7=9A=84=E8=B4=A7=E4=B8=BB=E3=80=81?= =?UTF-8?q?=E5=87=80=E9=87=8D=E3=80=81=E6=AF=9B=E9=87=8D=E3=80=81=E4=BD=93?= =?UTF-8?q?=E7=A7=AF=E3=80=81=E9=9D=A2=E7=A7=AF=E9=83=BD=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BA=86bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../persistence/MaterialInventoryImpl.java | 25 +++++++++++++++---- .../service/ShiftManageDomainService.java | 10 +++++++- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java index f6573dbbf..d4d6c2f92 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java @@ -1,6 +1,7 @@ package com.mhd.wms.domain.materialInventory.repository.persistence; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mhd.common.core.exception.ServiceException; @@ -24,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.util.*; @@ -161,7 +163,7 @@ public class MaterialInventoryImpl extends ServiceImpl materialInventoryAddNowMap = new HashMap<>(); // 批量获取物料基础信息,以获取货主ID(用于查询和key生成) - Map materialBaseInfoIdToShipperIdMap = new HashMap<>(); + Map materialBaseInfoIdToShipperIdMap = new HashMap<>(); if (!CollectionUtils.isEmpty(materialInventoryDOList)) { Set materialBaseInfoIds = new HashSet<>(); for (MaterialInventoryDO materialInventoryDO : materialInventoryDOList) { @@ -178,7 +180,8 @@ public class MaterialInventoryImpl extends ServiceImpl wrapper = - new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper() + LambdaQueryWrapper wrapper = + new LambdaQueryWrapper() .eq(MaterialInventory::getStorageLocationId, materialInventoryDO.getStorageLocationId()) .eq(MaterialInventory::getMaterialBaseInfoId, materialInventoryDO.getMaterialBaseInfoId()) .eq(MaterialInventory::getDelFlag, 1); @@ -228,6 +237,12 @@ public class MaterialInventoryImpl extends ServiceImpl shiftMaterialDetailPOList = shiftMaterialDetailService.queryListChildren(shiftMaterialDetailDO); for (ShiftMaterialDetailPO shiftMaterialDetailPO : shiftMaterialDetailPOList){ + MaterialInventory materialInventoryOldDb = materialInventoryService.getById(shiftMaterialDetailPO.getMaterialInventoryId()); BigDecimal shiftQuantity = shiftMaterialDetailPO.getShiftQuantity(); //构建新物料库存信息 + shiftMaterialDetailPO.setNetWeight(materialInventoryOldDb.getNetWeight()); + shiftMaterialDetailPO.setGrossWeight(materialInventoryOldDb.getGrossWeight()); + shiftMaterialDetailPO.setVolume(materialInventoryOldDb.getVolume()); + shiftMaterialDetailPO.setArea(materialInventoryOldDb.getArea()); materialInventoryNowList.add(genMaterialInventory(shiftMaterialDetailPO)); List shiftMaterialDetailPOChildrenList = shiftMaterialDetailPO.getChildren(); for (ShiftMaterialDetailPO shiftMaterialDetailPOChildren : shiftMaterialDetailPOChildrenList){ @@ -428,7 +433,6 @@ public class ShiftManageDomainService { //构建新物料库存信息 materialInventoryNowList.add(genMaterialInventory(shiftMaterialDetailPOChildren)); }; - MaterialInventory materialInventoryOldDb = materialInventoryService.getById(shiftMaterialDetailPO.getMaterialInventoryId()); if (materialInventoryOldDb.getInventoryQuantity().compareTo(shiftQuantity) < 0){ throw new ServiceException("物料原库位下的物料库存不足,不能进行移位"); } @@ -525,6 +529,10 @@ public class ShiftManageDomainService { materialInventoryDONow.setContainerTypeName(shiftMaterialDetailPO.getContainerTypeName()); materialInventoryDONow.setInventoryQuantity(shiftMaterialDetailPO.getShiftQuantity()); materialInventoryDONow.setAllocationQuantity(shiftMaterialDetailPO.getShiftQuantity()); + materialInventoryDONow.setNetWeight(shiftMaterialDetailPO.getNetWeight()); + materialInventoryDONow.setGrossWeight(shiftMaterialDetailPO.getGrossWeight()); + materialInventoryDONow.setVolume(shiftMaterialDetailPO.getVolume()); + materialInventoryDONow.setArea(shiftMaterialDetailPO.getArea()); materialInventoryDONow.setOrganizationId(loginUser.getUserPo().getOrganizationId()); materialInventoryDONow.setOrganizationName(loginUser.getUserPo().getOrganizationName()); materialInventoryDONow.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());