Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-account
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.account
pica-cloud-account
提交
7132ac46
提交
7132ac46
编写于
3月 08, 2022
作者:
wenhao.qin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
补充上次
上级
acdae6b7
流水线
#43139
已取消 于阶段
变更
3
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
37 行增加
和
28 行删除
+37
-28
PermissionDoctorRoleMapper.java
...unt/account/server/mapper/PermissionDoctorRoleMapper.java
+2
-0
HospitalSaasUserServiceImpl.java
...ount/server/service/impl/HospitalSaasUserServiceImpl.java
+9
-7
PermissionDoctorRoleMapper.xml
...src/main/resources/mybatis/PermissionDoctorRoleMapper.xml
+26
-21
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/mapper/PermissionDoctorRoleMapper.java
浏览文件 @
7132ac46
...
@@ -33,6 +33,8 @@ public interface PermissionDoctorRoleMapper {
...
@@ -33,6 +33,8 @@ public interface PermissionDoctorRoleMapper {
List
<
PermissionDoctorRole
>
selectByRoleId
(
Long
id
);
List
<
PermissionDoctorRole
>
selectByRoleId
(
Long
id
);
PermissionDoctorRole
selectByUserId
(
Long
id
);
int
deleteByRoleId
(
Map
<
String
,
Object
>
map
);
int
deleteByRoleId
(
Map
<
String
,
Object
>
map
);
List
<
PermissionDoctorRole
>
queryDoctorMenu
(
Integer
doctorId
);
List
<
PermissionDoctorRole
>
queryDoctorMenu
(
Integer
doctorId
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/HospitalSaasUserServiceImpl.java
浏览文件 @
7132ac46
...
@@ -191,19 +191,21 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
...
@@ -191,19 +191,21 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
if
(
Objects
.
isNull
(
req
)
||
Objects
.
isNull
(
req
.
getHospitalId
()))
{
if
(
Objects
.
isNull
(
req
)
||
Objects
.
isNull
(
req
.
getHospitalId
()))
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"参数错误"
);
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"参数错误"
);
}
}
if
(
req
.
getLoginFlag
()
==
1
&&
Objects
.
nonNull
(
req
.
getRoleId
())
&&
req
.
getRoleId
()
!=
0
&&
req
.
getRoleId
()
<
SaasRoleEnum
.
SAAS_MAIN_ADMIN
.
getCode
())
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"当前角色不可删除"
);
}
if
(
req
.
getLoginFlag
()
==
0
&&
Objects
.
nonNull
(
req
.
getRoleId
())
&&
req
.
getRoleId
()
!=
0
&&
req
.
getRoleId
()
<
SaasRoleEnum
.
SAAS_DOCTOR
.
getCode
())
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"当前角色不可删除"
);
}
validatorAdminRole
(
req
.
getRoleId
(),
req
.
getHospitalId
().
longValue
());
validatorAdminRole
(
req
.
getRoleId
(),
req
.
getHospitalId
().
longValue
());
String
mobileEncrypt
=
AESUtil
.
encryptV0
(
req
.
getMobile
());
String
mobileEncrypt
=
AESUtil
.
encryptV0
(
req
.
getMobile
());
Account
accountExist
=
accountMapper
.
getByMobilePhone
(
mobileEncrypt
);
Account
accountExist
=
accountMapper
.
getByMobilePhone
(
mobileEncrypt
);
if
(
accountExist
==
null
)
{
if
(
accountExist
==
null
)
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"当前用户不存在"
);
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"当前用户不存在"
);
}
}
PermissionDoctorRole
doctorRole
=
doctorRoleMapper
.
selectByUserId
(
req
.
getId
());
if
(
req
.
getLoginFlag
()
==
1
&&
Objects
.
nonNull
(
doctorRole
)
&&
!
Objects
.
equals
(
req
.
getRoleId
(),
doctorRole
.
getRoleId
())
&&
req
.
getRoleId
()
!=
0
&&
doctorRole
.
getRoleId
()
<
SaasRoleEnum
.
SAAS_MAIN_ADMIN
.
getCode
())
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"当前角色不可删除"
);
}
if
(
req
.
getLoginFlag
()
==
0
&&
Objects
.
nonNull
(
doctorRole
)
&&!
Objects
.
equals
(
req
.
getRoleId
(),
doctorRole
.
getRoleId
())
&&
req
.
getRoleId
()
!=
0
&&
doctorRole
.
getRoleId
()
<
SaasRoleEnum
.
SAAS_DOCTOR
.
getCode
())
{
throw
new
PicaException
(
PicaResultCode
.
PARAM_IS_INVALID
.
code
(),
"当前角色不可删除"
);
}
Account
account
=
new
Account
();
Account
account
=
new
Account
();
account
.
setId
(
req
.
getId
());
account
.
setId
(
req
.
getId
());
account
.
setModifyId
(
doctorId
);
account
.
setModifyId
(
doctorId
);
...
...
server/src/main/resources/mybatis/PermissionDoctorRoleMapper.xml
浏览文件 @
7132ac46
...
@@ -48,7 +48,8 @@
...
@@ -48,7 +48,8 @@
and modified_time
<
DATE_FORMAT(NOW(), '%Y-%m-%d %H:00:00')
and modified_time
<
DATE_FORMAT(NOW(), '%Y-%m-%d %H:00:00')
</insert>
</insert>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.PermissionDoctorRole"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.PermissionDoctorRole"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into permission_doctor_role (id, doctor_id, hospital_id,
insert into permission_doctor_role (id, doctor_id, hospital_id,
role_id, delete_flag, created_id,
role_id, delete_flag, created_id,
created_time, modified_id, modified_time)
created_time, modified_id, modified_time)
...
@@ -164,8 +165,8 @@
...
@@ -164,8 +165,8 @@
<update
id=
"deleteByDoctorId"
parameterType=
"java.util.Map"
>
<update
id=
"deleteByDoctorId"
parameterType=
"java.util.Map"
>
update permission_doctor_role
update permission_doctor_role
set delete_flag
= 2
,
set delete_flag
= 2
,
modified_id = #{modifiedId,jdbcType=BIGINT},
modified_id
= #{modifiedId,jdbcType=BIGINT},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where doctor_id = #{id,jdbcType=BIGINT}
where doctor_id = #{id,jdbcType=BIGINT}
</update>
</update>
...
@@ -180,27 +181,31 @@
...
@@ -180,27 +181,31 @@
</update>
</update>
<select
id=
"queryDoctorMenu"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
<select
id=
"queryDoctorMenu"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
SELECT
SELECT pr.*
pr.*
FROM permission_doctor_role pr,
FROM
p_saas_menu pm
permission_doctor_role pr,
WHERE pr.doctor_id = #{doctorId}
p_saas_menu pm
AND pr.role_id = pm.permission_role_id
WHERE
AND pr.delete_flag = 1
pr.doctor_id = #{doctorId}
AND pm.delete_flag = 1
AND pr.role_id = pm.permission_role_id
AND pm.system_type = 42
AND pr.delete_flag = 1
GROUP BY pm.NAME
AND pm.delete_flag = 1
AND pm.system_type = 42
GROUP BY
pm. NAME
</select>
</select>
<select
id=
"selectByHospitalIdRoleId"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByHospitalIdRoleId"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
SELECT
SELECT pr.*
pr.*
FROM permission_doctor_role pr
FROM
permission_doctor_role pr
WHERE pr.hospital_id = #{hospitalId}
WHERE pr.hospital_id = #{hospitalId}
and pr.role_id = #{roleId} AND pr.delete_flag = 1 order by pr.modified_time desc limit 1
and pr.role_id = #{roleId}
AND pr.delete_flag = 1
order by pr.modified_time desc
limit 1
</select>
<select
id=
"selectByUserId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from permission_doctor_role
where doctor_id = #{id,jdbcType=BIGINT} and delete_flag = 1
limit 1;
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录