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
3ecfef88
Commit
3ecfef88
authored
Apr 29, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增vcc手动授信回调接口
parent
239dfe37
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
5 deletions
+54
-5
VccGenController.java
.../qg/qaplatform/zdata/controller/vcc/VccGenController.java
+16
-0
VccDataMapper.java
...ain/java/cn/qg/qaplatform/zdata/mapper/VccDataMapper.java
+6
-0
Vcc.java
src/main/java/cn/qg/qaplatform/zdata/process/Vcc.java
+4
-3
VccDataService.java
...va/cn/qg/qaplatform/zdata/service/vcc/VccDataService.java
+2
-0
VccDataServiceImpl.java
...qaplatform/zdata/service/vcc/impl/VccDataServiceImpl.java
+21
-2
VccDataMapper.xml
src/main/resources/mapper/zdata/VccDataMapper.xml
+5
-0
No files found.
src/main/java/cn/qg/qaplatform/zdata/controller/vcc/VccGenController.java
View file @
3ecfef88
...
...
@@ -32,4 +32,20 @@ public class VccGenController {
}
return
JsonResult
.
success
(
result
);
}
/**
* vcc授信回调简单版本
* @param namespace 环境
* @param phoneNo 手机号
* @param result 结果
* @param amount 金额
* @return
*/
@GetMapping
(
"/risk"
)
public
JsonResult
vccRiskControl
(
String
namespace
,
String
phoneNo
,
Boolean
result
,
Integer
amount
)
{
if
(
amount
==
null
)
{
amount
=
10000
;
}
return
JsonResult
.
success
(
vccDataService
.
vccManualRiskControl
(
namespace
,
phoneNo
,
result
,
amount
));
}
}
src/main/java/cn/qg/qaplatform/zdata/mapper/VccDataMapper.java
View file @
3ecfef88
...
...
@@ -3,6 +3,7 @@ package cn.qg.qaplatform.zdata.mapper;
import
cn.qg.qaplatform.zdata.entity.VccUserEntity
;
import
java.util.List
;
import
java.util.Map
;
public
interface
VccDataMapper
{
/**
...
...
@@ -14,4 +15,9 @@ public interface VccDataMapper {
* 查看用户vcc状态
*/
VccUserEntity
queryUserVccStatus
(
String
phoneNo
);
/**
* 查看vcc风控授信信息
*/
Map
<
String
,
Object
>
getVccRiskRecord
(
String
uuid
);
}
src/main/java/cn/qg/qaplatform/zdata/process/Vcc.java
View file @
3ecfef88
...
...
@@ -219,7 +219,7 @@ public class Vcc {
/**
* vcc风控授信回调
*/
public
static
void
vccWindControlCreditCallback
(
String
namespace
,
String
uuid
,
String
riskNo
,
boolean
auditResul
t
)
{
public
static
JSONObject
vccWindControlCreditCallback
(
String
namespace
,
String
uuid
,
String
riskNo
,
boolean
auditResult
,
Integer
amoun
t
)
{
String
url
=
"https://talos-"
+
namespace
+
".liangkebang.net/ex/vcc/risk/auth_amount_completion"
;
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_YEAR
,
calendar
.
get
(
Calendar
.
DAY_OF_YEAR
)
+
15
);
...
...
@@ -228,7 +228,7 @@ public class Vcc {
calendar2
.
add
(
Calendar
.
YEAR
,
1
);
Long
deadLine
=
calendar2
.
getTimeInMillis
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"amount"
,
10000
);
params
.
put
(
"amount"
,
amount
);
params
.
put
(
"auditResult"
,
auditResult
);
params
.
put
(
"bizChannel"
,
159904
);
params
.
put
(
"bizNo"
,
riskNo
);
...
...
@@ -244,6 +244,7 @@ public class Vcc {
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
log
.
info
(
"手动vcc风控授信回调参数:{}"
,
params
);
log
.
info
(
"vcc风控授信回调结果:"
+
result
);
return
result
;
}
/**
...
...
@@ -355,6 +356,6 @@ public class Vcc {
Map
<
String
,
String
>
loginResult
=
login
(
"vcc3"
,
"18300000418"
,
"214"
,
"214"
);
String
uuid
=
loginResult
.
get
(
"uuid"
);
String
riskNo
=
getRiskNo
(
"vcc3"
,
uuid
);
vccWindControlCreditCallback
(
"vcc3"
,
"1"
,
riskNo
,
true
);
vccWindControlCreditCallback
(
"vcc3"
,
"1"
,
riskNo
,
true
,
10000
);
}
}
src/main/java/cn/qg/qaplatform/zdata/service/vcc/VccDataService.java
View file @
3ecfef88
...
...
@@ -24,4 +24,6 @@ public interface VccDataService {
* 根据手机号获取用户vcc状态
*/
VccUserEntity
queryUserVccStatus
(
String
namespace
,
String
phoneNo
);
Boolean
vccManualRiskControl
(
String
namespace
,
String
phoneNo
,
Boolean
result
,
Integer
amount
);
}
src/main/java/cn/qg/qaplatform/zdata/service/vcc/impl/VccDataServiceImpl.java
View file @
3ecfef88
package
cn
.
qg
.
qaplatform
.
zdata
.
service
.
vcc
.
impl
;
import
cn.qg.qaplatform.config.SwitchDataSource
;
import
cn.qg.qaplatform.zdata.entity.XjfqGenProcessVo
;
import
cn.qg.qaplatform.zdata.enums.VccStatusEnum
;
import
cn.qg.qaplatform.zdata.mapper.VccDataMapper
;
import
cn.qg.qaplatform.zdata.entity.VccOpenResultVo
;
import
cn.qg.qaplatform.zdata.entity.VccUserEntity
;
import
cn.qg.qaplatform.zdata.mapper.XyqbLoanDataMapper
;
import
cn.qg.qaplatform.zdata.process.Vcc
;
import
cn.qg.qaplatform.zdata.service.risk.RuleEngineService
;
import
cn.qg.qaplatform.zdata.service.vcc.VccDataService
;
...
...
@@ -14,6 +16,7 @@ import cn.qg.qaplatform.zdata.service.xyqb.XyqbBasicQueryService;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -35,6 +38,9 @@ public class VccDataServiceImpl implements VccDataService {
@Autowired
XyqbBasicQueryService
xyqbBasicQueryService
;
@Autowired
XyqbLoanDataMapper
xyqbLoanDataMapper
;
/**
* vcc造数据
* @param namespace 环境
...
...
@@ -100,9 +106,9 @@ public class VccDataServiceImpl implements VccDataService {
}
else
if
(
creditResult
.
get
(
"status"
).
equals
(
"0"
)
&&
searchCreditCount
==
10
)
{
String
riskNo
=
Vcc
.
getRiskNo
(
namespace
,
uuid
);
if
(
status
==
2
)
{
Vcc
.
vccWindControlCreditCallback
(
namespace
,
uuid
,
riskNo
,
false
);
Vcc
.
vccWindControlCreditCallback
(
namespace
,
uuid
,
riskNo
,
false
,
10000
);
}
else
{
Vcc
.
vccWindControlCreditCallback
(
namespace
,
uuid
,
riskNo
,
true
);
Vcc
.
vccWindControlCreditCallback
(
namespace
,
uuid
,
riskNo
,
true
,
10000
);
}
break
;
}
...
...
@@ -173,4 +179,17 @@ public class VccDataServiceImpl implements VccDataService {
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"vcc_talos"
);
return
vccDataMapper
.
queryUserVccStatus
(
phoneNo
);
}
@Override
public
Boolean
vccManualRiskControl
(
String
namespace
,
String
phoneNo
,
Boolean
result
,
Integer
amount
)
{
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"xyqb_user"
);
XjfqGenProcessVo
xjfqGenProcessVo
=
xyqbLoanDataMapper
.
getUserInfoByPhoneNo
(
phoneNo
);
String
uuid
=
xjfqGenProcessVo
.
getUuid
();
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"vcc_talos"
);
Map
<
String
,
Object
>
riskRecord
=
vccDataMapper
.
getVccRiskRecord
(
uuid
);
String
riskNo
=
riskRecord
.
get
(
"risk_no"
).
toString
();
JSONObject
creditResult
=
Vcc
.
vccWindControlCreditCallback
(
namespace
,
uuid
,
riskNo
,
result
,
amount
);
return
creditResult
.
get
(
"content"
).
toString
().
equals
(
"success"
);
}
}
src/main/resources/mapper/zdata/VccDataMapper.xml
View file @
3ecfef88
...
...
@@ -32,4 +32,9 @@
`phone_no` = #{phoneNo}
</where>
</select>
<select
id=
"getVccRiskRecord"
resultType=
"java.util.Map"
>
SELECT * FROM `risk_record` where `uuid` = #{uuid}
</select>
</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