废弃 ,换标文件上传 ,排车托盘锁粒度

This commit is contained in:
2026-09-14 16:49:00 +08:00
parent 60ebc2e376
commit 78bbd69a26
23 changed files with 443 additions and 21 deletions
@@ -54,7 +54,8 @@ public record DispatchPalletCandidate(
fbaWarehouseCode, packageCount, volumeCbm, sourceStage, null, null);
}
public String sourcePalletKey() {
// A plan pallet keeps the same lock identity before and after the physical pallet is received.
return planPalletId != null ? "PLAN:" + planPalletId : "RECEIVED:" + warehousePalletId;
// Once received, the physical pallet is the shared resource even when it contains
// allocations from multiple inbound orders/plan-pallet rows.
return warehousePalletId != null ? "RECEIVED:" + warehousePalletId : "PLAN:" + planPalletId;
}
}
@@ -637,8 +637,9 @@ public class DispatchService {
private DispatchPalletLock activeLock(String customerId, DispatchPalletCandidate candidate) {
DispatchPalletLock active = locks.lockActive(customerId, candidate.sourcePalletKey());
if (active == null && candidate.warehousePalletId() != null) {
active = locks.lockActive(customerId, "RECEIVED:" + candidate.warehousePalletId());
if (active == null && candidate.warehousePalletId() != null && candidate.planPalletId() != null) {
// Read legacy plan-level locks created before physical-pallet locking was introduced.
active = locks.lockActive(customerId, "PLAN:" + candidate.planPalletId());
}
return active;
}