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
6e85dbb2
Commit
6e85dbb2
authored
Nov 14, 2017
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
追加:对用户个人信息(实名认证、注册新增、修改保存)的写入做出与联系人信息一致的校验,同时修正部分旧代码(motan)
parent
4bef1489
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
58 deletions
+83
-58
MotanUserServiceImpl.java
.../xyqb/controller/external/motan/MotanUserServiceImpl.java
+32
-19
AppController.java
...antgroup/xyqb/controller/external/user/AppController.java
+3
-5
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+20
-31
SyncUserController.java
...oup/xyqb/controller/external/user/SyncUserController.java
+28
-3
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/motan/MotanUserServiceImpl.java
View file @
6e85dbb2
...
@@ -41,6 +41,7 @@ import java.sql.Timestamp;
...
@@ -41,6 +41,7 @@ import java.sql.Timestamp;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Random
;
import
java.util.Random
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -196,6 +197,18 @@ public class MotanUserServiceImpl implements UserMotanService {
...
@@ -196,6 +197,18 @@ public class MotanUserServiceImpl implements UserMotanService {
return
returnErrorValue
(
"要保存的用户详情对象不能为null"
);
return
returnErrorValue
(
"要保存的用户详情对象不能为null"
);
}
}
UserDetail
userDetail
=
new
UserDetail
();
UserDetail
userDetail
=
new
UserDetail
();
if
(!
ValidationUtil
.
validateChinese
(
userDetailUpdateBean
.
getName
()))
{
return
returnErrorValue
(
"用户姓名错误"
);
}
IdCardInfo
info
=
null
;
try
{
info
=
idCardService
.
getIdCardInfo
(
userDetailUpdateBean
.
getIdNo
());
}
catch
(
ParseException
ex
)
{
log
.
error
(
"用户身份证号错误, idNo: {}"
,
userDetailUpdateBean
.
getIdNo
(),
ex
);
}
if
(
Objects
.
isNull
(
info
)
||
!
info
.
isValid
())
{
return
returnErrorValue
(
"身份证号码错误"
);
}
if
(
null
!=
userDetailUpdateBean
.
getId
()
&&
userDetailUpdateBean
.
getId
()
>
0L
)
{
if
(
null
!=
userDetailUpdateBean
.
getId
()
&&
userDetailUpdateBean
.
getId
()
>
0L
)
{
userDetail
.
setId
(
userDetailUpdateBean
.
getId
());
userDetail
.
setId
(
userDetailUpdateBean
.
getId
());
}
}
...
@@ -207,12 +220,7 @@ public class MotanUserServiceImpl implements UserMotanService {
...
@@ -207,12 +220,7 @@ public class MotanUserServiceImpl implements UserMotanService {
userDetail
.
setCreatedAt
(
time
);
userDetail
.
setCreatedAt
(
time
);
userDetail
.
setUpdatedAt
(
time
);
userDetail
.
setUpdatedAt
(
time
);
userDetail
.
setIdType
(
IdType
.
ID_CARD
);
userDetail
.
setIdType
(
IdType
.
ID_CARD
);
try
{
userDetail
.
setGender
(
info
.
getGender
());
userDetail
.
setGender
(
idCardService
.
getIdCardInfo
(
userDetailUpdateBean
.
getIdNo
()).
getGender
());
}
catch
(
ParseException
e
)
{
log
.
error
(
"根据身份证获取性别出错,userDetailUpdateBean:{}"
,
JSON
.
toJSONString
(
userDetailUpdateBean
),
e
);
return
returnErrorValue
(
"根据身份证获取性别出错."
);
}
userDetail
.
setEmail
(
userDetailUpdateBean
.
getEmail
());
userDetail
.
setEmail
(
userDetailUpdateBean
.
getEmail
());
userDetail
=
userDetailService
.
saveUserDetail
(
userDetail
);
userDetail
=
userDetailService
.
saveUserDetail
(
userDetail
);
if
(
userDetail
!=
null
)
{
if
(
userDetail
!=
null
)
{
...
@@ -241,6 +249,18 @@ public class MotanUserServiceImpl implements UserMotanService {
...
@@ -241,6 +249,18 @@ public class MotanUserServiceImpl implements UserMotanService {
if
(
StringUtils
.
isBlank
(
userDetailSaveBean
.
getIdNo
()))
{
if
(
StringUtils
.
isBlank
(
userDetailSaveBean
.
getIdNo
()))
{
return
returnErrorValue
(
"用户身份证为空"
);
return
returnErrorValue
(
"用户身份证为空"
);
}
}
if
(!
ValidationUtil
.
validateChinese
(
userDetailSaveBean
.
getName
()))
{
return
returnErrorValue
(
"用户姓名错误"
);
}
IdCardInfo
info
=
null
;
try
{
info
=
idCardService
.
getIdCardInfo
(
userDetailSaveBean
.
getIdNo
());
}
catch
(
ParseException
ex
)
{
log
.
error
(
"用户身份证号错误, idNo: {}"
,
userDetailSaveBean
.
getIdNo
(),
ex
);
}
if
(
Objects
.
isNull
(
info
)
||
!
info
.
isValid
())
{
return
returnErrorValue
(
"身份证号码错误"
);
}
Timestamp
time
=
new
Timestamp
(
System
.
currentTimeMillis
());
Timestamp
time
=
new
Timestamp
(
System
.
currentTimeMillis
());
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
if
(
userDetail
==
null
)
{
if
(
userDetail
==
null
)
{
...
@@ -251,19 +271,12 @@ public class MotanUserServiceImpl implements UserMotanService {
...
@@ -251,19 +271,12 @@ public class MotanUserServiceImpl implements UserMotanService {
}
else
{
}
else
{
userDetail
.
setUpdatedAt
(
time
);
userDetail
.
setUpdatedAt
(
time
);
}
}
userDetail
.
setName
(
userDetail
.
getName
());
userDetail
.
setName
(
userDetail
SaveBean
.
getName
());
userDetail
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
userDetail
.
setPhoneNo
(
userDetail
SaveBean
.
getPhoneNo
());
userDetail
.
setIdType
(
IdType
.
ID_CARD
);
userDetail
.
setIdType
(
IdType
.
ID_CARD
);
if
(
StringUtils
.
isNotBlank
(
userDetail
.
getIdNo
()))
{
userDetail
.
setGender
(
info
.
getGender
());
try
{
userDetail
.
setIdNo
(
userDetailSaveBean
.
getIdNo
());
userDetail
.
setGender
(
idCardService
.
getIdCardInfo
(
userDetail
.
getIdNo
()).
getGender
());
userDetail
.
setEmail
(
userDetailSaveBean
.
getEmail
());
}
catch
(
ParseException
e
)
{
log
.
error
(
"根据身份证获取性别出错,身份证号码:{}"
,
userDetail
.
getIdNo
(),
e
);
return
returnErrorValue
(
"身份证信息出错"
);
}
userDetail
.
setIdNo
(
userDetail
.
getIdNo
());
}
userDetail
.
setEmail
(
userDetail
.
getEmail
());
userDetail
=
userDetailService
.
saveUserDetail
(
userDetail
);
userDetail
=
userDetailService
.
saveUserDetail
(
userDetail
);
if
(
userDetail
!=
null
)
{
if
(
userDetail
!=
null
)
{
return
returnSuccessValue
(
fromUserDetail
(
userDetail
));
return
returnSuccessValue
(
fromUserDetail
(
userDetail
));
...
@@ -801,7 +814,7 @@ public class MotanUserServiceImpl implements UserMotanService {
...
@@ -801,7 +814,7 @@ public class MotanUserServiceImpl implements UserMotanService {
log
.
info
(
"第三方(聚美)登录用户注册成功, registerFrom:{}, phoneNo:{},idNo:{},name:{} 并且已发送短信通知"
,
registerFrom
,
phoneNo
,
idNo
,
name
);
log
.
info
(
"第三方(聚美)登录用户注册成功, registerFrom:{}, phoneNo:{},idNo:{},name:{} 并且已发送短信通知"
,
registerFrom
,
phoneNo
,
idNo
,
name
);
}
}
if
(
StringUtils
.
isNot
Empty
(
idNo
)
&&
StringUtils
.
isNotEmpty
(
name
))
{
if
(
StringUtils
.
isNot
Blank
(
idNo
)
&&
StringUtils
.
isNotBlank
(
name
)
&&
ValidationUtil
.
validateChinese
(
name
))
{
IdCardInfo
cardInfo
;
IdCardInfo
cardInfo
;
try
{
try
{
cardInfo
=
idCardService
.
getIdCardInfoWithExceptions
(
idNo
);
cardInfo
=
idCardService
.
getIdCardInfoWithExceptions
(
idNo
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/AppController.java
View file @
6e85dbb2
...
@@ -35,6 +35,8 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -35,6 +35,8 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.util.Objects
;
import
java.util.Random
;
import
java.util.Random
;
import
static
cn
.
quantgroup
.
xyqb
.
constant
.
UserConstant
.
USER_ERROR_OR_PASSWORD_ERROR
;
import
static
cn
.
quantgroup
.
xyqb
.
constant
.
UserConstant
.
USER_ERROR_OR_PASSWORD_ERROR
;
...
@@ -231,14 +233,10 @@ public class AppController implements IBaseController {
...
@@ -231,14 +233,10 @@ public class AppController implements IBaseController {
* @return
* @return
*/
*/
private
User
register
(
Long
registerFrom
,
String
phoneNo
,
String
idNo
,
String
name
,
Long
channelId
)
{
private
User
register
(
Long
registerFrom
,
String
phoneNo
,
String
idNo
,
String
name
,
Long
channelId
)
{
String
randomCode
=
String
.
valueOf
(
random
.
nextInt
(
899999
)
+
100000
);
String
randomCode
=
String
.
valueOf
(
random
.
nextInt
(
899999
)
+
100000
);
String
uuid
=
lkbUserService
.
registerApp
(
phoneNo
,
randomCode
);
String
uuid
=
lkbUserService
.
registerApp
(
phoneNo
,
randomCode
);
Timestamp
currentTime
=
new
Timestamp
(
System
.
currentTimeMillis
());
Timestamp
currentTime
=
new
Timestamp
(
System
.
currentTimeMillis
());
LOGGER
.
info
(
"第三方登录用户,保存 User"
);
LOGGER
.
info
(
"第三方登录用户,保存 User"
);
User
user
=
new
User
();
User
user
=
new
User
();
if
(
channelId
==
222L
)
{
if
(
channelId
==
222L
)
{
user
.
setRegisteredFrom
(
channelId
);
user
.
setRegisteredFrom
(
channelId
);
...
@@ -262,7 +260,7 @@ public class AppController implements IBaseController {
...
@@ -262,7 +260,7 @@ public class AppController implements IBaseController {
LOGGER
.
info
(
"第三方(聚美)登录用户注册成功, registerFrom:{}, phoneNo:{},idNo:{},name:{} 并且已发送短信通知"
,
registerFrom
,
phoneNo
,
idNo
,
name
);
LOGGER
.
info
(
"第三方(聚美)登录用户注册成功, registerFrom:{}, phoneNo:{},idNo:{},name:{} 并且已发送短信通知"
,
registerFrom
,
phoneNo
,
idNo
,
name
);
}
}
if
(
StringUtils
.
isNot
Empty
(
idNo
)
&&
StringUtils
.
isNotEmpty
(
name
))
{
if
(
StringUtils
.
isNot
Blank
(
idNo
)
&&
StringUtils
.
isNotBlank
(
name
)
&&
ValidationUtil
.
validateChinese
(
name
))
{
LOGGER
.
info
(
"第三方登录用户,保存 UserDetail"
);
LOGGER
.
info
(
"第三方登录用户,保存 UserDetail"
);
IdCardInfo
cardInfo
;
IdCardInfo
cardInfo
;
try
{
try
{
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
6e85dbb2
...
@@ -16,19 +16,7 @@ import cn.quantgroup.xyqb.entity.enumerate.IncomeRangeEnum;
...
@@ -16,19 +16,7 @@ import cn.quantgroup.xyqb.entity.enumerate.IncomeRangeEnum;
import
cn.quantgroup.xyqb.entity.enumerate.MaritalStatus
;
import
cn.quantgroup.xyqb.entity.enumerate.MaritalStatus
;
import
cn.quantgroup.xyqb.entity.enumerate.OccupationEnum
;
import
cn.quantgroup.xyqb.entity.enumerate.OccupationEnum
;
import
cn.quantgroup.xyqb.exception.UserNotExistException
;
import
cn.quantgroup.xyqb.exception.UserNotExistException
;
import
cn.quantgroup.xyqb.model.AddressRet
;
import
cn.quantgroup.xyqb.model.*
;
import
cn.quantgroup.xyqb.model.ContactRet
;
import
cn.quantgroup.xyqb.model.IdType
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.UserAssociation
;
import
cn.quantgroup.xyqb.model.UserDetailRet
;
import
cn.quantgroup.xyqb.model.UserExtInfoRet
;
import
cn.quantgroup.xyqb.model.UserInfo
;
import
cn.quantgroup.xyqb.model.UserRegisterMqMessage
;
import
cn.quantgroup.xyqb.model.UserRet
;
import
cn.quantgroup.xyqb.model.UserSpouseRet
;
import
cn.quantgroup.xyqb.model.UserStatistics
;
import
cn.quantgroup.xyqb.model.XContactInfo
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.http.IHttpService
;
import
cn.quantgroup.xyqb.service.http.IHttpService
;
import
cn.quantgroup.xyqb.service.session.ISessionService
;
import
cn.quantgroup.xyqb.service.session.ISessionService
;
...
@@ -53,11 +41,7 @@ import com.google.common.base.MoreObjects;
...
@@ -53,11 +41,7 @@ import com.google.common.base.MoreObjects;
import
com.google.common.collect.ImmutableMap
;
import
com.google.common.collect.ImmutableMap
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
...
@@ -277,35 +261,40 @@ public class InnerController implements IBaseController {
...
@@ -277,35 +261,40 @@ public class InnerController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"用户手机号为空."
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"用户手机号为空."
,
null
);
}
}
if
(
StringUtils
.
isBlank
(
name
))
{
if
(
StringUtils
.
isBlank
(
name
))
{
return
JsonResult
.
buildErrorStateResult
(
"用户名为空."
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"用户
姓
名为空."
,
null
);
}
}
if
(
StringUtils
.
isBlank
(
idNo
))
{
if
(
StringUtils
.
isBlank
(
idNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"用户身份证为空."
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"用户身份证为空."
,
null
);
}
}
if
(!
ValidationUtil
.
validateChinese
(
name
))
{
return
JsonResult
.
buildErrorStateResult
(
"用户姓名错误"
,
null
);
}
IdCardInfo
info
=
null
;
try
{
info
=
idCardService
.
getIdCardInfo
(
idNo
);
}
catch
(
ParseException
ex
)
{
LOGGER
.
error
(
"用户身份证号错误, idNo: {}"
,
idNo
);
return
JsonResult
.
buildErrorStateResult
(
"身份证号码错误"
,
null
);
}
if
(
Objects
.
isNull
(
info
)
||
!
info
.
isValid
())
{
return
JsonResult
.
buildErrorStateResult
(
"身份证号码错误"
,
null
);
}
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
UserDetail
userDetail
=
userDetailService
.
findByUserId
(
userId
);
Timestamp
time
=
new
Timestamp
(
System
.
currentTimeMillis
());
Timestamp
time
=
new
Timestamp
(
System
.
currentTimeMillis
());
if
(
null
==
userDetail
){
if
(
null
==
userDetail
){
userDetail
=
new
UserDetail
();
userDetail
=
new
UserDetail
();
userDetail
.
setCreatedAt
(
time
);
userDetail
.
setCreatedAt
(
time
);
}
}
if
(
id
!=
null
&&
id
>
0
)
{
userDetail
.
setId
(
id
);
}
userDetail
.
setUserId
(
userId
);
userDetail
.
setUserId
(
userId
);
userDetail
.
setName
(
name
);
userDetail
.
setName
(
name
);
userDetail
.
setPhoneNo
(
phoneNo
);
userDetail
.
setPhoneNo
(
phoneNo
);
userDetail
.
setIdNo
(
idNo
);
userDetail
.
setIdNo
(
idNo
);
if
(
id
!=
null
&&
id
>
0
)
{
userDetail
.
setId
(
id
);
}
userDetail
.
setUpdatedAt
(
time
);
userDetail
.
setUpdatedAt
(
time
);
userDetail
.
setIdType
(
IdType
.
ID_CARD
);
userDetail
.
setIdType
(
IdType
.
ID_CARD
);
try
{
userDetail
.
setGender
(
info
.
getGender
());
userDetail
.
setGender
(
idCardService
.
getIdCardInfo
(
idNo
).
getGender
());
}
catch
(
ParseException
e
)
{
LOGGER
.
error
(
"根据身份证获取性别出错,错误信息:"
+
e
);
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
userDetail
.
setEmail
(
email
);
userDetail
.
setEmail
(
email
);
userDetail
=
userDetailService
.
saveUserDetail
(
userDetail
);
userDetail
=
userDetailService
.
saveUserDetail
(
userDetail
);
if
(
userDetail
!=
null
)
{
if
(
userDetail
!=
null
)
{
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/user/SyncUserController.java
View file @
6e85dbb2
...
@@ -2,17 +2,25 @@ package cn.quantgroup.xyqb.controller.external.user;
...
@@ -2,17 +2,25 @@ 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.model.IdCardInfo
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.UserModel
;
import
cn.quantgroup.xyqb.model.UserModel
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.ParseException
;
import
java.util.Objects
;
/**
/**
* 同步用户数据,第三方模块访问时
* 同步用户数据,第三方模块访问时
* Created by Miraculous on 15/12/29.
* Created by Miraculous on 15/12/29.
...
@@ -20,19 +28,23 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -20,19 +28,23 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RestController
@RequestMapping
(
"/api/sync"
)
@RequestMapping
(
"/api/sync"
)
public
class
SyncUserController
{
public
class
SyncUserController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
SyncUserController
.
class
);
@Autowired
@Autowired
private
IUserService
userService
;
private
IUserService
userService
;
@Autowired
@Autowired
private
IUserDetailService
userDetailService
;
private
IUserDetailService
userDetailService
;
/*
@Autowired
@Autowired
private IUserDetailRepository userDetailRepository;*/
private
IIdCardService
idCardService
;
@Autowired
@Autowired
@Qualifier
(
"stringRedisTemplate"
)
@Qualifier
(
"stringRedisTemplate"
)
private
RedisTemplate
<
String
,
String
>
stringRedisTemplate
;
private
RedisTemplate
<
String
,
String
>
stringRedisTemplate
;
public
SyncUserController
()
{
}
@RequestMapping
(
"/user"
)
@RequestMapping
(
"/user"
)
public
JsonResult
fetchUser
(
String
key
,
String
phoneNo
)
{
public
JsonResult
fetchUser
(
String
key
,
String
phoneNo
)
{
if
(
StringUtils
.
isEmpty
(
key
)
||
!
"abc1234"
.
equals
(
key
))
{
if
(
StringUtils
.
isEmpty
(
key
)
||
!
"abc1234"
.
equals
(
key
))
{
...
@@ -56,9 +68,22 @@ public class SyncUserController {
...
@@ -56,9 +68,22 @@ public class SyncUserController {
@RequestMapping
(
"/save_detail"
)
@RequestMapping
(
"/save_detail"
)
public
JsonResult
saveUserDetail
(
String
key
,
UserDetail
userDetail
)
{
public
JsonResult
saveUserDetail
(
String
key
,
UserDetail
userDetail
)
{
if
(
StringUtils
.
isEmpty
(
key
)
||
!
"abc1234"
.
equals
(
key
))
{
if
(
StringUtils
.
isEmpty
(
key
)
||
!
"abc1234"
.
equals
(
key
)
||
Objects
.
isNull
(
userDetail
)
||
StringUtils
.
isBlank
(
userDetail
.
getPhoneNo
())
)
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
}
if
(!
ValidationUtil
.
validateChinese
(
userDetail
.
getName
()))
{
return
JsonResult
.
buildErrorStateResult
(
"姓名错误"
,
null
);
}
IdCardInfo
info
=
null
;
try
{
info
=
idCardService
.
getIdCardInfo
(
userDetail
.
getIdNo
());
}
catch
(
ParseException
ex
)
{
LOGGER
.
error
(
"身份证号错误, idNo: {}"
,
userDetail
.
getIdNo
());
return
JsonResult
.
buildErrorStateResult
(
"身份证号码错误"
,
null
);
}
if
(
Objects
.
isNull
(
info
)
||
!
info
.
isValid
())
{
return
JsonResult
.
buildErrorStateResult
(
"身份证号码错误"
,
null
);
}
String
phoneNo
=
userDetail
.
getPhoneNo
();
String
phoneNo
=
userDetail
.
getPhoneNo
();
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
User
user
=
userService
.
findByPhoneWithCache
(
phoneNo
);
if
(
null
==
user
)
{
if
(
null
==
user
)
{
...
...
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