出库单按规则生成;执行单回显通知单备注;

This commit is contained in:
王奎兴
2026-08-08 16:41:22 +08:00
parent 1b8a75aea5
commit 6a0818350a
7 changed files with 132 additions and 6 deletions
@@ -526,4 +526,53 @@
<select id="getInLotNo" resultType="java.lang.String">
select LOT_NO from "NGWL_TEST_WMS".IN_MATERIAL_DETAIL where MATERIAL_BASE_INFO_ID = #{baseId} and IN_ORDER_NUMBER = #{inOrderNumber}
</select>
<!-- 跨4张入库单表查询指定前缀+组织+仓库的所有入库单号(取最大序号+1,防止删单后单号重复) -->
<select id="getMaxStockOutOrderByPrefixAndOrgAndWarehouse" resultType="java.lang.String">
SELECT out_order_number FROM NGWL_TEST_OMS.reserve_stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
AND del_flag = 1
<if test="organizationId != null">
AND organization_id = #{organizationId}
</if>
<if test="warehouseId != null">
AND warehouse_id = #{warehouseId}
</if>
UNION ALL
SELECT out_order_number FROM NGWL_TEST_OMS.reservation_stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
AND del_flag = 1
<if test="organizationId != null">
AND organization_id = #{organizationId}
</if>
<if test="warehouseId != null">
AND warehouse_id = #{warehouseId}
</if>
UNION ALL
SELECT out_order_number FROM NGWL_TEST_OMS.execution_stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
AND del_flag = 1
<if test="organizationId != null">
AND organization_id = #{organizationId}
</if>
<if test="warehouseId != null">
AND warehouse_id = #{warehouseId}
</if>
UNION ALL
SELECT out_order_number FROM stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
AND del_flag = 1
<if test="organizationId != null">
AND organization_id = #{organizationId}
</if>
<if test="warehouseId != null">
AND warehouse_id = #{warehouseId}
</if>
</select>
</mapper>