| | |
| | | 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)); |
| | | } |
| | |
| | | .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()); |