及时库存查询修改;
This commit is contained in:
+5
-1
@@ -69,6 +69,10 @@ public class ImmediateInventoryDO extends BaseVOEntity {
|
|||||||
@Excel(name = "库存数量")
|
@Excel(name = "库存数量")
|
||||||
private BigDecimal inventoryQuantity;
|
private BigDecimal inventoryQuantity;
|
||||||
|
|
||||||
|
@ApiModelProperty("复核数量")
|
||||||
|
@Excel(name = "复核数量")
|
||||||
|
private BigDecimal checkQuantity;
|
||||||
|
|
||||||
@ApiModelProperty("可用数量 ")
|
@ApiModelProperty("可用数量 ")
|
||||||
@Excel(name = "可用数量 ")
|
@Excel(name = "可用数量 ")
|
||||||
private BigDecimal allocationQuantity;
|
private BigDecimal allocationQuantity;
|
||||||
@@ -144,4 +148,4 @@ public class ImmediateInventoryDO extends BaseVOEntity {
|
|||||||
@Excel(name = "拣货数量结束")
|
@Excel(name = "拣货数量结束")
|
||||||
private BigDecimal pickQuantityEnd;
|
private BigDecimal pickQuantityEnd;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -342,9 +342,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
b.material_name,
|
b.material_name,
|
||||||
b.material_code,
|
b.material_code,
|
||||||
b.bar_code,
|
b.bar_code,
|
||||||
sum(a.inventory_quantity) inventory_quantity,
|
<!-- sum(a.inventory_quantity) inventory_quantity,
|
||||||
sum(a.allocation_quantity) allocation_quantity,
|
sum(a.allocation_quantity) allocation_quantity,
|
||||||
sum(a.freeze_quantity) freeze_quantity,
|
sum(a.freeze_quantity) freeze_quantity,-->
|
||||||
|
a.inventory_quantity ,
|
||||||
|
a.allocation_quantity ,
|
||||||
|
a.freeze_quantity ,
|
||||||
ifnull(
|
ifnull(
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
@@ -426,6 +429,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
and (a.shipper_name = #{shipperName} OR b.shipper_name = #{shipperName})
|
and (a.shipper_name = #{shipperName} OR b.shipper_name = #{shipperName})
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="shipperId != null and shipperId != '' ">
|
||||||
|
and a.shipper_id = #{shipperId}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="warehouseId != null and warehouseId != '' ">
|
<if test="warehouseId != null and warehouseId != '' ">
|
||||||
and a.warehouse_id = #{warehouseId}
|
and a.warehouse_id = #{warehouseId}
|
||||||
</if>
|
</if>
|
||||||
@@ -442,6 +449,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
and b.material_name = #{materialName}
|
and b.material_name = #{materialName}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="materialCode != null and materialCode != '' ">
|
||||||
|
and b.material_code = #{materialCode}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="barCode != null and barCode != '' ">
|
<if test="barCode != null and barCode != '' ">
|
||||||
and b.bar_code = #{barCode}
|
and b.bar_code = #{barCode}
|
||||||
</if>
|
</if>
|
||||||
@@ -561,34 +572,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
0
|
0
|
||||||
) < #{pickQuantityEnd}
|
) < #{pickQuantityEnd}
|
||||||
</if>
|
</if>
|
||||||
|
<!--
|
||||||
GROUP BY
|
GROUP BY
|
||||||
a.warehouse_id,
|
a.warehouse_id,
|
||||||
a.material_base_info_id,
|
a.material_base_info_id,
|
||||||
a.shipper_id
|
a.shipper_id
|
||||||
HAVING 1=1
|
HAVING 1=1-->
|
||||||
|
|
||||||
|
<if test="checkQuantity != 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
|
||||||
|
WHERE
|
||||||
|
d.CHECK_STATUS = 2
|
||||||
|
AND d.DEL_FLAG = 1
|
||||||
|
AND c.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
|
||||||
|
),
|
||||||
|
0
|
||||||
|
) = #{checkQuantity}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="inventoryQuantity != null ">
|
||||||
|
and a.inventory_quantity = #{inventoryQuantity}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="inventoryQuantityStart != null ">
|
<if test="inventoryQuantityStart != null ">
|
||||||
and sum(a.inventory_quantity) > #{inventoryQuantityStart}
|
and a.inventory_quantity > #{inventoryQuantityStart}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="inventoryQuantityEnd != null ">
|
<if test="inventoryQuantityEnd != null ">
|
||||||
and sum(a.inventory_quantity) < #{inventoryQuantityEnd}
|
and a.inventory_quantity < #{inventoryQuantityEnd}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="allocationQuantityStart != null ">
|
<if test="allocationQuantityStart != null ">
|
||||||
and sum(a.allocation_quantity) > #{allocationQuantityStart}
|
and a.allocation_quantity > #{allocationQuantityStart}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="allocationQuantityEnd != null ">
|
<if test="allocationQuantityEnd != null ">
|
||||||
and sum(a.allocation_quantity) < #{allocationQuantityEnd}
|
and a.allocation_quantity < #{allocationQuantityEnd}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="freezeQuantityStart != null ">
|
<if test="freezeQuantityStart != null ">
|
||||||
and sum(a.freeze_quantity) > #{freezeQuantityStart}
|
and a.freeze_quantity > #{freezeQuantityStart}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="freezeQuantityEnd != null ">
|
<if test="freezeQuantityEnd != null ">
|
||||||
and sum(a.freeze_quantity) < #{freezeQuantityEnd}
|
and a.freeze_quantity < #{freezeQuantityEnd}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -637,7 +674,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
material_inventory a
|
material_inventory a
|
||||||
LEFT JOIN material_base_info b on a.material_base_info_id = b.material_base_info_id
|
LEFT JOIN material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||||
WHERE
|
WHERE
|
||||||
a.del_flag = 1 AND b.shipper_id = #{shipperId} AND a.top_organization_id = #{topOrganizationId}
|
a.del_flag = 1 AND b.shipper_id = #{shipperId} AND a.organization_id = #{organizationId}
|
||||||
<if test="materialBaseInfoId != null and materialBaseInfoId != ''">
|
<if test="materialBaseInfoId != null and materialBaseInfoId != ''">
|
||||||
AND a.material_base_info_id = #{materialBaseInfoId}
|
AND a.material_base_info_id = #{materialBaseInfoId}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user