|
@@ -1,34 +1,34 @@
|
|
|
-
|
|
|
- orderVOList.sort(Comparator.comparingInt(OrderVO::getPoints).reversed());
|
|
|
- for (OrderVO orderVO : orderVOList) {
|
|
|
- Integer sumBrandPoints = 0;
|
|
|
-
|
|
|
- if (CollUtil.isNotEmpty(orderCouponVOList)){
|
|
|
- for (OrderCouponVO orderCouponVO : orderCouponVOList) {
|
|
|
-
|
|
|
- if (orderCouponVO.getBuinessId().equals(orderVO.getVendorId())
|
|
|
- && orderCouponVO.getProjectIds().contains(orderVO.getProductId())){
|
|
|
- sumBrandPoints += orderVO.getPoints();
|
|
|
- orderCouponVO.setBrandPoints(orderVO.getPoints());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- CouponUserDO couponUserDO = new CouponUserDO();
|
|
|
- couponUserDO.setId(orderCouponVO.getCouponId());
|
|
|
- couponUserDO.setIsUse(1);
|
|
|
- couponUserDO.setUserId(pointsOrderSaveReqListVO.getUserId());
|
|
|
- couponUserDO.setBrandPoints(orderCouponVO.getBrandPoints());
|
|
|
- couponUserDO.setUseTime(LocalDateTime.now());
|
|
|
- couponUserDO.setBuinessId(orderVO.getVendorId());
|
|
|
- couponUserDO.setOrderNo(orderVO.getOrderNo());
|
|
|
- couponUserService.goUpdateCouponUser(couponUserDO, false);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
-
|
|
|
- Integer sumBrandTotalsPoints = orderCouponVOList.stream()
|
|
|
- .map(orderCouponVO -> ObjUtil.defaultIfNull(orderCouponVO.getBrandPoints(),0))
|
|
|
- .mapToInt(Integer::intValue)
|
|
|
- .sum();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- pointsOrderSaveReqListVO.setTotalsCouponPoints(sumBrandTotalsPoints);
|
|
|
- }
|
|
|
+
|
|
|
+
|