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
cb3f3acd
Commit
cb3f3acd
authored
Mar 13, 2020
by
王向伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客服系统自测,修改问题,添加渠道查询接口
parent
b3d6b32c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
261 additions
and
124 deletions
+261
-124
WebSecurityConfig.java
...roup/customer/config/http/security/WebSecurityConfig.java
+4
-2
ChannelConfigurationResult.java
...omer/model/kaordermapping/ChannelConfigurationResult.java
+24
-0
Repayment.java
...in/java/cn/quantgroup/customer/model/order/Repayment.java
+0
-2
ChannelRest.java
src/main/java/cn/quantgroup/customer/rest/ChannelRest.java
+34
-0
IKaService.java
src/main/java/cn/quantgroup/customer/service/IKaService.java
+5
-1
IUserService.java
...ain/java/cn/quantgroup/customer/service/IUserService.java
+4
-4
KaServiceImpl.java
...va/cn/quantgroup/customer/service/impl/KaServiceImpl.java
+62
-21
OrderServiceImpl.java
...cn/quantgroup/customer/service/impl/OrderServiceImpl.java
+6
-6
UserServiceImpl.java
.../cn/quantgroup/customer/service/impl/UserServiceImpl.java
+64
-46
XyqbServiceImpl.java
.../cn/quantgroup/customer/service/impl/XyqbServiceImpl.java
+58
-42
No files found.
src/main/java/cn/quantgroup/customer/config/http/security/WebSecurityConfig.java
View file @
cb3f3acd
...
@@ -3,6 +3,7 @@ package cn.quantgroup.customer.config.http.security;
...
@@ -3,6 +3,7 @@ package cn.quantgroup.customer.config.http.security;
import
cn.quantgroup.customer.config.http.mvc.filter.CsrfHeaderFilter
;
import
cn.quantgroup.customer.config.http.mvc.filter.CsrfHeaderFilter
;
import
cn.quantgroup.customer.service.IUserService
;
import
cn.quantgroup.customer.service.IUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.annotation.Order
;
...
@@ -21,6 +22,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -21,6 +22,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private
final
IUserService
userService
;
private
final
IUserService
userService
;
private
final
PasswordEncoder
passwordEncoder
;
private
final
PasswordEncoder
passwordEncoder
;
@Value
(
"${allowed.routes}"
)
private
String
allowedRoutes
;
@Autowired
@Autowired
public
WebSecurityConfig
(
IUserService
userService
,
PasswordEncoder
passwordEncoder
)
{
public
WebSecurityConfig
(
IUserService
userService
,
PasswordEncoder
passwordEncoder
)
{
this
.
userService
=
userService
;
this
.
userService
=
userService
;
...
@@ -30,8 +33,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -30,8 +33,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
//String allowedRoutes = "/test/**,/error/**,/user/**,/repay/**";
//String allowedRoutes = "/test/**,/error/**,/user/login";
String
allowedRoutes
=
"/test/**,/error/**,/user/login"
;
String
[]
allowedRoutesArr
=
allowedRoutes
.
split
(
","
);
String
[]
allowedRoutesArr
=
allowedRoutes
.
split
(
","
);
http
.
httpBasic
().
and
()
http
.
httpBasic
().
and
()
.
authorizeRequests
()
.
authorizeRequests
()
...
...
src/main/java/cn/quantgroup/customer/model/kaordermapping/ChannelConfigurationResult.java
0 → 100644
View file @
cb3f3acd
package
cn
.
quantgroup
.
customer
.
model
.
kaordermapping
;
import
lombok.Data
;
/**
* Created by wudi on 2016/11/28.
*/
@Data
public
class
ChannelConfigurationResult
{
private
Long
id
;
private
String
channelName
;
private
String
channelCode
;
private
Long
registeredFrom
;
}
\ No newline at end of file
src/main/java/cn/quantgroup/customer/model/order/Repayment.java
View file @
cb3f3acd
...
@@ -133,8 +133,6 @@ public class Repayment {
...
@@ -133,8 +133,6 @@ public class Repayment {
}
}
repayment
.
setRepaymentStatus
(
repayStatus
);
repayment
.
setRepaymentStatus
(
repayStatus
);
//还款类型 待确定
repayment
.
setRepayType
(
repaymentPlanItem
.
getRepaymentType
());
repayment
.
setRepayType
(
repaymentPlanItem
.
getRepaymentType
());
repayment
.
setOverdueDays
(
repaymentPlanItem
.
getOverdueDays
());
repayment
.
setOverdueDays
(
repaymentPlanItem
.
getOverdueDays
());
return
repayment
;
return
repayment
;
...
...
src/main/java/cn/quantgroup/customer/rest/ChannelRest.java
0 → 100644
View file @
cb3f3acd
package
cn
.
quantgroup
.
customer
.
rest
;
import
cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.service.IKaService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* 渠道相关
*
* @author Wang Xiangwei
* @version 2020/3/13
*/
@Slf4j
@RestController
@RequestMapping
(
"/channel"
)
public
class
ChannelRest
{
@Autowired
private
IKaService
kaService
;
@GetMapping
(
"/all"
)
public
JsonResult
<
List
<
ChannelConfigurationResult
>>
getAllChannel
()
{
JsonResult
<
List
<
ChannelConfigurationResult
>>
allChannelConfiguration
=
kaService
.
getAllChannelConfiguration
();
return
allChannelConfiguration
;
}
}
src/main/java/cn/quantgroup/customer/service/IKaService.java
View file @
cb3f3acd
package
cn
.
quantgroup
.
customer
.
service
;
package
cn
.
quantgroup
.
customer
.
service
;
import
cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
...
@@ -17,9 +18,12 @@ public interface IKaService {
...
@@ -17,9 +18,12 @@ public interface IKaService {
/**
/**
* key 申请订单号 value 渠道订单号
* key 申请订单号 value 渠道订单号
*
* @param applyOrderNos
* @param applyOrderNos
* @return
* @return
*/
*/
JsonResult
<
Map
<
String
,
String
>>
findMap
(
List
<
String
>
applyOrderNos
);
JsonResult
<
Map
<
String
,
String
>>
findMap
(
List
<
String
>
applyOrderNos
);
JsonResult
<
List
<
ChannelConfigurationResult
>>
getAllChannelConfiguration
();
}
}
src/main/java/cn/quantgroup/customer/service/IUserService.java
View file @
cb3f3acd
package
cn
.
quantgroup
.
customer
.
service
;
package
cn
.
quantgroup
.
customer
.
service
;
import
cn.quantgroup.customer.model.xyqbuser.UserBasicInfo
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
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
;
...
@@ -24,16 +25,15 @@ public interface IUserService extends UserDetailsService {
...
@@ -24,16 +25,15 @@ public interface IUserService extends UserDetailsService {
/**
/**
* 用户基本信息
* 用户基本信息
*
* @param userQueryParam
* @param userQueryParam
* @return
* @return
*/
*/
JsonResult
findUserInfo
(
UserQueryParam
userQueryParam
);
JsonResult
<
UserBasicInfo
>
findUserInfo
(
UserQueryParam
userQueryParam
);
JsonResult
findUserInfoByOrderParam
(
OrderQueryParam
orderQueryParam
);
JsonResult
<
UserBasicInfo
>
findUserInfoByOrderParam
(
OrderQueryParam
orderQueryParam
);
JsonResult
findUserCombination
(
UserCombinationParam
userCombinationParam
);
JsonResult
findUserCombination
(
UserCombinationParam
userCombinationParam
);
}
}
src/main/java/cn/quantgroup/customer/service/impl/KaServiceImpl.java
View file @
cb3f3acd
...
@@ -2,11 +2,14 @@ package cn.quantgroup.customer.service.impl;
...
@@ -2,11 +2,14 @@ package cn.quantgroup.customer.service.impl;
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.kaordermapping.ChannelConfigurationResult
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
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.IKaService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.util.JSONTools
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -21,8 +24,6 @@ import java.util.Map;
...
@@ -21,8 +24,6 @@ import java.util.Map;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.StringJoiner
;
import
java.util.StringJoiner
;
import
static
cn
.
quantgroup
.
customer
.
constant
.
Constant
.
GSON
;
/**
/**
* @author Wang Xiangwei
* @author Wang Xiangwei
* @version 2020/3/9
* @version 2020/3/9
...
@@ -32,7 +33,7 @@ import static cn.quantgroup.customer.constant.Constant.GSON;
...
@@ -32,7 +33,7 @@ import static cn.quantgroup.customer.constant.Constant.GSON;
public
class
KaServiceImpl
implements
IKaService
{
public
class
KaServiceImpl
implements
IKaService
{
@Value
(
"${
ka.
api.http}"
)
@Value
(
"${
q
api.http}"
)
private
String
kaSysUrl
;
private
String
kaSysUrl
;
@Autowired
@Autowired
...
@@ -51,34 +52,40 @@ public class KaServiceImpl implements IKaService {
...
@@ -51,34 +52,40 @@ public class KaServiceImpl implements IKaService {
String
applyOrderNo
=
orderQueryParam
.
getApplyOrderNo
();
String
applyOrderNo
=
orderQueryParam
.
getApplyOrderNo
();
String
channelOrderNo
=
orderQueryParam
.
getChannelOrderNo
();
String
channelOrderNo
=
orderQueryParam
.
getChannelOrderNo
();
Long
loanId
=
orderQueryParam
.
getLoanId
();
Long
loanId
=
orderQueryParam
.
getLoanId
();
Long
channelId
=
orderQueryParam
.
getChannelId
();
String
url
=
kaSysUrl
+
"/external/get/orderMapping"
;
String
url
=
kaSysUrl
+
"/external/get/orderMapping"
;
try
{
try
{
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
if
(
!
Objects
.
is
Null
(
applyOrderNo
))
{
if
(
Objects
.
non
Null
(
applyOrderNo
))
{
param
.
put
(
"applyOrderNo"
,
applyOrderNo
);
param
.
put
(
"applyOrderNo"
,
applyOrderNo
);
}
}
if
(
StringUtils
.
isNotBlank
(
channelOrderNo
))
{
if
(
StringUtils
.
isNotBlank
(
channelOrderNo
))
{
param
.
put
(
"channelOrderNo"
,
channelOrderNo
);
param
.
put
(
"channelOrderNo"
,
channelOrderNo
);
}
}
if
(!
Objects
.
isNull
(
loanId
))
{
if
(
Objects
.
nonNull
(
channelId
))
{
param
.
put
(
"channelId"
,
channelId
);
}
if
(
Objects
.
nonNull
(
loanId
))
{
param
.
put
(
"loanId"
,
loanId
);
param
.
put
(
"loanId"
,
loanId
);
}
}
String
result
=
httpService
.
get
(
url
,
param
);
String
result
=
null
;
try
{
result
=
httpService
.
get
(
url
,
param
);
}
catch
(
Exception
e
)
{
log
.
error
(
" {}查询orderMapping失败http请求异常 url={},param={}"
,
logPre
,
url
,
param
,
e
);
return
JsonResult
.
buildErrorStateResult
(
"通讯异常"
,
null
);
}
log
.
info
(
"{} 请求ka系统返回值:{}"
,
logPre
,
result
);
log
.
info
(
"{} 请求ka系统返回值:{}"
,
logPre
,
result
);
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
JsonResult
.
class
);
if
(
Objects
.
isNull
(
jsonResult
)
||
!
jsonResult
.
isSuccess
(
))
{
if
(
StringUtils
.
isBlank
(
result
))
{
log
.
error
(
"{} 查询orderMapping失败 jsonResult={}"
,
logPre
,
jsonR
esult
);
log
.
error
(
"{} 查询orderMapping失败 jsonResult={}"
,
logPre
,
r
esult
);
return
JsonResult
.
buildErrorStateResult
(
"查询orderMapping失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"查询orderMapping失败"
,
null
);
}
}
TypeReference
<
JsonResult
<
LoanOrderMapping
>>
typeToken
=
new
TypeReference
<
JsonResult
<
LoanOrderMapping
>>()
{
Object
data
=
jsonResult
.
getData
();
};
LoanOrderMapping
loanOrderMapping
=
GSON
.
fromJson
(
data
.
toString
(),
LoanOrderMapping
.
class
);
JsonResult
<
LoanOrderMapping
>
jsonResult
=
JSONTools
.
deserialize
(
result
,
typeToken
);
jsonResult
.
setData
(
loanOrderMapping
);
return
jsonResult
;
return
jsonResult
;
...
@@ -106,15 +113,49 @@ public class KaServiceImpl implements IKaService {
...
@@ -106,15 +113,49 @@ public class KaServiceImpl implements IKaService {
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
param
.
put
(
"applyNos"
,
stringJoiner
.
toString
());
param
.
put
(
"applyNos"
,
stringJoiner
.
toString
());
String
result
=
httpService
.
get
(
url
,
param
);
String
result
;
try
{
result
=
httpService
.
get
(
url
,
param
);
}
catch
(
Exception
e
)
{
log
.
error
(
"{} 通过申请订单号获取渠道订单号失败"
,
logPre
,
e
);
return
JsonResult
.
buildErrorStateResult
(
"查询渠道订单号失败"
,
null
);
}
log
.
info
(
"{} 请求ka系统返回值:{}"
,
logPre
,
result
);
if
(
StringUtils
.
isBlank
(
result
))
{
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
JsonResult
.
class
);
log
.
error
(
"{} 获得渠道订单号 jsonResult={}"
,
logPre
,
result
);
if
(
Objects
.
isNull
(
jsonResult
)
||
!
jsonResult
.
isSuccess
())
{
log
.
error
(
"{} 获得渠道订单号 jsonResult={}"
,
logPre
,
jsonResult
);
return
JsonResult
.
buildErrorStateResult
(
"获得渠道订单号"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"获得渠道订单号"
,
null
);
}
}
TypeReference
<
JsonResult
<
Map
<
String
,
String
>>>
typeToken
=
new
TypeReference
<
JsonResult
<
Map
<
String
,
String
>>>()
{
};
JsonResult
<
Map
<
String
,
String
>>
jsonResult
=
JSONTools
.
deserialize
(
result
,
typeToken
);
return
jsonResult
;
}
@Override
public
JsonResult
<
List
<
ChannelConfigurationResult
>>
getAllChannelConfiguration
()
{
String
logPre
=
"KaServiceImpl.getAllChannelConfiguration"
;
log
.
info
(
"{},获得所有渠道"
,
logPre
);
String
url
=
kaSysUrl
+
"/external//query/all/channelConfiguration"
;
String
result
;
try
{
result
=
httpService
.
get
(
url
);
}
catch
(
Exception
e
)
{
log
.
error
(
"{} 获得所有渠道失败"
,
logPre
,
e
);
return
JsonResult
.
buildErrorStateResult
(
"获得所有渠道失败"
,
null
);
}
if
(
StringUtils
.
isBlank
(
result
))
{
log
.
error
(
"{} 获得所有渠道 jsonResult={}"
,
logPre
,
result
);
return
JsonResult
.
buildErrorStateResult
(
"获得所有渠道失败"
,
null
);
}
TypeReference
<
JsonResult
<
List
<
ChannelConfigurationResult
>>>
typeToken
=
new
TypeReference
<
JsonResult
<
List
<
ChannelConfigurationResult
>>>()
{
};
JsonResult
<
List
<
ChannelConfigurationResult
>>
jsonResult
=
JSONTools
.
deserialize
(
result
,
typeToken
);
return
jsonResult
;
return
jsonResult
;
}
}
}
}
src/main/java/cn/quantgroup/customer/service/impl/OrderServiceImpl.java
View file @
cb3f3acd
...
@@ -43,11 +43,12 @@ public class OrderServiceImpl implements IOrderService {
...
@@ -43,11 +43,12 @@ public class OrderServiceImpl implements IOrderService {
JsonResult
<
List
<
FlowNode
>>
flowChart
=
xyqbService
.
findFlowChart
(
applyOrderNo
);
JsonResult
<
List
<
FlowNode
>>
flowChart
=
xyqbService
.
findFlowChart
(
applyOrderNo
);
if
(!
flowChart
.
isSuccess
())
{
if
(!
flowChart
.
isSuccess
())
{
log
.
error
(
"{} 流程图查询失败 result={}"
,
logPre
,
flowChart
);
return
flowChart
;
return
flowChart
;
}
}
List
<
FlowNode
>
flowNodeList
=
flowChart
.
getData
();
List
<
FlowNode
>
flowNodeList
=
flowChart
.
getData
();
if
(
!
Objects
.
is
Null
(
head
))
{
if
(
Objects
.
non
Null
(
head
))
{
FlowNode
flowNode
=
new
FlowNode
();
FlowNode
flowNode
=
new
FlowNode
();
flowNode
.
setName
(
"渠道用户信息导入"
);
flowNode
.
setName
(
"渠道用户信息导入"
);
flowNode
.
setStatus
(
1
);
flowNode
.
setStatus
(
1
);
...
@@ -66,8 +67,8 @@ public class OrderServiceImpl implements IOrderService {
...
@@ -66,8 +67,8 @@ public class OrderServiceImpl implements IOrderService {
JsonResult
<
LoanOrder
>
loanOrder
=
xyqbService
.
findLoanOrder
(
loanId
);
JsonResult
<
LoanOrder
>
loanOrder
=
xyqbService
.
findLoanOrder
(
loanId
);
if
(!
loanOrder
.
isSuccess
())
{
if
(!
loanOrder
.
isSuccess
())
{
log
.
error
(
"{} 提现订单查询失败 loanId={}, result={}"
,
logPre
,
loanId
,
loanOrder
);
log
.
error
(
"{} 提现订单查询失败 loanId={}, result={}"
,
logPre
,
loanId
,
loanOrder
);
return
JsonResult
.
buildErrorStateResult
(
loanOrder
.
getMsg
(),
loanOrder
.
getData
());
return
JsonResult
.
buildErrorStateResult
(
loanOrder
.
getMsg
(),
loanOrder
.
getData
());
}
}
...
@@ -80,13 +81,12 @@ public class OrderServiceImpl implements IOrderService {
...
@@ -80,13 +81,12 @@ public class OrderServiceImpl implements IOrderService {
List
<
Repayment
>
repaymentList
=
new
ArrayList
<>();
List
<
Repayment
>
repaymentList
=
new
ArrayList
<>();
List
<
RepaymentPlanItem
>
repaymentPlans
=
orderRepaymentJsonResult
.
getData
().
getRepaymentPlans
();
List
<
RepaymentPlanItem
>
repaymentPlans
=
orderRepaymentJsonResult
.
getData
().
getRepaymentPlans
();
repaymentPlans
.
forEach
(
e
->
repaymentList
.
add
(
Repayment
.
valueOf
(
e
)));
repaymentPlans
.
forEach
(
e
->
repaymentList
.
add
(
Repayment
.
valueOf
(
e
)));
LoanOrderDetail
loanOrderDetail
=
new
LoanOrderDetail
();
LoanOrderDetail
loanOrderDetail
=
new
LoanOrderDetail
();
loanOrderDetail
.
setLoanOrder
(
loanOrder
.
getData
());
loanOrderDetail
.
setLoanOrder
(
loanOrder
.
getData
());
loanOrderDetail
.
setRepaymentList
(
repaymentList
);
loanOrderDetail
.
setRepaymentList
(
repaymentList
);
return
JsonResult
.
buildSuccessResult
(
""
,
loanOrderDetail
);
return
JsonResult
.
buildSuccessResult
(
""
,
loanOrderDetail
);
}
}
}
}
src/main/java/cn/quantgroup/customer/service/impl/UserServiceImpl.java
View file @
cb3f3acd
...
@@ -24,11 +24,13 @@ import cn.quantgroup.customer.service.IXyqbService;
...
@@ -24,11 +24,13 @@ import cn.quantgroup.customer.service.IXyqbService;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.util.DateUtil
;
import
cn.quantgroup.customer.util.DateUtil
;
import
cn.quantgroup.customer.util.IdcardUtils
;
import
cn.quantgroup.customer.util.IdcardUtils
;
import
cn.quantgroup.customer.util.JSONTools
;
import
cn.quantgroup.customer.util.ValidationUtil
;
import
cn.quantgroup.customer.util.ValidationUtil
;
import
cn.quantgroup.riskcontrol.model.AuthenticationUserDetail
;
import
cn.quantgroup.riskcontrol.model.AuthenticationUserDetail
;
import
cn.quantgroup.user.retbean.XUserDetail
;
import
cn.quantgroup.user.retbean.XUserDetail
;
import
cn.quantgroup.user.retbean.XUserFullInfo
;
import
cn.quantgroup.user.retbean.XUserFullInfo
;
import
cn.quantgroup.user.vo.UserSysResult
;
import
cn.quantgroup.user.vo.UserSysResult
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.GsonBuilder
;
...
@@ -153,11 +155,10 @@ public class UserServiceImpl implements IUserService {
...
@@ -153,11 +155,10 @@ public class UserServiceImpl implements IUserService {
@Override
@Override
public
JsonResult
findUserInfo
(
UserQueryParam
userQueryParam
)
{
public
JsonResult
<
UserBasicInfo
>
findUserInfo
(
UserQueryParam
userQueryParam
)
{
final
String
LOG_PRE
=
"UserServiceImpl.findUserInfo"
;
final
String
LOG_PRE
=
"UserServiceImpl.findUserInfo"
;
log
.
info
(
"{} 查询用户信息 userCombinationParam={}"
,
LOG_PRE
,
userQueryParam
);
log
.
info
(
"{} 查询用户信息 userCombinationParam={}"
,
LOG_PRE
,
userQueryParam
);
//通过userId查询
//通过userId查询
if
(
Objects
.
nonNull
(
userQueryParam
.
getUserId
()))
{
if
(
Objects
.
nonNull
(
userQueryParam
.
getUserId
()))
{
log
.
info
(
"{} 通过userId查询 userId={}"
,
LOG_PRE
,
userQueryParam
.
getUserId
());
log
.
info
(
"{} 通过userId查询 userId={}"
,
LOG_PRE
,
userQueryParam
.
getUserId
());
...
@@ -186,7 +187,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -186,7 +187,7 @@ public class UserServiceImpl implements IUserService {
}
}
//通过身份证号获得
//通过身份证号获得
if
(
Objects
.
nonNull
(
userQueryParam
.
getIdNo
()))
{
if
(
StringUtils
.
isNotBlank
(
userQueryParam
.
getIdNo
()))
{
//通过业务系统获得
//通过业务系统获得
log
.
info
(
"{} 通过phoneNo查询 idNo={}"
,
LOG_PRE
,
userQueryParam
.
getIdNo
());
log
.
info
(
"{} 通过phoneNo查询 idNo={}"
,
LOG_PRE
,
userQueryParam
.
getIdNo
());
return
findUserDetailByIdNo
(
userQueryParam
.
getIdNo
());
return
findUserDetailByIdNo
(
userQueryParam
.
getIdNo
());
...
@@ -202,40 +203,47 @@ public class UserServiceImpl implements IUserService {
...
@@ -202,40 +203,47 @@ public class UserServiceImpl implements IUserService {
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
param
.
put
(
"idNo"
,
idNo
);
param
.
put
(
"idNo"
,
idNo
);
String
result
=
httpService
.
post
(
url
,
param
);
String
result
=
httpService
.
post
(
url
,
param
);
log
.
info
(
"[user][findUserDetailByIdNo ] 请求业务系统返回值:{}"
,
result
);
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
JsonResult
.
class
);
if
(!
Objects
.
isNull
(
jsonResult
)
&&
jsonResult
.
isSuccess
())
{
Object
data
=
jsonResult
.
getData
();
if
(
data
instanceof
List
)
{
List
list
=
(
List
)
data
;
if
(
list
.
size
()
>
1
)
{
return
JsonResult
.
buildErrorStateResult
(
"身份证查询返回多条数据,请用其他参数查询"
,
null
);
}
if
(
list
.
size
()
==
0
)
{
return
JsonResult
.
buildErrorStateResult
(
"不存在相关用户信息"
,
null
);
}
Object
o
=
list
.
get
(
0
);
XUserDetail
userDetail
=
GSON
.
fromJson
(
o
.
toString
(),
XUserDetail
.
class
);
UserBasicInfo
userBasicInfo
=
new
UserBasicInfo
();
String
createAt
=
DateUtil
.
format
(
userDetail
.
getCreatedAt
(),
DateUtil
.
DATE_FORMAT_1
);
userBasicInfo
.
setCreateAt
(
createAt
);
userBasicInfo
.
setGender
(
userDetail
.
getGender
().
getName
());
userBasicInfo
.
setIdNo
(
userDetail
.
getIdNo
());
userBasicInfo
.
setName
(
userDetail
.
getName
());
userBasicInfo
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
userBasicInfo
.
setStatus
(
userDetail
.
getEnable
()
?
"正常"
:
"封禁"
);
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
}
if
(
StringUtils
.
isBlank
(
result
))
{
log
.
error
(
"UserServiceImpl.findUserDetailByIdNo请求业务系统返回值:{}"
,
result
);
return
JsonResult
.
buildErrorStateResult
(
ErrorCodeEnum
.
RETURN_ERROR
.
getMessage
(),
ErrorCodeEnum
.
RETURN_ERROR
.
getCode
());
}
}
TypeReference
<
JsonResult
<
List
<
XUserDetail
>>>
typeToken
=
new
TypeReference
<
JsonResult
<
List
<
XUserDetail
>>>()
{
};
JsonResult
<
List
<
XUserDetail
>>
jsonResult
=
JSONTools
.
deserialize
(
result
,
typeToken
);
if
(!
jsonResult
.
isSuccess
())
{
log
.
error
(
"UserServiceImpl.findUserDetailByIdNo 查询失败 result={}"
,
jsonResult
);
return
jsonResult
;
}
List
<
XUserDetail
>
xUserDetails
=
jsonResult
.
getData
();
if
(
xUserDetails
.
size
()
>
1
)
{
return
JsonResult
.
buildErrorStateResult
(
"身份证查询返回多条数据,请用其他参数查询"
,
null
);
}
if
(
xUserDetails
.
size
()
==
0
)
{
return
JsonResult
.
buildErrorStateResult
(
"不存在相关用户信息"
,
null
);
}
Object
o
=
xUserDetails
.
get
(
0
);
XUserDetail
userDetail
=
GSON
.
fromJson
(
o
.
toString
(),
XUserDetail
.
class
);
UserBasicInfo
userBasicInfo
=
new
UserBasicInfo
();
String
createAt
=
DateUtil
.
format
(
userDetail
.
getCreatedAt
(),
DateUtil
.
DATE_FORMAT_1
);
userBasicInfo
.
setCreateAt
(
createAt
);
userBasicInfo
.
setGender
(
userDetail
.
getGender
().
getName
());
userBasicInfo
.
setIdNo
(
userDetail
.
getIdNo
());
userBasicInfo
.
setName
(
userDetail
.
getName
());
userBasicInfo
.
setPhoneNo
(
userDetail
.
getPhoneNo
());
userBasicInfo
.
setUserId
(
userDetail
.
getUserId
());
userBasicInfo
.
setStatus
(
userDetail
.
getEnable
()
==
null
?
"未知"
:(
userDetail
.
getEnable
()?
"正常"
:
"封禁"
));
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"[user][findUserDetailByIdNo ] 网络通讯异常,idNo:{},ex:{}"
,
idNo
,
ExceptionUtils
.
getStackTrace
(
e
));
log
.
error
(
"[user][findUserDetailByIdNo ] 网络通讯异常,idNo:{},ex:{}"
,
idNo
,
ExceptionUtils
.
getStackTrace
(
e
));
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
throw
new
BusinessException
(
ErrorCodeEnum
.
NET_ERROR
);
}
}
return
JsonResult
.
buildErrorStateResult
(
"查询用户信息错误"
,
null
);
}
}
private
JsonResult
getUserBasicInfoResult
(
UserSysResult
userSysResult
)
{
private
JsonResult
getUserBasicInfoResult
(
UserSysResult
userSysResult
)
{
...
@@ -249,12 +257,11 @@ public class UserServiceImpl implements IUserService {
...
@@ -249,12 +257,11 @@ 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
.
setUserId
(
userDetail
.
getUserId
());
userBasicInfo
.
setStatus
(
userDetail
.
getEnable
()
==
null
?
"未知"
:(
userDetail
.
getEnable
()?
"正常"
:
"封禁"
));
}
else
{
}
else
{
return
(
JsonResult
)
data
;
return
(
JsonResult
)
data
;
}
}
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
return
JsonResult
.
buildSuccessResult
(
null
,
userBasicInfo
);
}
}
...
@@ -283,6 +290,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -283,6 +290,7 @@ public class UserServiceImpl implements IUserService {
* @return Tuple<Boolean, String> false 参数验证失败 value失败描述 true表示参数验证成功 value 表示使用哪类参数 1 表示order 2 表示user
* @return Tuple<Boolean, String> false 参数验证失败 value失败描述 true表示参数验证成功 value 表示使用哪类参数 1 表示order 2 表示user
*/
*/
private
Tuple
<
Boolean
,
String
>
validate
(
UserCombinationParam
userCombinationParam
)
{
private
Tuple
<
Boolean
,
String
>
validate
(
UserCombinationParam
userCombinationParam
)
{
log
.
info
(
"综合查询参数验证 param={}"
,
userCombinationParam
);
Tuple
<
Boolean
,
String
>
result
=
new
Tuple
<>();
Tuple
<
Boolean
,
String
>
result
=
new
Tuple
<>();
int
userParam
=
0
;
int
userParam
=
0
;
int
orderParam
=
0
;
int
orderParam
=
0
;
...
@@ -313,7 +321,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -313,7 +321,7 @@ public class UserServiceImpl implements IUserService {
orderParam
++;
orderParam
++;
}
}
if
(
!
Objects
.
is
Null
(
userCombinationParam
.
getUserId
()))
{
if
(
Objects
.
non
Null
(
userCombinationParam
.
getUserId
()))
{
userParam
++;
userParam
++;
}
}
...
@@ -340,7 +348,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -340,7 +348,7 @@ public class UserServiceImpl implements IUserService {
return
result
;
return
result
;
}
}
//分类参数验证
//分类参数验证
订单参数优先
if
(
orderParam
==
1
)
{
if
(
orderParam
==
1
)
{
result
.
setKey
(
true
);
result
.
setKey
(
true
);
result
.
setValue
(
"1"
);
result
.
setValue
(
"1"
);
...
@@ -351,8 +359,6 @@ public class UserServiceImpl implements IUserService {
...
@@ -351,8 +359,6 @@ public class UserServiceImpl implements IUserService {
result
.
setValue
(
"2"
);
result
.
setValue
(
"2"
);
return
result
;
return
result
;
}
}
result
.
setKey
(
false
);
result
.
setKey
(
false
);
result
.
setValue
(
"参数过多"
);
result
.
setValue
(
"参数过多"
);
return
result
;
return
result
;
...
@@ -369,8 +375,8 @@ public class UserServiceImpl implements IUserService {
...
@@ -369,8 +375,8 @@ public class UserServiceImpl implements IUserService {
log
.
error
(
"{},参数验证失败,{}"
,
logPre
,
tuple
.
getValue
());
log
.
error
(
"{},参数验证失败,{}"
,
logPre
,
tuple
.
getValue
());
return
JsonResult
.
buildErrorStateResult
(
tuple
.
getValue
(),
null
);
return
JsonResult
.
buildErrorStateResult
(
tuple
.
getValue
(),
null
);
}
}
JsonResult
<
UserBasicInfo
>
userInfo
;
JsonResult
<
List
<
ApplyOrder
>>
applyOrders
;
JsonResult
<
List
<
ApplyOrder
>>
applyOrders
;
JsonResult
userInfo
;
if
(
"1"
.
equals
(
tuple
.
getValue
()))
{
if
(
"1"
.
equals
(
tuple
.
getValue
()))
{
//订单参数查询
//订单参数查询
OrderQueryParam
orderQueryParam
=
new
OrderQueryParam
();
OrderQueryParam
orderQueryParam
=
new
OrderQueryParam
();
...
@@ -379,7 +385,11 @@ public class UserServiceImpl implements IUserService {
...
@@ -379,7 +385,11 @@ public class UserServiceImpl implements IUserService {
orderQueryParam
.
setChannelId
(
userCombinationParam
.
getChannelId
());
orderQueryParam
.
setChannelId
(
userCombinationParam
.
getChannelId
());
orderQueryParam
.
setChannelOrderNo
(
userCombinationParam
.
getChannelOrderNo
());
orderQueryParam
.
setChannelOrderNo
(
userCombinationParam
.
getChannelOrderNo
());
userInfo
=
this
.
findUserInfoByOrderParam
(
orderQueryParam
);
userInfo
=
this
.
findUserInfoByOrderParam
(
orderQueryParam
);
applyOrders
=
findApplyOrders
(
orderQueryParam
);
if
(!
userInfo
.
isSuccess
())
{
log
.
error
(
"{} 查询用户失败 result={}"
,
logPre
,
userInfo
);
return
userInfo
;
}
applyOrders
=
this
.
findApplyOrders
(
orderQueryParam
);
}
else
{
}
else
{
//用户参数查询
//用户参数查询
UserQueryParam
userQueryParam
=
new
UserQueryParam
();
UserQueryParam
userQueryParam
=
new
UserQueryParam
();
...
@@ -388,18 +398,21 @@ public class UserServiceImpl implements IUserService {
...
@@ -388,18 +398,21 @@ public class UserServiceImpl implements IUserService {
userQueryParam
.
setUserId
(
userCombinationParam
.
getUserId
());
userQueryParam
.
setUserId
(
userCombinationParam
.
getUserId
());
userQueryParam
.
setUuid
(
userCombinationParam
.
getUuid
());
userQueryParam
.
setUuid
(
userCombinationParam
.
getUuid
());
userInfo
=
this
.
findUserInfo
(
userQueryParam
);
userInfo
=
this
.
findUserInfo
(
userQueryParam
);
applyOrders
=
findApplyOrders
(
userQueryParam
);
if
(!
userInfo
.
isSuccess
())
{
log
.
error
(
"{} 查询用户失败 result={}"
,
logPre
,
userInfo
);
return
userInfo
;
}
userQueryParam
.
setUserId
(
userInfo
.
getData
().
getUserId
());
applyOrders
=
this
.
findApplyOrders
(
userQueryParam
);
}
}
if
(!
userInfo
.
isSuccess
())
{
return
userInfo
;
}
if
(!
applyOrders
.
isSuccess
())
{
if
(!
applyOrders
.
isSuccess
())
{
log
.
error
(
"{} 查询申请订单失败 result={}"
,
logPre
,
applyOrders
);
return
applyOrders
;
return
applyOrders
;
}
}
UserBasicInfo
userBasicInfo
=
(
UserBasicInfo
)
userInfo
.
getData
();
UserBasicInfo
userBasicInfo
=
userInfo
.
getData
();
List
<
ApplyOrder
>
applyOrderList
=
applyOrders
.
getData
();
List
<
ApplyOrder
>
applyOrderList
=
applyOrders
.
getData
();
//通过申请订单号获得渠道订单号
//通过申请订单号获得渠道订单号
List
<
String
>
applyOrderNoList
=
applyOrderList
.
stream
().
map
(
e
->
e
.
getApplyOrderNo
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
applyOrderNoList
=
applyOrderList
.
stream
().
map
(
e
->
e
.
getApplyOrderNo
()).
distinct
().
collect
(
Collectors
.
toList
());
...
@@ -421,6 +434,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -421,6 +434,7 @@ public class UserServiceImpl implements IUserService {
//订单信息综合查询
//订单信息综合查询
private
JsonResult
findApplyOrders
(
OrderQueryParam
orderQueryParam
)
{
private
JsonResult
findApplyOrders
(
OrderQueryParam
orderQueryParam
)
{
String
logPre
=
"UserService.findApplyOrders"
;
String
logPre
=
"UserService.findApplyOrders"
;
log
.
info
(
"{} 通过订单参数查询申请订单 orderQueryParam={}"
,
logPre
,
orderQueryParam
);
ApplyOrderQuery
applyOrderQuery
=
new
ApplyOrderQuery
();
ApplyOrderQuery
applyOrderQuery
=
new
ApplyOrderQuery
();
Long
loanId
=
orderQueryParam
.
getLoanId
();
Long
loanId
=
orderQueryParam
.
getLoanId
();
String
applyNo
=
orderQueryParam
.
getApplyOrderNo
();
String
applyNo
=
orderQueryParam
.
getApplyOrderNo
();
...
@@ -444,7 +458,8 @@ public class UserServiceImpl implements IUserService {
...
@@ -444,7 +458,8 @@ public class UserServiceImpl implements IUserService {
//用户信息综合查询
//用户信息综合查询
private
JsonResult
findApplyOrders
(
UserQueryParam
userQueryParam
)
{
private
JsonResult
findApplyOrders
(
UserQueryParam
userQueryParam
)
{
String
logPre
=
"UserServiceImpl.findApplyOrders"
;
log
.
info
(
"{} 通过用户参数查询申请订单 userQueryParam={}"
,
logPre
,
userQueryParam
);
ApplyOrderQuery
applyOrderQuery
=
new
ApplyOrderQuery
();
ApplyOrderQuery
applyOrderQuery
=
new
ApplyOrderQuery
();
applyOrderQuery
.
setUserId
(
userQueryParam
.
getUserId
());
applyOrderQuery
.
setUserId
(
userQueryParam
.
getUserId
());
//申请订单查询
//申请订单查询
...
@@ -454,9 +469,10 @@ public class UserServiceImpl implements IUserService {
...
@@ -454,9 +469,10 @@ public class UserServiceImpl implements IUserService {
}
}
@Override
@Override
public
JsonResult
findUserInfoByOrderParam
(
OrderQueryParam
orderQueryParam
)
{
public
JsonResult
<
UserBasicInfo
>
findUserInfoByOrderParam
(
OrderQueryParam
orderQueryParam
)
{
String
logPre
=
"UserServiceImpl.findUserInfoByOrderParam"
;
String
logPre
=
"UserServiceImpl.findUserInfoByOrderParam"
;
log
.
info
(
"{} 订单参数查询用户信息 orderQueryParam={}"
,
logPre
,
orderQueryParam
);
//渠道订单号需要有渠道号
//渠道订单号需要有渠道号
boolean
channelParam
=
StringUtils
.
isNotBlank
(
orderQueryParam
.
getChannelOrderNo
())
&&
Objects
.
nonNull
(
orderQueryParam
.
getChannelId
());
boolean
channelParam
=
StringUtils
.
isNotBlank
(
orderQueryParam
.
getChannelOrderNo
())
&&
Objects
.
nonNull
(
orderQueryParam
.
getChannelId
());
if
(
Objects
.
nonNull
(
orderQueryParam
.
getLoanId
())
||
if
(
Objects
.
nonNull
(
orderQueryParam
.
getLoanId
())
||
...
@@ -466,7 +482,7 @@ public class UserServiceImpl implements IUserService {
...
@@ -466,7 +482,7 @@ public class UserServiceImpl implements IUserService {
JsonResult
<
LoanOrderMapping
>
orderMapping
=
kaService
.
findOrderMapping
(
orderQueryParam
);
JsonResult
<
LoanOrderMapping
>
orderMapping
=
kaService
.
findOrderMapping
(
orderQueryParam
);
if
(!
orderMapping
.
isSuccess
()
||
Objects
.
isNull
(
orderMapping
.
getData
()))
{
if
(!
orderMapping
.
isSuccess
()
||
Objects
.
isNull
(
orderMapping
.
getData
()))
{
log
.
error
(
"{} 查询orderMapping失败 param={} result={}"
,
logPre
,
orderQueryParam
,
orderMapping
);
log
.
error
(
"{} 查询orderMapping失败 param={} result={}"
,
logPre
,
orderQueryParam
,
orderMapping
);
return
orderMapping
;
return
JsonResult
.
buildErrorStateResult
(
orderMapping
.
getMsg
(),
null
)
;
}
}
Long
qgUserId
=
orderMapping
.
getData
().
getQgUserId
();
Long
qgUserId
=
orderMapping
.
getData
().
getQgUserId
();
UserSysResult
<
XUserDetail
>
userDetailByUserId
=
userSdk
.
getService
().
findUserDetailByUserId
(
qgUserId
);
UserSysResult
<
XUserDetail
>
userDetailByUserId
=
userSdk
.
getService
().
findUserDetailByUserId
(
qgUserId
);
...
@@ -480,4 +496,6 @@ public class UserServiceImpl implements IUserService {
...
@@ -480,4 +496,6 @@ public class UserServiceImpl implements IUserService {
}
}
return
JsonResult
.
buildErrorStateResult
(
"参数全部为空"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"参数全部为空"
,
null
);
}
}
}
}
src/main/java/cn/quantgroup/customer/service/impl/XyqbServiceImpl.java
View file @
cb3f3acd
package
cn
.
quantgroup
.
customer
.
service
.
impl
;
package
cn
.
quantgroup
.
customer
.
service
.
impl
;
import
cn.quantgroup.customer.model.order.*
;
import
cn.quantgroup.customer.model.order.ApplyOrder
;
import
cn.quantgroup.customer.model.order.FlowNode
;
import
cn.quantgroup.customer.model.order.LoanOrder
;
import
cn.quantgroup.customer.model.order.OrderRepayment
;
import
cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery
;
import
cn.quantgroup.customer.rest.param.applyorder.ApplyOrderQuery
;
import
cn.quantgroup.customer.rest.param.card.ModifyReservePhone
;
import
cn.quantgroup.customer.rest.param.card.ModifyReservePhone
;
import
cn.quantgroup.customer.rest.param.card.UnBindCardModel
;
import
cn.quantgroup.customer.rest.param.card.UnBindCardModel
;
...
@@ -18,9 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -18,9 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
static
cn
.
quantgroup
.
customer
.
constant
.
Constant
.
GSON
;
import
java.util.Map
;
import
java.util.Objects
;
@Slf4j
@Slf4j
@Service
(
"xyqbService"
)
@Service
(
"xyqbService"
)
...
@@ -29,8 +33,14 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -29,8 +33,14 @@ public class XyqbServiceImpl implements IXyqbService {
@Value
(
"${api.http}"
)
@Value
(
"${api.http}"
)
private
String
xyqbSysUrl
;
private
String
xyqbSysUrl
;
@Value
(
"${clotho.api.http}"
)
private
String
clothoSysUrl
;
private
final
IHttpService
httpService
;
private
final
IHttpService
httpService
;
@Autowired
@Autowired
public
XyqbServiceImpl
(
IHttpService
httpService
)
{
public
XyqbServiceImpl
(
IHttpService
httpService
)
{
this
.
httpService
=
httpService
;
this
.
httpService
=
httpService
;
...
@@ -61,31 +71,29 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -61,31 +71,29 @@ public class XyqbServiceImpl implements IXyqbService {
String
orderNo
=
applyOrderQuery
.
getOrderNo
();
String
orderNo
=
applyOrderQuery
.
getOrderNo
();
Long
loanId
=
applyOrderQuery
.
getLoanId
();
Long
loanId
=
applyOrderQuery
.
getLoanId
();
Long
userId
=
applyOrderQuery
.
getUserId
();
Long
userId
=
applyOrderQuery
.
getUserId
();
String
url
=
xyqbSysUrl
+
"/ex/inside
/customer_sys/query/applyOrder"
;
String
url
=
clothoSysUrl
+
"/ex
/customer_sys/query/applyOrder"
;
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
if
(
StringUtils
.
isNotEmpty
(
orderNo
))
{
if
(
StringUtils
.
isNotEmpty
(
orderNo
))
{
param
.
put
(
"orderNo"
,
orderNo
);
param
.
put
(
"orderNo"
,
orderNo
);
}
}
if
(
Objects
.
nonNull
(
userId
))
{
if
(
Objects
.
nonNull
(
userId
))
{
param
.
put
(
"userId"
,
userId
);
param
.
put
(
"userId"
,
userId
.
toString
()
);
}
}
if
(
Objects
.
nonNull
(
loanId
))
{
if
(
Objects
.
nonNull
(
loanId
))
{
param
.
put
(
"loanId"
,
loanId
);
param
.
put
(
"loanId"
,
loanId
.
toString
()
);
}
}
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
header
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
JsonResult
jsonResult
=
httpService
.
post
(
url
,
header
,
param
,
JsonResult
.
class
);
String
result
=
httpService
.
post
(
url
,
header
,
param
);
if
(
Objects
.
isNull
(
jsonResult
)
||
jsonResult
.
isSuccess
())
{
log
.
error
(
"{} 调用信用钱包失败 url={}, header={},param={},result={}"
,
logPre
,
url
,
header
,
param
,
jsonResult
);
if
(
StringUtils
.
isBlank
(
result
))
{
log
.
error
(
"{} 调用信用钱包失败 url={}, header={},param={},result={}"
,
logPre
,
url
,
header
,
param
,
result
);
return
JsonResult
.
buildErrorStateResult
(
"申请订单查询失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"申请订单查询失败"
,
null
);
}
}
List
<
ApplyOrder
>
applyOrderList
=
new
ArrayList
<>();
List
list
=
(
List
)
jsonResult
.
getData
();
TypeReference
<
JsonResult
<
List
<
ApplyOrder
>>>
typeToken
=
new
TypeReference
<
JsonResult
<
List
<
ApplyOrder
>>>()
{
list
.
forEach
(
e
->
{
};
ApplyOrder
applyOrder
=
GSON
.
fromJson
(
e
.
toString
(),
ApplyOrder
.
class
);
JsonResult
<
List
<
ApplyOrder
>>
jsonResult
=
JSONTools
.
deserialize
(
result
,
typeToken
);
applyOrderList
.
add
(
applyOrder
);
});
jsonResult
.
setData
(
applyOrderList
);
return
jsonResult
;
return
jsonResult
;
}
}
...
@@ -93,7 +101,7 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -93,7 +101,7 @@ public class XyqbServiceImpl implements IXyqbService {
public
JsonResult
<
List
<
FlowNode
>>
findFlowChart
(
String
orderNo
)
{
public
JsonResult
<
List
<
FlowNode
>>
findFlowChart
(
String
orderNo
)
{
String
logPre
=
"XyqbServiceImpl.findFlowChart"
;
String
logPre
=
"XyqbServiceImpl.findFlowChart"
;
log
.
info
(
"{} 流程日志查询 orderNo={}"
,
logPre
,
orderNo
);
log
.
info
(
"{} 流程日志查询 orderNo={}"
,
logPre
,
orderNo
);
String
url
=
xyqbSysUrl
+
"/ex
/inside/customer_sys/query/applyOrder
"
;
String
url
=
xyqbSysUrl
+
"/ex
customer_sys/query/flow
"
;
if
(
StringUtils
.
isEmpty
(
orderNo
))
{
if
(
StringUtils
.
isEmpty
(
orderNo
))
{
log
.
error
(
"{} 申请订单号为空 orderNo={}"
,
logPre
,
orderNo
);
log
.
error
(
"{} 申请订单号为空 orderNo={}"
,
logPre
,
orderNo
);
return
JsonResult
.
buildErrorStateResult
(
"申请订单号为空"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"申请订单号为空"
,
null
);
...
@@ -102,20 +110,22 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -102,20 +110,22 @@ public class XyqbServiceImpl implements IXyqbService {
param
.
put
(
"orderNo"
,
orderNo
);
param
.
put
(
"orderNo"
,
orderNo
);
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
header
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
JsonResult
jsonResult
=
httpService
.
post
(
url
,
header
,
param
,
JsonResult
.
class
);
String
result
=
null
;
try
{
result
=
httpService
.
post
(
url
,
header
,
param
);
}
catch
(
Exception
e
)
{
log
.
error
(
"{} 通讯异常 url={},param={}"
,
logPre
,
url
,
param
,
e
);
return
JsonResult
.
buildErrorStateResult
(
"通讯异常"
,
null
);
}
if
(
Objects
.
isNull
(
jsonResult
)
||
!
jsonResult
.
isSuccess
(
))
{
if
(
StringUtils
.
isBlank
(
result
))
{
log
.
error
(
"{} 调用信用钱包失败 url={}, header={},param={},result={}"
,
logPre
,
url
,
header
,
param
,
jsonR
esult
);
log
.
error
(
"{} 调用信用钱包失败 url={}, header={},param={},result={}"
,
logPre
,
url
,
header
,
param
,
r
esult
);
return
JsonResult
.
buildErrorStateResult
(
"流程日志查询失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"流程日志查询失败"
,
null
);
}
}
TypeReference
<
JsonResult
<
List
<
FlowNode
>>>
typeToken
=
new
TypeReference
<
JsonResult
<
List
<
FlowNode
>>>()
{
List
data
=
(
List
)
jsonResult
.
getData
();
};
List
<
FlowNode
>
flowNodeList
=
new
ArrayList
<>();
JsonResult
<
List
<
FlowNode
>>
jsonResult
=
JSONTools
.
deserialize
(
result
,
typeToken
);
data
.
forEach
(
e
->
{
flowNodeList
.
add
(
GSON
.
fromJson
(
e
.
toString
(),
FlowNode
.
class
));
});
jsonResult
.
setData
(
flowNodeList
);
return
jsonResult
;
return
jsonResult
;
}
}
...
@@ -124,17 +134,23 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -124,17 +134,23 @@ public class XyqbServiceImpl implements IXyqbService {
public
JsonResult
<
LoanOrder
>
findLoanOrder
(
Long
loanId
)
{
public
JsonResult
<
LoanOrder
>
findLoanOrder
(
Long
loanId
)
{
String
logPre
=
"XyqbServiceImpl.findLoanOrder"
;
String
logPre
=
"XyqbServiceImpl.findLoanOrder"
;
log
.
info
(
"{} 提现订单详情 loanId={}"
,
logPre
,
loanId
);
log
.
info
(
"{} 提现订单详情 loanId={}"
,
logPre
,
loanId
);
String
url
=
xyqbSysUrl
+
"/ex/inside
/customer_sys/loan/detail"
;
String
url
=
clothoSysUrl
+
"/ex
/customer_sys/loan/detail"
;
if
(
Objects
.
isNull
(
loanId
))
{
if
(
Objects
.
isNull
(
loanId
))
{
log
.
error
(
"{} 借款订单号为空 orderNo={}"
,
logPre
,
loanId
);
log
.
error
(
"{} 借款订单号为空 orderNo={}"
,
logPre
,
loanId
);
return
JsonResult
.
buildErrorStateResult
(
"借款订单号为空"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"借款订单号为空"
,
null
);
}
}
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
param
.
put
(
"loanId"
,
loanId
);
param
.
put
(
"loanId"
,
loanId
.
toString
()
);
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
header
=
Maps
.
newHashMap
();
header
.
put
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
header
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
String
result
=
httpService
.
post
(
url
,
header
,
param
);
String
result
=
null
;
try
{
result
=
httpService
.
post
(
url
,
header
,
param
);
}
catch
(
Exception
e
)
{
log
.
error
(
"{} 远程调用异常 url={},param={}"
,
logPre
,
url
,
param
,
e
);
return
JsonResult
.
buildErrorStateResult
(
"网络异常"
,
null
);
}
if
(
StringUtils
.
isBlank
(
result
))
{
if
(
StringUtils
.
isBlank
(
result
))
{
log
.
error
(
"{} 调用信用钱包失败 url={}, header={},param={},result={}"
,
logPre
,
url
,
header
,
param
,
result
);
log
.
error
(
"{} 调用信用钱包失败 url={}, header={},param={},result={}"
,
logPre
,
url
,
header
,
param
,
result
);
...
@@ -163,8 +179,8 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -163,8 +179,8 @@ public class XyqbServiceImpl implements IXyqbService {
TypeReference
<
JsonResult
<
OrderRepayment
>>
typeToken
=
new
TypeReference
<
JsonResult
<
OrderRepayment
>>()
{
TypeReference
<
JsonResult
<
OrderRepayment
>>
typeToken
=
new
TypeReference
<
JsonResult
<
OrderRepayment
>>()
{
};
};
JsonResult
<
OrderRepayment
>
result1
=
JSONTools
.
deserialize
(
result
,
typeToken
);
JsonResult
<
OrderRepayment
>
result1
=
JSONTools
.
deserialize
(
result
,
typeToken
);
if
(
result1
!=
null
&&
result1
.
isSuccess
()
)
{
if
(
result1
!=
null
)
{
return
JsonResult
.
buildSuccessResult
(
""
,
result1
)
;
return
result1
;
}
else
{
}
else
{
return
JsonResult
.
buildErrorStateResult
(
"还款计划查询失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"还款计划查询失败"
,
null
);
}
}
...
@@ -180,7 +196,7 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -180,7 +196,7 @@ public class XyqbServiceImpl implements IXyqbService {
*/
*/
@Override
@Override
public
String
queryCardLists
(
Long
userId
)
{
public
String
queryCardLists
(
Long
userId
)
{
String
url
=
xyqbSysUrl
+
"/ex/
inside/
customer_sys/query/bankcard"
;
String
url
=
xyqbSysUrl
+
"/ex/customer_sys/query/bankcard"
;
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
if
(
Objects
.
nonNull
(
userId
))
{
if
(
Objects
.
nonNull
(
userId
))
{
param
.
put
(
"userId"
,
userId
);
param
.
put
(
"userId"
,
userId
);
...
@@ -197,7 +213,7 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -197,7 +213,7 @@ public class XyqbServiceImpl implements IXyqbService {
@Override
@Override
public
String
queryCardRelation
(
Long
bankId
)
{
public
String
queryCardRelation
(
Long
bankId
)
{
String
url
=
xyqbSysUrl
+
"/ex/
inside/
customer_sys/query/cardrelation"
;
String
url
=
xyqbSysUrl
+
"/ex/customer_sys/query/cardrelation"
;
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
if
(
Objects
.
nonNull
(
bankId
))
{
if
(
Objects
.
nonNull
(
bankId
))
{
param
.
put
(
"bankId"
,
bankId
);
param
.
put
(
"bankId"
,
bankId
);
...
@@ -215,7 +231,7 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -215,7 +231,7 @@ public class XyqbServiceImpl implements IXyqbService {
@Override
@Override
public
String
unBindCardRelation
(
UnBindCardModel
unBindCardModel
)
{
public
String
unBindCardRelation
(
UnBindCardModel
unBindCardModel
)
{
String
url
=
xyqbSysUrl
+
"/ex/
inside/
customer_sys/unbundle/relation"
;
String
url
=
xyqbSysUrl
+
"/ex/customer_sys/unbundle/relation"
;
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
Long
userId
=
unBindCardModel
.
getUserId
();
Long
userId
=
unBindCardModel
.
getUserId
();
Long
bindCardRecordId
=
unBindCardModel
.
getBindCardRecordId
();
Long
bindCardRecordId
=
unBindCardModel
.
getBindCardRecordId
();
...
@@ -237,7 +253,7 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -237,7 +253,7 @@ public class XyqbServiceImpl implements IXyqbService {
@Override
@Override
public
String
modifyReservePhone
(
ModifyReservePhone
modifyReservePhone
)
{
public
String
modifyReservePhone
(
ModifyReservePhone
modifyReservePhone
)
{
String
url
=
xyqbSysUrl
+
"/ex/
inside/
customer_sys/modify/reservedphone"
;
String
url
=
xyqbSysUrl
+
"/ex/customer_sys/modify/reservedphone"
;
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
8
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
8
);
Long
userId
=
modifyReservePhone
.
getUserId
();
Long
userId
=
modifyReservePhone
.
getUserId
();
Long
bankId
=
modifyReservePhone
.
getBankId
();
Long
bankId
=
modifyReservePhone
.
getBankId
();
...
@@ -264,7 +280,7 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -264,7 +280,7 @@ public class XyqbServiceImpl implements IXyqbService {
@Override
@Override
public
String
queryRepayInfo
(
RepayOrderInfoQuery
repayOrderQuery
)
{
public
String
queryRepayInfo
(
RepayOrderInfoQuery
repayOrderQuery
)
{
String
url
=
xyqbSysUrl
+
"/ex/
inside/
customer_sys/query/repayment"
;
String
url
=
xyqbSysUrl
+
"/ex/customer_sys/query/repayment"
;
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
Long
loanId
=
repayOrderQuery
.
getLoanId
();
Long
loanId
=
repayOrderQuery
.
getLoanId
();
Integer
termNo
=
repayOrderQuery
.
getTermNo
();
Integer
termNo
=
repayOrderQuery
.
getTermNo
();
...
@@ -287,7 +303,7 @@ public class XyqbServiceImpl implements IXyqbService {
...
@@ -287,7 +303,7 @@ public class XyqbServiceImpl implements IXyqbService {
@Override
@Override
public
String
queryRepayOptRecords
(
String
businessFlowNo
)
{
public
String
queryRepayOptRecords
(
String
businessFlowNo
)
{
String
url
=
xyqbSysUrl
+
"/ex/
inside/
customer_sys/repayment/detail"
;
String
url
=
xyqbSysUrl
+
"/ex/customer_sys/repayment/detail"
;
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>(
4
);
if
(
StringUtils
.
isNotBlank
(
businessFlowNo
))
{
if
(
StringUtils
.
isNotBlank
(
businessFlowNo
))
{
param
.
put
(
"businessFlowNo"
,
businessFlowNo
);
param
.
put
(
"businessFlowNo"
,
businessFlowNo
);
...
...
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