|
@@ -271,6 +271,11 @@ public class SysUserController {
|
|
|
if (StringUtils.isEmpty(id)) {
|
|
|
return ResponseVO.fail("id不能为空!");
|
|
|
}
|
|
|
+ // id获取用户
|
|
|
+ SysUser sysUser = sysUserService.getById(id);
|
|
|
+ if (sysUser == null) {
|
|
|
+ return ResponseVO.fail("不能删除用户!");
|
|
|
+ }
|
|
|
try {
|
|
|
boolean bo = sysUserService.removeUserById(Integer.parseInt(id));
|
|
|
if (bo) {
|
|
@@ -340,4 +345,38 @@ public class SysUserController {
|
|
|
}
|
|
|
return ResponseVO.success();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 解锁用户信息
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/relockUser")
|
|
|
+ @InterfaceLimit
|
|
|
+ @OperateLog(title = "用户管理", businessType = BusinessType.OTHER)
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:user:relock')")
|
|
|
+ public ResponseVO relockUser(String id) {
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ return ResponseVO.fail("id不能为空!");
|
|
|
+ }
|
|
|
+ // id获取用户
|
|
|
+ SysUser sysUser = sysUserService.getById(id);
|
|
|
+ if (sysUser == null) {
|
|
|
+ return ResponseVO.fail("不能解锁用户!");
|
|
|
+ }
|
|
|
+ if (!"1".equals(sysUser.getStatus())) {
|
|
|
+ return ResponseVO.fail("只能对【锁定】状态的进行解锁!");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ boolean bo = sysUserService.relockUserById(Integer.parseInt(id));
|
|
|
+ if (bo) {
|
|
|
+ return ResponseVO.success("解锁成功");
|
|
|
+ } else {
|
|
|
+ log.error("解锁失败");
|
|
|
+ return ResponseVO.fail("解锁失败");
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ log.error("解锁异常");
|
|
|
+ return ResponseVO.error(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|