fix: 保存前重校验出库库存
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
gp.material_id AS material_id,
|
||||
gp.material_code AS material_code,
|
||||
mb.material_name AS material_name,
|
||||
gp.qty - gp.frozen_qty AS available_qty,
|
||||
gp.qty - COALESCE(gp.frozen_qty, 0) AS available_qty,
|
||||
gp.qty_unit_id AS qty_unit_id,
|
||||
gp.qty_unit_name AS qty_unit_name,
|
||||
gp.ext_code AS ext_code,
|
||||
@@ -33,7 +33,7 @@
|
||||
LEFT JOIN base_materialbase mb ON mb.material_id = gp.material_id AND mb.deleted = 0
|
||||
WHERE sa.stor_id = #{reqVO.storId}
|
||||
AND gp.status = '可用'
|
||||
AND gp.qty - gp.frozen_qty > 0
|
||||
AND gp.qty - COALESCE(gp.frozen_qty, 0) > 0
|
||||
AND gp.deleted = 0
|
||||
<if test="reqVO.materialCode != null and reqVO.materialCode != ''">
|
||||
AND gp.material_code LIKE CONCAT('%', #{reqVO.materialCode}, '%')
|
||||
@@ -60,7 +60,7 @@
|
||||
LEFT JOIN base_materialbase mb ON mb.material_id = gp.material_id AND mb.deleted = 0
|
||||
WHERE sa.stor_id = #{storId}
|
||||
AND gp.status = '可用'
|
||||
AND gp.qty - gp.frozen_qty > 0
|
||||
AND gp.qty - COALESCE(gp.frozen_qty, 0) > 0
|
||||
AND gp.deleted = 0
|
||||
AND gp.vehicle_code IN
|
||||
<foreach collection="vehicleCodes" item="vehicleCode" open="(" separator="," close=")">
|
||||
@@ -69,4 +69,27 @@
|
||||
ORDER BY gp.vehicle_code, gp.group_id
|
||||
</select>
|
||||
|
||||
<select id="selectAvailableInventoryByVehicleCodesForUpdate"
|
||||
resultType="cn.code.nl.module.wms.controller.admin.iostorinv.vo.AvailableInventoryRespVO">
|
||||
SELECT <include refid="availableInventoryColumns"/>
|
||||
FROM wms_group_plate gp
|
||||
INNER JOIN (
|
||||
SELECT stor_id, storagevehicle_code, MAX(stor_code) AS stor_code, MAX(stor_name) AS stor_name
|
||||
FROM wms_structattr
|
||||
WHERE deleted = 0
|
||||
GROUP BY stor_id, storagevehicle_code
|
||||
) sa ON sa.storagevehicle_code = gp.vehicle_code
|
||||
LEFT JOIN base_materialbase mb ON mb.material_id = gp.material_id AND mb.deleted = 0
|
||||
WHERE sa.stor_id = #{storId}
|
||||
AND gp.status = '可用'
|
||||
AND gp.qty - COALESCE(gp.frozen_qty, 0) > 0
|
||||
AND gp.deleted = 0
|
||||
AND gp.vehicle_code IN
|
||||
<foreach collection="vehicleCodes" item="vehicleCode" open="(" separator="," close=")">
|
||||
#{vehicleCode}
|
||||
</foreach>
|
||||
ORDER BY gp.vehicle_code, gp.group_id
|
||||
FOR UPDATE
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user