This commit is contained in:
2026-08-26 16:50:22 +08:00
parent fd1a81594a
commit 6c4543c18c
25 changed files with 1704 additions and 9 deletions
@@ -47,6 +47,14 @@ public class ReceivingContainerController {
return ApiResponse.success(service.candidates(identity.operatorKey(), identity.overseasWarehouseId()));
}
@GetMapping("/warehouse-profile")
@Operation(summary = "Get the authenticated warehouse picker's current Chinese warehouse master name")
public ApiResponse<ReceivingContainerResponses.WarehouseProfile> warehouseProfile(
@AuthenticationPrincipal AuthenticatedUser user) {
PdaWarehouseIdentity identity = identity(user);
return ApiResponse.success(service.warehouseProfile(identity.overseasWarehouseId()));
}
@GetMapping("/{containerNo}")
@Operation(summary = "Get one receiving container without exposing plan or allocation IDs")
public ApiResponse<ReceivingContainerResponses.Session> detail(@AuthenticationPrincipal AuthenticatedUser user,
@@ -10,6 +10,8 @@ public final class ReceivingContainerResponses {
List<String> destinationCodes, int plannedPalletCount,
int totalPackages, int receivedPackages, boolean currentAccount) { }
public record WarehouseProfile(String warehouseId, String warehouseCode, String warehouseName) { }
public record Session(String containerNo, Long overseasWarehouseId, String overseasWarehouseName,
String status, String operatorName, int version,
List<SignedPhoto> photos, LocalDateTime preparedAt, LocalDateTime signedAt,
@@ -87,6 +87,12 @@ public class ReceivingContainerService {
.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
}
public ReceivingContainerResponses.WarehouseProfile warehouseProfile(long overseasWarehouseId) {
WarehouseResourceGateway.WarehouseReference value = warehouse.requireActiveSharedWarehouse(overseasWarehouseId);
return new ReceivingContainerResponses.WarehouseProfile(
Long.toString(value.warehouseId()), value.warehouseCode(), value.warehouseName());
}
public List<ReceivingContainerResponses.Candidate> candidates(String operatorKey, long overseasWarehouseId) {
ReceivingContainerSession current = sessions.findActiveByOperator(activeOperatorKey(operatorKey));
requireSessionWarehouse(current, overseasWarehouseId);