Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
customer-service
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
QG
customer-service
Commits
9e29dde6
Commit
9e29dde6
authored
Mar 23, 2020
by
王向伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户信息查询修改逻辑
parent
068cee67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
35 deletions
+40
-35
OrderServiceImpl.java
...cn/quantgroup/customer/service/impl/OrderServiceImpl.java
+1
-1
UserServiceImpl.java
.../cn/quantgroup/customer/service/impl/UserServiceImpl.java
+39
-34
No files found.
src/main/java/cn/quantgroup/customer/service/impl/OrderServiceImpl.java
View file @
9e29dde6
...
...
@@ -245,7 +245,7 @@ public class OrderServiceImpl implements IOrderService {
result
.
setValue
(
"请求参数为空"
);
return
result
;
}
else
if
(
orderParam
>
1
)
{
result
.
setValue
(
"只能
选择一个参数进行
查询"
);
result
.
setValue
(
"只能
使用渠道号和渠道订单号组合
查询"
);
return
result
;
}
...
...
src/main/java/cn/quantgroup/customer/service/impl/UserServiceImpl.java
View file @
9e29dde6
...
...
@@ -161,24 +161,26 @@ public class UserServiceImpl implements IUserService {
//通过userId查询
if
(
Objects
.
nonNull
(
userQueryParam
.
getUserId
()))
{
log
.
info
(
"{} 通过userId查询 userId={}"
,
LOG_PRE
,
userQueryParam
.
getUserId
());
UserSysResult
<
XUser
>
userByUserId
=
userSdk
.
getService
().
findUserByUserId
(
userQueryParam
.
getUserId
());
UserSysResult
<
XUserDetail
>
userDetailByUserId
=
userSdk
.
getService
().
findUserDetailByUserId
(
userQueryParam
.
getUserId
());
return
getUserBasicInfoResult
(
userDetailByUserId
);
return
getUserBasicInfoResult
(
user
ByUserId
,
user
DetailByUserId
);
}
if
(
StringUtils
.
isNotBlank
(
userQueryParam
.
getPhoneNo
()))
{
log
.
info
(
"{} 通过phoneNo查询 phoneNo={}"
,
LOG_PRE
,
userQueryParam
.
getPhoneNo
());
UserSysResult
<
XUser
>
userByPhoneNo
=
userSdk
.
getService
().
findUserByPhoneNo
(
userQueryParam
.
getPhoneNo
());
UserSysResult
<
XUserDetail
>
userDetailByPhone
=
userSdk
.
getService
().
findUserDetailByPhone
(
userQueryParam
.
getPhoneNo
());
return
getUserBasicInfoResult
(
userDetailByPhone
);
return
getUserBasicInfoResult
(
user
ByPhoneNo
,
user
DetailByPhone
);
}
if
(
StringUtils
.
isNotBlank
(
userQueryParam
.
getUuid
()))
{
log
.
info
(
"{} 通过uuid查询 uuid={}"
,
LOG_PRE
,
userQueryParam
.
getUuid
());
UserSysResult
<
XUser
FullInfo
>
userFullInfoByUuid
=
userSdk
.
getService
().
findUserFullInfo
ByUuid
(
userQueryParam
.
getUuid
());
Object
jsonResultData
=
getJsonResultData
(
userFullInfo
ByUuid
);
UserSysResult
<
XUser
>
xUserByUuid
=
userSdk
.
getService
().
findUser
ByUuid
(
userQueryParam
.
getUuid
());
Object
jsonResultData
=
getJsonResultData
(
xUser
ByUuid
);
if
(
jsonResultData
instanceof
XUserFullInfo
)
{
XUserFullInfo
xUserFullInfo
=
(
XUserFullInfo
)
jsonResultData
;
UserSysResult
<
XUserDetail
>
userDetailByPhone
=
userSdk
.
getService
().
findUserDetailByPhone
(
xUserFullInfo
.
getPhoneNo
());
return
getUserBasicInfoResult
(
userDetailByPhone
);
return
getUserBasicInfoResult
(
xUserByUuid
,
userDetailByPhone
);
}
else
{
return
(
JsonResult
)
jsonResultData
;
}
...
...
@@ -249,26 +251,30 @@ public class UserServiceImpl implements IUserService {
}
private
JsonResult
getUserBasicInfoResult
(
UserSysResult
userSysResult
)
{
Object
data
=
getJsonResultData
(
userSysResult
);
private
JsonResult
getUserBasicInfoResult
(
UserSysResult
<
XUser
>
xUserUserSysResult
,
UserSysResult
<
XUserDetail
>
detailUserSysResult
)
{
Object
detailUser
=
getJsonResultData
(
detailUserSysResult
);
Object
xUserData
=
getJsonResultData
(
xUserUserSysResult
);
UserBasicInfo
userBasicInfo
=
new
UserBasicInfo
();
if
(
data
instanceof
XUserDetail
)
{
XUserDetail
userDetail
=
(
XUserDetail
)
data
;
String
createAt
=
DateUtil
.
format
(
userDetail
.
getCreatedAt
(),
DateUtil
.
DATE_FORMAT_1
);
if
(
Objects
.
isNull
(
xUserData
))
{
log
.
error
(
" 用户不存在 userSysResult={}"
,
xUserData
);
return
JsonResult
.
buildErrorStateResult
(
"用户不存在"
,
xUserData
);
}
if
(
xUserData
instanceof
XUser
)
{
XUser
xUser
=
(
XUser
)
xUserData
;
userBasicInfo
.
setUserId
(
xUser
.
getId
());
userBasicInfo
.
setPhoneNo
(
DesensitizeUtil
.
phoneMark
(
xUser
.
getPhoneNo
()));
String
createAt
=
DateUtil
.
format
(
xUser
.
getCreatedAt
(),
DateUtil
.
DATE_FORMAT_1
);
userBasicInfo
.
setCreatedAt
(
createAt
);
Boolean
enable
=
xUser
.
getEnable
();
userBasicInfo
.
setStatus
(
enable
==
null
?
"未知"
:
(
enable
?
"正常"
:
"封禁"
));
}
if
(
detailUser
instanceof
XUserDetail
)
{
XUserDetail
userDetail
=
(
XUserDetail
)
detailUser
;
userBasicInfo
.
setGender
(
userDetail
.
getGender
().
getName
());
userBasicInfo
.
setIdNo
(
DesensitizeUtil
.
idNoMark
(
userDetail
.
getIdNo
()));
userBasicInfo
.
setName
(
userDetail
.
getName
());
userBasicInfo
.
setPhoneNo
(
DesensitizeUtil
.
phoneMark
(
userDetail
.
getPhoneNo
()));
userBasicInfo
.
setUserId
(
userDetail
.
getUserId
());
UserSysResult
<
XUser
>
userByUserId
=
userSdk
.
getService
().
findUserByUserId
(
userDetail
.
getUserId
());
if
(
userByUserId
!=
null
&&
userByUserId
.
isSuccess
())
{
Boolean
enable
=
userByUserId
.
getData
().
getEnable
();
userBasicInfo
.
setStatus
(
enable
==
null
?
"未知"
:
(
enable
?
"正常"
:
"封禁"
));
}
}
else
{
return
(
JsonResult
)
data
;
}
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
}
...
...
@@ -287,10 +293,7 @@ public class UserServiceImpl implements IUserService {
return
JsonResult
.
buildErrorStateResult
(
"查询用户失败"
,
userSysResult
.
getData
());
}
if
(
Objects
.
isNull
(
userSysResult
.
getData
())){
log
.
error
(
"{} 用户不存在 userSysResult={}"
,
logPre
,
userSysResult
);
return
JsonResult
.
buildErrorStateResult
(
"用户不存在"
,
userSysResult
.
getData
());
}
return
userSysResult
.
getData
();
}
...
...
@@ -360,7 +363,7 @@ public class UserServiceImpl implements IUserService {
result
.
setValue
(
"参数不能为空"
);
return
result
;
}
else
if
(
orderParam
+
userParam
>
1
)
{
result
.
setValue
(
"只能
选择一个参数进行
查询"
);
result
.
setValue
(
"只能
使用渠道号和渠道订单号组合
查询"
);
return
result
;
}
...
...
@@ -376,7 +379,7 @@ public class UserServiceImpl implements IUserService {
result
.
setValue
(
"2"
);
return
result
;
}
result
.
setValue
(
"只能
选择一个参数进行
查询"
);
result
.
setValue
(
"只能
使用渠道号和渠道订单号组合
查询"
);
return
result
;
}
...
...
@@ -496,7 +499,7 @@ public class UserServiceImpl implements IUserService {
log
.
info
(
"{} 订单参数查询用户信息 orderQueryParam={}"
,
logPre
,
orderQueryParam
);
//渠道订单号需要有渠道号
boolean
channelParam
=
StringUtils
.
isNotBlank
(
orderQueryParam
.
getChannelOrderNo
())
&&
Objects
.
nonNull
(
orderQueryParam
.
getChannelId
());
if
(
channelParam
)
{
if
(
channelParam
)
{
//通过ka获得userId然后通过userId查询
JsonResult
<
LoanOrderMapping
>
orderMapping
=
kaService
.
findOrderMapping
(
orderQueryParam
);
if
(!
orderMapping
.
isSuccess
())
{
...
...
@@ -504,11 +507,12 @@ public class UserServiceImpl implements IUserService {
return
JsonResult
.
buildErrorStateResult
(
"查询失败"
,
null
);
}
if
(
Objects
.
isNull
(
orderMapping
.
getData
()))
{
return
JsonResult
.
buildErrorStateResult
(
"
无数据,请用其他参数
查询"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"
请确认搜索条件后再
查询"
,
null
);
}
Long
qgUserId
=
orderMapping
.
getData
().
getQgUserId
();
UserSysResult
<
XUser
>
userByUserId
=
userSdk
.
getService
().
findUserByUserId
(
qgUserId
);
UserSysResult
<
XUserDetail
>
userDetailByUserId
=
userSdk
.
getService
().
findUserDetailByUserId
(
qgUserId
);
return
getUserBasicInfoResult
(
userDetailByUserId
);
return
getUserBasicInfoResult
(
user
ByUserId
,
user
DetailByUserId
);
}
if
(
Objects
.
nonNull
(
orderQueryParam
.
getLoanId
())
||
StringUtils
.
isNotBlank
(
orderQueryParam
.
getApplyOrderNo
()))
{
...
...
@@ -519,17 +523,18 @@ public class UserServiceImpl implements IUserService {
applyOrderQuery
.
setLoanId
(
loanId
);
//申请订单查询
JsonResult
<
List
<
ApplyOrder
>>
applyOrders
=
xyqbService
.
findApplyOrders
(
applyOrderQuery
);
if
(!
applyOrders
.
isSuccess
())
{
log
.
error
(
"{} 获得申请订单失败 applyOrderQuery={} result={}"
,
logPre
,
applyOrderQuery
,
applyOrders
);
if
(!
applyOrders
.
isSuccess
())
{
log
.
error
(
"{} 获得申请订单失败 applyOrderQuery={} result={}"
,
logPre
,
applyOrderQuery
,
applyOrders
);
return
JsonResult
.
buildErrorStateResult
(
"查询失败"
,
null
);
}
if
(
CollectionUtils
.
isEmpty
(
applyOrders
.
getData
()))
{
return
JsonResult
.
buildErrorStateResult
(
"
无数据,请用其他参数
查询"
,
null
);
if
(
CollectionUtils
.
isEmpty
(
applyOrders
.
getData
()))
{
return
JsonResult
.
buildErrorStateResult
(
"
请确认搜索条件后再
查询"
,
null
);
}
Long
userId
=
applyOrders
.
getData
().
get
(
0
).
getUserId
();
UserSysResult
<
XUser
>
userByUserId
=
userSdk
.
getService
().
findUserByUserId
(
userId
);
UserSysResult
<
XUserDetail
>
userDetailByUserId
=
userSdk
.
getService
().
findUserDetailByUserId
(
userId
);
return
getUserBasicInfoResult
(
userDetailByUserId
);
return
getUserBasicInfoResult
(
user
ByUserId
,
user
DetailByUserId
);
}
//走到这里申请订单号和借款订单号都为空, 渠道订单号和渠道号至少一个为空
...
...
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