feat(wms): 优化库存查询接口并添加新功能

- 在 WmsInventory 模型中添加仓库名称字段
- 在 WmsInventoryVo 中添加仓库名称字段
- 在 IWmsInventoryService 中添加按库位和物料类型查询库存的新方法
- 优化库存查询 SQL,关联查询仓库名称
hwmom-htk
zangch@mesnac.com 4 months ago
parent 3059c90936
commit 2189c0f53b

@ -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;//字段映射

@ -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;
}

@ -82,6 +82,16 @@ public interface IWmsInventoryService {
TableDataInfo<WmsInventoryVo> listInventoryAlarm(WmsInventoryBo bo, PageQuery pageQuery);
/**
*
*
*
* @param locationCode
* @param materialTypeId ID
* @return
*/
List<WmsInventoryVo> queryInventoryByLocationAndMaterialType(String locationCode, Long materialTypeId);
/**
*
* @param batchCode

@ -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());

Loading…
Cancel
Save