| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.example.jz.modle.R; |
| | |
| | | } |
| | | |
| | | @DeleteMapping("/manager") |
| | | @ApiOperation("删除管理") |
| | | @ApiOperation("删除管理人员") |
| | | public R removeManager(@RequestParam Integer id) { |
| | | List<Cause> list = causeService.list(new LambdaQueryWrapper<Cause>().eq(Cause::getUserId, id)); |
| | | if (!Objects.isNull(list) && list.size() != 0){ |
| | |
| | | return R.ok(userService.removeById(id)); |
| | | } |
| | | |
| | | @DeleteMapping("/crowd") |
| | | @ApiOperation("删除普通用户") |
| | | public R removeCrowd(@RequestParam Integer id){ |
| | | List<Report> list = reportService.list(Wrappers.<Report>lambdaQuery().eq(Report::getUserId, id)); |
| | | for (Report report : list) { |
| | | groupUserService.remove(new LambdaQueryWrapper<GroupUser>().eq(GroupUser::getUserId, report.getId())); |
| | | messageService.remove(new LambdaQueryWrapper<Message>().eq(Message::getUserId, report.getId())); |
| | | reportService.removeById(report.getId()); |
| | | } |
| | | userService.remove(Wrappers.<User>lambdaQuery().eq(User::getId, id)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/manager") |
| | | @ApiOperation("分页查询所有数据") |
| | | public R selectManager(Page<User> page, User user) { |