use of com.paascloud.provider.model.vo.OrderProductVo 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.OrderProductVo in project paascloud-master by paascloud.
the class OmcOrderController method getOrderCartProduct.
/**
* 获取购物车商品数量.
*
* @return the order cart product
*/
@PostMapping("/getOrderCartProduct")
@ApiOperation(httpMethod = "POST", value = "获取购物车商品数量")
public Wrapper getOrderCartProduct() {
logger.info("getOrderCartProduct - 获取购物车商品数量");
OrderProductVo orderCartProduct = omcCartService.getOrderCartProduct(getLoginAuthDto().getUserId());
return WrapMapper.ok(orderCartProduct);
}
Aggregations