This commit is contained in:
2026-08-10 18:40:43 +08:00
parent efcd046853
commit 86632ef383
6 changed files with 13 additions and 5 deletions
@@ -43,7 +43,8 @@ public interface WarehousePalletLocationClient {
BigDecimal totalVolumeCbm, BigDecimal palletCapacityCbm, String palletType,
LocalDateTime expiresAt, boolean measurementCompleted) {}
record ConfirmRequest(long tenantId, long warehouseId, String sourceService, long businessId,
long operatorId, BigDecimal totalVolumeCbm, BigDecimal palletCapacityCbm) {}
long operatorId, BigDecimal totalVolumeCbm, BigDecimal palletCapacityCbm,
int packageCount) {}
record ReleaseRequest(long tenantId, String sourceService, long businessId, long operatorId,
String reason) {}
record SelectiveReleaseRequest(long tenantId, String sourceService, long businessId,
@@ -52,7 +52,7 @@ public class MeasurementLocationOccupationService {
WarehousePalletLocationClient.BatchResult occupied = requireSuccess(call(() -> warehouse.confirm(
internalToken, new WarehousePalletLocationClient.ConfirmRequest(resourceTenantId, warehouseId,
SOURCE_SERVICE, inboundId, operatorId, volume,
properties.getDefaultPalletCapacityCbm()))), "测量完成后库位占用失败");
properties.getDefaultPalletCapacityCbm(), packageCount))), "测量完成后库位占用失败");
allocations.replace(tenantId, inboundId, warehouseId, resourceTenantId,
properties.getDefaultPalletCapacityCbm(), packageCount, occupied);
} catch (RuntimeException failure) {
@@ -65,6 +65,7 @@ class MeasurementLocationOccupationServiceTest {
verify(warehouse).confirm(org.mockito.ArgumentMatchers.eq("internal-token"), confirm.capture());
assertThat(confirm.getValue().tenantId()).isEqualTo(PLATFORM_RESOURCE_TENANT);
assertThat(confirm.getValue().businessId()).isEqualTo(INBOUND);
assertThat(confirm.getValue().packageCount()).isEqualTo(20);
verify(allocations, times(2)).replace(
org.mockito.ArgumentMatchers.eq(BUSINESS_TENANT),
@@ -96,6 +97,7 @@ class MeasurementLocationOccupationServiceTest {
ArgumentCaptor.forClass(WarehousePalletLocationClient.ConfirmRequest.class);
verify(warehouse).confirm(org.mockito.ArgumentMatchers.eq("internal-token"), confirm.capture());
assertThat(confirm.getValue().tenantId()).isEqualTo(PLATFORM_RESOURCE_TENANT);
assertThat(confirm.getValue().packageCount()).isEqualTo(20);
verify(allocations, times(2)).replace(
org.mockito.ArgumentMatchers.eq(BUSINESS_TENANT),