|
|
|
@ -4,9 +4,11 @@ import cn.estsh.i3plus.core.api.iservice.busi.IPersonnelService;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysFileService;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysRoleService;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.EncryptTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.StringTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
@ -19,7 +21,6 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
@ -64,6 +65,8 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "添加用户信息", notes = "返回内容添加用户信息")
|
|
|
|
|
public ResultBean insertUserDetailModel(UserDetailModel model) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
SysUser user = model.getSysUser();
|
|
|
|
|
SysUserInfo info = model.getSysUserInfo();
|
|
|
|
|
|
|
|
|
@ -143,6 +146,8 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "修改用户信息", notes = "返回内容添加用户信息")
|
|
|
|
|
public ResultBean updateUserDetailModel(UserDetailModel model) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
SysUser user = model.getSysUser();
|
|
|
|
|
SysUserInfo info = model.getSysUserInfo();
|
|
|
|
|
|
|
|
|
@ -228,6 +233,8 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "修改用户信息", notes = "返回内容添加用户信息")
|
|
|
|
|
public ResultBean updateUserModel(UserDetailModel model) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
checkUserModel(model);
|
|
|
|
|
SysUser user = personnelService.getSysUserById(Long.parseLong(model.getUserId()));
|
|
|
|
|
initUser(model, user);
|
|
|
|
@ -334,6 +341,8 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "删除用户信息", notes = "根据用户信息id删除信息")
|
|
|
|
|
public ResultBean deleteSysUserInfo(@PathVariable("id") String id) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
//条件验证
|
|
|
|
|
ValidatorBean.checkNotNull(id, "id为空");
|
|
|
|
|
|
|
|
|
@ -362,6 +371,8 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
|
|
|
|
|
public ResultBean deleteSysUserInfoByIds(String[] ids) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
ids = ConvertBean.modelSafeArrayNumber(ids, true);
|
|
|
|
|
if (ids.length == 0) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
@ -405,6 +416,8 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "删除账号信息", notes = "根据账号信息id删除信息")
|
|
|
|
|
public ResultBean deleteSysUser(@PathVariable("id") String id) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
//条件验证
|
|
|
|
|
ValidatorBean.checkNotNull(id, "id为空");
|
|
|
|
|
|
|
|
|
@ -433,6 +446,8 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
|
|
|
|
|
public ResultBean deleteSysUserByIds(String[] ids) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
ids = ConvertBean.modelSafeArrayNumber(ids, true);
|
|
|
|
|
if (ids.length == 0) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
@ -559,6 +574,57 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取账号的所有组织信息集合
|
|
|
|
|
* @return 组织信息集合
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(value = "/user/get-organize-list")
|
|
|
|
|
@ApiOperation(value = "获取账号信息", notes = "获取用户账号的所有组织信息")
|
|
|
|
|
public ResultBean getUserOrganizeList(){
|
|
|
|
|
try {
|
|
|
|
|
List<SysOrganize> list = AuthUtil.getSessionUser().getUser().getOrganizeList();
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(list);
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/user/session-organize/{id}")
|
|
|
|
|
@ApiOperation(value = "修改用户会话组织信息", notes = "修改用户会话组织信息")
|
|
|
|
|
public ResultBean updateUserOrganizeList(@PathVariable("id") String idStr){
|
|
|
|
|
try {
|
|
|
|
|
ValidatorBean.checkIsNumber(idStr, "id为空");
|
|
|
|
|
List<SysOrganize> list = AuthUtil.getSessionUser().getUser().getOrganizeList();
|
|
|
|
|
Long id = Long.parseLong(idStr);
|
|
|
|
|
SysOrganize organize = null;
|
|
|
|
|
for (SysOrganize org : list) {
|
|
|
|
|
if(org.getId().equals(id)){
|
|
|
|
|
organize = org;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(organize == null){
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.IMPP.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
.setErrorDetail("不存在的组织信息")
|
|
|
|
|
.setErrorSolution("请重新操作")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 会话工厂信息保存进Redis
|
|
|
|
|
AuthUtil.setOrganize(organize);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(organize);
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 数据必填校验
|
|
|
|
|
*
|
|
|
|
|
* @param model 用户信息
|
|
|
|
@ -588,7 +654,7 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 数据必填校验
|
|
|
|
|
*
|
|
|
|
|
* @param model数据消息
|
|
|
|
|
* @param model 数据消息
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
public void checkUserModel(UserDetailModel model) throws Exception {
|
|
|
|
@ -631,6 +697,8 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
* @param model 用户模型
|
|
|
|
|
*/
|
|
|
|
|
public void refreshRef(SysUser user, SysUserInfo info, UserDetailModel model) {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
if (user != null) {
|
|
|
|
|
// 刷新账号 部门关系
|
|
|
|
|
personnelService.refreshRefSysUserDepartment(user.getId(), StringTool.getArrayLong(model.getUserDepartmentIdList()));
|
|
|
|
|