fix(firstleg): defer PDA allocation release transition

This commit is contained in:
2026-08-10 18:00:24 +08:00
parent 84209bffd7
commit 3bfc11a94d
2 changed files with 23 additions and 4 deletions
@@ -24,10 +24,11 @@ public interface InboundPalletAllocationMapper extends BaseMapper<InboundPalletA
@Update("""
UPDATE fl_inbound_pallet_allocation
SET picked_package_count = picked_package_count + #{count},
allocation_status = CASE
WHEN picked_package_count + #{count} = allocated_package_count THEN 'RELEASED'
ELSE 'CONFIRMED'
END,
/* Keep the snapshot confirmed until the atomic warehouse release
succeeds. markReleased is the single owner of this transition;
changing it here makes the subsequent idempotent release update
affect zero rows and surfaces as S0500 from PDA pick. */
allocation_status = 'CONFIRMED',
updated_at = CURRENT_TIMESTAMP(3)
WHERE id = #{id}
AND tenant_id = #{tenantId}