fix(warehouse-overseas): avoid pallet batch gap lock
This commit is contained in:
-7
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user