vip优惠商品添加用户是否vip判断
This commit is contained in:
@@ -388,7 +388,7 @@ public class BookLabelAndMarketController {
|
||||
List<Map<String,Object>> list = toLabelService.listMaps(wrapper);
|
||||
for (Map<String,Object> map:list){
|
||||
ShopProduct shopProduct = shopProductService.getById(map.get("product_id").toString());
|
||||
if (shopProduct.getIsVipPrice()==1){
|
||||
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
|
||||
map.put("vip_price",shopProductService.getVipPrice(shopProduct));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class BuyOrderController {
|
||||
@RequestMapping("/getVipDiscountAmount")
|
||||
public R getVipDiscountAmount(@RequestBody BuyOrder buyOrder){
|
||||
BigDecimal b = new BigDecimal(0);
|
||||
if (!userVipService.noVip()){
|
||||
if (userVipService.isVip()){
|
||||
List<BuyOrderProduct> buyOrderProductList = buyOrder.getProductList();
|
||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||
BigDecimal pvda = shopProductService.getVipDiscountAmount(shopProductService.getById(buyOrderProduct.getProductId()));
|
||||
@@ -172,7 +172,7 @@ public class BuyOrderController {
|
||||
List<BuyOrderProduct> buyOrderProductList = buyOrder.getProductList();
|
||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||
ShopProduct shopProduct = shopProductService.getById(buyOrderProduct.getProductId());
|
||||
if (!userVipService.noVip()){
|
||||
if (userVipService.isVip()){
|
||||
BigDecimal pvda = shopProductService.getVipDiscountAmount(shopProductService.getById(buyOrderProduct.getProductId()));
|
||||
if (pvda.compareTo(BigDecimal.ZERO)>0){
|
||||
continue;
|
||||
@@ -194,7 +194,7 @@ public class BuyOrderController {
|
||||
wrapper.in(ShopProduct::getProductId,Arrays.asList(productIds));
|
||||
List<ShopProduct> shopProductList = shopProductService.list(wrapper);
|
||||
for (ShopProduct shopProduct:shopProductList){
|
||||
if (shopProduct.getIsVipPrice()==1){
|
||||
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
|
||||
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
|
||||
}
|
||||
}
|
||||
@@ -294,7 +294,7 @@ public class BuyOrderController {
|
||||
ShopProduct product = shopProductService.getById(productId);
|
||||
BigDecimal price = getRealPrice(product);
|
||||
if (buyOrder.getVipDiscountAmount()!=null&&buyOrder.getVipDiscountAmount().compareTo(new BigDecimal(0))>0
|
||||
&&product.getIsVipPrice()==1){
|
||||
&&userVipService.isVip()&&product.getIsVipPrice()==1){
|
||||
price = shopProductService.getVipPrice(product);
|
||||
}
|
||||
if (!handleStock(buyOrderProduct, product)) {
|
||||
|
||||
@@ -280,7 +280,7 @@ public class ShopProductController {
|
||||
}
|
||||
for (ShopProductBookEntity spbe : ss) {
|
||||
ShopProduct ca_sp = shopProductService.getById(spbe.getProductId());
|
||||
if (!userVipService.noVip()&&ca_sp.getIsVipPrice()==1){
|
||||
if (userVipService.isVip()&&ca_sp.getIsVipPrice()==1){
|
||||
ca_sp.setVipPrice(shopProductService.getVipPrice(ca_sp));
|
||||
}
|
||||
frag.add(ca_sp);
|
||||
@@ -322,7 +322,7 @@ public class ShopProductController {
|
||||
booklist.add(String.valueOf(bookId));
|
||||
list.add(byId);
|
||||
}
|
||||
if (shopProduct.getIsVipPrice()==1){
|
||||
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
|
||||
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
|
||||
}
|
||||
//添加获取标签逻辑
|
||||
|
||||
@@ -765,7 +765,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
goodsResponseVo.setProductName(shopProduct.getProductName());
|
||||
goodsResponseVo.setProductImage(shopProduct.getProductImages());
|
||||
goodsResponseVo.setProductPrice(shopProduct.getPrice());
|
||||
if (shopProduct.getIsVipPrice()==1){
|
||||
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
|
||||
goodsResponseVo.setVipPrice(shopProductService.getVipPrice(shopProduct));
|
||||
}else {
|
||||
goodsResponseVo.setVipPrice(BigDecimal.ZERO);
|
||||
|
||||
@@ -82,7 +82,7 @@ public class OrderCartServiceImpl extends ServiceImpl<OrderCartDao, OrderCartEnt
|
||||
}
|
||||
shopCartVo.setActivityPrice(price);
|
||||
shopCartVo.setIsVipPrice(productEntity.getIsVipPrice());
|
||||
if (productEntity.getIsVipPrice()==1){
|
||||
if (userVipService.isVip()&&productEntity.getIsVipPrice()==1){
|
||||
shopCartVo.setVipPrice(shopProductService.getVipPrice(productEntity));
|
||||
}
|
||||
cartList.add(shopCartVo);
|
||||
|
||||
@@ -54,10 +54,10 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
||||
@Override
|
||||
public BigDecimal getVipDiscountAmount(ShopProduct shopProduct) {
|
||||
BigDecimal p = new BigDecimal(0);
|
||||
if (shopProduct.getIsVipPrice()==1){
|
||||
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
|
||||
if (userVipService.is4569SVip()||userVipService.is78SVip()){
|
||||
p = shopProduct.getPrice().multiply(new BigDecimal(0.8));
|
||||
}else if (!userVipService.noVip()){
|
||||
}else if (userVipService.isVip()){
|
||||
p = shopProduct.getPrice().multiply(new BigDecimal(0.9));
|
||||
}
|
||||
//如果有折扣价,比折扣价低就返回vip折扣金额
|
||||
@@ -76,7 +76,7 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
||||
BigDecimal b = new BigDecimal(0);
|
||||
if (userVipService.is4569SVip()||userVipService.is78SVip()){
|
||||
b = shopProduct.getPrice().multiply(new BigDecimal(0.8)).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
}else if (!userVipService.noVip()){
|
||||
}else if (userVipService.isVip()){
|
||||
b = shopProduct.getPrice().multiply(new BigDecimal(0.9)).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
}else {
|
||||
BigDecimal activityPrice = shopProduct.getActivityPrice();
|
||||
|
||||
Reference in New Issue
Block a user