修改vipprice,用户会员类型修改
This commit is contained in:
@@ -190,23 +190,12 @@ public class BuyOrderController {
|
||||
public R getShopProductListByIds(@RequestBody Map<String,Object> params){
|
||||
String[] productIds = params.get("productIds").toString().split(",");
|
||||
LambdaQueryWrapper<ShopProduct> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.select(ShopProduct::getProductId,ShopProduct::getProductName,ShopProduct::getProductImages,ShopProduct::getPrice,ShopProduct::getActivityPrice,ShopProduct::getIsVipPrice);
|
||||
wrapper.select(ShopProduct::getProductId,ShopProduct::getProductName,ShopProduct::getProductImages,ShopProduct::getPrice,ShopProduct::getActivityPrice,ShopProduct::getIsVipPrice,ShopProduct::getGoodsType);
|
||||
wrapper.in(ShopProduct::getProductId,Arrays.asList(productIds));
|
||||
List<ShopProduct> shopProductList = shopProductService.list(wrapper);
|
||||
for (ShopProduct shopProduct:shopProductList){
|
||||
//vip价格,不是vip或者活动价更低,返回0
|
||||
if (shopProduct.getIsVipPrice()==1){
|
||||
BigDecimal b = new BigDecimal(0);
|
||||
if (userVipService.is456SVip()||userVipService.is78SVip()){
|
||||
b = shopProduct.getPrice().multiply(new BigDecimal(0.8)).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
}else if (!userVipService.noVip()){
|
||||
b = shopProduct.getPrice().multiply(new BigDecimal(0.9)).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
if (shopProduct.getActivityPrice().compareTo(new BigDecimal(0))>0
|
||||
&&b.compareTo(shopProduct.getActivityPrice())>0){
|
||||
b = new BigDecimal(0);
|
||||
}
|
||||
shopProduct.setVipPrice(b);
|
||||
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
|
||||
}
|
||||
}
|
||||
return R.ok().put("shopProductList",shopProductList);
|
||||
|
||||
Reference in New Issue
Block a user