Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
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
QA
holmes
Commits
5fbd1757
Commit
5fbd1757
authored
Apr 15, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
323918d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
18 deletions
+46
-18
RuleEngineInterceptor.java
.../java/cn/qg/holmes/interceptor/RuleEngineInterceptor.java
+46
-18
No files found.
src/main/java/cn/qg/holmes/interceptor/RuleEngineInterceptor.java
View file @
5fbd1757
...
@@ -6,15 +6,14 @@ import com.alibaba.fastjson.JSON;
...
@@ -6,15 +6,14 @@ import com.alibaba.fastjson.JSON;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.lang.Nullable
;
import
org.springframework.lang.Nullable
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Calendar
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
/**
* 风控相关接口拦截器
* 风控相关接口拦截器
...
@@ -26,6 +25,9 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
...
@@ -26,6 +25,9 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
@Autowired
@Autowired
MockMapper
mockMapper
;
MockMapper
mockMapper
;
@Value
(
"${early.settle.channel}"
)
private
String
earlySettleChannel
;
public
Map
<
String
,
Object
>
convertParameterMap
(
Map
<
String
,
String
[]>
parameterMap
)
{
public
Map
<
String
,
Object
>
convertParameterMap
(
Map
<
String
,
String
[]>
parameterMap
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
Map
.
Entry
<
String
,
String
[]>
entry:
parameterMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
[]>
entry:
parameterMap
.
entrySet
())
{
...
@@ -58,11 +60,13 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
...
@@ -58,11 +60,13 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
}
}
public
Map
<
String
,
Object
>
handleRiskAudit
(
Map
<
String
,
Object
>
requestMap
)
{
public
Map
<
String
,
Object
>
handleRiskAudit
(
Map
<
String
,
Object
>
requestMap
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_YEAR
,
calendar
.
get
(
Calendar
.
DAY_OF_YEAR
)
+
15
);
Long
openingDeadLine
=
calendar
.
getTimeInMillis
();
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
String
bizType
=
requestMap
.
get
(
"bizType"
).
toString
();
String
bizChannel
=
requestMap
.
get
(
"bizChannel"
).
toString
();
String
uuid
=
requestMap
.
get
(
"uuid"
).
toString
();
String
bizNo
=
requestMap
.
get
(
"bizNo"
).
toString
();
String
sceneId
=
requestMap
.
get
(
"sceneId"
).
toString
();
resultMap
.
put
(
"code"
,
0
);
resultMap
.
put
(
"code"
,
0
);
resultMap
.
put
(
"msg"
,
"success"
);
resultMap
.
put
(
"msg"
,
"success"
);
bodyMap
.
put
(
"msg"
,
"success"
);
bodyMap
.
put
(
"msg"
,
"success"
);
...
@@ -75,27 +79,51 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
...
@@ -75,27 +79,51 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
bodyMap
.
put
(
"isFuseModuleHit"
,
null
);
bodyMap
.
put
(
"isFuseModuleHit"
,
null
);
bodyMap
.
put
(
"callbackUrl"
,
null
);
bodyMap
.
put
(
"callbackUrl"
,
null
);
bodyMap
.
put
(
"amountTermLimits"
,
null
);
bodyMap
.
put
(
"amountTermLimits"
,
null
);
bodyMap
.
put
(
"bizType"
,
requestMap
.
get
(
"bizType"
));
bodyMap
.
put
(
"bizType"
,
bizType
);
bodyMap
.
put
(
"bizChannel"
,
requestMap
.
get
(
"bizChannel"
));
bodyMap
.
put
(
"bizChannel"
,
bizChannel
);
bodyMap
.
put
(
"uuid"
,
requestMap
.
get
(
"uuid"
));
bodyMap
.
put
(
"uuid"
,
uuid
);
bodyMap
.
put
(
"bizNo"
,
requestMap
.
get
(
"bizNo"
));
bodyMap
.
put
(
"bizNo"
,
bizNo
);
bodyMap
.
put
(
"sceneId"
,
requestMap
.
get
(
"sceneId"
));
bodyMap
.
put
(
"sceneId"
,
sceneId
);
bodyMap
.
put
(
"auditResult"
,
true
);
bodyMap
.
put
(
"amount"
,
null
);
bodyMap
.
put
(
"amount"
,
null
);
bodyMap
.
put
(
"term"
,
null
);
bodyMap
.
put
(
"term"
,
null
);
bodyMap
.
put
(
"validity"
,
"30"
);
bodyMap
.
put
(
"validity"
,
"30"
);
bodyMap
.
put
(
"deadLine"
,
"4102415999000"
);
bodyMap
.
put
(
"deadLine"
,
"4102415999000"
);
bodyMap
.
put
(
"financeProducts"
,
null
);
bodyMap
.
put
(
"financeProducts"
,
null
);
bodyMap
.
put
(
"otherInformation"
,
null
);
bodyMap
.
put
(
"otherInformation"
,
null
);
bodyMap
.
put
(
"quotaPaymentAmount"
,
null
);
bodyMap
.
put
(
"extData"
,
null
);
bodyMap
.
put
(
"extData"
,
null
);
bodyMap
.
put
(
"success"
,
true
);
bodyMap
.
put
(
"success"
,
true
);
bodyMap
.
put
(
"refuseReason"
,
null
);
bodyMap
.
put
(
"refuseReason"
,
null
);
bodyMap
.
put
(
"allowInstalment"
,
null
);
bodyMap
.
put
(
"auditResult"
,
true
);
bodyMap
.
put
(
"allowInstalmentTerms"
,
null
);
// vcc授信额度审核
bodyMap
.
put
(
"openingDeadLine"
,
null
);
if
(
bizType
.
equals
(
"8"
)
&&
sceneId
.
equals
(
"0"
))
{
if
(
requestMap
.
get
(
"bizType"
).
equals
(
"8"
)
&&
requestMap
.
get
(
"sceneId"
).
equals
(
"12"
))
{
// TODO: 不知道namespace,暂时无法审核
bodyMap
.
put
(
"quotaPaymentAmount"
,
"10000"
);
}
// KA准入审核, sceneId=2
if
(
sceneId
.
equals
(
"2"
))
{
}
// vcc账户冻结审核
if
(
sceneId
.
equals
(
"8"
))
{
}
// vcc账户解冻审核
if
(
sceneId
.
equals
(
"9"
))
{
}
// vcc账单分期审核, sceneId=11
if
(
bizType
.
equals
(
"8"
)
&&
sceneId
.
equals
(
"11"
))
{
bodyMap
.
put
(
"allowInstalment"
,
1
);
bodyMap
.
put
(
"allowInstalmentTerms"
,
"3,6,9,12"
);
}
// vcc支付限额审核, sceneId=12
if
(
bizChannel
.
equals
(
"8"
)
&&
sceneId
.
equals
(
"12"
))
{
bodyMap
.
put
(
"auditResult"
,
true
);
// true-允许使用额度支付, false-不允许使用额度支付
// bodyMap.put("quotaPaymentAmount", "10000"); // quotaPaymentAmount
}
// 提前结清审核,如果渠道不在apollo配置里,则审核拒绝
if
(
sceneId
.
equals
(
"14"
))
{
String
[]
earlySettleChannelArray
=
earlySettleChannel
.
split
(
","
);
if
(!
Arrays
.
asList
(
earlySettleChannelArray
).
contains
(
bizChannel
))
{
bodyMap
.
put
(
"auditResult"
,
false
);
}
}
}
resultMap
.
put
(
"body"
,
bodyMap
);
resultMap
.
put
(
"body"
,
bodyMap
);
return
resultMap
;
return
resultMap
;
...
...
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