| | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.VipCenterService; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.VipGoodClient; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private RemoteOrderGoodsClient remoteOrderGoodsClient; |
| | | @Resource |
| | | private VipGoodClient vipGoodClient; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | @Override |
| | | public Boolean checkReadyToBeProxy(Long userId) { |
| | | public Boolean checkReadyToBeProxy(Long userId,Integer vipId) { |
| | | AppUser appUser = appUserService.getById(userId); |
| | | if (appUser.getShopPoint() >= 500){ |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(vipId); |
| | | if (vipSetting.getVipLevelUpShopRole() == 0){ |
| | | return false; |
| | | } |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | if (appUser.getShopPoint() >= vipLevelUpShop){ |
| | | return true; |
| | | } |
| | | if (appUser.getSharePoint() >= 400){ |
| | | Integer vipLevelUpShare = vipSetting.getVipLevelUpShare(); |
| | | if (appUser.getSharePoint() >= vipLevelUpShare){ |
| | | return true; |
| | | } |
| | | |