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
bb6b1aab
Commit
bb6b1aab
authored
Mar 21, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug:/api/sync/save_detail未判断是否已存在,直接save存在问题,改为先预判,再执行save(新增或更新)
parent
5163603a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
SyncUserController.java
...oup/xyqb/controller/external/user/SyncUserController.java
+13
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/SyncUserController.java
View file @
bb6b1aab
...
@@ -83,11 +83,23 @@ public class SyncUserController {
...
@@ -83,11 +83,23 @@ public class SyncUserController {
}
}
String
phoneNo
=
userDetail
.
getPhoneNo
();
String
phoneNo
=
userDetail
.
getPhoneNo
();
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
if
(
null
==
user
)
{
if
(
Objects
.
isNull
(
user
))
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
}
userDetail
.
setId
(
null
);
userDetail
.
setId
(
null
);
userDetail
.
setUserId
(
user
.
getId
());
userDetail
.
setUserId
(
user
.
getId
());
/*
* 如果已存在记录,则更新
*/
UserDetail
theUserDetail
=
userDetailService
.
findByPhoneNo
(
phoneNo
);
if
(
Objects
.
isNull
(
theUserDetail
)){
theUserDetail
=
userDetailService
.
findByUserId
(
user
.
getId
());
}
if
(
Objects
.
isNull
(
theUserDetail
)){
userDetail
.
setId
(
null
);
}
else
{
userDetail
.
setId
(
theUserDetail
.
getId
());
}
userDetailService
.
saveUserDetail
(
userDetail
);
userDetailService
.
saveUserDetail
(
userDetail
);
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
}
}
...
...
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