vip优惠商品添加用户是否vip判断
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user