vip 价格 shiro bug

This commit is contained in:
wangjinlei
2025-03-18 11:14:25 +08:00
parent 16f8166877
commit b9eaa57ffc
2 changed files with 13 additions and 10 deletions

View File

@@ -765,11 +765,11 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
goodsResponseVo.setProductName(shopProduct.getProductName());
goodsResponseVo.setProductImage(shopProduct.getProductImages());
goodsResponseVo.setProductPrice(shopProduct.getPrice());
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
goodsResponseVo.setVipPrice(shopProductService.getVipPrice(shopProduct));
}else {
// if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
// goodsResponseVo.setVipPrice(shopProductService.getVipPrice(shopProduct));
// }else {
goodsResponseVo.setVipPrice(BigDecimal.ZERO);
}
// }
goodsResponseVo.setQuantity(buyOrderProduct.getQuantity());
goodsResponseVo.setProductId(shopProduct.getProductId());
QueryWrapper<ExpressOrder> expressOrderQueryWrapper = new QueryWrapper<>();

View File

@@ -17,6 +17,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -66,9 +67,10 @@ 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));
}
// if (userVipService.isVip()&&product.getIsVipPrice()==1){
// product.setVipPrice(shopProductService.getVipPrice(product));
// }
product.setVipPrice(BigDecimal.ZERO);
flag.put("detail",product);//基础信息
//查询包含的书
MPJLambdaWrapper<ShopProductBookEntity> shopProductBookEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();
@@ -123,9 +125,10 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
List<ShopProduct> shopProducts = (List)flag.get("GLProducts");
if (shopProducts.size()>0){
for (ShopProduct shopProduct : shopProducts) {
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
}
shopProduct.setVipPrice(BigDecimal.ZERO);
// if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
// shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
// }
}
}
}