use of com.wayn.common.core.domain.vo.order.OrderDetailVO in project waynboot-mall by wayn111.
the class OrderServiceImpl method getOrderDetailByOrderSn.
@Override
public R getOrderDetailByOrderSn(String orderSn) {
R success = R.success();
LambdaQueryWrapper<Order> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(Order::getOrderSn, orderSn);
Order order = getOne(queryWrapper);
OrderDetailVO orderDetailVO = new OrderDetailVO();
MyBeanUtil.copyProperties(order, orderDetailVO);
orderDetailVO.setOrderStatusText(OrderUtil.orderStatusText(order));
orderDetailVO.setPayTypeText(OrderUtil.payTypeText(order));
LambdaQueryWrapper<OrderGoods> queryWrapper1 = Wrappers.lambdaQuery(OrderGoods.class);
queryWrapper1.eq(OrderGoods::getOrderId, order.getId());
List<OrderGoods> list = iOrderGoodsService.list(queryWrapper1);
List<OrderGoodsVO> orderGoodsVOS = BeanUtil.copyToList(list, OrderGoodsVO.class);
orderDetailVO.setOrderGoodsVOList(orderGoodsVOS);
return success.add("order", orderDetailVO);
}
Aggregations