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;
}
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;
}
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;
}
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;
}
Aggregations