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
ffc3acb2
Commit
ffc3acb2
authored
Feb 13, 2017
by
zhouqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加修改接口
parent
1c92003f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
9 deletions
+64
-9
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+44
-0
UserExtInfo.java
src/main/java/cn/quantgroup/xyqb/entity/UserExtInfo.java
+9
-9
IUserExtInfoService.java
.../cn/quantgroup/xyqb/service/user/IUserExtInfoService.java
+2
-0
UserExtInfoServiceImpl.java
...tgroup/xyqb/service/user/impl/UserExtInfoServiceImpl.java
+9
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
ffc3acb2
...
@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.controller.external.user;
...
@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.controller.external.user;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.entity.UserExtInfo
;
import
cn.quantgroup.xyqb.entity.UserExtInfo
;
import
cn.quantgroup.xyqb.entity.enumerate.*
;
import
cn.quantgroup.xyqb.model.*
;
import
cn.quantgroup.xyqb.model.*
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
...
@@ -189,6 +190,49 @@ public class InnerController {
...
@@ -189,6 +190,49 @@ public class InnerController {
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
}
}
@RequestMapping
(
"/user_ext_info/update"
)
public
JsonResult
updateMarryStatus
(
Long
userId
,
IncomeEnum
incomeEnum
,
IncomeRangeEnum
incomeRangeEnum
,
OccupationEnum
occupationEnum
,
EducationEnum
educationEnum
,
Boolean
hasCar
,
Boolean
hasSocialSecurity
,
Boolean
hasHouse
,
Boolean
hasCreditCard
,
MaritalStatus
maritalStatus
)
{
if
(
null
==
userId
)
{
return
JsonResult
.
buildErrorStateResult
(
"用户ID不能为空"
,
null
);
}
UserExtInfo
info
=
userExtInfoService
.
findByUserId
(
userId
);
if
(
info
==
null
)
{
Timestamp
now
=
new
Timestamp
(
System
.
currentTimeMillis
());
info
=
new
UserExtInfo
();
info
.
setCreatedAt
(
now
);
info
.
setUpdateAt
(
now
);
}
if
(
incomeEnum
!=
null
)
{
info
.
setIncomeEnum
(
incomeEnum
);
}
if
(
incomeRangeEnum
!=
null
)
{
info
.
setIncomeRangeEnum
(
incomeRangeEnum
);
}
if
(
occupationEnum
!=
null
)
{
info
.
setOccupationEnum
(
occupationEnum
);
}
if
(
educationEnum
!=
null
)
{
info
.
setEducationEnum
(
educationEnum
);
}
if
(
hasCar
!=
null
)
{
info
.
setHasCar
(
hasCar
);
}
if
(
hasSocialSecurity
!=
null
)
{
info
.
setHasCreditCard
(
hasCreditCard
);
}
if
(
hasHouse
!=
null
)
{
info
.
setHasHouse
(
hasHouse
);
}
if
(
maritalStatus
!=
null
)
{
info
.
setMarryStatus
(
maritalStatus
);
}
info
=
userExtInfoService
.
save
(
info
);
return
JsonResult
.
buildSuccessResult
(
null
,
info
);
}
@RequestMapping
(
"/user_detail/search_list"
)
@RequestMapping
(
"/user_detail/search_list"
)
public
JsonResult
searchUserDetailList
(
String
name
,
String
phoneNo
,
String
idNo
)
{
public
JsonResult
searchUserDetailList
(
String
name
,
String
phoneNo
,
String
idNo
)
{
List
<
UserDetail
>
userDetails
=
userDetailService
.
searchUserDetailList
(
name
,
phoneNo
,
idNo
);
List
<
UserDetail
>
userDetails
=
userDetailService
.
searchUserDetailList
(
name
,
phoneNo
,
idNo
);
...
...
src/main/java/cn/quantgroup/xyqb/entity/UserExtInfo.java
View file @
ffc3acb2
...
@@ -25,23 +25,23 @@ public class UserExtInfo implements Serializable {
...
@@ -25,23 +25,23 @@ public class UserExtInfo implements Serializable {
@Column
(
name
=
"user_id"
)
@Column
(
name
=
"user_id"
)
private
Long
userId
;
private
Long
userId
;
@Column
(
name
=
"means_of_income_payment"
)
@Column
(
name
=
"means_of_income_payment"
)
private
IncomeEnum
incomeEnum
;
private
IncomeEnum
incomeEnum
=
IncomeEnum
.
UNKNOWN
;
@Column
(
name
=
"monthly_income_range"
)
@Column
(
name
=
"monthly_income_range"
)
private
IncomeRangeEnum
incomeRangeEnum
;
private
IncomeRangeEnum
incomeRangeEnum
=
IncomeRangeEnum
.
UNKNOWN
;
@Column
(
name
=
"occupation"
)
@Column
(
name
=
"occupation"
)
private
OccupationEnum
occupationEnum
;
private
OccupationEnum
occupationEnum
=
OccupationEnum
.
UNKNOWN
;
@Column
(
name
=
"education"
)
@Column
(
name
=
"education"
)
private
EducationEnum
educationEnum
;
private
EducationEnum
educationEnum
=
EducationEnum
.
UNKNOWN
;
@Column
(
name
=
"has_car"
)
@Column
(
name
=
"has_car"
)
private
boolean
hasCar
;
private
boolean
hasCar
=
false
;
@Column
(
name
=
"has_social_security"
)
@Column
(
name
=
"has_social_security"
)
private
boolean
hasSocialSecurity
;
private
boolean
hasSocialSecurity
=
false
;
@Column
(
name
=
"has_house"
)
@Column
(
name
=
"has_house"
)
private
boolean
hasHouse
;
private
boolean
hasHouse
=
false
;
@Column
(
name
=
"has_credit_card"
)
@Column
(
name
=
"has_credit_card"
)
private
boolean
hasCreditCard
;
private
boolean
hasCreditCard
=
false
;
@Column
(
name
=
"marry_status"
)
@Column
(
name
=
"marry_status"
)
private
MaritalStatus
marryStatus
;
private
MaritalStatus
marryStatus
=
MaritalStatus
.
UNKNOWN
;
@Column
(
name
=
"created_at"
)
@Column
(
name
=
"created_at"
)
private
Timestamp
createdAt
;
private
Timestamp
createdAt
;
@Column
(
name
=
"updated_at"
)
@Column
(
name
=
"updated_at"
)
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IUserExtInfoService.java
View file @
ffc3acb2
...
@@ -8,4 +8,6 @@ import cn.quantgroup.xyqb.entity.UserExtInfo;
...
@@ -8,4 +8,6 @@ import cn.quantgroup.xyqb.entity.UserExtInfo;
public
interface
IUserExtInfoService
{
public
interface
IUserExtInfoService
{
UserExtInfo
findByUserId
(
Long
userId
);
UserExtInfo
findByUserId
(
Long
userId
);
UserExtInfo
save
(
UserExtInfo
info
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserExtInfoServiceImpl.java
View file @
ffc3acb2
...
@@ -4,8 +4,10 @@ import cn.quantgroup.xyqb.entity.UserExtInfo;
...
@@ -4,8 +4,10 @@ import cn.quantgroup.xyqb.entity.UserExtInfo;
import
cn.quantgroup.xyqb.repository.IUserExtInfoRepository
;
import
cn.quantgroup.xyqb.repository.IUserExtInfoRepository
;
import
cn.quantgroup.xyqb.service.user.IUserExtInfoService
;
import
cn.quantgroup.xyqb.service.user.IUserExtInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
/**
* Created by Miraculous on 2017/1/3.
* Created by Miraculous on 2017/1/3.
...
@@ -22,4 +24,11 @@ public class UserExtInfoServiceImpl implements IUserExtInfoService {
...
@@ -22,4 +24,11 @@ public class UserExtInfoServiceImpl implements IUserExtInfoService {
return
userExtInfoRepository
.
findByUserId
(
userId
);
return
userExtInfoRepository
.
findByUserId
(
userId
);
}
}
@Override
@Transactional
@CacheEvict
(
value
=
"userextinfocache"
,
key
=
"'extinfo' + #info.userId"
,
cacheManager
=
"cacheManager"
)
public
UserExtInfo
save
(
UserExtInfo
info
)
{
return
userExtInfoRepository
.
save
(
info
);
}
}
}
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