|
@@ -232,13 +232,11 @@ public class PageServiceImpl implements PageService {
|
|
|
// 搜索热门关键字
|
|
|
List<String> searchHotWord = pageMapper.getSearchKeyword();
|
|
|
if (!CollectionUtils.isEmpty(searchHotWord) && searchHotWord.size() > 8) {
|
|
|
- searchHotWord.parallelStream()
|
|
|
- .filter(str -> !StringUtils.isEmpty(str)).limit(8)
|
|
|
- .collect(Collectors.toList());
|
|
|
+ searchHotWord.parallelStream().filter(str -> !StringUtils.isEmpty(str)).limit(8).collect(Collectors.toList());
|
|
|
}
|
|
|
map.put("searchHotWord", searchHotWord);
|
|
|
// 头部菜单
|
|
|
- List<TopMenuVo> menuList = pageMapper.getTopMenus(0,source);
|
|
|
+ List<TopMenuVo> menuList = pageMapper.getTopMenus(0, source);
|
|
|
menuList.forEach(item -> {
|
|
|
String link = item.getLink();
|
|
|
if (StringUtils.isNotBlank(link)) {
|
|
@@ -250,13 +248,16 @@ public class PageServiceImpl implements PageService {
|
|
|
}
|
|
|
}
|
|
|
item.setLinkType(AppletsLinkUtil.getLinkType(link));
|
|
|
+ if (3 == item.getLinkType()) {
|
|
|
+ item.setAdsImage(pageMapper.getLiveAdvertisingImage());
|
|
|
+ }
|
|
|
item.setLinkParam(AppletsLinkUtil.getLinkParam(item.getLinkType(), link));
|
|
|
item.setLink(link);
|
|
|
}
|
|
|
});
|
|
|
map.put("topMenuList", menuList);
|
|
|
// 快捷运营菜单
|
|
|
- List<TopMenuVo> shortcutList = pageMapper.getTopMenus(2,source);
|
|
|
+ List<TopMenuVo> shortcutList = pageMapper.getTopMenus(2, source);
|
|
|
shortcutList.forEach(item -> {
|
|
|
String link = item.getLink();
|
|
|
if (StringUtils.isNotBlank(link)) {
|
|
@@ -642,23 +643,23 @@ public class PageServiceImpl implements PageService {
|
|
|
}
|
|
|
// 商品不处于已删除/待审核/审核未通过的状态
|
|
|
if (0 != product.getValidFlag()) {
|
|
|
- // 数据库获取基本价格信息
|
|
|
- PriceVo price = priceMapper.getDetailPrice(productId);
|
|
|
- // 根据用户id设置详细价格
|
|
|
- priceUtilService.setPriceByUserId(price, userId, 0);
|
|
|
- // 设置价格
|
|
|
- product.setPrice(price.getPrice());
|
|
|
- product.setOriginalPrice(price.getOriginalPrice());
|
|
|
- product.setMinBuyNumber(price.getMinBuyNumber());
|
|
|
- product.setUnit(price.getUnit());
|
|
|
- product.setStock(price.getStock());
|
|
|
- product.setSkus(price.getSkus());
|
|
|
- product.setSkuId(price.getSkuId());
|
|
|
- product.setActStatus(price.getActStatus());
|
|
|
- product.setPromotions(price.getPromotions());
|
|
|
- product.setUserIdentity(price.getUserIdentity());
|
|
|
- product.setSvipProductFlag(price.getSvipProductFlag());
|
|
|
- product.setSvipPriceTag(price.getSvipPriceTag());
|
|
|
+ // 数据库获取基本价格信息
|
|
|
+ PriceVo price = priceMapper.getDetailPrice(productId);
|
|
|
+ // 根据用户id设置详细价格
|
|
|
+ priceUtilService.setPriceByUserId(price, userId, 0);
|
|
|
+ // 设置价格
|
|
|
+ product.setPrice(price.getPrice());
|
|
|
+ product.setOriginalPrice(price.getOriginalPrice());
|
|
|
+ product.setMinBuyNumber(price.getMinBuyNumber());
|
|
|
+ product.setUnit(price.getUnit());
|
|
|
+ product.setStock(price.getStock());
|
|
|
+ product.setSkus(price.getSkus());
|
|
|
+ product.setSkuId(price.getSkuId());
|
|
|
+ product.setActStatus(price.getActStatus());
|
|
|
+ product.setPromotions(price.getPromotions());
|
|
|
+ product.setUserIdentity(price.getUserIdentity());
|
|
|
+ product.setSvipProductFlag(price.getSvipProductFlag());
|
|
|
+ product.setSvipPriceTag(price.getSvipPriceTag());
|
|
|
//设置展示的价格等级
|
|
|
product.setPriceGrade(priceUtilService.getPriceGrade(product.getPrice()));
|
|
|
//查询商品收藏情况,1未收藏,0未收藏,未收藏过该商品用户是null
|
|
@@ -1122,8 +1123,7 @@ public class PageServiceImpl implements PageService {
|
|
|
if (product != null) {
|
|
|
// visibility 3:所有人可见,2:普通机构可见,1:会员机构可见,4:仅医美机构可见
|
|
|
String visibility = product.getVisibility();
|
|
|
- boolean visibileFlag = "3".equals(visibility) || ("4".equals(visibility) && clubType == 1) || ("1".equals(visibility) && (isSuperVip || identity == 2))
|
|
|
- || ("2".equals(visibility) && (isSuperVip || identity == 2 || identity == 4));
|
|
|
+ boolean visibileFlag = "3".equals(visibility) || ("4".equals(visibility) && clubType == 1) || ("1".equals(visibility) && (isSuperVip || identity == 2)) || ("2".equals(visibility) && (isSuperVip || identity == 2 || identity == 4));
|
|
|
if (!visibileFlag) {
|
|
|
iterator.remove();
|
|
|
} else {
|
|
@@ -1253,7 +1253,7 @@ public class PageServiceImpl implements PageService {
|
|
|
if (0 == finalPermission) {
|
|
|
imageArchive.setImageList(imageList);
|
|
|
} else if (2 == productClassify && imageArchive.getImageNum() >= 5) {
|
|
|
- imageArchive.setImageList(imageList.subList(0,2));
|
|
|
+ imageArchive.setImageList(imageList.subList(0, 2));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1303,7 +1303,7 @@ public class PageServiceImpl implements PageService {
|
|
|
archiveDetail.setProductName(archive.getProductName());
|
|
|
archiveDetail.setProductType(archive.getProductType());
|
|
|
archiveDetail.setShopName(archive.getShopName());
|
|
|
- archiveDetail.setRelatedLabels(StringUtils.strip(item.toString(),"[]"));
|
|
|
+ archiveDetail.setRelatedLabels(StringUtils.strip(item.toString(), "[]"));
|
|
|
return ResponseJson.success(archiveDetail);
|
|
|
}
|
|
|
|