From ebc7bee5be08677a2134fc861ad039e0e622e3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Wed, 22 Jul 2026 22:06:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=9131?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/ReservationStockInOrderMapper.java | 4 +++- .../ReservationStockInOrderImpl.java | 23 +++++++++++++++---- mhd_oms/src/main/resources/bootstrap.yml | 4 ++-- .../ReservationStockInOrderMapper.xml | 8 ++++--- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/mapper/ReservationStockInOrderMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/mapper/ReservationStockInOrderMapper.java index d2c956a0c..04cdbdd8b 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/mapper/ReservationStockInOrderMapper.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/mapper/ReservationStockInOrderMapper.java @@ -2,6 +2,7 @@ package com.mhd.oms.domain.reservationStockInOrder.repository.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO; import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder; import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO; import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialGoodsRulePO; @@ -30,13 +31,14 @@ public interface ReservationStockInOrderMapper extends BaseMapper getMaterialBaseInfoList(@Param("id") String id); public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@Param("id") Long id); public MaterialGoodsRulePO getGoodsInfoByMaterialBaseInfoIds(@Param("id") Long id); + public List getkcId(@Param("id") Long id, @Param("q") BigDecimal q); public String getUserNcCode(@Param("id") Long id); diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java index ee11a2413..0584639a8 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java @@ -20,6 +20,7 @@ import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IRese import com.mhd.oms.domain.reservationInMaterialDetail.repository.facade.IReservationInMaterialDetailService; import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO; import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReservationInMaterialDetailDO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.facade.IReservationOutMaterialDetailService; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.todo.ReservationOutMaterialDetailDO; import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder; @@ -192,7 +193,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl> shipperIds = new ArrayList<>(); Set processedShipperIds = new HashSet<>(); for (ProductDetail productDetail : productDetailList) { - MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode()); + MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode(),loginUser.getUserPo().getOrganizationId()); if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) { Long shipperId = materialBaseInfoPO.getShipperId(); if (processedShipperIds.add(shipperId)) { @@ -254,9 +255,23 @@ public class ReservationStockInOrderImpl extends ServiceImpl reservationMaterialInventoryPOS = stockInOrderMapper.getkcId(materialBaseInfoId, new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP)); + if (reservationMaterialInventoryPOS != null&&reservationMaterialInventoryPOS.size() > 0) { + ReservationMaterialInventoryPO reservationMaterialInventoryPO = reservationMaterialInventoryPOS.get(0); + Long materialInventoryId = reservationMaterialInventoryPO.getMaterialInventoryId(); + String batchNumber = reservationMaterialInventoryPO.getBatchNumber(); + String lotNumber = reservationMaterialInventoryPO.getLotNumber(); + reservationOutMaterialDetailDO.setMaterialInventoryId(materialInventoryId); + reservationOutMaterialDetailDO.setBatchNumber(batchNumber); + reservationOutMaterialDetailDO.setLotNo(lotNumber); + } else { + throw new RuntimeException("物料批次库存数量少于出库数量!"); + } reservationOutMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId()); reservationOutMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode()); reservationOutMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName()); @@ -360,7 +375,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl> shipperIds = new ArrayList<>(); Set processedShipperIds = new HashSet<>(); for (StockInProductDetail productDetail : productDetailList) { - MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode()); + MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode(),loginUser.getUserPo().getOrganizationId()); if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) { Long shipperId = materialBaseInfoPO.getShipperId(); if (processedShipperIds.add(shipperId)) { @@ -412,7 +427,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_NAME = #{name} - + select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_CODE = #{code} and ORGANIZATION_ID = #{orgId} select * from "NGWL_TEST_WMS".MATERIAL_GOODS_RULE where 1 = 1 and DEL_FLAG = 1 and MATERIAL_BASE_INFO_ID = #{id} - +