提交 65f09370 编写于 作者: minghao.wu's avatar minghao.wu

fix: 角色编辑和删除排除系统默认

上级 6059353a
流水线 #42942 已取消 于阶段
......@@ -44,8 +44,8 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
throw new PicaWarnException(PicaResultCode.DATA_EXCEPTION.code(), "长度≤100字符");
}
if (Objects.nonNull(req.getId()) && (req.getId() == 1 || req.getId() == 2 || req.getId() == 3)) {
throw new PicaWarnException(AccountExceptionEnum.PAT_ACCT_HAS_EXIST.getCode(), "该角色无法删除");
if (Objects.nonNull(req.getId()) && (req.getId() <= 4 )) {
throw new PicaWarnException(AccountExceptionEnum.PAT_ACCT_HAS_EXIST.getCode(), "该角色无法编辑或删除");
}
int num;
......@@ -53,7 +53,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
role.setRoleName(req.getName());
PermissionRole byNameCode = permissionRoleMapper.selectByNameCode(role);
if (null != byNameCode) {
throw new PicaWarnException(AccountExceptionEnum.PAT_ACCT_HAS_EXIST.getCode(), "该角色重复");
throw new PicaWarnException(AccountExceptionEnum.PAT_ACCT_HAS_EXIST.getCode(), "该角色名称重复");
}
if (null != req.getId()) {
role.setId(req.getId());
......
......@@ -80,7 +80,7 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
String nxKey = Constants.REPEAT_REGISTER_PREFIX + mobile;
Long resultNx = redisClient.setnx(nxKey, mobile);
if (resultNx == 0) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "请勿重复提交");
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "该角色名称重复");
}
redisClient.expire(nxKey, 2);
if (resultNx == 1) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册