| | |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditUserDto; |
| | | import com.ruoyi.system.dto.UpAndDownDTO; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.dto.UserIdDto; |
| | | import com.ruoyi.system.model.TAppUser; |
| | | import com.ruoyi.system.query.TAppUserQuery; |
| | | import com.ruoyi.system.service.TAppUserService; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 编辑人员 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:updateUser')") |
| | | @ApiOperation(value = "编辑人员") |
| | | @ApiOperation(value = "编辑人员", response = TAppUser.class) |
| | | @PostMapping(value = "/api/t-app-user/updateUser") |
| | | public R<?> updateUser(@RequestBody String param) { |
| | | TAppUser tAppUser = JSON.parseObject(param, TAppUser.class); |
| | |
| | | /** |
| | | * 删除人员 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:delUser')") |
| | | @ApiOperation(value = "删除人员") |
| | | @PostMapping(value = "/api/t-app-user/delUser") |
| | | public R<?> delUser(@RequestBody String param) { |
| | | String id = JSON.parseObject(param, String.class); |
| | | TAppUser appUser = appUserService.getById(id); |
| | | UserIdDto dto = JSON.parseObject(param, UserIdDto.class); |
| | | TAppUser appUser = appUserService.getById(dto.getId()); |
| | | appUser.setDisabled(true); |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | |
| | | /** |
| | | * 禁用/启用 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:updateStatus')") |
| | | @ApiOperation(value = "禁用/启用") |
| | | @PostMapping(value = "/api/t-app-user/updateStatus") |
| | | public R<?> updateStatus(@RequestBody String param) { |
| | |
| | | /** |
| | | * 禁用/启用 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @ApiOperation(value = "重置密码") |
| | | @PostMapping(value = "/api/t-app-user/resetPwd") |
| | | public R<?> resetPwd(@RequestBody String param) { |
| | | String id = JSON.parseObject(param, String.class); |
| | | TAppUser appUser = appUserService.getById(id); |
| | | UserIdDto dto = JSON.parseObject(param, UserIdDto.class); |
| | | TAppUser appUser = appUserService.getById(dto.getId()); |
| | | String pwd = SecurityUtils.encryptPassword("123456"); |
| | | appUser.setPassword(pwd); |
| | | appUserService.updateById(appUser); |
| | |
| | | /** |
| | | * 获取人员审核管理分页列表 |
| | | */ |
| | | @ApiOperation(value = "获取人员审核管理分页列表", response = TAppUserPageVo.class) |
| | | // @PreAuthorize("@ss.hasPermi('system:user:pageAuditList')") |
| | | @ApiOperation(value = "获取人员审核管理分页列表", response = TAppUserQuery.class) |
| | | @PostMapping(value = "/api/t-app-user/pageAuditList") |
| | | public R<PageInfo<TAppUserPageVo>> pageAuditList(@RequestBody String param) { |
| | | TAppUserQuery query = JSON.parseObject(param, TAppUserQuery.class); |
| | |
| | | /** |
| | | * 获取人员审核管理详情 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:auditDetail')") |
| | | @ApiOperation(value = "获取人员审核管理详情", response = TAppUserPageVo.class) |
| | | @PostMapping(value = "/api/t-app-user/pageAuditDetail") |
| | | public R<TAppUserPageVo> pageAuditDetail(@RequestBody String param) { |
| | | TAppUserQuery query = JSON.parseObject(param, TAppUserQuery.class); |
| | | return R.ok(appUserService.pageAuditDetail(query)); |
| | | @PostMapping(value = "/api/t-app-user/auditDetail") |
| | | public R<TAppUserPageVo> auditDetail(@RequestBody String param) { |
| | | UserIdDto dto = JSON.parseObject(param, UserIdDto.class); |
| | | return R.ok(appUserService.pageAuditDetail(dto.getId())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑人员 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:auditUser')") |
| | | @ApiOperation(value = "人员审核", response = AuditUserDto.class) |
| | | @PostMapping(value = "/api/t-app-user/auditUser") |
| | | public R<?> auditUser(@RequestBody String param) { |
| | | AuditUserDto dto = JSON.parseObject(param, AuditUserDto.class); |
| | | TAppUser tAppUser = appUserService.getById(dto.getId()); |
| | | tAppUser.setStatus(dto.getStatus()); |
| | | tAppUser.setTeamId(dto.getTeamId()); |
| | | appUserService.updateById(tAppUser); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |