即时库存复核数量查询

This commit is contained in:
zhou-hongcheng
2026-03-17 10:13:02 +08:00
parent 7dd32e8676
commit c0669f122d
3 changed files with 39 additions and 3 deletions
@@ -148,4 +148,10 @@ public class ImmediateInventoryDO extends BaseVOEntity {
@Excel(name = "拣货数量结束")
private BigDecimal pickQuantityEnd;
@ApiModelProperty("复核数量开始")
private BigDecimal checkQuantityBegin;
@ApiModelProperty("复核数量开始")
private BigDecimal checkQuantityEnd;
}
@@ -150,4 +150,10 @@ public class ImmediateInventoryDTO {
private BigDecimal freezeQuantityBegin;
private BigDecimal allocationQuantityBegin;
private BigDecimal checkQuantity;
@ApiModelProperty("复核数量开始")
private BigDecimal checkQuantityBegin;
@ApiModelProperty("复核数量开始")
private BigDecimal checkQuantityEnd;
}
@@ -828,7 +828,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.shipper_id
HAVING 1=1-->
<if test="checkQuantity != null ">
<if test="checkQuantityBegin != null ">
and
ifnull(
(
@@ -839,7 +839,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
WHERE
d.CHECK_STATUS = 2 and e.STATUS = 1
d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12)
AND d.DEL_FLAG = 1
AND c.DEL_FLAG = 1
and e.del_flag = 1
@@ -849,7 +849,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
),
0
) = #{checkQuantity}
) > #{checkQuantityBegin}
</if>
<if test="checkQuantityEnd != null ">
and
ifnull(
(
SELECT
SUM(c.CHECK_QUANTITY) AS CHECK_QUANTITY
FROM
OUT_MATERIAL_DETAIL c
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
WHERE
d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12)
AND d.DEL_FLAG = 1
AND c.DEL_FLAG = 1
and e.del_flag = 1
AND d.warehouse_id = a.warehouse_id
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
AND c.material_base_info_id = a.material_base_info_id
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
),
0
) &lt; #{checkQuantityEnd}
</if>
<if test="inventoryQuantity != null ">