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
062121e1
Commit
062121e1
authored
Jan 04, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充注册渠道主键以及二级商户主键
parent
6a44731c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
54 deletions
+81
-54
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+38
-21
UserAssociationModel.java
...n/java/cn/quantgroup/xyqb/model/UserAssociationModel.java
+43
-33
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
062121e1
...
...
@@ -56,6 +56,8 @@ public class InnerController implements IBaseController {
@Autowired
private
IUserDetailService
userDetailService
;
@Autowired
private
IUserBtRegisterService
userBtRegisterService
;
@Autowired
private
IIdCardService
idCardService
;
@Autowired
private
IUserExtInfoService
userExtInfoService
;
...
...
@@ -596,36 +598,51 @@ public class InnerController implements IBaseController {
@RequestMapping
(
"/user-association/search/userId"
)
@LogHttpCaller
public
JsonResult
findUserAssociationModelByUserId
(
Long
userId
)
{
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
if
(
Objects
.
isNull
(
userId
)
||
userId
<
0
){
return
JsonResult
.
buildErrorStateResult
(
""
,
""
);
}
UserAssociationModel
bean
=
new
UserAssociationModel
();
if
(
null
!=
userDetail
)
{
UserExtInfo
extInfo
=
userExtInfoService
.
findByUserId
(
userDetail
.
getUserId
());
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
if
(!
Objects
.
isNull
(
userDetail
))
{
bean
.
setId
(
userDetail
.
getUserId
());
bean
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
bean
.
setName
(
userDetail
.
getName
());
bean
.
setIdNo
(
userDetail
.
getIdNo
());
bean
.
setQq
(
userDetail
.
getQq
());
bean
.
setGender
(
Optional
.
ofNullable
(
userDetail
.
getGender
()).
orElse
(
cn
.
quantgroup
.
xyqb
.
model
.
Gender
.
UNKNOWN
).
getName
());
if
(
null
!=
extInfo
)
{
if
(
null
==
extInfo
.
getEducationEnum
()){
bean
.
setEducationEnum
(
cn
.
quantgroup
.
user
.
enums
.
EducationEnum
.
UNKNOWN
.
getName
());
}
else
{
bean
.
setEducationEnum
(
extInfo
.
getEducationEnum
().
getName
());
}
if
(
null
==
extInfo
.
getOccupationEnum
()){
bean
.
setOccupationEnum
(
cn
.
quantgroup
.
user
.
enums
.
OccupationEnum
.
UNKNOWN
.
getName
());
}
else
{
bean
.
setOccupationEnum
(
extInfo
.
getOccupationEnum
().
getName
());
}
if
(
null
==
extInfo
.
getMarryStatus
()){
bean
.
setMarryStatus
(
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
UNKNOWN
.
getDescription
());
}
else
{
bean
.
setMarryStatus
(
extInfo
.
getMarryStatus
().
getDescription
());
}
}
User
user
=
userService
.
findById
(
userId
);
if
(!
Objects
.
isNull
(
user
))
{
bean
.
setRegisterFrom
(
user
.
getRegisteredFrom
());
}
UserBtRegister
userBtRegister
=
userBtRegisterService
.
findByUserId
(
userId
);
if
(!
Objects
.
isNull
(
userBtRegister
))
{
bean
.
setMerchantId
(
userBtRegister
.
getRegisterBtMerchantId
());
}
UserExtInfo
extInfo
=
userExtInfoService
.
findByUserId
(
userDetail
.
getUserId
());
if
(!
Objects
.
isNull
(
extInfo
))
{
if
(
null
==
extInfo
.
getEducationEnum
()){
bean
.
setEducationEnum
(
cn
.
quantgroup
.
user
.
enums
.
EducationEnum
.
UNKNOWN
.
getName
());
}
else
{
bean
.
setEducationEnum
(
extInfo
.
getEducationEnum
().
getName
());
}
Address
address
=
addressService
.
findByUserId
(
userDetail
.
getUserId
());
List
<
Contact
>
contacts
=
contactService
.
findByUserId
(
userDetail
.
getUserId
(),
true
);
if
(
null
==
extInfo
.
getOccupationEnum
()){
bean
.
setOccupationEnum
(
cn
.
quantgroup
.
user
.
enums
.
OccupationEnum
.
UNKNOWN
.
getName
());
}
else
{
bean
.
setOccupationEnum
(
extInfo
.
getOccupationEnum
().
getName
());
}
if
(
null
==
extInfo
.
getMarryStatus
()){
bean
.
setMarryStatus
(
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
UNKNOWN
.
getDescription
());
}
else
{
bean
.
setMarryStatus
(
extInfo
.
getMarryStatus
().
getDescription
());
}
}
Address
address
=
addressService
.
findByUserId
(
userDetail
.
getUserId
());
if
(!
Objects
.
isNull
(
address
))
{
bean
.
putAddressList
(
Arrays
.
asList
(
address
));
}
List
<
Contact
>
contacts
=
contactService
.
findByUserId
(
userDetail
.
getUserId
(),
true
);
if
(!
Objects
.
isNull
(
address
))
{
bean
.
putContractList
(
contacts
);
}
return
JsonResult
.
buildSuccessResult
(
""
,
bean
);
...
...
src/main/java/cn/quantgroup/xyqb/model/UserAssociationModel.java
View file @
062121e1
...
...
@@ -16,41 +16,51 @@ import java.util.Objects;
*/
@Data
public
class
UserAssociationModel
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1L
;
private
Long
id
;
private
String
uuid
;
private
String
phoneNo
;
private
String
idNo
;
private
String
name
;
private
String
gender
;
private
String
marryStatus
;
private
String
educationEnum
;
private
String
occupationEnum
;
private
String
qq
;
private
List
<
AddressModel
>
addressList
;
private
List
<
ContactModel
>
contractList
;
private
static
final
long
serialVersionUID
=
-
1L
;
private
Long
id
;
private
String
uuid
;
private
String
phoneNo
;
private
String
idNo
;
private
String
name
;
private
String
gender
;
private
String
marryStatus
;
private
String
educationEnum
;
private
String
occupationEnum
;
private
String
qq
;
private
Long
registerFrom
;
private
Long
merchantId
;
private
List
<
AddressModel
>
addressList
;
private
List
<
ContactModel
>
contractList
;
public
void
putAddressList
(
List
<
Address
>
entitylist
){
if
(
Objects
.
isNull
(
entitylist
)){
return
;
/**
* 填充地址模型列表
* @param entitylist
*/
public
void
putAddressList
(
List
<
Address
>
entitylist
){
if
(
Objects
.
isNull
(
entitylist
)){
return
;
}
if
(
Objects
.
isNull
(
this
.
addressList
)){
this
.
addressList
=
new
ArrayList
<
AddressModel
>(
entitylist
.
size
());
}
for
(
Address
entity
:
entitylist
)
{
this
.
addressList
.
add
(
AddressModel
.
entity2Model
(
entity
));
}
}
if
(
Objects
.
isNull
(
this
.
addressList
)){
this
.
addressList
=
new
ArrayList
<
AddressModel
>(
entitylist
.
size
());
}
for
(
Address
entity
:
entitylist
)
{
this
.
addressList
.
add
(
AddressModel
.
entity2Model
(
entity
));
}
}
public
void
putContractList
(
List
<
Contact
>
entitylist
){
if
(
Objects
.
isNull
(
entitylist
)){
return
;
}
if
(
Objects
.
isNull
(
this
.
contractList
)){
this
.
contractList
=
new
ArrayList
<
ContactModel
>(
entitylist
.
size
());
}
for
(
Contact
entity
:
entitylist
)
{
this
.
contractList
.
add
(
ContactModel
.
entity2Model
(
entity
));
/**
* 填充联系人模型列表
* @param entitylist
*/
public
void
putContractList
(
List
<
Contact
>
entitylist
){
if
(
Objects
.
isNull
(
entitylist
)){
return
;
}
if
(
Objects
.
isNull
(
this
.
contractList
)){
this
.
contractList
=
new
ArrayList
<
ContactModel
>(
entitylist
.
size
());
}
for
(
Contact
entity
:
entitylist
)
{
this
.
contractList
.
add
(
ContactModel
.
entity2Model
(
entity
));
}
}
}
}
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