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
提交
31ed35ca
提交
31ed35ca
编写于
3月 03, 2022
作者:
wenhao.qin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
saas平台修改
上级
17a1b41d
流水线
#42851
已失败 于阶段
变更
9
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
51 行增加
和
30 行删除
+51
-30
HospitalSaasRoleController.java
...account/server/controller/HospitalSaasRoleController.java
+2
-2
HospitalSaasUserController.java
...account/server/controller/HospitalSaasUserController.java
+5
-5
PermissionRoleMapper.java
...d/account/account/server/mapper/PermissionRoleMapper.java
+2
-2
HospitalSaasUserReq.java
...cloud/account/account/server/req/HospitalSaasUserReq.java
+26
-5
HospitalRoleResp.java
...a/cloud/account/account/server/resp/HospitalRoleResp.java
+2
-1
HospitalSaasRoleService.java
...count/account/server/service/HospitalSaasRoleService.java
+1
-1
HospitalSaasRoleServiceImpl.java
...ount/server/service/impl/HospitalSaasRoleServiceImpl.java
+7
-7
HospitalSaasUserServiceImpl.java
...ount/server/service/impl/HospitalSaasUserServiceImpl.java
+3
-4
PermissionRoleMapper.xml
server/src/main/resources/mybatis/PermissionRoleMapper.xml
+3
-3
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/HospitalSaasRoleController.java
浏览文件 @
31ed35ca
...
...
@@ -42,8 +42,8 @@ public class HospitalSaasRoleController extends AccountBaseController {
@ApiOperation
(
"机构saas平台角色列表"
)
@PostMapping
(
value
=
"/hospital/role/listByPage"
)
@EnabledLoginValidate
public
PicaResponse
<
HospitalRoleResp
>
L
istByPage
(
@RequestBody
HospitalRoleListReq
req
)
{
HospitalRoleResp
hospitalRoleResp
=
hospitalSaasRoleService
.
L
istByPage
(
req
);
public
PicaResponse
<
HospitalRoleResp
>
l
istByPage
(
@RequestBody
HospitalRoleListReq
req
)
{
HospitalRoleResp
hospitalRoleResp
=
hospitalSaasRoleService
.
l
istByPage
(
req
);
return
PicaResponse
.
toResponse
(
hospitalRoleResp
);
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/HospitalSaasUserController.java
浏览文件 @
31ed35ca
...
...
@@ -32,28 +32,28 @@ public class HospitalSaasUserController extends AccountBaseController {
@ApiOperation
(
"机构saas平台人员注册 0失败 1成功"
)
@PostMapping
(
value
=
"/hospital/register"
)
@EnabledLoginValidate
public
PicaResponse
<
Integer
>
Register
(
@Validated
@RequestBody
HospitalSaasUserReq
req
)
{
public
PicaResponse
<
Integer
>
register
(
@RequestBody
HospitalSaasUserReq
req
)
{
return
PicaResponse
.
toResponse
(
hospitalSaasUserService
.
register
(
req
,
super
.
getProductType
(),
super
.
getSourceType
(),
getPicaUser
()));
}
@ApiOperation
(
"机构saas平台人员更新 0失败 1成功"
)
@PostMapping
(
value
=
"/hospital/upsert"
)
@EnabledLoginValidate
public
PicaResponse
<
Integer
>
U
psert
(
@RequestBody
HospitalSaasUserReq
req
)
{
public
PicaResponse
<
Integer
>
u
psert
(
@RequestBody
HospitalSaasUserReq
req
)
{
return
PicaResponse
.
toResponse
(
hospitalSaasUserService
.
upsert
(
req
,
getPicaUser
()));
}
@ApiOperation
(
"机构saas平台人员列表查询"
)
@GetMapping
(
value
=
"/hospital/list"
)
@EnabledLoginValidate
public
PicaResponse
<
HospitalSaasUserResp
>
L
ist
(
@RequestBody
HospitalSaasUserListReq
req
)
{
public
PicaResponse
<
HospitalSaasUserResp
>
l
ist
(
@RequestBody
HospitalSaasUserListReq
req
)
{
return
PicaResponse
.
toResponse
(
hospitalSaasUserService
.
listByPage
(
req
));
}
@ApiOperation
(
"机构saas平台人员删除 0失败 1成功"
)
@DeleteMapping
(
value
=
"/hospital/delete"
)
@EnabledLoginValidate
public
PicaResponse
<
Integer
>
D
elete
(
@RequestParam
(
"id"
)
Long
id
)
{
public
PicaResponse
<
Integer
>
d
elete
(
@RequestParam
(
"id"
)
Long
id
)
{
return
PicaResponse
.
toResponse
(
hospitalSaasUserService
.
delete
(
id
));
}
...
...
@@ -67,7 +67,7 @@ public class HospitalSaasUserController extends AccountBaseController {
@ApiOperation
(
"机构saas平台人员-角色列表"
)
@GetMapping
(
value
=
"/hospital/role/listByPage"
)
@EnabledLoginValidate
public
PicaResponse
<
HospitalRoleResp
>
L
istByPage
()
{
public
PicaResponse
<
HospitalRoleResp
>
l
istByPage
()
{
return
PicaResponse
.
toResponse
(
hospitalSaasRoleService
.
querySaasRoles
());
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/mapper/PermissionRoleMapper.java
浏览文件 @
31ed35ca
...
...
@@ -22,9 +22,9 @@ public interface PermissionRoleMapper {
int
updateByPrimaryKey
(
PermissionRole
record
);
List
<
HospitalRoleDto
>
L
istByPage
(
Map
<
String
,
Object
>
map
);
List
<
HospitalRoleDto
>
l
istByPage
(
Map
<
String
,
Object
>
map
);
int
L
istCountByPage
(
Map
<
String
,
Object
>
map
);
int
l
istCountByPage
(
Map
<
String
,
Object
>
map
);
int
deleteById
(
Long
id
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/req/HospitalSaasUserReq.java
浏览文件 @
31ed35ca
// Copyright 2016-2101 Pica.
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
req
;
import
com.pica.cloud.account.account.server.enums.AccountExceptionEnum
;
import
com.pica.cloud.foundation.entity.PicaWarnException
;
import
com.pica.cloud.foundation.utils.utils.ValidateUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NonNull
;
import
org.apache.commons.lang.StringUtils
;
import
org.hibernate.validator.constraints.NotBlank
;
import
javax.validation.constraints.Max
;
...
...
@@ -23,26 +27,43 @@ public class HospitalSaasUserReq {
private
Long
id
;
@ApiModelProperty
(
"姓名"
)
@NotBlank
(
message
=
"姓名不能为空!"
)
@Max
(
value
=
16
,
message
=
"长度≤16字符!"
)
private
String
name
;
@ApiModelProperty
(
"机构id"
)
private
Integer
hospitalId
;
@ApiModelProperty
(
"手机号"
)
@NotBlank
(
message
=
"手机号不能为空!"
)
private
String
mobile
;
@ApiModelProperty
(
"密码"
)
@NotBlank
(
message
=
"密码不能为空!"
)
private
String
password
;
@ApiModelProperty
(
"备注"
)
private
String
comment
;
@ApiModelProperty
(
"角色id"
)
@NotBlank
(
message
=
"角色id不能为空!"
)
private
Long
roleId
;
private
void
checkInsertParams
()
{
if
(
StringUtils
.
isBlank
(
this
.
mobile
))
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getCode
(),
"手机号不能为空"
);
}
if
(
StringUtils
.
isBlank
(
this
.
name
))
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getCode
(),
"姓名不能为空"
);
}
if
(
StringUtils
.
isBlank
(
this
.
password
))
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getCode
(),
"密码不能为空"
);
}
if
(
null
==
this
.
roleId
)
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getCode
(),
"角色id不能为空"
);
}
if
(
this
.
name
.
length
()
>
16
)
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getCode
(),
"姓名长度≤16字符!"
);
}
if
(!
ValidateUtils
.
isMobile
(
this
.
mobile
))
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getCode
(),
"姓名长度≤16字符!"
);
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/resp/HospitalRoleResp.java
浏览文件 @
31ed35ca
...
...
@@ -15,8 +15,9 @@ import java.util.List;
@Data
@AllArgsConstructor
public
class
HospitalRoleResp
{
@ApiModelProperty
(
"查询列表"
)
private
List
<
HospitalRoleDto
>
list
=
new
ArrayList
();
@ApiModelProperty
(
"总条数"
)
private
Integer
totalCount
=
0
;
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/HospitalSaasRoleService.java
浏览文件 @
31ed35ca
...
...
@@ -18,7 +18,7 @@ public interface HospitalSaasRoleService {
int
insertAndModify
(
HospitalRoleDetailReq
req
,
PicaUser
user
);
HospitalRoleResp
L
istByPage
(
HospitalRoleListReq
req
);
HospitalRoleResp
l
istByPage
(
HospitalRoleListReq
req
);
int
delete
(
Long
id
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/HospitalSaasRoleServiceImpl.java
浏览文件 @
31ed35ca
...
...
@@ -53,7 +53,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
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
.
setRoleCode
(
"saas_admin"
+
CommonUtil
.
getRandom
(
10
));
role
.
setRemark
(
req
.
getDescribe
());
role
.
setCreatedId
(
Long
.
valueOf
(
user
.
getId
()));
role
.
setCreatedTime
(
new
Date
());
...
...
@@ -80,22 +80,22 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
}
@Override
public
HospitalRoleResp
L
istByPage
(
HospitalRoleListReq
req
)
{
public
HospitalRoleResp
l
istByPage
(
HospitalRoleListReq
req
)
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>(
3
);
list
.
add
(
1
);
list
.
add
(
2
);
//todo 过滤当前人员的角色信息
//list.add();
Map
<
String
,
Object
>
map
=
new
HashMap
(
2
);
Map
<
String
,
Object
>
map
=
new
HashMap
(
4
);
map
.
put
(
"list"
,
list
);
map
.
put
(
"name"
,
req
.
getName
());
int
count
=
permissionRoleMapper
.
L
istCountByPage
(
map
);
int
count
=
permissionRoleMapper
.
l
istCountByPage
(
map
);
if
(
count
<
1
)
{
return
new
HospitalRoleResp
(
Collections
.
emptyList
(),
0
);
}
map
.
put
(
"pageNo"
,
(
req
.
getPageNo
()
-
1
)
*
req
.
getPageSize
());
map
.
put
(
"pageSize"
,
req
.
getPageSize
());
List
<
HospitalRoleDto
>
roleDtos
=
permissionRoleMapper
.
L
istByPage
(
map
);
List
<
HospitalRoleDto
>
roleDtos
=
permissionRoleMapper
.
l
istByPage
(
map
);
return
new
HospitalRoleResp
(
roleDtos
,
count
);
}
...
...
@@ -103,7 +103,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
@Transactional
public
int
delete
(
Long
id
)
{
permissionRoleMapper
.
deleteById
(
id
);
//把这个角色下的人员信息 调整为默认角色
//把这个角色下的人员信息 调整为默认角色
todo 需写死一个默认角色的id
permissionDoctorRoleMapper
.
upsertDefaultRole
(
id
);
return
1
;
}
...
...
@@ -118,7 +118,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
public
HospitalRoleDto
getRoleDetail
(
Long
id
)
{
HospitalRoleDto
roleDto
=
new
HospitalRoleDto
();
PermissionRole
permissionRole
=
permissionRoleMapper
.
selectByPrimaryKey
(
id
);
BeanUtils
.
copyProperties
(
permissionRole
,
roleDto
);
BeanUtils
.
copyProperties
(
permissionRole
,
roleDto
);
roleDto
.
setRoleId
(
permissionRole
.
getId
());
return
roleDto
;
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/HospitalSaasUserServiceImpl.java
浏览文件 @
31ed35ca
...
...
@@ -57,7 +57,7 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
}
//得到手机号
String
mobile
=
req
.
getMobile
();
//
注册接口幂等性处理:注册成功,删除缓存.
//
幂等校验
String
nxKey
=
Constants
.
REPEAT_REGISTER_PREFIX
+
mobile
;
Long
resultNx
=
redisClient
.
setnx
(
nxKey
,
mobile
);
redisClient
.
expire
(
nxKey
,
2
);
...
...
@@ -66,7 +66,7 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
String
mobileEncrypt
=
AESUtil
.
encryptV0
(
mobile
);
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
mobileEncrypt
);
Account
byMobilePhone
=
accountMapper
.
getByMobilePhone
(
mobileEncrypt
);
//
说明是新用户注册,走注册逻辑,如果已经存在按产品要求走更新
逻辑
//
新用户 走注册
逻辑
if
(
accountInfoEntity
==
null
)
{
redisClient
.
expire
(
nxKey
,
30
);
Date
currentTime
=
Calendar
.
getInstance
().
getTime
();
...
...
@@ -88,7 +88,6 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
}
else
{
//走更新的逻辑,只可以更新角色和备注, 如果需要更新密码 就覆盖老的密码
byMobilePhone
.
setComment
(
req
.
getComment
());
//TODO 密码需接入加密的逻辑
byMobilePhone
.
setPassword
(
req
.
getPassword
());
accountMapper
.
updateByIdSelective
(
byMobilePhone
);
//更新角色信息 逻辑删除
...
...
@@ -141,7 +140,7 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
map
.
put
(
"name"
,
req
.
getName
());
map
.
put
(
"mobile"
,
req
.
getMobile
());
Integer
count
=
accountMapper
.
listCountByPage
(
map
);
if
(
count
<
=
1
)
{
if
(
count
<
1
)
{
return
new
HospitalSaasUserResp
(
Collections
.
emptyList
(),
0
);
}
map
.
put
(
"pageNo"
,
(
req
.
getPageNo
()
-
1
)
*
req
.
getPageSize
());
...
...
server/src/main/resources/mybatis/PermissionRoleMapper.xml
浏览文件 @
31ed35ca
...
...
@@ -150,18 +150,18 @@
)
</if>
<if
test=
"name != null and name != ''"
>
and pr.role_name like concat(
'%',
trim(#{name,jdbcType=VARCHAR}),'%')
and pr.role_name like concat(trim(#{name,jdbcType=VARCHAR}),'%')
</if>
</sql>
<select
id=
"
L
istCountByPage"
resultType=
"java.lang.Integer"
>
<select
id=
"
l
istCountByPage"
resultType=
"java.lang.Integer"
>
select count(*)
from permission_role as pr
where pr.delete_flag = 1
<include
refid=
"list_by_page"
></include>
</select>
<select
id=
"
L
istByPage"
resultType=
"com.pica.cloud.account.account.server.resp.HospitalRoleDto"
>
<select
id=
"
l
istByPage"
resultType=
"com.pica.cloud.account.account.server.resp.HospitalRoleDto"
>
select
pr.created_time as createTime,
pr.role_name as roleName,
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录