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

This commit is contained in:
mlf9527 2023-06-19 19:45:37 +08:00
parent c41b969a8a
commit fd1f05001e

View File

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