public R pageOrder(Page page, Order order) {
List<OrderVo> listvo = new ArrayList<>();
LambdaQueryWrapper<Order> lamquer = Wrappers.lambdaQuery();
lamquer.eq(Order::getMemberId, order.getMemberId())
.eq(Order::getStatus, order.getStatus());
List<Order> listOrder = orderService.list(lamquer);
Map<String, List<Order>> resultMap = new HashMap<>();
for (Order mUserBean : listOrder) {
if (resultMap.containsKey(mUserBean.getOrderSn())) {
resultMap.get(mUserBean.getOrderSn()).add(mUserBean);
} else {
List<Order> tmpList = new ArrayList<>();
tmpList.add(mUserBean);
resultMap.put(mUserBean.getOrderSn(), tmpList);
}
}
Set<Map.Entry<String, List<Order>>> entrySet = resultMap.entrySet();
return R.ok(entrySet);
}
|