Pu Zhibing
2025-01-20 41af6f7c9dbd59d945946c805c3f29eeaa8bb261
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -531,8 +531,7 @@
            appUserClient.editAppUserById(appUser);
    
            //降级检测
            boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId());
            if(vipDemotion){
            if(1 < appUser.getVipId() && appUser.getVipId() < 4){
                appUserClient.vipDemotion(appUser.getId());
            }
            //回退优惠券状态
@@ -668,8 +667,7 @@
        appUserClient.editAppUserById(appUser);
    
        //降级检测
        boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId());
        if(vipDemotion){
        if(1 < appUser.getVipId() && appUser.getVipId() < 4){
            appUserClient.vipDemotion(appUser.getId());
        }
@@ -730,18 +728,7 @@
        return R.ok();
    }
    /**
     * 会员降级检测
     */
    public boolean vipDemotion(Integer shopPoint, Integer vipId){
        if(vipId == 1 || vipId > 3){
            return false;
        }
        VipSetting vipSetting = vipSettingClient.getVipSetting(vipId).getData();
        Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole();
        Integer vipLevelUpShop = vipSetting.getVipLevelUpShop();
        return 1 == vipLevelUpShopRole && shopPoint < vipLevelUpShop;
    }
    
    
    /**