|
|
|
@ -4,6 +4,7 @@ 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;
|
|
|
|
@ -19,7 +20,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;
|
|
|
|
@ -30,7 +30,10 @@ import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description :
|
|
|
|
@ -128,6 +131,7 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
// 关系 刷新
|
|
|
|
|
refreshRef(user, info, model);
|
|
|
|
|
|
|
|
|
|
endMultiService();
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
@ -155,6 +159,7 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
personnelService.checkSysUserOnly(user);
|
|
|
|
|
|
|
|
|
|
SysUserInfo userInfo = personnelService.getSysUserInfoById(info.getId());
|
|
|
|
|
SysUser sysUser = personnelService.getSysUserById(user.getId());
|
|
|
|
|
|
|
|
|
|
SysDepartment infoDepartment = personnelService.getSysDepartmentById(Long.parseLong(model.getInfoDepartmentId()));
|
|
|
|
|
if (infoDepartment == null) {
|
|
|
|
@ -202,17 +207,23 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
userInfo.setUserGrade(info.getUserGrade());
|
|
|
|
|
userInfo.setUserEmployeeType(info.getUserEmployeeType());
|
|
|
|
|
|
|
|
|
|
user.setDepartmentId(userDepartment.getId());
|
|
|
|
|
user.setDepartmentNameRdd(userDepartment.getName());
|
|
|
|
|
user.setOrganizeId(userOrganize.getId());
|
|
|
|
|
user.setOrganizeNameRdd(userOrganize.getName());
|
|
|
|
|
sysUser.setUserLoginName(user.getUserLoginName());
|
|
|
|
|
sysUser.setLanguageCode(user.getLanguageCode());
|
|
|
|
|
sysUser.setUserEmail(user.getUserEmail());
|
|
|
|
|
sysUser.setUserPhone(user.getUserPhone());
|
|
|
|
|
sysUser.setDepartmentId(userDepartment.getId());
|
|
|
|
|
sysUser.setDepartmentNameRdd(userDepartment.getName());
|
|
|
|
|
sysUser.setOrganizeId(userOrganize.getId());
|
|
|
|
|
sysUser.setOrganizeNameRdd(userOrganize.getName());
|
|
|
|
|
|
|
|
|
|
// 关系 刷新
|
|
|
|
|
refreshRef(user, userInfo, model);
|
|
|
|
|
refreshRef(sysUser, userInfo, model);
|
|
|
|
|
// 更新 密码
|
|
|
|
|
refreshSysUserPassword(user);
|
|
|
|
|
if(StringUtils.isNotBlank(user.getUserLoginPassword())){
|
|
|
|
|
refreshSysUserPassword(sysUser);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
personnelService.saveSysUser(user);
|
|
|
|
|
personnelService.saveSysUser(sysUser);
|
|
|
|
|
personnelService.saveSysUserInfo(userInfo);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
@ -573,6 +584,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 用户信息
|
|
|
|
@ -602,7 +664,7 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 数据必填校验
|
|
|
|
|
*
|
|
|
|
|
* @param model数据消息
|
|
|
|
|
* @param model 数据消息
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
public void checkUserModel(UserDetailModel model) throws Exception {
|
|
|
|
|