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
59c38dc3
Commit
59c38dc3
authored
Mar 09, 2020
by
王向伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户综合查询,添加ka调用
parent
b3952aee
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
229 additions
and
44 deletions
+229
-44
LoanOrderMapping.java
...group/customer/model/kaordermapping/LoanOrderMapping.java
+49
-0
OrderMappingQueryParam.java
...tomer/rest/param/ordermapping/OrderMappingQueryParam.java
+17
-0
IKaService.java
src/main/java/cn/quantgroup/customer/service/IKaService.java
+15
-0
KaServiceImpl.java
...va/cn/quantgroup/customer/service/impl/KaServiceImpl.java
+87
-0
UserServiceImpl.java
.../cn/quantgroup/customer/service/impl/UserServiceImpl.java
+61
-44
No files found.
src/main/java/cn/quantgroup/customer/model/kaordermapping/LoanOrderMapping.java
0 → 100644
View file @
59c38dc3
package
cn
.
quantgroup
.
customer
.
model
.
kaordermapping
;
import
lombok.Data
;
import
java.sql.Timestamp
;
/**
* @author Wang Xiangwei
* @version 2020/3/9
*/
@Data
public
class
LoanOrderMapping
{
private
Long
id
;
private
String
channelOrderNo
;
private
String
channelPaymentNo
;
private
String
applyNo
;
private
Long
loanId
;
private
Long
registeredFrom
;
private
String
orderExtend
;
private
String
businessType
;
private
Timestamp
paymentAt
;
private
Long
qgUserId
;
private
Timestamp
createdAt
;
private
Timestamp
updatedAt
;
}
src/main/java/cn/quantgroup/customer/rest/param/ordermapping/OrderMappingQueryParam.java
0 → 100644
View file @
59c38dc3
package
cn
.
quantgroup
.
customer
.
rest
.
param
.
ordermapping
;
import
lombok.Data
;
/**
* @author Wang Xiangwei
* @version 2020/3/9
*/
@Data
public
class
OrderMappingQueryParam
{
private
Long
loanId
;
private
String
channelOrderNo
;
private
String
applyOrderNo
;
}
src/main/java/cn/quantgroup/customer/service/IKaService.java
0 → 100644
View file @
59c38dc3
package
cn
.
quantgroup
.
customer
.
service
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderMappingQueryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
/**
* @author Wang Xiangwei
* @version 2020/3/9
*/
public
interface
IKaService
{
JsonResult
<
LoanOrderMapping
>
findOrderMapping
(
OrderMappingQueryParam
orderMappingQueryParam
);
}
src/main/java/cn/quantgroup/customer/service/impl/KaServiceImpl.java
0 → 100644
View file @
59c38dc3
package
cn
.
quantgroup
.
customer
.
service
.
impl
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.exception.BusinessException
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderMappingQueryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.service.IKaService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
java.util.Objects
;
import
static
cn
.
quantgroup
.
customer
.
constant
.
Constant
.
GSON
;
/**
* @author Wang Xiangwei
* @version 2020/3/9
*/
@Slf4j
@Service
public
class
KaServiceImpl
implements
IKaService
{
@Value
(
"${ka.api.http}"
)
private
String
kaSysUrl
;
@Autowired
private
IHttpService
httpService
;
@Override
public
JsonResult
<
LoanOrderMapping
>
findOrderMapping
(
OrderMappingQueryParam
orderMappingQueryParam
)
{
String
logPre
=
"KaServiceImpl.findOrderMapping"
;
log
.
info
(
"{},获得orderMapping orderMappingQueryParam={}"
,
logPre
,
orderMappingQueryParam
);
if
(
Objects
.
isNull
(
orderMappingQueryParam
)){
log
.
error
(
"{} 查询参数为空 orderMappingQueryParam={}"
,
logPre
,
orderMappingQueryParam
);
return
JsonResult
.
buildErrorStateResult
(
"查询参数为空"
,
null
);
}
String
applyOrderNo
=
orderMappingQueryParam
.
getApplyOrderNo
();
String
channelOrderNo
=
orderMappingQueryParam
.
getChannelOrderNo
();
Long
loanId
=
orderMappingQueryParam
.
getLoanId
();
String
url
=
kaSysUrl
+
"/api/order_mapping/get"
;
try
{
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
if
(!
Objects
.
isNull
(
applyOrderNo
)){
param
.
put
(
"applyOrderNo"
,
applyOrderNo
);
}
if
(
StringUtils
.
isNotBlank
(
channelOrderNo
)){
param
.
put
(
"channelOrderNo"
,
channelOrderNo
);
}
if
(
StringUtils
.
isNotBlank
(
channelOrderNo
)){
param
.
put
(
"loanId"
,
loanId
);
}
String
result
=
httpService
.
get
(
url
,
param
);
log
.
info
(
"{} 请求ka系统返回值:{}"
,
logPre
,
result
);
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
JsonResult
.
class
);
if
(
Objects
.
isNull
(
jsonResult
)
||
!
jsonResult
.
isSuccess
()){
log
.
error
(
"{} 查询orderMapping失败 jsonResult={}"
,
logPre
,
jsonResult
);
return
JsonResult
.
buildErrorStateResult
(
"查询orderMapping失败"
,
null
);
}
Object
data
=
jsonResult
.
getData
();
LoanOrderMapping
loanOrderMapping
=
GSON
.
fromJson
(
data
.
toString
(),
LoanOrderMapping
.
class
);
jsonResult
.
setData
(
loanOrderMapping
);
return
jsonResult
;
}
catch
(
Exception
e
)
{
log
.
error
(
"{} 网络通讯异常,orderMappingQueryParam:{},ex:{}"
,
orderMappingQueryParam
,
ExceptionUtils
.
getStackTrace
(
e
));
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
}
}
}
src/main/java/cn/quantgroup/customer/service/impl/UserServiceImpl.java
View file @
59c38dc3
...
@@ -5,15 +5,18 @@ import cn.quantgroup.customer.entity.User;
...
@@ -5,15 +5,18 @@ import cn.quantgroup.customer.entity.User;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.exception.BusinessException
;
import
cn.quantgroup.customer.exception.BusinessException
;
import
cn.quantgroup.customer.model.Tuple
;
import
cn.quantgroup.customer.model.Tuple
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.model.xyqbuser.UserBasicInfo
;
import
cn.quantgroup.customer.model.xyqbuser.UserBasicInfo
;
import
cn.quantgroup.customer.model.xyqbuser.UserCombination
;
import
cn.quantgroup.customer.model.xyqbuser.UserCombination
;
import
cn.quantgroup.customer.repo.UserRepo
;
import
cn.quantgroup.customer.repo.UserRepo
;
import
cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery
;
import
cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderMappingQueryParam
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneAudit
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneAudit
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneFeedback
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneFeedback
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneQuery
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneQuery
;
import
cn.quantgroup.customer.rest.param.user.UserCombinationParam
;
import
cn.quantgroup.customer.rest.param.user.UserCombinationParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.service.IKaService
;
import
cn.quantgroup.customer.service.IUserService
;
import
cn.quantgroup.customer.service.IUserService
;
import
cn.quantgroup.customer.service.IXyqbService
;
import
cn.quantgroup.customer.service.IXyqbService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
...
@@ -30,7 +33,6 @@ import com.google.gson.GsonBuilder;
...
@@ -30,7 +33,6 @@ import com.google.gson.GsonBuilder;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetails
;
...
@@ -57,13 +59,15 @@ public class UserServiceImpl implements IUserService {
...
@@ -57,13 +59,15 @@ public class UserServiceImpl implements IUserService {
private
final
UserSdkImpl
userSdk
;
private
final
UserSdkImpl
userSdk
;
private
final
IXyqbService
xyqbService
;
private
final
IXyqbService
xyqbService
;
private
final
IKaService
kaService
;
@Autowired
@Autowired
public
UserServiceImpl
(
UserRepo
userRepo
,
IHttpService
httpService
,
UserSdkImpl
userSdk
,
IXyqbService
xyqb
Service
)
{
public
UserServiceImpl
(
UserRepo
userRepo
,
IHttpService
httpService
,
UserSdkImpl
userSdk
,
IXyqbService
xyqbService
,
IKaService
ka
Service
)
{
this
.
userRepo
=
userRepo
;
this
.
userRepo
=
userRepo
;
this
.
httpService
=
httpService
;
this
.
httpService
=
httpService
;
this
.
userSdk
=
userSdk
;
this
.
userSdk
=
userSdk
;
this
.
xyqbService
=
xyqbService
;
this
.
xyqbService
=
xyqbService
;
this
.
kaService
=
kaService
;
}
}
@Override
@Override
...
@@ -148,7 +152,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -148,7 +152,7 @@ public class UserServiceImpl implements IUserService {
@Override
@Override
public
JsonResult
findUserInfo
(
UserCombinationParam
userCombinationParam
)
{
public
JsonResult
findUserInfo
(
UserCombinationParam
userCombinationParam
)
{
final
String
LOG_PRE
=
"UserServiceImpl.findUserInfo"
;
final
String
LOG_PRE
=
"UserServiceImpl.findUserInfo"
;
log
.
info
(
"{} 查询用户信息 userCombinationParam={}"
,
LOG_PRE
,
userCombinationParam
);
log
.
info
(
"{} 查询用户信息 userCombinationParam={}"
,
LOG_PRE
,
userCombinationParam
);
Tuple
<
Boolean
,
String
>
tuple
=
validate
(
userCombinationParam
);
Tuple
<
Boolean
,
String
>
tuple
=
validate
(
userCombinationParam
);
if
(!
tuple
.
getKey
())
{
if
(!
tuple
.
getKey
())
{
...
@@ -157,47 +161,59 @@ public class UserServiceImpl implements IUserService {
...
@@ -157,47 +161,59 @@ public class UserServiceImpl implements IUserService {
}
}
//通过userId查询
//通过userId查询
if
(!
Objects
.
isNull
(
userCombinationParam
.
getUserId
())){
if
(!
Objects
.
isNull
(
userCombinationParam
.
getUserId
()))
{
log
.
info
(
"{} 通过userId查询 userId={}"
,
LOG_PRE
,
userCombinationParam
.
getUserId
());
log
.
info
(
"{} 通过userId查询 userId={}"
,
LOG_PRE
,
userCombinationParam
.
getUserId
());
UserSysResult
<
XUserDetail
>
userDetailByUserId
=
userSdk
.
getService
().
findUserDetailByUserId
(
userCombinationParam
.
getUserId
());
UserSysResult
<
XUserDetail
>
userDetailByUserId
=
userSdk
.
getService
().
findUserDetailByUserId
(
userCombinationParam
.
getUserId
());
return
getUserBasicInfoResult
(
userDetailByUserId
);
return
getUserBasicInfoResult
(
userDetailByUserId
);
}
}
if
(
StringUtils
.
isNotBlank
(
userCombinationParam
.
getPhoneNo
()))
{
if
(
StringUtils
.
isNotBlank
(
userCombinationParam
.
getPhoneNo
()))
{
log
.
info
(
"{} 通过phoneNo查询 phoneNo={}"
,
LOG_PRE
,
userCombinationParam
.
getPhoneNo
());
log
.
info
(
"{} 通过phoneNo查询 phoneNo={}"
,
LOG_PRE
,
userCombinationParam
.
getPhoneNo
());
UserSysResult
<
XUserDetail
>
userDetailByPhone
=
userSdk
.
getService
().
findUserDetailByPhone
(
userCombinationParam
.
getPhoneNo
());
UserSysResult
<
XUserDetail
>
userDetailByPhone
=
userSdk
.
getService
().
findUserDetailByPhone
(
userCombinationParam
.
getPhoneNo
());
return
getUserBasicInfoResult
(
userDetailByPhone
);
return
getUserBasicInfoResult
(
userDetailByPhone
);
}
}
if
(
StringUtils
.
isNotBlank
(
userCombinationParam
.
getUuid
()))
{
if
(
StringUtils
.
isNotBlank
(
userCombinationParam
.
getUuid
()))
{
log
.
info
(
"{} 通过uuid查询 uuid={}"
,
LOG_PRE
,
userCombinationParam
.
getUuid
());
log
.
info
(
"{} 通过uuid查询 uuid={}"
,
LOG_PRE
,
userCombinationParam
.
getUuid
());
UserSysResult
<
XUserFullInfo
>
userFullInfoByUuid
=
userSdk
.
getService
().
findUserFullInfoByUuid
(
userCombinationParam
.
getUuid
());
UserSysResult
<
XUserFullInfo
>
userFullInfoByUuid
=
userSdk
.
getService
().
findUserFullInfoByUuid
(
userCombinationParam
.
getUuid
());
Object
jsonResultData
=
getJsonResultData
(
userFullInfoByUuid
);
Object
jsonResultData
=
getJsonResultData
(
userFullInfoByUuid
);
if
(
jsonResultData
instanceof
XUserFullInfo
)
{
if
(
jsonResultData
instanceof
XUserFullInfo
)
{
XUserFullInfo
xUserFullInfo
=
(
XUserFullInfo
)
jsonResultData
;
XUserFullInfo
xUserFullInfo
=
(
XUserFullInfo
)
jsonResultData
;
UserSysResult
<
XUserDetail
>
userDetailByPhone
=
userSdk
.
getService
().
findUserDetailByPhone
(
xUserFullInfo
.
getPhoneNo
());
UserSysResult
<
XUserDetail
>
userDetailByPhone
=
userSdk
.
getService
().
findUserDetailByPhone
(
xUserFullInfo
.
getPhoneNo
());
return
getUserBasicInfoResult
(
userDetailByPhone
);
return
getUserBasicInfoResult
(
userDetailByPhone
);
}
else
{
}
else
{
return
(
JsonResult
)
jsonResultData
;
return
(
JsonResult
)
jsonResultData
;
}
}
}
}
if
(!
Objects
.
isNull
(
userCombinationParam
.
getLoanId
())
||
StringUtils
.
isNotBlank
(
userCombinationParam
.
getChannelOrderNo
())
||
StringUtils
.
isNotBlank
(
userCombinationParam
.
getOrderNo
()))
{
if
(!
Objects
.
isNull
(
userCombinationParam
.
getLoanId
())
||
StringUtils
.
isNotBlank
(
userCombinationParam
.
getChannelOrderNo
())
||
StringUtils
.
isNotBlank
(
userCombinationParam
.
getOrderNo
()))
{
//通过ka获得userId然后通过userId查询
//通过ka获得userId然后通过userId查询
OrderMappingQueryParam
param
=
new
OrderMappingQueryParam
();
param
.
setApplyOrderNo
(
userCombinationParam
.
getOrderNo
());
param
.
setChannelOrderNo
(
userCombinationParam
.
getChannelOrderNo
());
param
.
setLoanId
(
userCombinationParam
.
getLoanId
());
JsonResult
<
LoanOrderMapping
>
orderMapping
=
kaService
.
findOrderMapping
(
param
);
if
(!
orderMapping
.
isSuccess
()){
log
.
error
(
"{} 查询用户失败 param={} result={}"
,
LOG_PRE
,
param
,
orderMapping
);
return
orderMapping
;
}
Long
qgUserId
=
orderMapping
.
getData
().
getQgUserId
();
UserSysResult
<
XUserDetail
>
userDetailByUserId
=
userSdk
.
getService
().
findUserDetailByUserId
(
qgUserId
);
return
getUserBasicInfoResult
(
userDetailByUserId
);
}
}
if
(!
Objects
.
isNull
(
userCombinationParam
.
getIdNo
()))
{
if
(!
Objects
.
isNull
(
userCombinationParam
.
getIdNo
()))
{
//通过业务系统获得
//通过业务系统获得
log
.
info
(
"{} 通过phoneNo查询 idNo={}"
,
LOG_PRE
,
userCombinationParam
.
getIdNo
());
return
findUserDetailByIdNo
(
userCombinationParam
.
getIdNo
());
return
findUserDetailByIdNo
(
userCombinationParam
.
getIdNo
());
}
}
return
JsonResult
.
buildErrorStateResult
(
"无有效查询参数"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"无有效查询参数"
,
null
);
}
}
private
JsonResult
findUserDetailByIdNo
(
String
idNo
)
{
private
JsonResult
findUserDetailByIdNo
(
String
idNo
){
String
url
=
userSysUrl
+
"innerapi/user_detail/fuzzyQuery"
;
String
url
=
userSysUrl
+
"innerapi/user_detail/fuzzyQuery"
;
try
{
try
{
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
...
@@ -205,19 +221,19 @@ public class UserServiceImpl implements IUserService {
...
@@ -205,19 +221,19 @@ public class UserServiceImpl implements IUserService {
String
result
=
httpService
.
post
(
url
,
param
);
String
result
=
httpService
.
post
(
url
,
param
);
log
.
info
(
"[user][findUserDetailByIdNo ] 请求业务系统返回值:{}"
,
result
);
log
.
info
(
"[user][findUserDetailByIdNo ] 请求业务系统返回值:{}"
,
result
);
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
JsonResult
.
class
);
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
JsonResult
.
class
);
if
(!
Objects
.
isNull
(
jsonResult
)
&&
jsonResult
.
isSuccess
())
{
if
(!
Objects
.
isNull
(
jsonResult
)
&&
jsonResult
.
isSuccess
())
{
Object
data
=
jsonResult
.
getData
();
Object
data
=
jsonResult
.
getData
();
if
(
data
instanceof
List
)
{
if
(
data
instanceof
List
)
{
List
list
=
(
List
)
data
;
List
list
=
(
List
)
data
;
if
(
list
.
size
()
>
1
)
{
if
(
list
.
size
()
>
1
)
{
return
JsonResult
.
buildErrorStateResult
(
"身份证查询返回多条数据,请用其他参数查询"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"身份证查询返回多条数据,请用其他参数查询"
,
null
);
}
}
if
(
list
.
size
()
==
0
)
{
if
(
list
.
size
()
==
0
)
{
return
JsonResult
.
buildErrorStateResult
(
"不存在相关用户信息"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"不存在相关用户信息"
,
null
);
}
}
Object
o
=
list
.
get
(
0
);
Object
o
=
list
.
get
(
0
);
XUserDetail
userDetail
=
GSON
.
fromJson
(
o
.
toString
(),
XUserDetail
.
class
);
XUserDetail
userDetail
=
GSON
.
fromJson
(
o
.
toString
(),
XUserDetail
.
class
);
UserBasicInfo
userBasicInfo
=
new
UserBasicInfo
();
UserBasicInfo
userBasicInfo
=
new
UserBasicInfo
();
String
createAt
=
DateUtil
.
format
(
userDetail
.
getCreatedAt
(),
DateUtil
.
DATE_FORMAT_1
);
String
createAt
=
DateUtil
.
format
(
userDetail
.
getCreatedAt
(),
DateUtil
.
DATE_FORMAT_1
);
userBasicInfo
.
setCreateAt
(
createAt
);
userBasicInfo
.
setCreateAt
(
createAt
);
...
@@ -225,8 +241,8 @@ public class UserServiceImpl implements IUserService {
...
@@ -225,8 +241,8 @@ public class UserServiceImpl implements IUserService {
userBasicInfo
.
setIdNo
(
userDetail
.
getIdNo
());
userBasicInfo
.
setIdNo
(
userDetail
.
getIdNo
());
userBasicInfo
.
setName
(
userDetail
.
getName
());
userBasicInfo
.
setName
(
userDetail
.
getName
());
userBasicInfo
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
userBasicInfo
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
userBasicInfo
.
setStatus
(
userDetail
.
getEnable
()
?
"正常"
:
"封禁"
);
userBasicInfo
.
setStatus
(
userDetail
.
getEnable
()
?
"正常"
:
"封禁"
);
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
}
}
}
}
...
@@ -236,12 +252,13 @@ public class UserServiceImpl implements IUserService {
...
@@ -236,12 +252,13 @@ public class UserServiceImpl implements IUserService {
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
}
}
return
JsonResult
.
buildErrorStateResult
(
"查询用户信息错误"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"查询用户信息错误"
,
null
);
}
}
private
JsonResult
getUserBasicInfoResult
(
UserSysResult
userSysResult
)
{
private
JsonResult
getUserBasicInfoResult
(
UserSysResult
userSysResult
)
{
Object
data
=
getJsonResultData
(
userSysResult
);
Object
data
=
getJsonResultData
(
userSysResult
);
UserBasicInfo
userBasicInfo
=
new
UserBasicInfo
();
UserBasicInfo
userBasicInfo
=
new
UserBasicInfo
();
if
(
data
instanceof
XUserDetail
)
{
if
(
data
instanceof
XUserDetail
)
{
XUserDetail
userDetail
=
(
XUserDetail
)
data
;
XUserDetail
userDetail
=
(
XUserDetail
)
data
;
String
createAt
=
DateUtil
.
format
(
userDetail
.
getCreatedAt
(),
DateUtil
.
DATE_FORMAT_1
);
String
createAt
=
DateUtil
.
format
(
userDetail
.
getCreatedAt
(),
DateUtil
.
DATE_FORMAT_1
);
userBasicInfo
.
setCreateAt
(
createAt
);
userBasicInfo
.
setCreateAt
(
createAt
);
...
@@ -249,27 +266,27 @@ public class UserServiceImpl implements IUserService {
...
@@ -249,27 +266,27 @@ public class UserServiceImpl implements IUserService {
userBasicInfo
.
setIdNo
(
userDetail
.
getIdNo
());
userBasicInfo
.
setIdNo
(
userDetail
.
getIdNo
());
userBasicInfo
.
setName
(
userDetail
.
getName
());
userBasicInfo
.
setName
(
userDetail
.
getName
());
userBasicInfo
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
userBasicInfo
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
userBasicInfo
.
setStatus
(
userDetail
.
getEnable
()
?
"正常"
:
"封禁"
);
userBasicInfo
.
setStatus
(
userDetail
.
getEnable
()
?
"正常"
:
"封禁"
);
}
else
{
}
else
{
return
(
JsonResult
)
data
;
return
(
JsonResult
)
data
;
}
}
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
}
}
private
Object
getJsonResultData
(
UserSysResult
userSysResult
)
{
private
Object
getJsonResultData
(
UserSysResult
userSysResult
)
{
String
logPre
=
"UserServiceImpl.getJsonResultData"
;
String
logPre
=
"UserServiceImpl.getJsonResultData"
;
log
.
info
(
"{} 转换为对象 userSysResult={}"
,
logPre
,
userSysResult
);
log
.
info
(
"{} 转换为对象 userSysResult={}"
,
logPre
,
userSysResult
);
if
(
Objects
.
isNull
(
userSysResult
))
{
if
(
Objects
.
isNull
(
userSysResult
))
{
log
.
error
(
"{} 转换参数为空 userSysResult={}"
,
logPre
,
userSysResult
);
log
.
error
(
"{} 转换参数为空 userSysResult={}"
,
logPre
,
userSysResult
);
return
JsonResult
.
buildErrorStateResult
(
"远程调用结果为空"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"远程调用结果为空"
,
null
);
}
}
if
(!
userSysResult
.
isSuccess
()
||
Objects
.
isNull
(
userSysResult
.
getData
()))
{
if
(!
userSysResult
.
isSuccess
()
||
Objects
.
isNull
(
userSysResult
.
getData
()))
{
log
.
error
(
"{} 远程调用失败 userSysResult={}"
,
logPre
,
userSysResult
);
log
.
error
(
"{} 远程调用失败 userSysResult={}"
,
logPre
,
userSysResult
);
return
JsonResult
.
buildErrorStateResult
(
userSysResult
.
getMsg
(),
userSysResult
.
getData
());
return
JsonResult
.
buildErrorStateResult
(
userSysResult
.
getMsg
(),
userSysResult
.
getData
());
}
}
return
userSysResult
.
getData
();
return
userSysResult
.
getData
();
}
}
...
@@ -339,9 +356,9 @@ public class UserServiceImpl implements IUserService {
...
@@ -339,9 +356,9 @@ public class UserServiceImpl implements IUserService {
@Override
@Override
public
JsonResult
findUserCombination
(
UserCombinationParam
userCombinationParam
)
{
public
JsonResult
findUserCombination
(
UserCombinationParam
userCombinationParam
)
{
String
logPre
=
"UserServiceImpl.findUserCombination"
;
String
logPre
=
"UserServiceImpl.findUserCombination"
;
log
.
info
(
"{},综合查询 userCombinationParam={}"
,
logPre
,
userCombinationParam
);
log
.
info
(
"{},综合查询 userCombinationParam={}"
,
logPre
,
userCombinationParam
);
JsonResult
userInfo
=
this
.
findUserInfo
(
userCombinationParam
);
JsonResult
userInfo
=
this
.
findUserInfo
(
userCombinationParam
);
if
(!
userInfo
.
isSuccess
())
{
if
(!
userInfo
.
isSuccess
())
{
return
userInfo
;
return
userInfo
;
}
}
UserBasicInfo
userBasicInfo
=
(
UserBasicInfo
)
userInfo
.
getData
();
UserBasicInfo
userBasicInfo
=
(
UserBasicInfo
)
userInfo
.
getData
();
...
@@ -350,16 +367,16 @@ public class UserServiceImpl implements IUserService {
...
@@ -350,16 +367,16 @@ public class UserServiceImpl implements IUserService {
applyOrderQuery
.
setOrderNo
(
userCombinationParam
.
getOrderNo
());
applyOrderQuery
.
setOrderNo
(
userCombinationParam
.
getOrderNo
());
applyOrderQuery
.
setUserId
(
userBasicInfo
.
getUserId
());
applyOrderQuery
.
setUserId
(
userBasicInfo
.
getUserId
());
JsonResult
applyOrders
=
xyqbService
.
findApplyOrders
(
applyOrderQuery
);
JsonResult
applyOrders
=
xyqbService
.
findApplyOrders
(
applyOrderQuery
);
if
(!
applyOrders
.
isSuccess
())
{
if
(!
applyOrders
.
isSuccess
())
{
return
applyOrders
;
return
applyOrders
;
}
}
List
applyOrderList
=
(
List
)
applyOrders
.
getData
();
List
applyOrderList
=
(
List
)
applyOrders
.
getData
();
UserCombination
userCombination
=
new
UserCombination
();
UserCombination
userCombination
=
new
UserCombination
();
userCombination
.
setUserInfo
(
userBasicInfo
);
userCombination
.
setUserInfo
(
userBasicInfo
);
userCombination
.
setApplyOrderList
(
applyOrderList
);
userCombination
.
setApplyOrderList
(
applyOrderList
);
return
JsonResult
.
buildSuccessResult
(
""
,
userCombination
);
return
JsonResult
.
buildSuccessResult
(
""
,
userCombination
);
}
}
}
}
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