feat(appointments): expose destination warehouse options
This commit is contained in:
+5
@@ -35,6 +35,11 @@ public class AppointmentCargoService {
|
||||
return new PageResult<>(rows, page, size, total, (total + size - 1) / size);
|
||||
}
|
||||
|
||||
/** 查询下拉框与货物分页共用权威目录范围,不从当前页猜测目的仓。 */
|
||||
public List<String> destinations() {
|
||||
return scope().destinations().stream().distinct().sorted().toList();
|
||||
}
|
||||
|
||||
private record Scope(List<String> origins, List<String> destinations) { }
|
||||
private Scope scope() {
|
||||
final List<AppointmentWarehouseClient.Warehouse> catalog;
|
||||
|
||||
+8
@@ -53,6 +53,14 @@ public class AppointmentPlanningController {
|
||||
return ApiResponse.success(new Resolved(source,result.get(0)));
|
||||
}
|
||||
|
||||
/** 目的仓选项沿用货物查询权限,只返回同范围的美国FBA仓码。 */
|
||||
@GetMapping("/cargo/destinations")
|
||||
@PreAuthorize("hasAuthority('platform:appointment:list') and hasAuthority('platform:overseas-warehouse:last-mile-order:list')")
|
||||
public ApiResponse<java.util.List<String>> destinations(@AuthenticationPrincipal AuthenticatedUser user) {
|
||||
requirePlatform(user);
|
||||
return ApiResponse.success(service.destinations());
|
||||
}
|
||||
|
||||
@GetMapping("/cargo")
|
||||
@PreAuthorize("hasAuthority('platform:appointment:list') and hasAuthority('platform:overseas-warehouse:last-mile-order:list')")
|
||||
public ApiResponse<PageResult<AppointmentCargo>> cargo(@AuthenticationPrincipal AuthenticatedUser user,
|
||||
|
||||
Reference in New Issue
Block a user