|
@@ -1,8 +1,5 @@
|
|
|
package com.caimei365.order.service.impl;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.caimei365.order.components.ProductService;
|
|
@@ -90,8 +87,15 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
// 促销活动(总)
|
|
|
List<PromotionsVo> totalPromotions = new ArrayList<>();
|
|
|
List<Integer> promotionsIds = new ArrayList<>();
|
|
|
+ // 用户注册时间
|
|
|
+ Date registerTime = orderCommonMapper.getUserRegisterTime(userId);
|
|
|
// 用户可用优惠券(总)
|
|
|
List<CouponVo> couponList = orderCommonMapper.getClubCouponList(userId);
|
|
|
+ // 用户可领取优惠券(总)
|
|
|
+ List<CouponVo> preCouponList = orderCommonMapper.getPrevCouponList(userId, registerTime);
|
|
|
+ List<CouponVo> totalCouponList = new ArrayList<>();
|
|
|
+ totalCouponList.addAll(couponList);
|
|
|
+ totalCouponList.addAll(preCouponList);
|
|
|
List<CartItemVo> cartAllProducts = new ArrayList<>();
|
|
|
// 用户身份
|
|
|
Integer userIdentity = baseMapper.getIdentityByUserId(userId);
|
|
@@ -321,7 +325,7 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
}
|
|
|
}
|
|
|
// 是否可领取优惠券
|
|
|
- Boolean couponsLogo = setCouponsLogo(shop.getShopId(), source, productList, couponList);
|
|
|
+ Boolean couponsLogo = setCouponsLogo(shop.getShopId(), source, productList, totalCouponList);
|
|
|
shop.setCouponsLogo(couponsLogo);
|
|
|
|
|
|
// 供应商商品
|
|
@@ -338,6 +342,8 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
totalPrice.set(MathUtil.add(totalPrice, shop.getTotalPrice()).doubleValue());
|
|
|
// 优惠总额
|
|
|
reducedPrice.set(MathUtil.add(reducedPrice, shop.getReducedPrice()).doubleValue());
|
|
|
+ // 超级会员优惠总额
|
|
|
+ svipReducedPrice.set(MathUtil.add(svipReducedPrice, shop.getSvipReducedPrice()).doubleValue());
|
|
|
// 总划线价
|
|
|
totalOriginalPrice.set(MathUtil.add(totalOriginalPrice, shop.getOriginalPrice()).doubleValue());
|
|
|
// 商品种类
|
|
@@ -388,6 +394,7 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
resultMap.put("totalCount", totalCount);
|
|
|
resultMap.put("totalPrice", totalPrice);
|
|
|
resultMap.put("reducedPrice", reducedPrice);
|
|
|
+ resultMap.put("svipReducedPrice", svipReducedPrice);
|
|
|
resultMap.put("totalOriginalPrice", totalOriginalPrice);
|
|
|
resultMap.put("promotions", totalPromotions);
|
|
|
resultMap.put("couponList", couponList);
|
|
@@ -1841,7 +1848,7 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
// 供应商下购物车商品列表
|
|
|
List<CartItemVo> productList = cartClubMapper.getCartProductsByShopId(shopId, userId);
|
|
|
// 未领取的优惠券
|
|
|
- List<CouponVo> preCouponList = orderCommonMapper.getPrevCouponList(userId);
|
|
|
+ List<CouponVo> preCouponList = orderCommonMapper.getPrevCouponList(userId, registerTime);
|
|
|
//剔除超级会员优惠券
|
|
|
List<Integer> vipCoupon = cartClubMapper.findVipCoupon();
|
|
|
if (preCouponList != null && preCouponList.size() > 0) {
|