Merge remote-tracking branch 'origin/wms_dev' into wms_dev

This commit is contained in:
zhou-hongcheng
2026-02-06 16:31:09 +08:00
28 changed files with 379 additions and 42 deletions
@@ -397,10 +397,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND d.del_flag = 1
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
WHERE
c.del_flag = 1 and d.STATUS = 1
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 3
AND e.warehouse_id = a.warehouse_id
AND (a.shipper_id IS NULL OR e.shipper_id = a.shipper_id)
AND c.material_base_info_id = a.material_base_info_id
and (c.BATCH_REF_NO = a.batch_ref_no or (c.BATCH_REF_NO is null and a.BATCH_REF_NO is null))
and (c.SHEET_REF_NO = a.sheet_ref_no or (c.SHEET_REF_NO is null and a.SHEET_REF_NO is null))
and (c.BOX_PALLET_NO = a.BOX_PALLET_NO or (c.BOX_PALLET_NO is null and a.BOX_PALLET_NO is null))
and (c.EXT_ATTR_1 = a.EXT_ATTR_1 or (c.EXT_ATTR_1 is null and a.EXT_ATTR_1 is null))
and (c.EXT_ATTR_2 = a.EXT_ATTR_2 or (c.EXT_ATTR_2 is null and a.EXT_ATTR_2 is null))
and (c.EXT_ATTR_3 = a.EXT_ATTR_3 or (c.EXT_ATTR_3 is null and a.EXT_ATTR_3 is null))
and (c.EXT_ATTR_4 = a.EXT_ATTR_4 or (c.EXT_ATTR_4 is null and a.EXT_ATTR_4 is null))
and (c.PRODUCTION_DATE = a.PRODUCTION_DATE or (c.PRODUCTION_DATE is null and a.PRODUCTION_DATE is null))
and (c.EXPIRY_DATE = a.EXPIRY_DATE or (c.EXPIRY_DATE is null and a.EXPIRY_DATE is null))
and (c.INVENTORY_DATE = a.INVENTORY_DATE or (c.INVENTORY_DATE is null and a.INVENTORY_DATE is null))
),
0
) received_quantity,
@@ -430,10 +440,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
WHERE
c.del_flag = 1 and d.STATUS = 1 and e.STATUS = 7
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
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
) pick_quantity,
@@ -444,13 +455,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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 = 2
d.CHECK_STATUS = 2 and e.STATUS = 1
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
) CHECK_QUANTITY,
@@ -519,10 +533,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND d.del_flag = 1
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
WHERE
c.del_flag = 1
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 3
AND e.warehouse_id = a.warehouse_id
AND (a.shipper_id IS NULL OR e.shipper_id = a.shipper_id)
AND c.material_base_info_id = a.material_base_info_id
and (c.BATCH_REF_NO = a.batch_ref_no or (c.BATCH_REF_NO is null and a.BATCH_REF_NO is null))
and (c.SHEET_REF_NO = a.sheet_ref_no or (c.SHEET_REF_NO is null and a.SHEET_REF_NO is null))
and (c.BOX_PALLET_NO = a.BOX_PALLET_NO or (c.BOX_PALLET_NO is null and a.BOX_PALLET_NO is null))
and (c.EXT_ATTR_1 = a.EXT_ATTR_1 or (c.EXT_ATTR_1 is null and a.EXT_ATTR_1 is null))
and (c.EXT_ATTR_2 = a.EXT_ATTR_2 or (c.EXT_ATTR_2 is null and a.EXT_ATTR_2 is null))
and (c.EXT_ATTR_3 = a.EXT_ATTR_3 or (c.EXT_ATTR_3 is null and a.EXT_ATTR_3 is null))
and (c.EXT_ATTR_4 = a.EXT_ATTR_4 or (c.EXT_ATTR_4 is null and a.EXT_ATTR_4 is null))
and (c.PRODUCTION_DATE = a.PRODUCTION_DATE or (c.PRODUCTION_DATE is null and a.PRODUCTION_DATE is null))
and (c.EXPIRY_DATE = a.EXPIRY_DATE or (c.EXPIRY_DATE is null and a.EXPIRY_DATE is null))
and (c.INVENTORY_DATE = a.INVENTORY_DATE or (c.INVENTORY_DATE is null and a.INVENTORY_DATE is null))
),
0
)> #{receivedQuantityStart}
@@ -539,10 +563,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND d.del_flag = 1
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
WHERE
c.del_flag = 1
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 3
AND e.warehouse_id = a.warehouse_id
AND (a.shipper_id IS NULL OR e.shipper_id = a.shipper_id)
AND c.material_base_info_id = a.material_base_info_id
and (c.BATCH_REF_NO = a.batch_ref_no or (c.BATCH_REF_NO is null and a.BATCH_REF_NO is null))
and (c.SHEET_REF_NO = a.sheet_ref_no or (c.SHEET_REF_NO is null and a.SHEET_REF_NO is null))
and (c.BOX_PALLET_NO = a.BOX_PALLET_NO or (c.BOX_PALLET_NO is null and a.BOX_PALLET_NO is null))
and (c.EXT_ATTR_1 = a.EXT_ATTR_1 or (c.EXT_ATTR_1 is null and a.EXT_ATTR_1 is null))
and (c.EXT_ATTR_2 = a.EXT_ATTR_2 or (c.EXT_ATTR_2 is null and a.EXT_ATTR_2 is null))
and (c.EXT_ATTR_3 = a.EXT_ATTR_3 or (c.EXT_ATTR_3 is null and a.EXT_ATTR_3 is null))
and (c.EXT_ATTR_4 = a.EXT_ATTR_4 or (c.EXT_ATTR_4 is null and a.EXT_ATTR_4 is null))
and (c.PRODUCTION_DATE = a.PRODUCTION_DATE or (c.PRODUCTION_DATE is null and a.PRODUCTION_DATE is null))
and (c.EXPIRY_DATE = a.EXPIRY_DATE or (c.EXPIRY_DATE is null and a.EXPIRY_DATE is null))
and (c.INVENTORY_DATE = a.INVENTORY_DATE or (c.INVENTORY_DATE is null and a.INVENTORY_DATE is null))
),
0
) < #{receivedQuantityEnd}
@@ -595,12 +629,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum( c.picking_quantity )
FROM
picking_material_detail c
LEFT JOIN picking_order d ON c.picking_order_number = d.order_number
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
WHERE
c.del_flag = 1
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
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
) > #{pickQuantityStart}
@@ -613,12 +649,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum( c.picking_quantity )
FROM
picking_material_detail c
LEFT JOIN picking_order d ON c.picking_order_number = d.order_number
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
WHERE
c.del_flag = 1
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
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
) < #{pickQuantityEnd}
@@ -639,13 +677,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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 = 2
d.CHECK_STATUS = 2 and e.STATUS = 1
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
) = #{checkQuantity}
@@ -59,10 +59,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.warehouse_name like concat('%', #{warehouseName}, '%')
</if>
<if test="orderNumber != null and orderNumber != '' ">
and a.order_number = #{orderNumber}
and a.order_number like concat('%', #{orderNumber}, '%')
</if>
<if test="pickingOrderNumber != null and pickingOrderNumber != ''">
and a.picking_order_number = #{pickingOrderNumber}
and a.picking_order_number like concat('%', #{pickingOrderNumber}, '%')
</if>
<if test="status != null ">
and a.status = #{status}
@@ -105,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and b.notice_number = #{noticeNumber}
</if>
<if test="inOrderNumber != null and inOrderNumber != ''">
and b.in_order_number = #{inOrderNumber}
and b.in_order_number like concat('%', #{inOrderNumber}, '%')
</if>
<if test="warehouseId != null ">
and b.warehouse_id = #{warehouseId}
@@ -363,6 +363,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderDate != null">
and a.ORDER_DATE = #{orderDate}
</if>
<if test="createTimeStart != null and createTimeStart != ''">
and date_format(a.create_time,'%Y-%m-%d') &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
and date_format(a.create_time,'%Y-%m-%d') &lt;= #{createTimeEnd}
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
@@ -124,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.notice_number = #{noticeNumber}
</if>
<if test="outOrderNumber != null and outOrderNumber != ''">
and a.out_order_number = #{outOrderNumber}
and a.out_order_number like concat('%', #{outOrderNumber}, '%')
</if>
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 -->
<if test="status != null ">
@@ -151,6 +151,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="auditRemark != null and auditRemark != ''">
and a.audit_remark = #{auditRemark}
</if>
<if test="checkTaskDistribution != null ">
and a.check_task_distribution = #{checkTaskDistribution}
</if>
<if test="auditBy != null ">
and a.audit_by = #{auditBy}
</if>
@@ -265,6 +268,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="createTimeStart != null and createTimeStart != ''">
and date_format(a.create_time,'%Y-%m-%d') &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
and date_format(a.create_time,'%Y-%m-%d') &lt;= #{createTimeEnd}
</if>
<if test="auditTimeStart != null and auditTimeStart != ''">
and date_format(a.audit_time,'%Y-%m-%d') &gt;= #{auditTimeStart}
</if>
<if test="auditTimeEnd != null and auditTimeEnd != ''">
and date_format(a.audit_time,'%Y-%m-%d') &lt;= #{auditTimeEnd}
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.serial_number = #{serialNumber}
</if>
<if test="taskNumber != null and taskNumber != ''">
and a.task_number = #{taskNumber}
and a.task_number like concat('%', #{taskNumber}, '%')
</if>
<if test="status != null ">
and a.status = #{status}
@@ -86,10 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.shipper_name like concat('%', #{shipperName}, '%')
</if>
<if test="orderNumber != null and orderNumber != ''">
and a.order_number = #{orderNumber}
and a.order_number like concat('%', #{orderNumber}, '%')
</if>
<if test="pickingOrderNumber != null and pickingOrderNumber != ''">
and a.picking_order_number = #{pickingOrderNumber}
and a.picking_order_number like concat('%', #{pickingOrderNumber}, '%')
</if>
<if test="abnormal != null ">
and a.abnormal = #{abnormal}
@@ -100,6 +100,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operatorsName != null and operatorsName != ''">
and a.operators_name like concat('%', #{operatorsName}, '%')
</if>
<if test="pickingQuantity != null ">
and a.picking_quantity = #{pickingQuantity}
</if>
<if test="operatorsEndTime != null ">
and a.operators_end_time = #{operatorsEndTime}
</if>
@@ -109,6 +112,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateByName != null and updateByName != ''">
and a.update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="storageLocationId != null ">
and a.storage_location_id = #{storageLocationId}
</if>
<if test="storageLocationList != null and storageLocationList.size > 0 ">
and a.storage_location_id in
<foreach collection="storageLocationList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="createTimeStart != null and createTimeStart != ''">
and date_format(a.create_time,'%Y-%m-%d') &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
and date_format(a.create_time,'%Y-%m-%d') &lt;= #{createTimeEnd}
</if>
<if test="operatorsEndTimeStart != null and operatorsEndTimeStart != ''">
and date_format(a.operators_end_time,'%Y-%m-%d') &gt;= #{operatorsEndTimeStart}
</if>
<if test="operatorsEndTimeEnd != null and operatorsEndTimeEnd != ''">
and date_format(a.operators_end_time,'%Y-%m-%d') &lt;= #{operatorsEndTimeEnd}
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
@@ -60,11 +60,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="inOrderNumber != null and inOrderNumber != '' ">
and a.in_order_number = #{inOrderNumber}
and a.in_order_number like concat('%', #{inOrderNumber}, '%')
</if>
<if test="receiptOrderNumber != null and receiptOrderNumber != ''">
and a.receipt_order_number like concat('%', #{receiptOrderNumber}, '%')
</if>
-- taskDistributionMerge
<if test="taskDistributionMerge != null ">
and a.task_distribution_merge = #{taskDistributionMerge}
</if>
<if test="status != null ">
and a.status = #{status}
</if>
@@ -119,6 +123,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="createTimeStart != null and createTimeStart != ''">
and date_format(a.create_time,'%Y-%m-%d') &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
and date_format(a.create_time,'%Y-%m-%d') &lt;= #{createTimeEnd}
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
@@ -52,13 +52,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.in_order_number = #{inOrderNumber}
</if>
<if test="receiptOrderNumber != null and receiptOrderNumber != ''">
and a.receipt_order_number = #{receiptOrderNumber}
and a.receipt_order_number like concat('%', #{receiptOrderNumber}, '%')
</if>
<if test="receiptTaskNumber != null and receiptTaskNumber != ''">
and a.receipt_task_number = #{receiptTaskNumber}
</if>
<if test="shelfOrderNumber != null and shelfOrderNumber != ''">
and a.shelf_order_number = #{shelfOrderNumber}
and a.shelf_order_number like concat('%', #{shelfOrderNumber}, '%')
</if>
<if test="status != null ">
and a.status = #{status}
@@ -93,6 +93,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="createTimeStart != null and createTimeStart != ''">
and date_format(a.create_time,'%Y-%m-%d') &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
and date_format(a.create_time,'%Y-%m-%d') &lt;= #{createTimeEnd}
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
@@ -101,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="joinStockReceiptOrderWhere">
<if test="receiptOrderNumber != null and receiptOrderNumber != ''">
and c.receipt_order_number = #{receiptOrderNumber}
and c.receipt_order_number like concat('%', #{receiptOrderNumber}, '%')
</if>
</sql>