废弃 ,换标文件上传 ,排车托盘锁粒度
This commit is contained in:
+3
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user