fix(lastleg): unblock inbound plan handoff
This commit is contained in:
+9
-1
@@ -49,7 +49,7 @@ public class InboundPlanController {
|
||||
+ OverseasPermissions.INBOUND_ORDER_CREATE)
|
||||
public ApiResponse<InboundPlanResponse> convert(@AuthenticationPrincipal AuthenticatedUser user,
|
||||
@Valid @RequestBody ConvertInboundPlanRequest request) {
|
||||
return ApiResponse.success(service.convert(scope(user, request.customerId()), request.orderId()));
|
||||
return ApiResponse.success(service.convert(convertScope(user, request.customerId()), request.orderId()));
|
||||
}
|
||||
|
||||
@GetMapping("/{planNo}")
|
||||
@@ -118,4 +118,12 @@ public class InboundPlanController {
|
||||
}
|
||||
return String.valueOf(user.tenantId());
|
||||
}
|
||||
|
||||
private String convertScope(AuthenticatedUser user, String requestedCustomer) {
|
||||
if (user != null && "PLATFORM".equals(user.appCode()) && user.tenantId() != null && user.tenantId() == 0L
|
||||
&& (requestedCustomer == null || requestedCustomer.isBlank() || "0".equals(requestedCustomer.trim()))) {
|
||||
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "平台生成入库计划必须指定客户");
|
||||
}
|
||||
return scope(user, requestedCustomer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user