Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
0c29b91b
Commit
0c29b91b
authored
Dec 10, 2018
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : 修复某种条件下 user hash mapping 数据比user detail 创建晚的情况
parent
28ccf13c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
UserDetailHashEventListener.java
...cn/quantgroup/xyqb/event/UserDetailHashEventListener.java
+9
-0
No files found.
src/main/java/cn/quantgroup/xyqb/event/UserDetailHashEventListener.java
View file @
0c29b91b
...
...
@@ -4,6 +4,7 @@ import cn.quantgroup.xyqb.entity.UserDetail;
import
cn.quantgroup.xyqb.entity.UserHashMapping
;
import
cn.quantgroup.xyqb.repository.IUserHashMappingRepository
;
import
cn.quantgroup.xyqb.util.encrypt.MD5Util
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationListener
;
...
...
@@ -13,6 +14,7 @@ import org.springframework.stereotype.Component;
* userDetail 更新时, 保存 hashMapping 数据
*/
@Component
@Slf4j
public
class
UserDetailHashEventListener
implements
ApplicationListener
<
UserDetailUpdateEvent
>
{
@Autowired
...
...
@@ -25,6 +27,13 @@ public class UserDetailHashEventListener implements ApplicationListener<UserDeta
UserHashMapping
userHashMapping
=
userHashMappingRepository
.
findByUserId
(
userDetail
.
getUserId
());
//如果不存在, 我先保存一下
if
(
userHashMapping
==
null
)
{
userHashMapping
=
new
UserHashMapping
(
userDetail
.
getUserId
());
String
phoneNo
=
userDetail
.
getPhoneNo
();
userHashMapping
.
setPhoneNoMd5
(
MD5Util
.
build
(
phoneNo
));
}
String
idNoMd5
=
userHashMapping
.
getIdNoMd5
();
String
idNo
=
userDetail
.
getIdNo
().
toUpperCase
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment