| | |
| | | import com.xinquan.course.api.domain.CourseCategory; |
| | | import com.xinquan.course.api.domain.CourseDTO; |
| | | import com.xinquan.course.api.domain.OrderCourseVO; |
| | | import com.xinquan.meditation.api.domain.Meditation; |
| | | import com.xinquan.order.api.feign.RemoteOrderService; |
| | | import com.xinquan.system.api.RemoteBannerService; |
| | | import com.xinquan.system.api.RemoteUserService; |
| | |
| | | private RemoteUserService remoteUserService; |
| | | @Resource |
| | | private NoticeRecordService noticeRecordService; |
| | | @ApiOperation(value = "会员临期", tags = "会员临期") |
| | | @PostMapping("/testVip") |
| | | public void testVip() { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | List<AppUser> list = appUserService.lambdaQuery().ne(AppUser::getUserStatus, 3).list(); |
| | | for (AppUser appUser : list) { |
| | | if (appUser.getVipExpireTime()!=null && appUser.getVipExpireTime().isAfter(now)){ |
| | | // 计算两个now和time的天数差 |
| | | long between = ChronoUnit.DAYS.between(now,appUser.getVipExpireTime()); |
| | | if (between<=7 &&between>=0){ |
| | | NoticeRecord noticeRecord = new NoticeRecord(); |
| | | noticeRecord.setAppUserId(appUser.getId()); |
| | | noticeRecord.setReadStatus(1); |
| | | noticeRecord.setNoticeType(1); |
| | | noticeRecord.setTitle("【会员临期通知】"); |
| | | noticeRecord.setContent("尊敬的泉疗愈会员你好,你的会员即将在" |
| | | +appUser.getVipExpireTime().toLocalDate()+"到期,到期后将不再享受会员权益,请及时续费"); |
| | | noticeRecordService.save(noticeRecord); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | @GetMapping("/deleteBalance/{id}/{amount}") |
| | | public R deleteBalance(@PathVariable("id")String id,@PathVariable("amount")String amount) { |
| | | AppUser byId = appUserService.getById(id); |
| | |
| | | noticeRecord.setReadStatus(1); |
| | | noticeRecord.setNoticeType(1); |
| | | noticeRecord.setTitle("【会员临期通知】"); |
| | | noticeRecord.setContent("尊敬的心泉疗愈会员你好,你的会员即将在" |
| | | noticeRecord.setContent("尊敬的泉疗愈会员你好,你的会员即将在" |
| | | +appUser.getVipExpireTime().toLocalDate()+"到期,到期后将不再享受会员权益,请及时续费"); |
| | | noticeRecordService.save(noticeRecord); |
| | | } |
| | |
| | | SysUser data = remoteUserService.getSysUserById(userid + "").getData(); |
| | | byId.setFreezingOperator(data.getNickName()+"("+data.getUserName()+")"); |
| | | appUserService.updateById(byId); |
| | | // 将被冻结的用户token清除 |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/detail") |
| | |
| | | page.sort((o1, o2) -> o2.getMoney().compareTo(o1.getMoney())); |
| | | |
| | | List<AppUser> testing = testing(page.size(), pageCurr, pageSize, page); |
| | | objectPage.setTotal(testing.size()); |
| | | objectPage.setTotal(page.size()); |
| | | objectPage.setRecords(testing); |
| | | return R.ok(PageDTO.of(objectPage, InviteRankListVO.class)); |
| | | } |
| | |
| | | objectPage.setRecords(testing); |
| | | objectPage.setTotal(res.size()); |
| | | return R.ok(PageDTO.of(objectPage, InviteRankListVO.class)) ; |
| | | } |
| | | @PostMapping("/inviteRankListShareInfo") |
| | | @ApiOperation(value = "爱心助力榜单详情-分页", tags = {"H5分享"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "id", name = "id", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(value = "分页参数,当前页码", name = "pageCurr", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(value = "分页参数,每页数量", name = "pageSize", required = true, dataType = "Integer") |
| | | }) |
| | | public R<PageDTO<InviteRankListVO>> inviteRankListShareInfo( |
| | | @RequestParam(value = "id") Integer id, |
| | | @RequestParam(value = "pageCurr", defaultValue = "1") Integer pageCurr, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LambdaQueryWrapper<AppUser> appUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | appUserLambdaQueryWrapper.eq(AppUser::getInviteUserId,id); |
| | | appUserLambdaQueryWrapper.ne(AppUser::getUserStatus,3); |
| | | Page<AppUser> page = appUserService.page(new Page<>(pageCurr, pageSize), appUserLambdaQueryWrapper); |
| | | return R.ok(PageDTO.of(page, InviteRankListVO.class)) ; |
| | | } |
| | | @PostMapping("/getUserInfo") |
| | | @ApiOperation(value = "获取用户信息", tags = {"个人中心"}) |
| | |
| | | .ne(AppUser::getUserStatus,3).one(); |
| | | if (one!=null){ |
| | | if (one.getId().equals(loginUser.getUserid())){ |
| | | return R.fail("不可赠送给自己"); |
| | | return R.giveError("不能赠送给自己"); |
| | | } |
| | | AppUserDetailVO appUserDetailVO = new AppUserDetailVO(); |
| | | appUserDetailVO.setId(one.getId()); |