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
e56afe11
Commit
e56afe11
authored
Mar 19, 2020
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正user_detial 请求参数接收方式错误的问题
parent
f5c7d281
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
UserDetailController.java
...troller/middleoffice/userdetail/UserDetailController.java
+6
-10
No files found.
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/userdetail/UserDetailController.java
View file @
e56afe11
...
...
@@ -9,8 +9,6 @@ import cn.quantgroup.xyqb.model.JsonResult;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.validator.ChineseName
;
import
cn.quantgroup.xyqb.validator.IdCard
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
...
...
@@ -45,7 +43,7 @@ public class UserDetailController {
@Valid
@RequestBody
UserDetailReq
userDetailReq
)
{
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
if
(
userDetail
==
null
)
{
return
save
(
userId
,
userDetailReq
.
getName
(),
userDetailReq
.
getIdNo
()
);
return
save
(
userId
,
userDetailReq
);
}
//更新
userDetail
.
setName
(
userDetailReq
.
getName
());
...
...
@@ -59,27 +57,25 @@ public class UserDetailController {
* 保存用户实名信息
*
* @param userId
* @param name
* @param idNo
* @param userDetailReq
* @return
*/
@PostMapping
(
"/{userId}"
)
public
JsonResult
save
(
@PathVariable
Long
userId
,
@ChineseName
String
name
,
@IdCard
String
idNo
)
{
@Valid
@RequestBody
UserDetailReq
userDetailReq
)
{
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
if
(
userDetail
!=
null
)
{
return
JsonResult
.
buildSuccessResultGeneric
(
userDetail
);
}
User
user
=
userService
.
findById
(
userId
);
IdCardInfo
idCardInfo
=
idCardService
.
getIdCardInfo
(
idNo
);
IdCardInfo
idCardInfo
=
idCardService
.
getIdCardInfo
(
userDetailReq
.
getIdNo
()
);
Timestamp
now
=
new
Timestamp
(
System
.
currentTimeMillis
());
userDetail
=
new
UserDetail
();
userDetail
.
setUserId
(
userId
);
userDetail
.
setName
(
name
);
userDetail
.
setName
(
userDetailReq
.
getName
()
);
userDetail
.
setPhoneNo
(
user
.
getPhoneNo
());
userDetail
.
setIdNo
(
idNo
);
userDetail
.
setIdNo
(
userDetailReq
.
getIdNo
()
);
userDetail
.
setIdType
(
IdType
.
ID_CARD
);
userDetail
.
setGender
(
idCardInfo
.
getGender
());
userDetail
.
setCreatedAt
(
now
);
...
...
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