|
@@ -3,6 +3,7 @@ package com.caimei365.commodity.service.impl;
|
|
|
import com.caimei365.commodity.components.PriceUtilService;
|
|
|
import com.caimei365.commodity.mapper.CouponMapper;
|
|
|
import com.caimei365.commodity.mapper.PageMapper;
|
|
|
+import com.caimei365.commodity.mapper.PriceMapper;
|
|
|
import com.caimei365.commodity.mapper.ShopMapper;
|
|
|
import com.caimei365.commodity.model.ResponseJson;
|
|
|
import com.caimei365.commodity.model.dto.CollarCouponsDto;
|
|
@@ -39,6 +40,8 @@ public class CouponServiceImpl implements CouponService {
|
|
|
@Resource
|
|
|
private PageMapper pageMapper;
|
|
|
@Resource
|
|
|
+ private PriceMapper priceMapper;
|
|
|
+ @Resource
|
|
|
private PriceUtilService priceUtilService;
|
|
|
|
|
|
/**
|
|
@@ -96,8 +99,17 @@ public class CouponServiceImpl implements CouponService {
|
|
|
if (coupon == null) {
|
|
|
return ResponseJson.error("活动已失效", null);
|
|
|
}
|
|
|
+ // 用户身份:0个人,1协销,2会员机构,3供应商,4普通机构
|
|
|
+ Integer identity = priceMapper.getIdentityByUserId(userId);
|
|
|
+ // 会员机构类型:1医美,2生美
|
|
|
+ if (null != identity && identity == 2) {
|
|
|
+ Integer clubType = priceMapper.getClubTypeById(userId);
|
|
|
+ if (null != clubType && clubType == 1){
|
|
|
+ identity = 5;
|
|
|
+ }
|
|
|
+ }
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
- List<ProductItemVo> productList = couponMapper.findCouponProduct(couponId, source);
|
|
|
+ List<ProductItemVo> productList = couponMapper.findCouponProduct(couponId, source, identity);
|
|
|
productList.forEach(p -> {
|
|
|
p.setCouponsLogo(true);
|
|
|
priceUtilService.setProductDetails(userId, p,2);
|