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
Expand all
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;
import
cn.quantgroup.customer.config.http.mvc.filter.CsrfHeaderFilter
;
import
cn.quantgroup.customer.service.IUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.security.SecurityProperties
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.annotation.Order
;
...
...
@@ -21,6 +22,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private
final
IUserService
userService
;
private
final
PasswordEncoder
passwordEncoder
;
@Value
(
"${allowed.routes}"
)
private
String
allowedRoutes
;
@Autowired
public
WebSecurityConfig
(
IUserService
userService
,
PasswordEncoder
passwordEncoder
)
{
this
.
userService
=
userService
;
...
...
@@ -30,8 +33,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
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
(
","
);
http
.
httpBasic
().
and
()
.
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 {
}
repayment
.
setRepaymentStatus
(
repayStatus
);
//还款类型 待确定
repayment
.
setRepayType
(
repaymentPlanItem
.
getRepaymentType
());
repayment
.
setOverdueDays
(
repaymentPlanItem
.
getOverdueDays
());
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
;
import
cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
...
...
@@ -17,9 +18,12 @@ public interface IKaService {
/**
* key 申请订单号 value 渠道订单号
*
* @param applyOrderNos
* @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
;
import
cn.quantgroup.customer.model.xyqbuser.UserBasicInfo
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneAudit
;
import
cn.quantgroup.customer.rest.param.phone.ModifyPhoneFeedback
;
...
...
@@ -24,16 +25,15 @@ public interface IUserService extends UserDetailsService {
/**
* 用户基本信息
*
* @param userQueryParam
* @return
*/
JsonResult
findUserInfo
(
UserQueryParam
userQueryParam
);
JsonResult
<
UserBasicInfo
>
findUserInfo
(
UserQueryParam
userQueryParam
);
JsonResult
findUserInfoByOrderParam
(
OrderQueryParam
orderQueryParam
);
JsonResult
<
UserBasicInfo
>
findUserInfoByOrderParam
(
OrderQueryParam
orderQueryParam
);
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;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.exception.BusinessException
;
import
cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult
;
import
cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping
;
import
cn.quantgroup.customer.rest.param.ordermapping.OrderQueryParam
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.service.IKaService
;
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
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -21,8 +24,6 @@ import java.util.Map;
import
java.util.Objects
;
import
java.util.StringJoiner
;
import
static
cn
.
quantgroup
.
customer
.
constant
.
Constant
.
GSON
;
/**
* @author Wang Xiangwei
* @version 2020/3/9
...
...
@@ -32,7 +33,7 @@ import static cn.quantgroup.customer.constant.Constant.GSON;
public
class
KaServiceImpl
implements
IKaService
{
@Value
(
"${
ka.
api.http}"
)
@Value
(
"${
q
api.http}"
)
private
String
kaSysUrl
;
@Autowired
...
...
@@ -51,34 +52,40 @@ public class KaServiceImpl implements IKaService {
String
applyOrderNo
=
orderQueryParam
.
getApplyOrderNo
();
String
channelOrderNo
=
orderQueryParam
.
getChannelOrderNo
();
Long
loanId
=
orderQueryParam
.
getLoanId
();
Long
channelId
=
orderQueryParam
.
getChannelId
();
String
url
=
kaSysUrl
+
"/external/get/orderMapping"
;
try
{
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
if
(
!
Objects
.
is
Null
(
applyOrderNo
))
{
if
(
Objects
.
non
Null
(
applyOrderNo
))
{
param
.
put
(
"applyOrderNo"
,
applyOrderNo
);
}
if
(
StringUtils
.
isNotBlank
(
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
);
}
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
);
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
JsonResult
.
class
);
if
(
Objects
.
isNull
(
jsonResult
)
||
!
jsonResult
.
isSuccess
(
))
{
log
.
error
(
"{} 查询orderMapping失败 jsonResult={}"
,
logPre
,
jsonR
esult
);
if
(
StringUtils
.
isBlank
(
result
))
{
log
.
error
(
"{} 查询orderMapping失败 jsonResult={}"
,
logPre
,
r
esult
);
return
JsonResult
.
buildErrorStateResult
(
"查询orderMapping失败"
,
null
);
}
Object
data
=
jsonResult
.
getData
();
LoanOrderMapping
loanOrderMapping
=
GSON
.
fromJson
(
data
.
toString
(),
LoanOrderMapping
.
class
);
jsonResult
.
setData
(
loanOrderMapping
);
TypeReference
<
JsonResult
<
LoanOrderMapping
>>
typeToken
=
new
TypeReference
<
JsonResult
<
LoanOrderMapping
>>()
{
};
JsonResult
<
LoanOrderMapping
>
jsonResult
=
JSONTools
.
deserialize
(
result
,
typeToken
);
return
jsonResult
;
...
...
@@ -106,15 +113,49 @@ public class KaServiceImpl implements IKaService {
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
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
);
JsonResult
jsonResult
=
GSON
.
fromJson
(
result
,
JsonResult
.
class
);
if
(
Objects
.
isNull
(
jsonResult
)
||
!
jsonResult
.
isSuccess
())
{
log
.
error
(
"{} 获得渠道订单号 jsonResult={}"
,
logPre
,
jsonResult
);
if
(
StringUtils
.
isBlank
(
result
))
{
log
.
error
(
"{} 获得渠道订单号 jsonResult={}"
,
logPre
,
result
);
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
;
}
}
src/main/java/cn/quantgroup/customer/service/impl/OrderServiceImpl.java
View file @
cb3f3acd
...
...
@@ -43,11 +43,12 @@ public class OrderServiceImpl implements IOrderService {
JsonResult
<
List
<
FlowNode
>>
flowChart
=
xyqbService
.
findFlowChart
(
applyOrderNo
);
if
(!
flowChart
.
isSuccess
())
{
log
.
error
(
"{} 流程图查询失败 result={}"
,
logPre
,
flowChart
);
return
flowChart
;
}
List
<
FlowNode
>
flowNodeList
=
flowChart
.
getData
();
if
(
!
Objects
.
is
Null
(
head
))
{
if
(
Objects
.
non
Null
(
head
))
{
FlowNode
flowNode
=
new
FlowNode
();
flowNode
.
setName
(
"渠道用户信息导入"
);
flowNode
.
setStatus
(
1
);
...
...
@@ -66,8 +67,8 @@ public class OrderServiceImpl implements IOrderService {
JsonResult
<
LoanOrder
>
loanOrder
=
xyqbService
.
findLoanOrder
(
loanId
);
if
(!
loanOrder
.
isSuccess
())
{
log
.
error
(
"{} 提现订单查询失败 loanId={}, result={}"
,
logPre
,
loanId
,
loanOrder
);
return
JsonResult
.
buildErrorStateResult
(
loanOrder
.
getMsg
(),
loanOrder
.
getData
());
log
.
error
(
"{} 提现订单查询失败 loanId={}, result={}"
,
logPre
,
loanId
,
loanOrder
);
return
JsonResult
.
buildErrorStateResult
(
loanOrder
.
getMsg
(),
loanOrder
.
getData
());
}
...
...
@@ -80,13 +81,12 @@ public class OrderServiceImpl implements IOrderService {
List
<
Repayment
>
repaymentList
=
new
ArrayList
<>();
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
.
setLoanOrder
(
loanOrder
.
getData
());
loanOrderDetail
.
setRepaymentList
(
repaymentList
);
return
JsonResult
.
buildSuccessResult
(
""
,
loanOrderDetail
);
return
JsonResult
.
buildSuccessResult
(
""
,
loanOrderDetail
);
}
}
src/main/java/cn/quantgroup/customer/service/impl/UserServiceImpl.java
View file @
cb3f3acd
This diff is collapsed.
Click to expand it.
src/main/java/cn/quantgroup/customer/service/impl/XyqbServiceImpl.java
View file @
cb3f3acd
This diff is collapsed.
Click to expand it.
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