6/19 完善了对注销用户的订单查询处理

This commit is contained in:
mlf9527 2023-06-19 19:45:37 +08:00
parent 485142fdd8
commit 95d0ba95f4

View File

@ -59,7 +59,12 @@ public class OrdersController {
List<OrdersDTO> ordersDTOS = page.getList().stream().map(ordersDTO -> { List<OrdersDTO> ordersDTOS = page.getList().stream().map(ordersDTO -> {
UserDTO userDTO = userService.get(ordersDTO.getUserId()); UserDTO userDTO = userService.get(ordersDTO.getUserId());
ordersDTO.setUserName(userDTO.getName()); if(userDTO!=null) {
ordersDTO.setUserName(userDTO.getName());
}
else {
ordersDTO.setUserName("账号已注销");
}
return ordersDTO; return ordersDTO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
page.setList(ordersDTOS); page.setList(ordersDTOS);