|
@@ -285,8 +285,8 @@ public class PageServiceImpl implements PageService {
|
|
|
String liveAdvertisingImage = pageMapper.getLiveAdvertisingImage();
|
|
|
map.put("liveImage", liveAdvertisingImage);
|
|
|
// 热门百科导航
|
|
|
- List <BaikeProductVo> baikeList = pageMapper.getSidebarBaike();
|
|
|
- baikeList.forEach(baikeProduct->{
|
|
|
+ List<BaikeProductVo> baikeList = pageMapper.getSidebarBaike();
|
|
|
+ baikeList.forEach(baikeProduct -> {
|
|
|
String commodityType = baikeProduct.getCommodityType() == 1 ? "product-" : "instrument-";
|
|
|
baikeProduct.setLink(domain + "/encyclopedia/" + commodityType + baikeProduct.getProductId() + ".html");
|
|
|
});
|
|
@@ -494,6 +494,8 @@ public class PageServiceImpl implements PageService {
|
|
|
@Override
|
|
|
public ResponseJson<ProductDetailVo> getProductDetails(Integer productId, Integer userId) {
|
|
|
ProductDetailVo product = pageMapper.getProductDetails(productId);
|
|
|
+ // 用户身份:0个人,1协销,2会员机构,3供应商,4普通机构
|
|
|
+ Integer identity = shopMapper.getUserIdentityById(userId);
|
|
|
if (product == null) {
|
|
|
//商品不存在
|
|
|
product = new ProductDetailVo();
|
|
@@ -533,6 +535,14 @@ public class PageServiceImpl implements PageService {
|
|
|
product.setImageList(imageList);
|
|
|
// 商品详情
|
|
|
ProductDetailInfoPo productDetail = shopMapper.getProductDetailInfo(productId);
|
|
|
+ //非资质机构商品详情展示普通机构商品详情
|
|
|
+ if (2 != identity) {
|
|
|
+ String chose = product.getProductDetailChose();
|
|
|
+ if(StringUtils.isNotEmpty(chose)&&"2".equals(chose)){
|
|
|
+ //将商品详情展示为普通机构商品详情
|
|
|
+ productDetail.setDetailInfo(productDetail.getDetailInfo2());
|
|
|
+ }
|
|
|
+ }
|
|
|
product.setProductDetail(productDetail);
|
|
|
// 相关参数
|
|
|
List<ProductParameterPo> parametersList = shopMapper.getProductParameters(productId);
|
|
@@ -570,8 +580,6 @@ public class PageServiceImpl implements PageService {
|
|
|
// 商品可见度:3:所有人可见,2:普通机构可见,1:会员机构可见,4:仅医美机构可见
|
|
|
Integer visibility = product.getVisibility();
|
|
|
if (null != userId && userId > 0) {
|
|
|
- // 用户身份:0个人,1协销,2会员机构,3供应商,4普通机构
|
|
|
- Integer identity = shopMapper.getUserIdentityById(userId);
|
|
|
// 会员机构类型:1医美,2生美
|
|
|
Integer clubType = 0;
|
|
|
if (null != identity && identity == 2) {
|
|
@@ -677,7 +685,7 @@ public class PageServiceImpl implements PageService {
|
|
|
identity = shopMapper.getUserIdentityById(userId);
|
|
|
identity = null == identity ? 0 : identity;
|
|
|
}
|
|
|
- boolean flag = (identity == 1 || identity == 2 || identity == 3);
|
|
|
+ boolean flag = (identity == 1 || identity == 2 || identity == 3);
|
|
|
if (!flag) {
|
|
|
return ResponseJson.success(1, "没有权限查看该项目仪器", new PageDetailVo());
|
|
|
}
|
|
@@ -929,12 +937,16 @@ public class PageServiceImpl implements PageService {
|
|
|
boolean isSuperVip = null != svipUserId;
|
|
|
// 根据用户Id查询用户身份: 0个人,1协销,2会员机构,3供应商,4普通机构
|
|
|
Integer identity = priceMapper.getIdentityByUserId(userId);
|
|
|
- if (null == identity) {identity = 0;}
|
|
|
+ if (null == identity) {
|
|
|
+ identity = 0;
|
|
|
+ }
|
|
|
// 会员机构类型:1医美,2生美
|
|
|
Integer clubType = 0;
|
|
|
if (identity == 2) {
|
|
|
clubType = priceMapper.getClubTypeById(userId);
|
|
|
- if (null == clubType) {clubType = 0;}
|
|
|
+ if (null == clubType) {
|
|
|
+ clubType = 0;
|
|
|
+ }
|
|
|
}
|
|
|
if (image.getProductId() != null) {
|
|
|
// 获取商品及价格
|
|
@@ -1227,10 +1239,10 @@ public class PageServiceImpl implements PageService {
|
|
|
public ResponseJson<List<BaikeTypeVo>> getBaikePageData(Integer commodityType) {
|
|
|
// 分类列表
|
|
|
List<BaikeTypeVo> baikeTypeList = pageMapper.getBaikeTypeList(commodityType);
|
|
|
- baikeTypeList.forEach(baikeType->{
|
|
|
+ baikeTypeList.forEach(baikeType -> {
|
|
|
// 产品/仪器列表
|
|
|
List<BaikeProductVo> productList = pageMapper.getBaikeProducts(baikeType.getTypeId(), null, 6);
|
|
|
- productList.forEach(product ->{
|
|
|
+ productList.forEach(product -> {
|
|
|
// 问题列表
|
|
|
List<String> questionList = pageMapper.getBaikeQuestionList(product.getProductId());
|
|
|
product.setQuestionList(questionList);
|