修改VIP商品优惠
This commit is contained in:
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.ShiroUtils;
|
||||
import com.peanut.modules.common.dao.BookDao;
|
||||
import com.peanut.modules.common.dao.ShopProductBookDao;
|
||||
import com.peanut.modules.common.dao.ShopProductCourseDao;
|
||||
@@ -67,10 +68,11 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
||||
public Map<String, Object> getProductDetail(Integer productId) {
|
||||
ShopProduct product = this.getById(productId);
|
||||
HashMap<String, Object> flag = new HashMap<>();
|
||||
// if (userVipService.isVip()&&product.getIsVipPrice()==1){
|
||||
// product.setVipPrice(shopProductService.getVipPrice(product));
|
||||
// }
|
||||
product.setVipPrice(BigDecimal.ZERO);
|
||||
if (userVipService.isVip(ShiroUtils.getUId())&&product.getIsVipPrice()==1){
|
||||
product.setVipPrice(shopProductService.getVipPrice(product));
|
||||
}else {
|
||||
product.setVipPrice(BigDecimal.ZERO);
|
||||
}
|
||||
flag.put("detail",product);//基础信息
|
||||
//查询包含的书
|
||||
MPJLambdaWrapper<ShopProductBookEntity> shopProductBookEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
||||
@@ -126,9 +128,9 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
||||
if (shopProducts.size()>0){
|
||||
for (ShopProduct shopProduct : shopProducts) {
|
||||
shopProduct.setVipPrice(BigDecimal.ZERO);
|
||||
// if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
|
||||
// shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
|
||||
// }
|
||||
if (userVipService.isVip(ShiroUtils.getUId())&&shopProduct.getIsVipPrice()==1){
|
||||
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user