| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import com.ruoyi.account.vo.vip.Level; |
| | | import com.ruoyi.account.vo.vip.VipLevel; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.api.feignClient.BaseSettingClient; |
| | | import com.ruoyi.other.api.feignClient.GoodsVipClient; |
| | | import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; |
| | | import com.ruoyi.other.api.feignClient.VipGoodClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.log4j.Log4j2; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private VipGoodClient vipGoodClient; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | |
| | | |
| | | @GetMapping("getVipLevelList") |
| | |
| | | |
| | | vipSettingList.forEach(vipSetting -> { |
| | | Level level = new Level(); |
| | | level.setId(vipSetting.getId()); |
| | | level.setName(vipSetting.getVipName()); |
| | | level.setVipInfo(vipSetting.getVipInfo()); |
| | | BeanUtils.copyBeanProp(level, vipSetting); |
| | | level.setVipDesc(baseSetting.getContent()); |
| | | level.setVipLevelUpShop(vipSetting.getVipLevelUpShop()); |
| | | level.setVipLevelUpShare(vipSetting.getVipLevelUpShare()); |
| | | level.setKeepBuyDay(vipSetting.getKeepBuyDay()); |
| | | level.setKeepBuyPoint(vipSetting.getKeepBuyPoint()); |
| | | level.setKeepShareDay(vipSetting.getKeepShareDay()); |
| | | level.setKeepSharePoint(vipSetting.getKeepSharePoint()); |
| | | level.setKeepShopDay(vipSetting.getKeepShopDay()); |
| | | level.setKeepShopPoint(vipSetting.getKeepShopPoint()); |
| | | |
| | | R<GoodsVip> goodsVipR = goodsVipMap.get(vipSetting.getId()); |
| | | if (R.isSuccess(goodsVipR)) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public R<Void> test() { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | AppUser appUser = appUserService.getById(loginUserApplet.getUserid()); |
| | | if (appUser.getShopPoint() < 500){ |
| | | return R.fail("消费积分不足500"); |
| | | } |
| | | if (appUser.getSharePoint() < 500){ |
| | | return R.fail("返佣积分不足500"); |
| | | } |
| | | // 当前用户的直推用户 |
| | | // List<AppUser> bottomUsers = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | // .eq(AppUser::getInviteUserId, loginUserApplet.getUserid()) |
| | | // .eq(AppUser::getVipId)); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private boolean checkSuccess(R<?> r) { |
| | | if (!R.isSuccess(r)) { |
| | | log.error("请求失败: " + r.getMsg()); |
| | |
| | | private Map<Integer, R<List<VipGood>>> getVipGoods(List<Integer> vipIds) { |
| | | Map<Integer, R<List<VipGood>>> result = new HashMap<>(); |
| | | for (Integer vipId : vipIds) { |
| | | R<List<VipGood>> vipGoodR = vipGoodClient.getVipGoodsByVipId(vipId); |
| | | result.put(vipId, vipGoodR); |
| | | // R<List<VipGood>> vipGoodR = vipGoodClient.getVipGoodsByVipId(vipId); |
| | | // result.put(vipId, vipGoodR); |
| | | } |
| | | return result; |
| | | } |