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
cab96047
Commit
cab96047
authored
Apr 16, 2020
by
杨锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 查询用户全量信息 for koala.
parent
784af0ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
31 deletions
+35
-31
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+35
-31
No files found.
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
cab96047
...
@@ -341,13 +341,43 @@ public class UserServiceImpl implements IUserService, IBaseController {
...
@@ -341,13 +341,43 @@ public class UserServiceImpl implements IUserService, IBaseController {
@Override
@Override
public
UserFullResp
findUserFullSearchByUserId
(
Long
userId
)
{
public
UserFullResp
findUserFullSearchByUserId
(
Long
userId
)
{
User
user
=
userRepository
.
findById
(
userId
);
User
user
=
userRepository
.
findById
(
userId
);
if
(
user
==
null
)
{
throw
new
DataException
(
"用户userId = 【"
+
userId
+
"】不存在"
);
}
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
UserExtInfo
userExtInfo
=
userExtInfoService
.
findByUserId
(
userId
);
UserExtInfo
userExtInfo
=
userExtInfoService
.
findByUserId
(
userId
);
Address
address
=
addressService
.
findByUserId
(
userId
);
Address
address
=
addressService
.
findByUserId
(
userId
);
UserFullResp
userFullResp
=
UserFullResp
.
builder
().
userId
(
userId
).
build
();
if
(
user
!=
null
)
{
userFullResp
.
setUuid
(
user
.
getUuid
());
}
if
(
userDetail
!=
null
)
{
userFullResp
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
userFullResp
.
setName
(
userDetail
.
getName
());
userFullResp
.
setIdNo
(
userDetail
.
getIdNo
());
userFullResp
.
setIdType
(
userDetail
.
getIdType
().
ordinal
());
userFullResp
.
setGender
(
userDetail
.
getGender
().
ordinal
());
userFullResp
.
setEmail
(
userDetail
.
getEmail
());
userFullResp
.
setQq
(
userDetail
.
getQq
());
}
if
(
userExtInfo
!=
null
)
{
userFullResp
.
setIncomeType
(
userExtInfo
.
getIncomeEnum
().
ordinal
());
userFullResp
.
setIncomeRange
(
userExtInfo
.
getIncomeRangeEnum
().
ordinal
());
userFullResp
.
setOccupation
(
userExtInfo
.
getOccupationEnum
().
ordinal
());
userFullResp
.
setEducation
(
userExtInfo
.
getEducationEnum
().
ordinal
());
userFullResp
.
setHasCar
(
userExtInfo
.
getHasCar
()
?
1
:
0
);
userFullResp
.
setHasSocialSecurity
(
userExtInfo
.
getHasSocialSecurity
()
?
1
:
0
);
userFullResp
.
setHasHouse
(
userExtInfo
.
getHasHouse
()
?
1
:
0
);
userFullResp
.
setHasCreditCard
(
userExtInfo
.
getHasCreditCard
()
?
1
:
0
);
userFullResp
.
setMarryStatus
(
userExtInfo
.
getMarryStatus
().
ordinal
());
}
if
(
address
!=
null
)
{
userFullResp
.
setProvinceCode
(
address
.
getProvinceCode
());
userFullResp
.
setProvince
(
address
.
getProvince
());
userFullResp
.
setCityCode
(
address
.
getCityCode
());
userFullResp
.
setCity
(
address
.
getCity
());
userFullResp
.
setDistrictCode
(
address
.
getDistrictCode
());
userFullResp
.
setDistrict
(
address
.
getDistrict
());
userFullResp
.
setAddress
(
address
.
getAddress
());
}
List
<
UserFullResp
.
Contact
>
contacts
=
Lists
.
newArrayList
();
List
<
UserFullResp
.
Contact
>
contacts
=
Lists
.
newArrayList
();
contactService
.
findByUserId
(
userId
,
true
).
forEach
(
contact
->
{
contactService
.
findByUserId
(
userId
,
true
).
forEach
(
contact
->
{
contacts
.
add
(
UserFullResp
.
Contact
.
builder
()
contacts
.
add
(
UserFullResp
.
Contact
.
builder
()
...
@@ -357,33 +387,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
...
@@ -357,33 +387,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
.
relation
(
contact
.
getRelation
().
ordinal
())
.
relation
(
contact
.
getRelation
().
ordinal
())
.
build
());
.
build
());
});
});
return
UserFullResp
.
builder
()
userFullResp
.
setContacts
(
contacts
);
.
userId
(
userId
)
return
userFullResp
;
.
uuid
(
user
.
getUuid
())
.
phoneNo
(
userDetail
.
getPhoneNo
())
.
name
(
userDetail
.
getName
())
.
idNo
(
userDetail
.
getIdNo
())
.
idType
(
userDetail
.
getIdType
().
ordinal
())
.
gender
(
userDetail
.
getGender
().
ordinal
())
.
email
(
userDetail
.
getEmail
())
.
qq
(
userDetail
.
getQq
())
.
incomeType
(
userExtInfo
.
getIncomeEnum
().
ordinal
())
.
incomeRange
(
userExtInfo
.
getIncomeRangeEnum
().
ordinal
())
.
occupation
(
userExtInfo
.
getOccupationEnum
().
ordinal
())
.
education
(
userExtInfo
.
getEducationEnum
().
ordinal
())
.
hasCar
(
userExtInfo
.
getHasCar
()
?
1
:
0
)
.
hasSocialSecurity
(
userExtInfo
.
getHasSocialSecurity
()
?
1
:
0
)
.
hasHouse
(
userExtInfo
.
getHasHouse
()
?
1
:
0
)
.
hasCreditCard
(
userExtInfo
.
getHasCreditCard
()
?
1
:
0
)
.
marryStatus
(
userExtInfo
.
getMarryStatus
().
ordinal
())
.
provinceCode
(
address
.
getProvinceCode
())
.
province
(
address
.
getProvince
())
.
cityCode
(
address
.
getCityCode
())
.
city
(
address
.
getCity
())
.
districtCode
(
address
.
getDistrictCode
())
.
district
(
address
.
getDistrict
())
.
address
(
address
.
getAddress
())
.
contacts
(
contacts
)
.
build
();
}
}
}
}
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