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
6a44731c
Commit
6a44731c
authored
Jan 04, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时提交,尝试解决多版本贮存冲突问题
parent
d59df18d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
171 additions
and
44 deletions
+171
-44
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+41
-27
AddressModel.java
src/main/java/cn/quantgroup/xyqb/model/AddressModel.java
+40
-0
ContactModel.java
src/main/java/cn/quantgroup/xyqb/model/ContactModel.java
+34
-0
UserAssociationModel.java
...n/java/cn/quantgroup/xyqb/model/UserAssociationModel.java
+56
-0
XContactIn.java
src/main/java/cn/quantgroup/xyqb/model/XContactIn.java
+0
-17
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
6a44731c
...
...
@@ -580,29 +580,32 @@ public class InnerController implements IBaseController {
return
JsonResult
.
buildSuccessResult
(
"success"
,
wechatUserInfo
.
getOpenId
());
}
/**
* 按照用户主键查询用户综合信息模型
* 综合信息模型包含:
* {
* 用户信息
* 个人信息
* 扩展信息
* 地址信息
* 联系人信息
* }
* @param userId - 用户表主键
* @return
*/
@RequestMapping
(
"/user-association/search/userId"
)
@LogHttpCaller
@RequestMapping
(
"/user-association/search/phone"
)
public
JsonResult
findUserAssociationByPhone
(
String
phoneNo
)
{
UserDetail
userDetail
=
userDetailService
.
findByPhoneNo
(
phoneNo
);
UserAssociation
bean
=
new
UserAssociation
();
public
JsonResult
findUserAssociationModelByUserId
(
Long
userId
)
{
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
UserAssociationModel
bean
=
new
UserAssociationModel
();
if
(
null
!=
userDetail
)
{
Address
address
=
addressService
.
findByUserId
(
userDetail
.
getUserId
());
List
<
Contact
>
contacts
=
contactService
.
findByUserId
(
userDetail
.
getUserId
(),
true
);
UserExtInfo
extInfo
=
userExtInfoService
.
findByUserId
(
userDetail
.
getUserId
());
bean
.
set
User
Id
(
userDetail
.
getUserId
());
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
!=
address
)
{
bean
.
setCity
(
address
.
getCity
());
bean
.
setDistrict
(
address
.
getDistrict
());
bean
.
setAddress
(
address
.
getAddress
());
bean
.
setProvince
(
address
.
getProvince
());
}
if
(
null
!=
extInfo
)
{
if
(
null
==
extInfo
.
getEducationEnum
()){
bean
.
setEducationEnum
(
cn
.
quantgroup
.
user
.
enums
.
EducationEnum
.
UNKNOWN
.
getName
());
...
...
@@ -614,20 +617,25 @@ public class InnerController implements IBaseController {
}
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
());
}
}
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
contacts
))
{
List
<
XContactInfo
>
userContacts
=
contacts2ContactRets
(
contacts
);
bean
.
setContractResults
(
userContacts
);
}
Address
address
=
addressService
.
findByUserId
(
userDetail
.
getUserId
());
List
<
Contact
>
contacts
=
contactService
.
findByUserId
(
userDetail
.
getUserId
(),
true
);
bean
.
putAddressList
(
Arrays
.
asList
(
address
));
bean
.
putContractList
(
contacts
);
}
return
JsonResult
.
buildSuccessResult
(
""
,
bean
);
}
@LogHttpCaller
@RequestMapping
(
"/user-association/search/phone"
)
public
JsonResult
findUserAssociationByPhone
(
String
phoneNo
)
{
UserDetail
userDetail
=
userDetailService
.
findByPhoneNo
(
phoneNo
);
UserAssociation
bean
=
getUserAssociation
(
userDetail
);
return
JsonResult
.
buildSuccessResult
(
""
,
bean
);
}
...
...
@@ -635,8 +643,17 @@ public class InnerController implements IBaseController {
@LogHttpCaller
public
JsonResult
findUserAssociationByUid
(
Long
uid
)
{
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
uid
);
UserAssociation
bean
=
new
UserAssociation
();
UserAssociation
bean
=
getUserAssociation
(
userDetail
);
return
JsonResult
.
buildSuccessResult
(
""
,
bean
);
}
/**
* 获取用户综合信息
* @param userDetail
* @return
*/
private
UserAssociation
getUserAssociation
(
UserDetail
userDetail
){
UserAssociation
bean
=
new
UserAssociation
();
if
(
null
!=
userDetail
)
{
Address
address
=
addressService
.
findByUserId
(
userDetail
.
getUserId
());
List
<
Contact
>
contacts
=
contactService
.
findByUserId
(
userDetail
.
getUserId
(),
true
);
...
...
@@ -647,12 +664,11 @@ public class InnerController implements IBaseController {
bean
.
setIdNo
(
userDetail
.
getIdNo
());
bean
.
setQq
(
userDetail
.
getQq
());
bean
.
setGender
(
Optional
.
ofNullable
(
userDetail
.
getGender
()).
orElse
(
cn
.
quantgroup
.
xyqb
.
model
.
Gender
.
UNKNOWN
).
getName
());
if
(
null
!=
address
)
{
bean
.
setProvince
(
address
.
getProvince
());
bean
.
setCity
(
address
.
getCity
());
bean
.
setDistrict
(
address
.
getDistrict
());
bean
.
setAddress
(
address
.
getAddress
());
bean
.
setProvince
(
address
.
getProvince
());
}
if
(
null
!=
extInfo
)
{
if
(
null
==
extInfo
.
getEducationEnum
()){
...
...
@@ -665,7 +681,6 @@ public class InnerController implements IBaseController {
}
else
{
bean
.
setOccupationEnum
(
extInfo
.
getOccupationEnum
().
getName
());
}
if
(
null
==
extInfo
.
getMarryStatus
()){
bean
.
setMarryStatus
(
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
UNKNOWN
.
getDescription
());
}
else
{
...
...
@@ -677,8 +692,7 @@ public class InnerController implements IBaseController {
bean
.
setContractResults
(
userContacts
);
}
}
return
JsonResult
.
buildSuccessResult
(
""
,
bean
);
return
bean
;
}
public
static
XContactInfo
contact2ContactRet
(
Contact
c
)
{
...
...
src/main/java/cn/quantgroup/xyqb/model/AddressModel.java
0 → 100644
View file @
6a44731c
package
cn
.
quantgroup
.
xyqb
.
model
;
import
cn.quantgroup.xyqb.entity.Address
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 地址信息数据模型
* @author renwc
* @date 2018-01-04
*/
@Data
public
class
AddressModel
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1L
;
private
Long
provinceCode
;
private
String
province
;
private
Long
cityCode
;
private
String
city
;
private
Long
districtCode
;
private
String
district
;
private
String
address
;
private
AddressModel
(){}
public
static
AddressModel
entity2Model
(
Address
entity
)
{
if
(
entity
==
null
)
{
return
null
;
}
AddressModel
model
=
new
AddressModel
();
model
.
setProvinceCode
(
entity
.
getProvinceCode
());
model
.
setCityCode
(
entity
.
getCityCode
());
model
.
setDistrictCode
(
entity
.
getDistrictCode
());
model
.
setDistrict
(
entity
.
getDistrict
());
model
.
setProvince
(
entity
.
getProvince
());
model
.
setCity
(
entity
.
getCity
());
model
.
setAddress
(
entity
.
getAddress
());
return
model
;
}
}
src/main/java/cn/quantgroup/xyqb/model/ContactModel.java
0 → 100644
View file @
6a44731c
package
cn
.
quantgroup
.
xyqb
.
model
;
import
cn.quantgroup.user.enums.Relation
;
import
cn.quantgroup.xyqb.entity.Contact
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Optional
;
/**
* 联系人数据模型
* @author renwc
* @date 2018-01-04
*/
@Data
public
class
ContactModel
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1L
;
private
String
name
;
private
String
phoneNo
;
private
String
relation
;
private
ContactModel
(){}
public
static
ContactModel
entity2Model
(
Contact
entity
)
{
if
(
entity
==
null
)
{
return
null
;
}
ContactModel
model
=
new
ContactModel
();
model
.
setName
(
entity
.
getName
());
model
.
setPhoneNo
(
entity
.
getPhoneNo
());
model
.
setRelation
(
Optional
.
ofNullable
(
entity
.
getRelation
()).
orElse
(
Relation
.
OTHER
).
getDescription
());
return
model
;
}
}
src/main/java/cn/quantgroup/xyqb/model/UserAssociationModel.java
0 → 100644
View file @
6a44731c
package
cn
.
quantgroup
.
xyqb
.
model
;
import
cn.quantgroup.xyqb.entity.Address
;
import
cn.quantgroup.xyqb.entity.Contact
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
/**
* 用户综合信息数据模型
* @author renwc
* @date 2018-01-04
*/
@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
;
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
));
}
}
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
));
}
}
}
src/main/java/cn/quantgroup/xyqb/model/XContactIn.java
deleted
100644 → 0
View file @
d59df18d
package
cn
.
quantgroup
.
xyqb
.
model
;
import
lombok.Data
;
/**
* Created by xuran on 2017/8/1.
*/
@Data
public
class
XContactIn
{
private
static
final
long
serialVersionUID
=
-
1L
;
private
Long
id
;
private
Long
userId
;
private
String
name
;
private
String
phoneNo
;
private
String
relation
;
}
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