feat(warehouse): 添加仓库使用次数统计功能

- 在WmsMaterialCoilMapper中新增selectWarehouseIdCount方法用于统计仓库钢卷数量
- 在WmsWarehouseBo中新增orderByUseCount字段支持按使用次数排序
- 修改WmsWarehouseServiceImpl实现按使用次数或序号排序逻辑
- 创建WarehouseUseCountTask定时任务每晚1点更新仓库使用次数
- 实现定时计算各仓库中钢卷数量并更新到useCount字段功能
This commit is contained in:
2026-04-16 14:25:54 +08:00
parent 623e78629d
commit e99d7709d2
5 changed files with 92 additions and 2 deletions

View File

@@ -924,5 +924,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${ew.customSqlSegment}
</select>
<!-- 统计仓库使用次数按warehouse_id出现次数排序 -->
<select id="selectWarehouseIdCount" resultType="java.util.Map">
SELECT warehouse_id, COUNT(*) AS coil_count
FROM wms_material_coil
WHERE del_flag = 0
AND warehouse_id IN
<foreach collection="list" item="wid" open="(" separator="," close=")">
#{wid}
</foreach>
GROUP BY warehouse_id
</select>
</mapper>