|
@@ -1,6 +1,7 @@
|
|
package com.caimei365.commodity.service.impl;
|
|
package com.caimei365.commodity.service.impl;
|
|
|
|
|
|
import com.caimei365.commodity.components.RedisService;
|
|
import com.caimei365.commodity.components.RedisService;
|
|
|
|
+import com.caimei365.commodity.mapper.PageMapper;
|
|
import com.caimei365.commodity.mapper.PriceMapper;
|
|
import com.caimei365.commodity.mapper.PriceMapper;
|
|
import com.caimei365.commodity.mapper.SecondHandMapper;
|
|
import com.caimei365.commodity.mapper.SecondHandMapper;
|
|
import com.caimei365.commodity.model.ResponseJson;
|
|
import com.caimei365.commodity.model.ResponseJson;
|
|
@@ -12,6 +13,7 @@ import com.caimei365.commodity.model.vo.*;
|
|
import com.caimei365.commodity.service.SecondHandService;
|
|
import com.caimei365.commodity.service.SecondHandService;
|
|
import com.caimei365.commodity.utils.ImageUtils;
|
|
import com.caimei365.commodity.utils.ImageUtils;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
+import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -42,6 +44,8 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
private RedisService redisService;
|
|
private RedisService redisService;
|
|
@Resource
|
|
@Resource
|
|
private PriceMapper priceMapper;
|
|
private PriceMapper priceMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private PageMapper pageMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -108,10 +112,13 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
if (userId != null && userId > 0) {
|
|
if (userId != null && userId > 0) {
|
|
userIdentity = priceMapper.getIdentityByUserId(userId);
|
|
userIdentity = priceMapper.getIdentityByUserId(userId);
|
|
}
|
|
}
|
|
|
|
+ // 超级会员标识
|
|
|
|
+ Integer svipUserId = pageMapper.getSvipUserIdByUserId(userId);
|
|
|
|
+ boolean svipUserFlag = null != svipUserId;
|
|
SecondDetailVo second = secondHandMapper.getSecondHandDetail(productId);
|
|
SecondDetailVo second = secondHandMapper.getSecondHandDetail(productId);
|
|
Integer visibility = second.getVisibility();
|
|
Integer visibility = second.getVisibility();
|
|
boolean b = userIdentity == 0 && (visibility == 1 || visibility == 2);
|
|
boolean b = userIdentity == 0 && (visibility == 1 || visibility == 2);
|
|
- boolean a = userIdentity == 4 && visibility == 1;
|
|
|
|
|
|
+ boolean a = userIdentity == 4 && visibility == 1 && !svipUserFlag;
|
|
if (b || a) {
|
|
if (b || a) {
|
|
return ResponseJson.error("无权限查看", null);
|
|
return ResponseJson.error("无权限查看", null);
|
|
}
|
|
}
|