Search in sources :

Example 1 with OrderVo

use of com.paascloud.provider.model.vo.OrderVo in project paascloud-master by paascloud.

the class OmcOrderServiceImpl method assembleOrderVoList.

private List<OrderVo> assembleOrderVoList(List<OmcOrder> orderList, Long userId) {
    List<OrderVo> orderVoList = Lists.newArrayList();
    for (OmcOrder order : orderList) {
        List<OmcOrderDetail> orderItemList;
        if (userId == null) {
            orderItemList = omcOrderDetailService.getListByOrderNo(order.getOrderNo());
        } else {
            orderItemList = omcOrderDetailService.getListByOrderNoUserId(order.getOrderNo(), userId);
        }
        OrderVo orderVo = assembleOrderVo(order, orderItemList);
        orderVoList.add(orderVo);
    }
    return orderVoList;
}
Also used : OrderVo(com.paascloud.provider.model.vo.OrderVo) OmcOrderDetail(com.paascloud.provider.model.domain.OmcOrderDetail) OmcOrder(com.paascloud.provider.model.domain.OmcOrder)

Example 2 with OrderVo

use of com.paascloud.provider.model.vo.OrderVo in project paascloud-master by paascloud.

the class OmcOrderServiceImpl method assembleOrderVo.

private OrderVo assembleOrderVo(OmcOrder order, List<OmcOrderDetail> orderItemList) {
    OrderVo orderVo = new OrderVo();
    orderVo.setOrderNo(order.getOrderNo());
    orderVo.setPayment(order.getPayment());
    orderVo.setPaymentType(order.getPaymentType());
    orderVo.setPaymentTypeDesc(Objects.requireNonNull(GlobalConstant.PaymentTypeEnum.codeOf(order.getPaymentType())).getValue());
    orderVo.setPostage(order.getPostage());
    orderVo.setStatus(order.getStatus());
    orderVo.setStatusDesc(OmcApiConstant.OrderStatusEnum.codeOf(order.getStatus()).getValue());
    orderVo.setShippingId(order.getShippingId());
    OmcShipping shipping = omcShippingMapper.selectByPrimaryKey(order.getShippingId());
    if (shipping != null) {
        orderVo.setReceiverName(shipping.getReceiverName());
        orderVo.setShippingVo(assembleShippingVo(shipping));
    }
    orderVo.setPaymentTime(order.getPaymentTime());
    orderVo.setSendTime(order.getSendTime());
    orderVo.setEndTime(order.getEndTime());
    orderVo.setCreateTime(order.getCreatedTime());
    orderVo.setCloseTime(order.getCloseTime());
    orderVo.setCreator(order.getCreator());
    orderVo.setImageHost("");
    List<OrderItemVo> orderItemVoList = Lists.newArrayList();
    for (OmcOrderDetail orderItem : orderItemList) {
        OrderItemVo orderItemVo = assembleOrderItemVo(orderItem);
        orderItemVoList.add(orderItemVo);
    }
    orderVo.setOrderItemVoList(orderItemVoList);
    return orderVo;
}
Also used : OrderVo(com.paascloud.provider.model.vo.OrderVo) OmcOrderDetail(com.paascloud.provider.model.domain.OmcOrderDetail) OmcShipping(com.paascloud.provider.model.domain.OmcShipping) OrderItemVo(com.paascloud.provider.model.vo.OrderItemVo)

Example 3 with OrderVo

use of com.paascloud.provider.model.vo.OrderVo in project paascloud-master by paascloud.

the class OmcOrderController method createOrderDoc.

/**
 * 创建订单.
 *
 * @param shippingId the shipping id
 *
 * @return the wrapper
 */
@PostMapping("createOrderDoc/{shippingId}")
@ApiOperation(httpMethod = "POST", value = "创建订单")
public Wrapper createOrderDoc(@PathVariable Long shippingId) {
    logger.info("createOrderDoc - 创建订单. shippingId={}", shippingId);
    LoginAuthDto loginAuthDto = getLoginAuthDto();
    logger.info("操作人信息. loginAuthDto={}", loginAuthDto);
    OrderVo orderDoc = omcOrderService.createOrderDoc(loginAuthDto, shippingId);
    return WrapMapper.ok(orderDoc);
}
Also used : OrderVo(com.paascloud.provider.model.vo.OrderVo) LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) ApiOperation(io.swagger.annotations.ApiOperation)

Example 4 with OrderVo

use of com.paascloud.provider.model.vo.OrderVo in project paascloud-master by paascloud.

the class OmcOrderController method queryUserOrderDetail.

@PostMapping("queryUserOrderDetail/{orderNo}")
@ApiOperation(httpMethod = "POST", value = "查询订单详情")
public Wrapper queryUserOrderDetail(@PathVariable String orderNo) {
    logger.info("queryUserOrderDetail - 查询订单明细. orderNo={}", orderNo);
    OrderVo orderVo = omcOrderService.getOrderDetail(orderNo);
    return WrapMapper.ok(orderVo);
}
Also used : OrderVo(com.paascloud.provider.model.vo.OrderVo) ApiOperation(io.swagger.annotations.ApiOperation)

Example 5 with OrderVo

use of com.paascloud.provider.model.vo.OrderVo in project paascloud-master by paascloud.

the class OmcOrderController method queryUserOrderDetailList.

/**
 * 查询订单详情.
 *
 * @param orderNo the order no
 *
 * @return the wrapper
 */
@PostMapping("queryUserOrderDetailList/{orderNo}")
@ApiOperation(httpMethod = "POST", value = "查询订单详情")
public Wrapper queryUserOrderDetailList(@PathVariable String orderNo) {
    logger.info("queryUserOrderDetailList - 查询用户订单明细. orderNo={}", orderNo);
    Long userId = getLoginAuthDto().getUserId();
    logger.info("操作人信息. userId={}", userId);
    OrderVo orderVo = omcOrderService.getOrderDetail(userId, orderNo);
    return WrapMapper.ok(orderVo);
}
Also used : OrderVo(com.paascloud.provider.model.vo.OrderVo) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

OrderVo (com.paascloud.provider.model.vo.OrderVo)5 ApiOperation (io.swagger.annotations.ApiOperation)3 OmcOrderDetail (com.paascloud.provider.model.domain.OmcOrderDetail)2 LoginAuthDto (com.paascloud.base.dto.LoginAuthDto)1 OmcOrder (com.paascloud.provider.model.domain.OmcOrder)1 OmcShipping (com.paascloud.provider.model.domain.OmcShipping)1 OrderItemVo (com.paascloud.provider.model.vo.OrderItemVo)1