test.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // // 订单按照积分从大到小排序
  2. // orderVOList.sort(Comparator.comparingInt(OrderVO::getPoints).reversed());
  3. // for (OrderVO orderVO : orderVOList) {
  4. // Integer sumBrandPoints = 0;
  5. // // TODO 优惠券使用
  6. // if (CollUtil.isNotEmpty(orderCouponVOList)){
  7. // for (OrderCouponVO orderCouponVO : orderCouponVOList) {
  8. // //判断商品ID在优化卷ID中包含
  9. // if (orderCouponVO.getBuinessId().equals(orderVO.getVendorId())
  10. // && orderCouponVO.getProjectIds().contains(orderVO.getProductId())){
  11. // sumBrandPoints += orderVO.getPoints();
  12. // orderCouponVO.setBrandPoints(orderVO.getPoints());
  13. // CouponUserDO couponUserDO = new CouponUserDO();
  14. // couponUserDO.setId(orderCouponVO.getCouponId());
  15. // couponUserDO.setIsUse(1);
  16. // couponUserDO.setUserId(pointsOrderSaveReqListVO.getUserId());
  17. // couponUserDO.setBrandPoints(orderCouponVO.getBrandPoints());
  18. // couponUserDO.setUseTime(LocalDateTime.now());
  19. // couponUserDO.setBuinessId(orderVO.getVendorId());
  20. // couponUserDO.setOrderNo(orderVO.getOrderNo());
  21. // couponUserService.goUpdateCouponUser(couponUserDO, false);
  22. // }
  23. // }
  24. // //优惠总积分
  25. // Integer sumBrandTotalsPoints = orderCouponVOList.stream()
  26. // .map(orderCouponVO -> ObjUtil.defaultIfNull(orderCouponVO.getBrandPoints(),0))
  27. // .mapToInt(Integer::intValue)
  28. // .sum();
  29. // pointsOrderSaveReqListVO.setTotalsCouponPoints(sumBrandTotalsPoints);
  30. // }