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

fix: 删除角色

上级 adfefb89
流水线 #42945 已取消 于阶段
...@@ -33,7 +33,7 @@ public interface PermissionDoctorRoleMapper { ...@@ -33,7 +33,7 @@ public interface PermissionDoctorRoleMapper {
List<PermissionDoctorRole> selectByRoleId(Long id); List<PermissionDoctorRole> selectByRoleId(Long id);
int upsertDefaultRole(Map<String, Object> map); int deleteByRoleId(Map<String, Object> map);
List<PermissionDoctorRole> queryDoctorMenu(Integer doctorId); List<PermissionDoctorRole> queryDoctorMenu(Integer doctorId);
......
...@@ -98,7 +98,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService { ...@@ -98,7 +98,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
throw new PicaWarnException(AccountExceptionEnum.PAT_ACCT_HAS_EXIST.getCode(), "请输入角色id"); throw new PicaWarnException(AccountExceptionEnum.PAT_ACCT_HAS_EXIST.getCode(), "请输入角色id");
} }
if (id == 1 || id == 2 || id == 3) { if (id <= 4) {
throw new PicaWarnException(AccountExceptionEnum.PAT_ACCT_HAS_EXIST.getCode(), "该角色无法删除"); throw new PicaWarnException(AccountExceptionEnum.PAT_ACCT_HAS_EXIST.getCode(), "该角色无法删除");
} }
...@@ -107,7 +107,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService { ...@@ -107,7 +107,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
map.put("modifiedId", user.getId()); map.put("modifiedId", user.getId());
map.put("modifiedTime", new Date()); map.put("modifiedTime", new Date());
permissionRoleMapper.deleteById(map); permissionRoleMapper.deleteById(map);
permissionDoctorRoleMapper.upsertDefaultRole(map); permissionDoctorRoleMapper.deleteByRoleId(map);
return 1; return 1;
} }
......
...@@ -170,10 +170,9 @@ ...@@ -170,10 +170,9 @@
where doctor_id = #{id,jdbcType=BIGINT} where doctor_id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="upsertDefaultRole" parameterType="java.util.Map"> <update id="deleteByRoleId" parameterType="java.util.Map">
update permission_doctor_role update permission_doctor_role
set delete_flag = 2, set delete_flag = 2,
# role_id = 4,
modified_id = #{modifiedId,jdbcType=BIGINT}, modified_id = #{modifiedId,jdbcType=BIGINT},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP} modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where role_id = #{id,jdbcType=BIGINT} where role_id = #{id,jdbcType=BIGINT}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册