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
21e24603
Commit
21e24603
authored
Nov 14, 2017
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
针对用户配偶信息添加和联系人信息一致的准入校验和查询过滤规则
parent
8856f9ad
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
MotanUserServiceImpl.java
.../xyqb/controller/external/motan/MotanUserServiceImpl.java
+3
-3
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+3
-3
UserSpouse.java
src/main/java/cn/quantgroup/xyqb/entity/UserSpouse.java
+9
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/motan/MotanUserServiceImpl.java
View file @
21e24603
...
@@ -524,7 +524,7 @@ public class MotanUserServiceImpl implements UserMotanService {
...
@@ -524,7 +524,7 @@ public class MotanUserServiceImpl implements UserMotanService {
return
returnErrorValue
(
"用户不能为空"
);
return
returnErrorValue
(
"用户不能为空"
);
}
}
UserSpouse
userSpouse
=
userSpouseService
.
findByUserId
(
userId
);
UserSpouse
userSpouse
=
userSpouseService
.
findByUserId
(
userId
);
if
(
userSpouse
==
null
)
{
if
(
userSpouse
==
null
||
!
userSpouse
.
valid
()
)
{
userSpouse
=
new
UserSpouse
(
userId
);
userSpouse
=
new
UserSpouse
(
userId
);
userSpouse
.
setStatus
(
MaritalStatus
.
UNKNOWN
);
userSpouse
.
setStatus
(
MaritalStatus
.
UNKNOWN
);
}
}
...
@@ -603,8 +603,8 @@ public class MotanUserServiceImpl implements UserMotanService {
...
@@ -603,8 +603,8 @@ public class MotanUserServiceImpl implements UserMotanService {
if
(!
ValidationUtil
.
validatePhoneNo
(
spousePhone
))
{
if
(!
ValidationUtil
.
validatePhoneNo
(
spousePhone
))
{
return
returnErrorValue
(
"手机号格式错误"
);
return
returnErrorValue
(
"手机号格式错误"
);
}
}
if
(
StringUtils
.
isBlank
(
spouseName
))
{
if
(
!
ValidationUtil
.
validateChinese
(
spouseName
))
{
return
returnErrorValue
(
"配偶姓名
不能为空
"
);
return
returnErrorValue
(
"配偶姓名
错误
"
);
}
}
}
}
UserSpouse
userSpouse
=
userSpouseService
.
findByUserId
(
xUserSpouse
.
getUserId
());
UserSpouse
userSpouse
=
userSpouseService
.
findByUserId
(
xUserSpouse
.
getUserId
());
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
21e24603
...
@@ -740,8 +740,8 @@ public class InnerController implements IBaseController {
...
@@ -740,8 +740,8 @@ public class InnerController implements IBaseController {
if
(!
ValidationUtil
.
validatePhoneNo
(
spousePhone
))
{
if
(!
ValidationUtil
.
validatePhoneNo
(
spousePhone
))
{
return
JsonResult
.
buildErrorStateResult
(
"手机号格式错误"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"手机号格式错误"
,
null
);
}
}
if
(
StringUtils
.
isBlank
(
spouseName
))
{
if
(
!
ValidationUtil
.
validateChinese
(
spouseName
))
{
return
JsonResult
.
buildErrorStateResult
(
"配偶姓名
不能为空
"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"配偶姓名
错误
"
,
null
);
}
}
}
}
UserSpouse
userSpouse
=
userSpouseService
.
findByUserId
(
userId
);
UserSpouse
userSpouse
=
userSpouseService
.
findByUserId
(
userId
);
...
@@ -765,7 +765,7 @@ public class InnerController implements IBaseController {
...
@@ -765,7 +765,7 @@ public class InnerController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"用户不能为空"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"用户不能为空"
,
null
);
}
}
UserSpouse
userSpouse
=
userSpouseService
.
findByUserId
(
userId
);
UserSpouse
userSpouse
=
userSpouseService
.
findByUserId
(
userId
);
if
(
userSpouse
==
null
)
{
if
(
userSpouse
==
null
||
!
userSpouse
.
valid
()
)
{
userSpouse
=
new
UserSpouse
(
userId
);
userSpouse
=
new
UserSpouse
(
userId
);
userSpouse
.
setStatus
(
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
UNKNOWN
);
userSpouse
.
setStatus
(
cn
.
quantgroup
.
user
.
enums
.
MaritalStatus
.
UNKNOWN
);
}
}
...
...
src/main/java/cn/quantgroup/xyqb/entity/UserSpouse.java
View file @
21e24603
...
@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.entity;
...
@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.entity;
import
cn.quantgroup.user.enums.MaritalStatus
;
import
cn.quantgroup.user.enums.MaritalStatus
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
lombok.*
;
import
lombok.*
;
import
javax.persistence.*
;
import
javax.persistence.*
;
...
@@ -44,4 +45,12 @@ public class UserSpouse implements Serializable {
...
@@ -44,4 +45,12 @@ public class UserSpouse implements Serializable {
public
UserSpouse
(
Long
userId
)
{
public
UserSpouse
(
Long
userId
)
{
this
.
userId
=
userId
;
this
.
userId
=
userId
;
}
}
/**
* 数据合法性校验
* @return
*/
public
boolean
valid
(){
return
(
ValidationUtil
.
validatePhoneNo
(
this
.
spousePhone
)
&&
ValidationUtil
.
validateChinese
(
this
.
spouseName
));
}
}
}
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