fix(warehouse-overseas): avoid pallet batch gap lock

This commit is contained in:
2026-09-08 23:59:50 +08:00
parent a88a04fd24
commit 93704a24ce
4 changed files with 8 additions and 9 deletions
@@ -51,13 +51,6 @@ public class WarehousePalletBatchService {
public WarehousePalletBatchResponse ensureReserved(WarehousePalletBatchRequests.EnsureReserved request) {
WarehousePalletBatchRequests.EnsureReserved normalized = normalize(request);
String requestHash = hash(normalized);
WarehousePalletBatchEntity existing = batches.lockByKey(normalized.warehouseId(), normalized.batchKey());
if (existing != null) {
requireSameRequest(existing, normalized.warehouseId(), requestHash);
if ("COMPENSATED".equals(existing.getStatus())) return reactivate(existing);
return response(existing, items.lockByBatch(existing.getId()), true);
}
WarehousePalletBatchEntity batch = new WarehousePalletBatchEntity();
batch.setId(IdWorker.getId());
batch.setWarehouseId(normalized.warehouseId());