From 2189c0f53b446cb57111b0f29d887292d0a22262 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Thu, 4 Sep 2025 09:29:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms):=20=E4=BC=98=E5=8C=96=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 WmsInventory 模型中添加仓库名称字段 - 在 WmsInventoryVo 中添加仓库名称字段 - 在 IWmsInventoryService 中添加按库位和物料类型查询库存的新方法 - 优化库存查询 SQL,关联查询仓库名称 --- .../main/java/org/dromara/wms/domain/WmsInventory.java | 10 ++++++++++ .../java/org/dromara/wms/domain/vo/WmsInventoryVo.java | 6 ++++++ .../org/dromara/wms/service/IWmsInventoryService.java | 10 ++++++++++ .../wms/service/impl/WmsInventoryServiceImpl.java | 5 ++++- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java index 0d9af2de..1f5651c8 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java @@ -90,9 +90,17 @@ public class WmsInventory { */ @TableField(fill = FieldFill.INSERT_UPDATE) private Date updateTime; + + + /** + * 仓库名称 + */ + @TableField(exist = false) + private String warehouseName; @TableField(exist = false) private String warehouseCode;//字段映射 + private String materialCode; @TableField(exist = false) private String materialName;//字段映射 @@ -106,6 +114,8 @@ public class WmsInventory { */ @TableField(exist = false) private String materialCategoryName;//字段映射 + + @TableField(exist = false) private String materialUnit;//字段映射 diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryVo.java index eb9f8246..059bfedf 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryVo.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryVo.java @@ -117,6 +117,7 @@ public class WmsInventoryVo implements Serializable { private String unitName;//字段映射 private String materialUnit;//字段映射 private String warehouseId; + private BigDecimal maxStockAmount; private BigDecimal minStockAmount; @@ -129,4 +130,9 @@ public class WmsInventoryVo implements Serializable { // 移库库位 private String newLocationCode; + + /** + * 仓库名称 + */ + private String warehouseName; } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryService.java index 713fe963..12e7cc28 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryService.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryService.java @@ -82,6 +82,16 @@ public interface IWmsInventoryService { TableDataInfo listInventoryAlarm(WmsInventoryBo bo, PageQuery pageQuery); + /** + * 根据库位编码和物料类型查询库存列表 + * 用于盘点任务中按物料类型过滤库存 + * + * @param locationCode 库位编码 + * @param materialTypeId 物料类型ID + * @return 库存列表 + */ + List queryInventoryByLocationAndMaterialType(String locationCode, Long materialTypeId); + /** * 根据批次码查询库存 * @param batchCode 批次码 diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java index 5e2c5937..2bc4d5da 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java @@ -88,6 +88,9 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService { // 关联表查询物料大类名称 .select(BaseMaterialCategory::getMaterialCategoryName) .leftJoin(BaseMaterialCategory.class, BaseMaterialCategory::getMaterialCategoryId, WmsInventory::getMaterialCategoryId) + // 关联表查询仓库 + .select(WmsBaseWarehouse::getWarehouseCode, WmsBaseWarehouse::getWarehouseName) + .leftJoin(WmsBaseWarehouse.class, WmsBaseWarehouse::getWarehouseId, WmsInventory::getStoreId) .eq(bo.getInventoryId() != null, WmsInventory::getInventoryId, bo.getInventoryId()) .eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsInventory::getBatchCode, bo.getBatchCode()) @@ -114,7 +117,7 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService { .select(BaseMaterialCategory::getMaterialCategoryName) .leftJoin(BaseMaterialCategory.class, BaseMaterialCategory::getMaterialCategoryId, WmsInventory::getMaterialCategoryId) // 关联表查询仓库 - .select(WmsBaseWarehouse::getWarehouseCode) + .select(WmsBaseWarehouse::getWarehouseCode, WmsBaseWarehouse::getWarehouseName) .leftJoin(WmsBaseWarehouse.class, WmsBaseWarehouse::getWarehouseId, WmsInventory::getStoreId); lqw.eq(bo.getInventoryId() != null, WmsInventory::getInventoryId, bo.getInventoryId());