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
提交
d2059844
提交
d2059844
编写于
3月 02, 2022
作者:
wenlei.liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
机构SaaS角色修改
上级
a9562a28
流水线
#42828
已取消 于阶段
变更
4
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
48 行增加
和
16 行删除
+48
-16
HospitalSaasRoleController.java
...account/server/controller/HospitalSaasRoleController.java
+5
-3
PermissionRoleMapper.java
...d/account/account/server/mapper/PermissionRoleMapper.java
+2
-0
HospitalSaasRoleServiceImpl.java
...ount/server/service/impl/HospitalSaasRoleServiceImpl.java
+20
-12
PermissionRoleMapper.xml
server/src/main/resources/mybatis/PermissionRoleMapper.xml
+21
-1
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/HospitalSaasRoleController.java
浏览文件 @
d2059844
...
...
@@ -7,6 +7,7 @@ import com.pica.cloud.account.account.server.resp.HospitalRoleResp;
import
com.pica.cloud.account.account.server.service.HospitalSaasRoleService
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.service.starter.interceptor.EnabledLoginValidate
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -26,7 +27,8 @@ public class HospitalSaasRoleController extends AccountBaseController {
@PostMapping
(
value
=
"/hospital/role/insertAndModify"
)
@EnabledLoginValidate
public
PicaResponse
<
Integer
>
insertAndModify
(
@RequestBody
HospitalRoleDetailReq
req
)
{
return
PicaResponse
.
toResponse
(
hospitalSaasRoleService
.
insertAndModify
(
req
,
getPicaUser
()));
PicaUser
user
=
fetchPicaUser
();
return
PicaResponse
.
toResponse
(
hospitalSaasRoleService
.
insertAndModify
(
req
,
user
));
}
@ApiOperation
(
"机构saas角色-删除"
)
...
...
@@ -37,10 +39,10 @@ public class HospitalSaasRoleController extends AccountBaseController {
}
@ApiOperation
(
"机构saas平台角色列表"
)
@
Ge
tMapping
(
value
=
"/hospital/role/listByPage"
)
@
Pos
tMapping
(
value
=
"/hospital/role/listByPage"
)
@EnabledLoginValidate
public
PicaResponse
<
HospitalRoleResp
>
ListByPage
(
@RequestBody
HospitalRoleListReq
req
)
{
HospitalRoleResp
hospitalRoleResp
=
hospitalSaasRoleService
.
ListByPage
(
req
);
return
PicaResponse
.
toResponse
(
hospitalRoleResp
);
}
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/PermissionRoleMapper.java
浏览文件 @
d2059844
...
...
@@ -29,4 +29,6 @@ public interface PermissionRoleMapper {
int
deleteById
(
Long
id
);
List
<
RoleDto
>
querySaasRoles
();
PermissionRole
selectByNameCode
(
PermissionRole
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/service/impl/HospitalSaasRoleServiceImpl.java
浏览文件 @
d2059844
// Copyright 2016-2101 Pica.
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.server.entity.PermissionDoctorRole
;
import
com.pica.cloud.account.account.server.entity.PermissionRole
;
import
com.pica.cloud.account.account.server.enums.AccountExceptionEnum
;
import
com.pica.cloud.account.account.server.mapper.PermissionDoctorRoleMapper
;
import
com.pica.cloud.account.account.server.mapper.PermissionRoleMapper
;
import
com.pica.cloud.account.account.server.req.HospitalRoleDetailReq
;
...
...
@@ -11,10 +11,9 @@ import com.pica.cloud.account.account.server.resp.HospitalRoleResp;
import
com.pica.cloud.account.account.server.resp.HospitalSaasRoleResp
;
import
com.pica.cloud.account.account.server.resp.RoleDto
;
import
com.pica.cloud.account.account.server.service.HospitalSaasRoleService
;
import
com.pica.cloud.
account.account.server.util.captcha.CommonUtils
;
import
com.pica.cloud.
foundation.entity.PicaWarnException
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
com.pica.cloud.foundation.utils.utils.CommonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -35,20 +34,29 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
@Override
public
int
insertAndModify
(
HospitalRoleDetailReq
req
,
PicaUser
user
)
{
int
num
;
if
(
null
!=
req
.
getId
()){
PermissionRole
role
=
permissionRoleMapper
.
selectByPrimaryKey
(
req
.
getId
());
PermissionRole
role
=
new
PermissionRole
();
role
.
setRoleName
(
req
.
getName
());
PermissionRole
byNameCode
=
permissionRoleMapper
.
selectByNameCode
(
role
);
if
(
null
!=
req
.
getId
())
{
if
(
null
!=
byNameCode
&&
!
byNameCode
.
getId
().
equals
(
req
.
getId
()))
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PAT_ACCT_HAS_EXIST
.
getCode
(),
AccountExceptionEnum
.
PAT_ACCT_HAS_EXIST
.
getMessage
());
}
role
.
setRoleName
(
req
.
getName
());
role
.
setRemark
(
req
.
getDescribe
());
role
.
setModifiedId
(
Long
.
valueOf
(
user
.
getId
()));
role
.
setModifiedTime
(
new
Date
());
num
=
permissionRoleMapper
.
updateByPrimaryKeySelective
(
role
);
}
else
{
PermissionRole
role
=
new
PermissionRole
();
role
.
setRoleCode
(
"saas_doctor_admin"
);
role
.
setRoleName
(
req
.
getName
());
}
else
{
if
(
null
!=
byNameCode
)
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PAT_ACCT_HAS_EXIST
.
getCode
(),
AccountExceptionEnum
.
PAT_ACCT_HAS_EXIST
.
getMessage
());
}
role
.
setRoleCode
(
"saas_admin"
+
CommonUtil
.
getRandom
(
10
));
role
.
setRemark
(
req
.
getDescribe
());
CommonUtils
.
setCommonParam
(
role
,
user
.
getId
(),
Calendar
.
getInstance
().
getTime
());
num
=
permissionRoleMapper
.
insert
(
role
);
role
.
setCreatedId
(
Long
.
valueOf
(
user
.
getId
()));
role
.
setCreatedTime
(
new
Date
());
role
.
setModifiedId
(
Long
.
valueOf
(
user
.
getId
()));
role
.
setModifiedTime
(
new
Date
());
num
=
permissionRoleMapper
.
insertSelective
(
role
);
}
// PermissionRole role = permissionRoleMapper.selectByPrimaryKey(req.getId());
// //新增
...
...
server/src/main/resources/mybatis/PermissionRoleMapper.xml
浏览文件 @
d2059844
...
...
@@ -29,7 +29,7 @@
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.PermissionRole"
>
insert into permission_role (id, role_code, role_name,remark
insert into permission_role (id, role_code, role_name,remark
,
delete_flag, created_id, created_time,
modified_id, modified_time)
values (#{id,jdbcType=BIGINT}, #{roleCode,jdbcType=VARCHAR}, #{roleName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
...
...
@@ -48,6 +48,9 @@
<if
test=
"roleName != null"
>
role_name,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
...
...
@@ -74,6 +77,9 @@
<if
test=
"roleName != null"
>
#{roleName,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=INTEGER},
</if>
...
...
@@ -174,4 +180,18 @@
set delete_flag = 2
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"selectByNameCode"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from permission_role
where delete_flag = 1
<if
test=
"roleCode != null"
>
and role_code = #{roleCode}
</if>
<if
test=
"roleName != null"
>
and role_name = #{roleName}
</if>
</select>
</mapper>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录