|
|
|
@ -7,6 +7,7 @@ import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.RefUserRole;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysUser;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysUserInfo;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
@ -137,6 +138,68 @@ public class SysUserController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/status")
|
|
|
|
|
@ApiOperation(value = "修改用户状态", notes = "根据ID修改用户状态")
|
|
|
|
|
public ResultBean updateStatus(String id, int status) {
|
|
|
|
|
try {
|
|
|
|
|
// 数据校验
|
|
|
|
|
ValidatorBean.checkNotNull(id, "用户id 不能为空");
|
|
|
|
|
ValidatorBean.checkNotZero(status, "用户状态不能为空");
|
|
|
|
|
|
|
|
|
|
sysUserService.updateSysUserStatus(id, status, AuthUtil.getSessionUser());
|
|
|
|
|
return new ResultBean(true);
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}", busExcep.getErrorDetail(), busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep.getErrorShow());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
LOGGER.error(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getDescription() + ":{}", e.getMessage(), e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/batch-status")
|
|
|
|
|
@ApiOperation(value = "批量修改系统功能状态", notes = "根据ID修改系统功能状态")
|
|
|
|
|
public ResultBean updateBatchStatus(String[] ids,int status) {
|
|
|
|
|
try {
|
|
|
|
|
ids = ConvertBean.modelSafeArrayNumber(ids,true);
|
|
|
|
|
|
|
|
|
|
// 数据校验
|
|
|
|
|
ValidatorBean.checkNotNull(ids, "功能id 不能为空");
|
|
|
|
|
ValidatorBean.checkNotZero(status, "功能状态不能为空");
|
|
|
|
|
|
|
|
|
|
sysUserService.updateBatchSysUserStatus(ids,status,AuthUtil.getSessionUser());
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch(ImppBusiException busExcep){
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}",busExcep.getErrorDetail(),busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep.getErrorShow());
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
LOGGER.error(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getDescription() + ":{}",e.getMessage(),e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/update-password")
|
|
|
|
|
@ApiOperation(value = "修改密码", notes = "修改当前登录用户密码")
|
|
|
|
|
public ResultBean updateSysUserPassword(String password,String newPwd) {
|
|
|
|
|
try {
|
|
|
|
|
SessionUser sessionUser = AuthUtil.getSessionUser();
|
|
|
|
|
// 数据校验
|
|
|
|
|
ValidatorBean.checkNotNull(password, "旧密码不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(newPwd, "新密码不能为空");
|
|
|
|
|
|
|
|
|
|
sysUserService.updateSysUserPassword(sessionUser.getUser().getId().toString(),password,newPwd);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch(ImppBusiException busExcep){
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}",busExcep.getErrorDetail(),busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep.getErrorShow());
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
LOGGER.error(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getDescription() + ":{}",e.getMessage(),e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/list")
|
|
|
|
|
@ApiOperation(value = "查询所有用户", notes = "查询所有系统用户")
|
|
|
|
|
public ResultBean findAll() {
|
|
|
|
@ -195,25 +258,6 @@ public class SysUserController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/status")
|
|
|
|
|
@ApiOperation(value = "修改用户状态", notes = "根据ID修改用户状态")
|
|
|
|
|
public ResultBean updateStatus(String id, int status) {
|
|
|
|
|
try {
|
|
|
|
|
// 数据校验
|
|
|
|
|
ValidatorBean.checkNotNull(id, "用户id 不能为空");
|
|
|
|
|
ValidatorBean.checkNotZero(status, "用户状态不能为空");
|
|
|
|
|
|
|
|
|
|
sysUserService.updateSysUserStatus(id, status, AuthUtil.getSessionUser());
|
|
|
|
|
return new ResultBean(true);
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}", busExcep.getErrorDetail(), busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep.getErrorShow());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
LOGGER.error(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getDescription() + ":{}", e.getMessage(), e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@DeleteMapping(value = "/batch-delete")
|
|
|
|
|
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
|
|
|
|
|
public ResultBean deleteBatchSysUserByIds(String[] ids){
|
|
|
|
@ -239,28 +283,6 @@ public class SysUserController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/batch-status")
|
|
|
|
|
@ApiOperation(value = "批量修改系统功能状态", notes = "根据ID修改系统功能状态")
|
|
|
|
|
public ResultBean updateBatchStatus(String[] ids,int status) {
|
|
|
|
|
try {
|
|
|
|
|
ids = ConvertBean.modelSafeArrayNumber(ids,true);
|
|
|
|
|
|
|
|
|
|
// 数据校验
|
|
|
|
|
ValidatorBean.checkNotNull(ids, "功能id 不能为空");
|
|
|
|
|
ValidatorBean.checkNotZero(status, "功能状态不能为空");
|
|
|
|
|
|
|
|
|
|
sysUserService.updateBatchSysUserStatus(ids,status,AuthUtil.getSessionUser());
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch(ImppBusiException busExcep){
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}",busExcep.getErrorDetail(),busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep.getErrorShow());
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
LOGGER.error(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getDescription() + ":{}",e.getMessage(),e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/find-ref-role/{userId}")
|
|
|
|
|
@ApiOperation(value = "查询角色的所有角色权限关系", notes = "查询角色的所有角色权限关系")
|
|
|
|
|
public ResultBean findRefRoleMenu(@PathVariable("userId") String userId) {
|
|
|
|
@ -279,5 +301,4 @@ public class SysUserController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|