Search in sources :

Example 1 with OrderItemVo

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

the class OmcCartServiceImpl method assembleOrderItemVo.

private OrderItemVo assembleOrderItemVo(OmcOrderDetail orderItem) {
    OrderItemVo orderItemVo = new OrderItemVo();
    orderItemVo.setOrderNo(orderItem.getOrderNo());
    orderItemVo.setProductId(orderItem.getProductId());
    orderItemVo.setProductName(orderItem.getProductName());
    orderItemVo.setProductImage(orderItem.getProductImage());
    orderItemVo.setCurrentUnitPrice(orderItem.getCurrentUnitPrice());
    orderItemVo.setQuantity(orderItem.getQuantity());
    orderItemVo.setTotalPrice(orderItem.getTotalPrice());
    orderItemVo.setCreateTime(orderItem.getCreatedTime());
    return orderItemVo;
}
Also used : OrderItemVo(com.paascloud.provider.model.vo.OrderItemVo)

Example 2 with OrderItemVo

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

the class OmcCartServiceImpl method getOrderCartProduct.

@Override
public OrderProductVo getOrderCartProduct(Long userId) {
    Preconditions.checkArgument(userId != null, ErrorCodeEnum.UAC10011001.msg());
    OrderProductVo orderProductVo = new OrderProductVo();
    List<OmcCart> omcCartList = omcCartMapper.selectCheckedCartByUserId(userId);
    List<OmcOrderDetail> orderItemList = this.getCartOrderItem(userId, omcCartList);
    List<OrderItemVo> orderItemVoList = Lists.newArrayList();
    BigDecimal payment = new BigDecimal("0");
    for (OmcOrderDetail orderItem : orderItemList) {
        payment = BigDecimalUtil.add(payment.doubleValue(), orderItem.getTotalPrice().doubleValue());
        final OptGetUrlRequest request = new OptGetUrlRequest();
        request.setAttachmentId(Long.valueOf(orderItem.getProductImage()));
        request.setEncrypt(true);
        String fileUrl = opcOssService.getFileUrl(request);
        OrderItemVo orderItemVo = assembleOrderItemVo(orderItem);
        orderItemVo.setProductImage(fileUrl);
        orderItemVoList.add(orderItemVo);
    }
    orderProductVo.setProductTotalPrice(payment);
    orderProductVo.setOrderItemVoList(orderItemVoList);
    return orderProductVo;
}
Also used : OptGetUrlRequest(com.paascloud.provider.model.dto.oss.OptGetUrlRequest) OrderProductVo(com.paascloud.provider.model.vo.OrderProductVo) OmcOrderDetail(com.paascloud.provider.model.domain.OmcOrderDetail) OrderItemVo(com.paascloud.provider.model.vo.OrderItemVo) OmcCart(com.paascloud.provider.model.domain.OmcCart) BigDecimal(java.math.BigDecimal)

Example 3 with OrderItemVo

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

the class OmcOrderServiceImpl method assembleOrderItemVo.

private OrderItemVo assembleOrderItemVo(OmcOrderDetail orderItem) {
    logger.info("订单信息 orderItem={}", orderItem);
    OrderItemVo orderItemVo = new OrderItemVo();
    orderItemVo.setOrderNo(orderItem.getOrderNo());
    orderItemVo.setProductId(orderItem.getProductId());
    orderItemVo.setProductName(orderItem.getProductName());
    // 查询商品的头图
    String url = mdcProductService.getMainImage(orderItem.getProductId());
    orderItemVo.setProductImage(url);
    orderItemVo.setCurrentUnitPrice(orderItem.getCurrentUnitPrice());
    orderItemVo.setQuantity(orderItem.getQuantity());
    orderItemVo.setTotalPrice(orderItem.getTotalPrice());
    orderItemVo.setCreateTime(orderItem.getCreatedTime());
    return orderItemVo;
}
Also used : OrderItemVo(com.paascloud.provider.model.vo.OrderItemVo)

Example 4 with OrderItemVo

use of com.paascloud.provider.model.vo.OrderItemVo 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)

Aggregations

OrderItemVo (com.paascloud.provider.model.vo.OrderItemVo)4 OmcOrderDetail (com.paascloud.provider.model.domain.OmcOrderDetail)2 OmcCart (com.paascloud.provider.model.domain.OmcCart)1 OmcShipping (com.paascloud.provider.model.domain.OmcShipping)1 OptGetUrlRequest (com.paascloud.provider.model.dto.oss.OptGetUrlRequest)1 OrderProductVo (com.paascloud.provider.model.vo.OrderProductVo)1 OrderVo (com.paascloud.provider.model.vo.OrderVo)1 BigDecimal (java.math.BigDecimal)1