| | |
| | | private RemoteUserService remoteUserService; |
| | | @Resource |
| | | private NoticeRecordService noticeRecordService; |
| | | @GetMapping("/deleteBalance/{id}/{amount}") |
| | | public R deleteBalance(@PathVariable("id")String id,@PathVariable("amount")String amount) { |
| | | AppUser byId = appUserService.getById(id); |
| | | if (byId!=null){ |
| | | BigDecimal subtract = byId.getBalance().subtract(new BigDecimal(amount)); |
| | | if (subtract.compareTo(BigDecimal.ZERO)<0){ |
| | | byId.setBalance(BigDecimal.ZERO); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/testNotice") |
| | | @ApiOperation(value = "测试通知", tags = "测试通知") |
| | | public R testNotice() { |
| | |
| | | } |
| | | courseLambdaQueryWrapper.in(AppUser::getId, collect); |
| | | } |
| | | courseLambdaQueryWrapper.isNotNull(AppUser::getCellPhone); |
| | | Page<AppUser> page = appUserService.page(new Page<>(courseDTO.getPageCurr(), courseDTO.getPageSize()), courseLambdaQueryWrapper); |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | return R.ok(PageDTO.empty(page)); |
| | |
| | | throw new ServiceException("验证码不正确"); |
| | | } |
| | | AppUser byId = appUserService.getById(userId); |
| | | |
| | | AppUser one = appUserService.lambdaQuery().eq(AppUser::getCellPhone, phone) |
| | | .ne(AppUser::getId, userId) |
| | | .ne(AppUser::getUserStatus, 3).one(); |
| | | if (one!=null){ |
| | | return R.fail("当前手机号已被绑定"); |
| | | } |
| | | byId.setCellPhone(phone); |
| | | boolean b = appUserService.updateById(byId); |
| | | return R.ok(); |