Search in sources :

Example 1 with OrderDetailVO

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);
}
Also used : R(com.wayn.common.util.R) OrderDetailVO(com.wayn.common.core.domain.vo.order.OrderDetailVO) OrderGoodsVO(com.wayn.common.core.domain.vo.order.OrderGoodsVO)

Aggregations

OrderDetailVO (com.wayn.common.core.domain.vo.order.OrderDetailVO)1 OrderGoodsVO (com.wayn.common.core.domain.vo.order.OrderGoodsVO)1 R (com.wayn.common.util.R)1