Browse Source

refactor(confirm-order): 注释掉积分排序及优惠券处理逻辑,准备后续优化

EvilDragon 3 months ago
parent
commit
322cc6b509
1 changed files with 30 additions and 30 deletions
  1. 30 30
      packages/app/src/pages/home/mall/confirm-order/test.java

+ 30 - 30
packages/app/src/pages/home/mall/confirm-order/test.java

@@ -1,34 +1,34 @@
-// 订单按照积分从大到小排序
-            orderVOList.sort(Comparator.comparingInt(OrderVO::getPoints).reversed());
-            for (OrderVO orderVO : orderVOList) {
-                Integer sumBrandPoints = 0;
-                // TODO 优惠券使用
-                if (CollUtil.isNotEmpty(orderCouponVOList)){
-                    for (OrderCouponVO orderCouponVO : orderCouponVOList) {
-                        //判断商品ID在优化卷ID中包含
-                        if (orderCouponVO.getBuinessId().equals(orderVO.getVendorId())
-                                && orderCouponVO.getProjectIds().contains(orderVO.getProductId())){
-                            sumBrandPoints += orderVO.getPoints();
-                            orderCouponVO.setBrandPoints(orderVO.getPoints());
+// // 订单按照积分从大到小排序
+//             orderVOList.sort(Comparator.comparingInt(OrderVO::getPoints).reversed());
+//             for (OrderVO orderVO : orderVOList) {
+//                 Integer sumBrandPoints = 0;
+//                 // TODO 优惠券使用
+//                 if (CollUtil.isNotEmpty(orderCouponVOList)){
+//                     for (OrderCouponVO orderCouponVO : orderCouponVOList) {
+//                         //判断商品ID在优化卷ID中包含
+//                         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);
-                        }
-                    }
+//                             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();
+//                     //优惠总积分
+//                     Integer sumBrandTotalsPoints = orderCouponVOList.stream()
+//                             .map(orderCouponVO -> ObjUtil.defaultIfNull(orderCouponVO.getBrandPoints(),0))
+//                             .mapToInt(Integer::intValue)
+//                             .sum();
 
-                    pointsOrderSaveReqListVO.setTotalsCouponPoints(sumBrandTotalsPoints);
-                }
+//                     pointsOrderSaveReqListVO.setTotalsCouponPoints(sumBrandTotalsPoints);
+//                 }