fix(wms 库存模块): 修复库存查询各页签分组维度不符合需求的问题
1. queryListByWl(物料查询):原按单物料分组会把同一物料跨仓库库存合并成一行,丢失仓库维度。子查询 partition by 增加 warehouse_id、join 增加 warehouse_id 关联、外层 GROUP BY 增加 warehouse_id,改为按"物料+仓库"汇总。 2. queryListByWlKw(物料/库位查询):GROUP BY 增加 shipper_id,改为按"货主+库位+物料"汇总,避免不同货主在同库位同物料的库存被错误合并。 3. queryListByHz(按货主查询):GROUP BY 增加 warehouse_id,改为按"货主+仓库"汇总;hzwl 分支改走 queryListByHz,符合"按货主查询:货主+仓库"需求。
This commit is contained in:
+3
-3
@@ -3,7 +3,7 @@ package com.mhd.wms.domain.inventoryAdjustmentRecord.service;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mhd.common.core.constant.SnowFlakeConstants;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
@@ -175,7 +175,7 @@ public class InventoryAdjustmentRecordDomainService {
|
||||
}
|
||||
materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new ServiceException("可用数量调整之后不能小于0");
|
||||
throw new ServiceException("调整之后可用数量不能小于0");
|
||||
}
|
||||
}
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
@@ -231,7 +231,7 @@ public class InventoryAdjustmentRecordDomainService {
|
||||
}
|
||||
materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new ServiceException("可用数量调整之后不能小于0");
|
||||
throw new ServiceException("调整之后可用数量不能小于0");
|
||||
}
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity());
|
||||
|
||||
+2
-1
@@ -78,7 +78,8 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
if ("hz".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByHz(materialInventoryDO);
|
||||
} else if ("hzwl".equals(queryRule)) { // 货主查询
|
||||
return materialInventoryMapper.queryListByHzWl(materialInventoryDO);
|
||||
return materialInventoryMapper.queryListByHz(materialInventoryDO);
|
||||
// return materialInventoryMapper.queryListByHzWl(materialInventoryDO);
|
||||
} else if ("wl".equals(queryRule)) { // 物料查询
|
||||
return materialInventoryMapper.queryListByWl(materialInventoryDO);
|
||||
} else if ("kw".equals(queryRule)) {
|
||||
|
||||
Reference in New Issue
Block a user