feat(wms): 新增按实际库区查询钢卷分布功能

- 在 IWmsMaterialCoilService 接口中新增 getDistributionByActualWarehouse 方法
- 实现钢卷按实际库区统计数量和重量的查询逻辑
- 添加对应的 Mapper XML 查询语句,支持按物品类型和 ID 过滤
- 在 Controller 中暴露新的 REST 接口 /distributionByActualWarehouse
- 扩展 WmsStockBo 和 WmsStockVo 类以支持实际库区相关字段
- 新增 queryPageListActual 方法用于分页查询实际库区库存数据
- 实现递归查询子实际库区的功能,并应用到查询条件中
- 更新 Mapper 文件及服务实现类以支持新查询逻辑
This commit is contained in:
2025-11-03 17:06:17 +08:00
parent 07c8ccbcdd
commit 83edc5703a
12 changed files with 169 additions and 7 deletions

View File

@@ -1125,6 +1125,26 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
return convertMapListToVoList(mapList);
}
@Override
public List<WmsMaterialCoilVo> getDistributionByActualWarehouse(String itemType, Long itemId) {
List<Map<String, Object>> mapList = baseMapper.getDistributionByActualWarehouse(itemType, itemId);
return convertMapListToVoListActual(mapList);
}
private List<WmsMaterialCoilVo> convertMapListToVoListActual(List<Map<String, Object>> mapList) {
List<WmsMaterialCoilVo> voList = new ArrayList<>();
for (Map<String, Object> map : mapList) {
WmsMaterialCoilVo vo = new WmsMaterialCoilVo();
vo.setActualWarehouseId(map.get("actual_warehouse_id") != null ? Long.valueOf(map.get("actual_warehouse_id").toString()) : null);
vo.setActualWarehouseName(map.get("actual_warehouse_name") != null ? map.get("actual_warehouse_name").toString() : null);
vo.setItemType(map.get("item_type") != null ? map.get("item_type").toString() : null);
vo.setItemId(map.get("item_id") != null ? Long.valueOf(map.get("item_id").toString()) : null);
vo.setCoilCount(map.get("coil_count") != null ? Long.valueOf(map.get("coil_count").toString()) : 0L);
vo.setTotalGrossWeight(map.get("total_gross_weight") != null ? new BigDecimal(map.get("total_gross_weight").toString()) : BigDecimal.ZERO);
vo.setTotalNetWeight(map.get("total_net_weight") != null ? new BigDecimal(map.get("total_net_weight").toString()) : BigDecimal.ZERO);
voList.add(vo);
}
return voList;
}
/**
* 查询不同类型的钢卷在不同库区的分布情况
* 按物品类型和物品ID分组统计每个库区的钢卷数量和重量