Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform
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
qa-platform
Commits
bc0ebe25
Commit
bc0ebe25
authored
Dec 24, 2020
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增风控相关,vcc造数据接口优化
parent
356b06b2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
74 additions
and
7 deletions
+74
-7
GenVccController.java
...in/java/cn/qg/qaplatform/controller/GenVccController.java
+0
-3
RuleEngineMapper.java
src/main/java/cn/qg/qaplatform/dao/RuleEngineMapper.java
+6
-0
Xyqb.java
src/main/java/cn/qg/qaplatform/process/Xyqb.java
+6
-0
RuleEngineService.java
...main/java/cn/qg/qaplatform/service/RuleEngineService.java
+13
-0
RuleEngineServiceImpl.java
.../cn/qg/qaplatform/service/impl/RuleEngineServiceImpl.java
+21
-0
VccDataServiceImpl.java
...ava/cn/qg/qaplatform/service/impl/VccDataServiceImpl.java
+12
-4
XyqbDataServiceImpl.java
...va/cn/qg/qaplatform/service/impl/XyqbDataServiceImpl.java
+8
-0
RuleEngineMapper.xml
src/main/resources/mapper/RuleEngineMapper.xml
+8
-0
No files found.
src/main/java/cn/qg/qaplatform/controller/GenVccController.java
View file @
bc0ebe25
...
...
@@ -21,9 +21,6 @@ public class GenVccController {
@PostMapping
(
"/gen"
)
@ApiOperation
(
value
=
"vcc造数据"
)
public
JsonResult
genVccUser
(
String
namespace
,
String
phoneNo
,
String
channel
,
Integer
status
)
throws
Exception
{
if
(
status
!=
0
&&
status
!=
1
&&
status
!=
2
)
{
return
JsonResult
.
clientFailed
(
"状态必须为0、1、2"
);
}
if
(!
channel
.
equals
(
"214"
)
&&
!
channel
.
equals
(
"217"
))
{
return
JsonResult
.
clientFailed
(
"渠道必须为214或217"
);
}
...
...
src/main/java/cn/qg/qaplatform/dao/RuleEngineMapper.java
0 → 100644
View file @
bc0ebe25
package
cn
.
qg
.
qaplatform
.
dao
;
public
interface
RuleEngineMapper
{
int
addBlackList
(
String
uuid
);
}
src/main/java/cn/qg/qaplatform/process/Xyqb.java
View file @
bc0ebe25
...
...
@@ -761,4 +761,10 @@ public class Xyqb {
return
flag
;
}
public
static
void
main
(
String
[]
args
)
throws
URISyntaxException
{
String
fundOpToken
=
loginFundOP
(
"vcc2"
);
boolean
assignFundResult
=
assignFundOrNot
(
"vcc2"
,
480
,
fundOpToken
);
System
.
out
.
println
(
"分配结果为:"
+
assignFundResult
);
}
}
src/main/java/cn/qg/qaplatform/service/RuleEngineService.java
0 → 100644
View file @
bc0ebe25
package
cn
.
qg
.
qaplatform
.
service
;
/**
* 风控相关接口
*/
public
interface
RuleEngineService
{
/**
* 添加授信黑名单
* @param uuid uuid
* @return 成功与否
*/
boolean
addBlackList
(
String
uuid
);
}
src/main/java/cn/qg/qaplatform/service/impl/RuleEngineServiceImpl.java
0 → 100644
View file @
bc0ebe25
package
cn
.
qg
.
qaplatform
.
service
.
impl
;
import
cn.qg.qaplatform.common.SwitchDataSource
;
import
cn.qg.qaplatform.dao.RuleEngineMapper
;
import
cn.qg.qaplatform.service.RuleEngineService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
RuleEngineServiceImpl
implements
RuleEngineService
{
@Autowired
RuleEngineMapper
ruleEngineMapper
;
@Override
public
boolean
addBlackList
(
String
uuid
)
{
SwitchDataSource
.
dataSourceSwitch
(
"fe"
,
"workflow"
);
int
insertResult
=
ruleEngineMapper
.
addBlackList
(
uuid
);
return
insertResult
>=
1
;
}
}
src/main/java/cn/qg/qaplatform/service/impl/VccDataServiceImpl.java
View file @
bc0ebe25
...
...
@@ -5,6 +5,7 @@ import cn.qg.qaplatform.dao.QueryVccDataMapper;
import
cn.qg.qaplatform.domain.GenVccUser
;
import
cn.qg.qaplatform.domain.QueryVccUser
;
import
cn.qg.qaplatform.process.Vcc
;
import
cn.qg.qaplatform.service.RuleEngineService
;
import
cn.qg.qaplatform.service.VccDataService
;
import
cn.qg.qaplatform.utils.page.PageResult
;
import
cn.qg.qaplatform.utils.page.PageUtil
;
...
...
@@ -24,12 +25,15 @@ public class VccDataServiceImpl implements VccDataService {
@Autowired
QueryVccDataMapper
queryVccDataMapper
;
@Autowired
RuleEngineService
ruleEngineService
;
/**
* vcc造数据
* @param namespace 环境
* @param phoneNo 手机号
* @param openedChannel 创建渠道
* @param status
0-未激活,1-已激活
* @param status
1-授信成功,2-授信失败,3-开户成功,4-开户失败
* @return
* @throws Exception
*/
...
...
@@ -52,6 +56,10 @@ public class VccDataServiceImpl implements VccDataService {
Map
loginResult
=
Vcc
.
login
(
namespace
,
phoneNo
,
openedChannel
,
openedChannel
);
String
token
=
loginResult
.
get
(
"token"
).
toString
();
String
uuid
=
loginResult
.
get
(
"uuid"
).
toString
();
// 加入授信黑名单
if
(
status
==
2
)
{
ruleEngineService
.
addBlackList
(
uuid
);
}
// 检查用户是否已有额度
boolean
haveQuota
=
Vcc
.
checkIfAlreadyHaveQuota
(
namespace
,
uuid
);
if
(
haveQuota
)
{
...
...
@@ -74,7 +82,7 @@ public class VccDataServiceImpl implements VccDataService {
Vcc
.
submitCredit
(
namespace
,
token
,
vccChannel
);
// 授信结果查询
Vcc
.
searchCreditResult
(
namespace
,
token
,
vccChannel
);
if
(
status
==
0
)
{
if
(
status
==
1
||
status
==
2
)
{
genVccUser
.
setMsg
(
"提交授信成功!"
);
return
genVccUser
;
}
...
...
@@ -86,7 +94,7 @@ public class VccDataServiceImpl implements VccDataService {
String
requestId
=
Vcc
.
bindCardSms
(
namespace
,
token
,
vccChannel
,
"ABC"
,
"6228272537046278993"
);
// 额度激活
JSONObject
quotaActivationResult
=
Vcc
.
quotaActivation
(
namespace
,
token
,
vccChannel
,
"6228272537046278993"
,
requestId
);
if
(
status
==
1
)
{
if
(
status
==
3
)
{
// 开户结果
JSONObject
result
=
Vcc
.
openResult
(
namespace
,
token
,
vccChannel
);
Map
data
=
(
Map
)
result
.
get
(
"data"
);
...
...
@@ -96,7 +104,7 @@ public class VccDataServiceImpl implements VccDataService {
genVccUser
.
setEacctNo
(
eacctNo
);
genVccUser
.
setMsg
(
"开户成功"
);
}
if
(
status
==
2
)
{
if
(
status
==
4
)
{
Map
data
=
(
Map
)
quotaActivationResult
.
get
(
"data"
);
if
(
data
.
get
(
"status"
).
equals
(
"2"
))
{
genVccUser
.
setMsg
(
"开户失败"
);
...
...
src/main/java/cn/qg/qaplatform/service/impl/XyqbDataServiceImpl.java
View file @
bc0ebe25
...
...
@@ -7,6 +7,7 @@ import cn.qg.qaplatform.process.Xyqb;
import
cn.qg.qaplatform.service.QueryInProcessStatusService
;
import
cn.qg.qaplatform.service.XyqbDataService
;
import
cn.qg.qaplatform.service.QueryBasicLoanStatusDataService
;
import
com.alibaba.fastjson.JSONException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
...
@@ -47,6 +48,9 @@ public class XyqbDataServiceImpl implements XyqbDataService {
isAleadyAssign
=
Xyqb
.
assignFundOrNot
(
namespace
,
fundId
,
fundOpToken
);
}
catch
(
URISyntaxException
e
)
{
e
.
printStackTrace
();
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
return
false
;
}
boolean
assignResult
=
false
;
boolean
unblockResult
=
false
;
...
...
@@ -254,6 +258,10 @@ public class XyqbDataServiceImpl implements XyqbDataService {
boolean
assignFundResult
=
assignFundCorp
(
namespace
,
fundId
,
symbol
);
log
.
info
(
"分配资金方的结果为:"
+
assignFundResult
);
if
(!
assignFundResult
)
{
log
.
info
(
"资金方分配失败,请检查环境!"
);
return
false
;
}
/**
* 0 - 审核通过
...
...
src/main/resources/mapper/RuleEngineMapper.xml
0 → 100644
View file @
bc0ebe25
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"cn.qg.qaplatform.dao.RuleEngineMapper"
>
<insert
id=
"addBlackList"
>
INSERT INTO `black_list_config` (`uuid`, `expir_date`, `type`, `enable`,) VALUES (#{uuid}, '14', '0', '1');
</insert>
</mapper>
\ No newline at end of file
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