|
|
|
@ -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;
|
|
|
|
@ -559,6 +560,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 +640,7 @@ public class PersonnelController extends CoreBaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 数据必填校验
|
|
|
|
|
*
|
|
|
|
|
* @param model数据消息
|
|
|
|
|
* @param model 数据消息
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
public void checkUserModel(UserDetailModel model) throws Exception {
|
|
|
|
|