fix(firstleg): execute loading completion gate SQL

This commit is contained in:
2026-08-11 14:13:28 +08:00
parent df0f05c74d
commit bf7c214908
4 changed files with 7 additions and 5 deletions
@@ -25,7 +25,7 @@ public interface LoadingCompletionGateMapper {
AND c.status='CLEARANCE_COMPLETED' AND r.receipt_type='RELEASED' AND r.file_id IS NOT NULL
AND NOT EXISTS (SELECT 1 FROM fl_customs_receipt newer
WHERE newer.submission_batch_id=r.submission_batch_id
AND newer.receipt_type=r.receipt_type AND newer.receipt_version>r.receipt_version))
AND newer.receipt_type=r.receipt_type AND newer.receipt_version>r.receipt_version))
THEN 1 ELSE 0 END),0) customsReady
FROM fl_preload_loading_plan_link l
JOIN fl_loading_plan p ON p.id=l.loading_plan_id
@@ -59,7 +59,7 @@ public interface LoadingInboundMapper {
LEFT JOIN fl_inbound_order loaded
ON loaded.tenant_id=root.tenant_id AND loaded.parent_inbound_id=root.id
AND loaded.inbound_role='CHILD' AND loaded.split_purpose='LOADED'
AND loaded.process_status<>'LOADED' AND loaded.deleted=0
AND loaded.process_status<>'LOADED' AND loaded.deleted=0
SET root.process_status='LOADED', root.updated_by=#{operatorId}, root.version=root.version+1
WHERE root.tenant_id=#{tenantId} AND root.id=#{rootInboundId} AND root.deleted=0
AND root.inbound_role='MASTER' AND root.process_status IN ('INBOUNDED','LOADING')