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
提交
cad555c1
提交
cad555c1
编写于
11月 12, 2019
作者:
rushui.chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
20191112 登录成功后补充缓存信息
上级
66e73f43
流水线
#16951
已失败 于阶段
in 1 second
变更
3
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
58 行增加
和
2 行删除
+58
-2
AccountServiceImpl.java
...count/account/server/service/impl/AccountServiceImpl.java
+27
-0
TokenUtils.java
...om/pica/cloud/account/account/server/util/TokenUtils.java
+27
-1
AccountMapper.xml
server/src/main/resources/mybatis/AccountMapper.xml
+4
-1
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/service/impl/AccountServiceImpl.java
浏览文件 @
cad555c1
...
...
@@ -160,6 +160,7 @@ public class AccountServiceImpl implements AccountService {
}
}
//更新缓存中hospital_id,hospital信息
//成功返回0,失败返回1
private
int
refresh
(
Map
<
String
,
Object
>
doctorMap
)
{
...
...
@@ -167,6 +168,19 @@ public class AccountServiceImpl implements AccountService {
//String hospitalId = doctorMap.get("hospital_id") == null ? StringUtils.EMPTY : doctorMap.get("hospital_id").toString();
//String hospital = doctorMap.get("hospital") == null ? StringUtils.EMPTY : doctorMap.get("hospital").toString();
String
mobile
=
doctorMap
.
get
(
"mobile_phone"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"mobile_phone"
).
toString
();
String
status
=
doctorMap
.
get
(
"status"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"status"
).
toString
();
String
avatar_image_url
=
doctorMap
.
get
(
"avatar_image_url"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"avatar_image_url"
).
toString
();
String
email
=
doctorMap
.
get
(
"email"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"email"
).
toString
();
String
province
=
doctorMap
.
get
(
"province"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"province"
).
toString
();
String
province_name
=
doctorMap
.
get
(
"province"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"province_name"
).
toString
();
String
city
=
doctorMap
.
get
(
"city"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"city"
).
toString
();
String
city_name
=
doctorMap
.
get
(
"city_name"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"city_name"
).
toString
();
String
county
=
doctorMap
.
get
(
"county"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"county"
).
toString
();
String
county_name
=
doctorMap
.
get
(
"county_name"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"county_name"
).
toString
();
String
town
=
doctorMap
.
get
(
"town"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"town"
).
toString
();
String
town_name
=
doctorMap
.
get
(
"town_name"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"town_name"
).
toString
();
String
title
=
doctorMap
.
get
(
"title"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"title"
).
toString
();
String
title_id
=
doctorMap
.
get
(
"title_id"
)
==
null
?
StringUtils
.
EMPTY
:
doctorMap
.
get
(
"title_id"
).
toString
();
String
key
=
KEY_PREFIX
+
doctorId
;
try
{
...
...
@@ -176,7 +190,20 @@ public class AccountServiceImpl implements AccountService {
}
//cacheClient.hset(key, "hospital_id", StringUtils.isEmpty(hospitalId) ? "0" : hospitalId);
//cacheClient.hset(key, "hospital", hospital);
cacheClient
.
hset
(
key
,
"province_name"
,
province_name
);
cacheClient
.
hset
(
key
,
"city_name"
,
city_name
);
cacheClient
.
hset
(
key
,
"county_name"
,
county_name
);
cacheClient
.
hset
(
key
,
"town_name"
,
town_name
);
cacheClient
.
hset
(
key
,
"province_id"
,
province
);
cacheClient
.
hset
(
key
,
"city_id"
,
city
);
cacheClient
.
hset
(
key
,
"county_id"
,
county
);
cacheClient
.
hset
(
key
,
"town_id"
,
town
);
cacheClient
.
hset
(
key
,
"mobile"
,
mobile
);
cacheClient
.
hset
(
key
,
"status"
,
status
);
cacheClient
.
hset
(
key
,
"avatar_image_url"
,
avatar_image_url
);
cacheClient
.
hset
(
key
,
"email"
,
email
);
cacheClient
.
hset
(
key
,
"title_id"
,
title_id
);
cacheClient
.
hset
(
key
,
"title"
,
title
);
return
0
;
}
catch
(
Exception
ex
)
{
return
1
;
...
...
server/src/main/java/com/pica/cloud/account/account/server/util/TokenUtils.java
浏览文件 @
cad555c1
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
util
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
import
com.pica.cloud.account.account.server.mapper.DoctorMapper
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -27,6 +29,8 @@ public class TokenUtils {
@Qualifier
(
"cacheMigrateClient"
)
private
ICacheClient
cacheClient
;
@Autowired
private
DoctorMapper
doctorMapper
;
/**
* 校验token的状态
...
...
@@ -70,10 +74,32 @@ public class TokenUtils {
data
.
put
(
"token"
,
newToken
);
data
.
put
(
"id"
,
account
.
getId
()
+
""
);
data
.
put
(
"acctId"
,
account
.
getAcctId
()
+
""
);
data
.
put
(
"mobile"
,
account
.
getMobilePhone
());
if
(!
StringUtils
.
isBlank
(
account
.
getMobilePhone
()))
{
data
.
put
(
"mobile"
,
AESUtil
.
encryptV0
(
account
.
getMobilePhone
()));
}
else
{
data
.
put
(
"mobile"
,
""
);
}
data
.
put
(
"name"
,
account
.
getMobilePhone
().
replaceAll
(
"(\\d{3})\\d{4}(\\w{4})"
,
"$1****$2"
));
data
.
put
(
"created_time"
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
account
.
getCreatTime
()));
data
.
put
(
"sysCode"
,
sourceType
);
if
(
account
.
getId
()!=
null
){
Doctor
doctor
=
doctorMapper
.
selectByPrimaryKey
(
account
.
getId
().
intValue
());
data
.
put
(
"town"
,
doctor
.
getTown
()
+
""
);
data
.
put
(
"town_name"
,
doctor
.
getTownName
()+
""
);
data
.
put
(
"county"
,
doctor
.
getCounty
()
+
""
);
data
.
put
(
"county_name"
,
doctor
.
getCountyName
()+
""
);
data
.
put
(
"city"
,
doctor
.
getCity
()
+
""
);
data
.
put
(
"city_name"
,
doctor
.
getCityName
()+
""
);
data
.
put
(
"province"
,
doctor
.
getProvince
()
+
""
);
data
.
put
(
"province_name"
,
doctor
.
getProvinceName
()
+
""
);
data
.
put
(
"hospital"
,
doctor
.
getHospital
()+
""
);
data
.
put
(
"hospital_id"
,
doctor
.
getHospitalId
()
+
""
);
data
.
put
(
"department"
,
doctor
.
getDepartment
()+
""
);
data
.
put
(
"department_id"
,
doctor
.
getDepartmentId
()
+
""
);
data
.
put
(
"title"
,
doctor
.
getTitle
()+
""
);
data
.
put
(
"title_id"
,
doctor
.
getTitleId
()
+
""
);
data
.
put
(
"status"
,
doctor
.
getStatus
()
+
""
);
}
Iterator
<
Map
.
Entry
<
String
,
String
>>
iterator
=
data
.
entrySet
().
iterator
();
while
(
iterator
.
hasNext
())
{
Map
.
Entry
<
String
,
String
>
map
=
iterator
.
next
();
...
...
server/src/main/resources/mybatis/AccountMapper.xml
浏览文件 @
cad555c1
...
...
@@ -308,7 +308,10 @@
</select>
<select
id=
"getHospitalInfoByPage"
resultType=
"map"
>
select id, hospital_id, hospital, mobile_phone
select id, hospital_id, hospital,mobile_phone,
status, avatar_image_url, email,
province, province_name,city, city_name, county, county_name,town, town_name,
title,title_id
from p_doctor
where delete_flag = 1
<if
test=
"id != null"
>
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录