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
c90c0c4f
Commit
c90c0c4f
authored
Feb 21, 2022
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中台提前结清操作
parent
0a28b76a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
217 additions
and
10 deletions
+217
-10
ValidOperatePermitFilter.java
...omer/config/http/mvc/filter/ValidOperatePermitFilter.java
+1
-1
RepayRest.java
src/main/java/cn/quantgroup/customer/rest/RepayRest.java
+23
-4
EarlySettleOperateQueryReq.java
...customer/rest/param/repay/EarlySettleOperateQueryReq.java
+16
-0
EarlySettleOperateQueryResp.java
...ustomer/rest/param/repay/EarlySettleOperateQueryResp.java
+35
-0
EarlySettleOperateReq.java
...roup/customer/rest/param/repay/EarlySettleOperateReq.java
+19
-0
IKoalaService.java
...in/java/cn/quantgroup/customer/service/IKoalaService.java
+17
-0
IRepayService.java
...in/java/cn/quantgroup/customer/service/IRepayService.java
+6
-0
KoalaServiceImpl.java
...cn/quantgroup/customer/service/impl/KoalaServiceImpl.java
+82
-0
RepayServiceImpl.java
...cn/quantgroup/customer/service/impl/RepayServiceImpl.java
+18
-5
No files found.
src/main/java/cn/quantgroup/customer/config/http/mvc/filter/ValidOperatePermitFilter.java
View file @
c90c0c4f
...
...
@@ -26,7 +26,7 @@ import java.util.Objects;
* @Desc 鉴权过滤器
* @Update
*/
@WebFilter
(
filterName
=
"operatePermitFilter"
,
urlPatterns
=
{
"/operate/sys/*"
})
@WebFilter
(
filterName
=
"operatePermitFilter"
,
urlPatterns
=
{
"/operate/sys/*"
,
"/repay/earlySettleOperate"
})
@Slf4j
public
class
ValidOperatePermitFilter
implements
Filter
{
@Autowired
...
...
src/main/java/cn/quantgroup/customer/rest/RepayRest.java
View file @
c90c0c4f
package
cn
.
quantgroup
.
customer
.
rest
;
import
cn.quantgroup.customer.aop.OperateLog
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.rest.param.card.ModifyCardsQuery
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateQueryReq
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateReq
;
import
cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery
;
import
cn.quantgroup.customer.rest.param.repay.RepayOrderQuery
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.service.IRepayService
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.Objects
;
import
static
cn
.
quantgroup
.
customer
.
constant
.
Constant
.
GSON
;
@Slf4j
...
...
@@ -66,4 +69,20 @@ public class RepayRest {
log
.
info
(
"[查询还款操作记录],请求参数:businessFlowNo={}"
,
businessFlowNo
);
return
repayService
.
queryRepayOptRecords
(
businessFlowNo
);
}
@PostMapping
(
"/earlySettleOperateQuery"
)
public
JsonResult
earlySettleOperateQuery
(
@Valid
EarlySettleOperateQueryReq
req
)
{
log
.
info
(
"[earlySettleOperateQuery],请求参数: {}"
,
JSONObject
.
toJSONString
(
req
));
return
repayService
.
settleOperateQuery
(
req
);
}
@PostMapping
(
"/earlySettleOperate"
)
@OperateLog
(
moduleName
=
"中台提前结清操作"
)
public
JsonResult
earlySettleOperate
(
@Valid
EarlySettleOperateReq
req
)
{
if
(
Objects
.
isNull
(
req
)
||
StringUtils
.
isBlank
(
req
.
getCardNo
())
||
Objects
.
isNull
(
req
.
getLoanId
()))
{
return
JsonResult
.
buildErrorStateResult
(
ErrorCodeEnum
.
PARAM_ERROR
.
getMessage
(),
ErrorCodeEnum
.
PARAM_ERROR
.
getCode
());
}
return
repayService
.
earlySettleOperate
(
req
);
}
}
src/main/java/cn/quantgroup/customer/rest/param/repay/EarlySettleOperateQueryReq.java
0 → 100644
View file @
c90c0c4f
package
cn
.
quantgroup
.
customer
.
rest
.
param
.
repay
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
EarlySettleOperateQueryReq
implements
Serializable
{
@NotNull
(
message
=
"借款订单号不能为空"
)
private
Long
loanId
;
}
src/main/java/cn/quantgroup/customer/rest/param/repay/EarlySettleOperateQueryResp.java
0 → 100644
View file @
c90c0c4f
package
cn
.
quantgroup
.
customer
.
rest
.
param
.
repay
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
EarlySettleOperateQueryResp
implements
Serializable
{
private
Long
userId
;
private
String
name
;
private
String
phoneNo
;
private
String
uuid
;
private
Long
loanId
;
private
BigDecimal
earlySettleTotalAmount
;
private
Boolean
supportEarlySettle
;
private
String
orderStatus
;
private
String
orderStatusDesc
;
private
String
cardNo
;
}
src/main/java/cn/quantgroup/customer/rest/param/repay/EarlySettleOperateReq.java
0 → 100644
View file @
c90c0c4f
package
cn
.
quantgroup
.
customer
.
rest
.
param
.
repay
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
EarlySettleOperateReq
implements
Serializable
{
@NotNull
(
message
=
"借款订单号不能为空"
)
private
Long
loanId
;
@NotNull
(
message
=
"银行卡号不能为空"
)
private
String
cardNo
;
}
src/main/java/cn/quantgroup/customer/service/IKoalaService.java
0 → 100644
View file @
c90c0c4f
package
cn
.
quantgroup
.
customer
.
service
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateQueryReq
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateQueryResp
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateReq
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.List
;
public
interface
IKoalaService
{
JsonResult
<
List
<
EarlySettleOperateQueryResp
>>
settleOperateQuery
(
EarlySettleOperateQueryReq
req
);
JsonResult
<
JSONObject
>
earlySettleOperate
(
EarlySettleOperateReq
req
);
}
src/main/java/cn/quantgroup/customer/service/IRepayService.java
View file @
c90c0c4f
package
cn
.
quantgroup
.
customer
.
service
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateQueryReq
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateReq
;
import
cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery
;
import
cn.quantgroup.customer.rest.param.repay.RepayOrderQuery
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
...
...
@@ -10,4 +12,8 @@ public interface IRepayService {
JsonResult
queryRepayInfo
(
RepayOrderInfoQuery
repayOrderQuery
);
JsonResult
queryRepayOptRecords
(
String
businessFlowNo
);
JsonResult
settleOperateQuery
(
EarlySettleOperateQueryReq
req
);
JsonResult
earlySettleOperate
(
EarlySettleOperateReq
req
);
}
src/main/java/cn/quantgroup/customer/service/impl/KoalaServiceImpl.java
0 → 100644
View file @
c90c0c4f
package
cn
.
quantgroup
.
customer
.
service
.
impl
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateQueryReq
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateQueryResp
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateReq
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.service.IKoalaService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Service
(
"koalaService"
)
public
class
KoalaServiceImpl
implements
IKoalaService
{
@Value
(
"${koala.https}"
)
private
String
koalaSysUrl
;
private
final
IHttpService
httpService
;
private
final
UserSdkImpl
userSdk
;
@Autowired
public
KoalaServiceImpl
(
IHttpService
httpService
,
UserSdkImpl
userSdk
)
{
this
.
httpService
=
httpService
;
this
.
userSdk
=
userSdk
;
}
@Override
public
JsonResult
<
List
<
EarlySettleOperateQueryResp
>>
settleOperateQuery
(
EarlySettleOperateQueryReq
req
)
{
JsonResult
<
List
<
EarlySettleOperateQueryResp
>>
jsonResult
=
null
;
String
url
=
koalaSysUrl
+
"/v1/repayment/early_settlement/earlySettleOperateQuery"
;
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
param
.
put
(
"loanId"
,
req
.
getLoanId
());
String
response
=
httpService
.
get
(
url
,
param
);
log
.
info
(
"[KoalaServiceImpl][settleOperateQuery] param:{},请求业务系统返回值:{}"
,
param
,
response
);
if
(
StringUtils
.
isBlank
(
response
))
{
return
JsonResult
.
buildErrorStateResult
(
"查询失败"
,
null
);
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
response
);
if
(
jsonObject
.
getBoolean
(
"success"
))
{
JSONArray
data
=
jsonObject
.
getJSONArray
(
"data"
);
jsonResult
=
JsonResult
.
buildSuccessResult
(
"查询成功"
,
data
.
toJavaList
(
EarlySettleOperateQueryResp
.
class
));
}
else
{
jsonResult
=
JsonResult
.
buildErrorStateResult
(
jsonObject
.
getString
(
"msg"
));
}
return
jsonResult
;
}
@Override
public
JsonResult
<
JSONObject
>
earlySettleOperate
(
EarlySettleOperateReq
req
)
{
JsonResult
<
JSONObject
>
jsonResult
=
null
;
String
url
=
koalaSysUrl
+
"/v1/repayment/early_settlement/simpleCallPay"
;
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
param
.
put
(
"loanId"
,
req
.
getLoanId
());
param
.
put
(
"cardNo"
,
req
.
getCardNo
());
param
.
put
(
"noncestr"
,
"ceshikoalanoncestr"
);
String
response
=
httpService
.
post
(
url
,
param
);
log
.
info
(
"[KoalaServiceImpl][earlySettleOperate] param:{},请求业务系统返回值:{}"
,
param
,
response
);
if
(
StringUtils
.
isBlank
(
response
))
{
return
JsonResult
.
buildErrorStateResult
(
"请求失败"
,
null
);
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
response
);
if
(
jsonObject
.
getBoolean
(
"success"
))
{
JsonResult
.
buildSuccessResult
(
"已操作"
,
null
);
}
else
{
jsonResult
=
JsonResult
.
buildErrorStateResult
(
jsonObject
.
getString
(
"msg"
));
}
return
jsonResult
;
}
}
src/main/java/cn/quantgroup/customer/service/impl/RepayServiceImpl.java
View file @
c90c0c4f
...
...
@@ -3,6 +3,8 @@ package cn.quantgroup.customer.service.impl;
import
cn.quantgroup.customer.constant.Constant
;
import
cn.quantgroup.customer.enums.ErrorCodeEnum
;
import
cn.quantgroup.customer.exception.BusinessException
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateQueryReq
;
import
cn.quantgroup.customer.rest.param.repay.EarlySettleOperateReq
;
import
cn.quantgroup.customer.rest.param.repay.RepayOrderInfoQuery
;
import
cn.quantgroup.customer.rest.param.repay.RepayOrderQuery
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
...
...
@@ -10,10 +12,7 @@ import cn.quantgroup.customer.rest.vo.MoResult;
import
cn.quantgroup.customer.rest.vo.repay.RepayInfoResult
;
import
cn.quantgroup.customer.rest.vo.repay.RepayOptRecord
;
import
cn.quantgroup.customer.rest.vo.repay.XyqbRepayInfo
;
import
cn.quantgroup.customer.service.IRepayService
;
import
cn.quantgroup.customer.service.ISidecarService
;
import
cn.quantgroup.customer.service.IUserService
;
import
cn.quantgroup.customer.service.IXyqbService
;
import
cn.quantgroup.customer.service.*
;
import
cn.quantgroup.user.retbean.XUser
;
import
cn.quantgroup.user.vo.UserSysResult
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -33,13 +32,15 @@ public class RepayServiceImpl implements IRepayService {
private
final
UserSdkImpl
userSdk
;
private
final
IXyqbService
xyqbService
;
private
final
ISidecarService
sidecarService
;
private
final
IKoalaService
koalaService
;
@Autowired
public
RepayServiceImpl
(
IUserService
userService
,
UserSdkImpl
userSdk
,
IXyqbService
xyqbService
,
ISidecarService
sidecarService
)
{
public
RepayServiceImpl
(
IUserService
userService
,
UserSdkImpl
userSdk
,
IXyqbService
xyqbService
,
ISidecarService
sidecarService
,
IKoalaService
koalaService
)
{
this
.
userService
=
userService
;
this
.
userSdk
=
userSdk
;
this
.
xyqbService
=
xyqbService
;
this
.
sidecarService
=
sidecarService
;
this
.
koalaService
=
koalaService
;
}
@Override
...
...
@@ -154,4 +155,16 @@ public class RepayServiceImpl implements IRepayService {
log
.
info
(
"[查询还款操作记录],返回 repayOptRecordResult={}"
,
repayOptRecordResult
);
return
JsonResult
.
buildSuccessResult
(
"处理成功"
,
repayOptRecordResult
.
getData
());
}
@Override
public
JsonResult
settleOperateQuery
(
EarlySettleOperateQueryReq
req
)
{
return
koalaService
.
settleOperateQuery
(
req
);
}
@Override
public
JsonResult
earlySettleOperate
(
EarlySettleOperateReq
req
)
{
req
.
setCardNo
(
req
.
getCardNo
().
trim
());
return
koalaService
.
earlySettleOperate
(
req
);
}
}
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