| | |
| | | import com.ruoyi.account.service.*; |
| | | import com.ruoyi.account.util.PointDetailUtil; |
| | | import com.ruoyi.account.util.SignDayUtil; |
| | | import com.ruoyi.account.util.carBrand.CarBrandUtil; |
| | | import com.ruoyi.account.wx.model.WeixinProperties; |
| | | import com.ruoyi.account.util.GiveVipUtil; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.auth.AuthUtil; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | @Resource |
| | | private TInviteUserService inviteUserService; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "优惠卷列表不分页(1可使用2不可用)", tags = {"小程序-个人中心"}) |
| | | @PostMapping(value = "/user/coupon/getById") |
| | | public R<TAppCoupon> couponGetById(@RequestParam("id")Long id) { |
| | | TAppCoupon appCoupon = appCouponService.getById(id); |
| | | return R.ok(appCoupon); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "赠送会员", tags = {"用户管理-用户列表"}) |
| | |
| | | } |
| | | //增加vipDetail |
| | | giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay); |
| | | |
| | | |
| | | appUserService.updateById(nowUser); |
| | | //执行一次赠送优惠卷的定时任务 |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "已赠送列表", tags = {"小程序-个人中心-邀请好友"}) |
| | | @PostMapping(value = "/user/invite/page") |
| | | public R<Page<TInviteUser>> invitePage(@RequestBody BasePage basePage) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | |
| | | Page<TInviteUser> page = inviteUserService.lambdaQuery().eq(TInviteUser::getAppUserId, userId).isNotNull(TInviteUser::getAward).orderByDesc(TInviteUser::getCreateTime).page(Page.of(basePage.getPageCurr(), basePage.getPageSize())); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "已赠送列表", tags = {"小程序-个人中心-邀请好友"}) |
| | | @PostMapping(value = "/user/invite/info") |
| | | public R<InviteInfoDto> inviteInfo() { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | Integer point = 0; |
| | | List<TInviteUser> list = inviteUserService.lambdaQuery().eq(TInviteUser::getAppUserId, userId).isNotNull(TInviteUser::getAward).orderByDesc(TInviteUser::getCreateTime).list(); |
| | | for (TInviteUser tInviteUser : list) { |
| | | point = point +tInviteUser.getAward(); |
| | | } |
| | | InviteInfoDto inviteInfoDto = new InviteInfoDto(); |
| | | inviteInfoDto.setPoint(point); |
| | | inviteInfoDto.setInviteNum(list.size()); |
| | | |
| | | |
| | | return R.ok(inviteInfoDto); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "更换手机号", tags = {"小程序-用户管理-更换手机号"}) |
| | | @PostMapping(value = "/user/updatePhone") |
| | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆品牌", tags = {"小程序-个人中心-车辆"}) |
| | | @GetMapping(value = "/user/car/getBrands") |
| | | public R getBrands() throws Exception { |
| | | String brand = CarBrandUtil.getBrand(); |
| | | return R.ok(brand); |
| | | } |
| | | } |
| | | |