提交 ae9079c8 编写于 作者: wenhao.qin's avatar wenhao.qin

人员角色权限控制

上级 8804a9b7
...@@ -197,11 +197,11 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService { ...@@ -197,11 +197,11 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
if (accountExist == null) { if (accountExist == null) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "当前用户不存在"); throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "当前用户不存在");
} }
HospitalSaasUserEditResp resp = accountMapper.selectUserRoleById(req.getId()); HospitalSaasUserEditResp saasUser = accountMapper.selectUserRoleById(req.getId());
if (req.getLoginFlag() == 1 && Objects.nonNull(resp) && !Objects.equals(req.getRoleId(), resp.getRoleId()) && req.getRoleId() != 0 && resp.getRoleId() < SaasRoleEnum.SAAS_MAIN_ADMIN.getCode()) { if (req.getLoginFlag() == 1 && saasUser != null && saasUser.getRoleId() != null && !Objects.equals(req.getRoleId(), saasUser.getRoleId()) && req.getRoleId() != 0 && saasUser.getRoleId() < SaasRoleEnum.SAAS_MAIN_ADMIN.getCode()) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "当前角色不可编辑"); throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "当前角色不可编辑");
} }
if (req.getLoginFlag() == 0 && Objects.nonNull(resp) &&!Objects.equals(req.getRoleId(), resp.getRoleId()) && req.getRoleId() != 0 && resp.getRoleId() < SaasRoleEnum.SAAS_DOCTOR.getCode()) { if (req.getLoginFlag() == 0 && saasUser != null && saasUser.getRoleId() != null && !Objects.equals(req.getRoleId(), saasUser.getRoleId()) && req.getRoleId() != 0 && saasUser.getRoleId() < SaasRoleEnum.SAAS_DOCTOR.getCode()) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "当前角色不可编辑"); throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "当前角色不可编辑");
} }
Account account = new Account(); Account account = new Account();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册