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
cc1c67ea
Commit
cc1c67ea
authored
Jun 11, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改善Json对空字符串容错性
parent
74a026a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+2
-9
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
cc1c67ea
...
@@ -979,13 +979,9 @@ public class InnerController implements IBaseController {
...
@@ -979,13 +979,9 @@ public class InnerController implements IBaseController {
String
district
,
String
district
,
String
address
,
String
address
,
String
contacts
,
@RequestParam
(
defaultValue
=
"0"
,
required
=
false
)
Long
btRegisterChannelId
)
{
String
contacts
,
@RequestParam
(
defaultValue
=
"0"
,
required
=
false
)
Long
btRegisterChannelId
)
{
log
.
info
(
"[/innerapi/user/save_multi]保存用户、联系人、地址信息:registeredFrom:[{}], phoneNo[{}],name[{}],idNo[{}],provinceCode[{}],cityCode[{}],districtCode[{}],"
+
"address[{}],contacts[{}]"
,
registeredFrom
,
phoneNo
,
name
,
idNo
,
provinceCode
,
cityCode
,
districtCode
,
address
,
contacts
);
if
(!
NumberUtils
.
isDigits
(
registeredFrom
))
{
if
(!
NumberUtils
.
isDigits
(
registeredFrom
))
{
return
JsonResult
.
buildErrorStateResult
(
"注册渠道异常."
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"注册渠道异常."
,
null
);
}
}
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"手机号异常."
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"手机号异常."
,
null
);
}
}
...
@@ -1002,7 +998,6 @@ public class InnerController implements IBaseController {
...
@@ -1002,7 +998,6 @@ public class InnerController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"用户身份证号异常."
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"用户身份证号异常."
,
null
);
}
}
Address
addressObj
=
null
;
Address
addressObj
=
null
;
//地址信息,同时存在provinceCode和address时才校验地址信息
//地址信息,同时存在provinceCode和address时才校验地址信息
if
(
StringUtils
.
isNotEmpty
(
provinceCode
)
&&
StringUtils
.
isNotEmpty
(
address
))
{
if
(
StringUtils
.
isNotEmpty
(
provinceCode
)
&&
StringUtils
.
isNotEmpty
(
address
))
{
...
@@ -1038,7 +1033,6 @@ public class InnerController implements IBaseController {
...
@@ -1038,7 +1033,6 @@ public class InnerController implements IBaseController {
addressObj
.
setAddress
(
address
);
addressObj
.
setAddress
(
address
);
}
}
channelId
=
MoreObjects
.
firstNonNull
(
channelId
,
"-1"
);
channelId
=
MoreObjects
.
firstNonNull
(
channelId
,
"-1"
);
// 验证用户是否已存在
// 验证用户是否已存在
User
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
User
user
=
userService
.
findByPhoneInDb
(
phoneNo
);
...
@@ -1047,9 +1041,8 @@ public class InnerController implements IBaseController {
...
@@ -1047,9 +1041,8 @@ public class InnerController implements IBaseController {
}
}
List
<
Contact
>
contactList
=
null
;
List
<
Contact
>
contactList
=
null
;
if
(
contacts
!=
null
)
{
if
(
StringUtils
.
isNotBlank
(
contacts
))
{
contactList
=
JSONObject
.
parseObject
(
contacts
,
new
TypeReference
<
List
<
Contact
>>()
{
contactList
=
JSONObject
.
parseObject
(
contacts
,
new
TypeReference
<
List
<
Contact
>>(){});
});
for
(
Contact
contact
:
contactList
)
{
for
(
Contact
contact
:
contactList
)
{
contact
.
setRelation
(
contact
.
getRelation
()
==
null
?
Relation
.
OTHER
:
contact
.
getRelation
());
contact
.
setRelation
(
contact
.
getRelation
()
==
null
?
Relation
.
OTHER
:
contact
.
getRelation
());
Tuple
<
String
,
Boolean
>
stringBooleanTuple
=
contact
.
validAndResult
();
Tuple
<
String
,
Boolean
>
stringBooleanTuple
=
contact
.
validAndResult
();
...
...
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