|
@@ -620,7 +620,6 @@ public class PageServiceImpl implements PageService {
|
|
|
// 数据库获取基本价格信息
|
|
|
List<Sku> skus = priceMapper.findSkus(productId);
|
|
|
PriceVo price = priceMapper.getDetailPrice(productId);
|
|
|
- product.setSkus(skus);
|
|
|
price.setSkus(skus);
|
|
|
// 根据用户id设置详细价格
|
|
|
priceUtilService.setPriceByUserId(price, userId);
|
|
@@ -631,8 +630,11 @@ public class PageServiceImpl implements PageService {
|
|
|
product.setSvipProductFlag(price.getSvipProductFlag());
|
|
|
product.setSvipPriceTag(price.getSvipPriceTag());
|
|
|
AtomicBoolean lowPrice = new AtomicBoolean(false);
|
|
|
+ //设置展示的价格等级
|
|
|
+ product.setPriceGrade(priceUtilService.getPriceGrade(product.getPrice()));
|
|
|
// 设置阶梯价格详情
|
|
|
skus.forEach(s -> {
|
|
|
+ s.setPriceGrade(priceUtilService.getPriceGrade(s.getPrice()));
|
|
|
if (1 == s.getLadderPriceFlag()) {
|
|
|
List<LadderPriceVo> ladderPrices = priceMapper.getLadderPricesByProductId(s.getSkuId());
|
|
|
TaxVo tax = priceMapper.getTaxByProductId(productId);
|
|
@@ -648,7 +650,9 @@ public class PageServiceImpl implements PageService {
|
|
|
ProductItemVo showProduct = priceMapper.findLowPrice(productId);
|
|
|
product.setPrice(showProduct.getPrice());
|
|
|
product.setUnit(showProduct.getUnit());
|
|
|
+ product.setLadderPriceFlag(1);
|
|
|
} else {
|
|
|
+ product.setLadderPriceFlag(0);
|
|
|
List<Sku> collect = skus.stream().sorted(Comparator.comparing(Sku::getPrice)).collect(Collectors.toList());
|
|
|
product.setPrice(collect.get(0).getPrice());
|
|
|
product.setUnit(collect.get(0).getUnit());
|
|
@@ -656,6 +660,16 @@ public class PageServiceImpl implements PageService {
|
|
|
//查询商品收藏情况,1未收藏,0未收藏,未收藏过该商品用户是null
|
|
|
Integer like = likeMapper.findLike(userId, productId);
|
|
|
product.setUserLike(like);
|
|
|
+ //游客屏蔽价格
|
|
|
+ if (null == userId || 0 == userId) {
|
|
|
+ skus.forEach(s -> {
|
|
|
+ s.setCostPrice(0d);
|
|
|
+ s.setPrice(0d);
|
|
|
+ s.setNormalPrice(0d);
|
|
|
+ s.setOriginalPrice(0d);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ product.setSkus(skus);
|
|
|
}
|
|
|
return ResponseJson.success(product);
|
|
|
}
|