Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
方斌
51business
Commits
ba107535
Commit
ba107535
authored
Sep 06, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
2b1552f3
Pipeline
#13488
passed with stage
in 59 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
175 additions
and
13 deletions
+175
-13
blacklist.js
app/controller/credit/blacklist.js
+18
-0
credit_apply.js
app/model/prometheus/credit_apply.js
+50
-0
credit_blacklist_report.js
app/model/prometheus/credit_blacklist_report.js
+0
-1
credit.js
app/router/credit.js
+1
-0
apply.js
app/service/credit/apply.js
+105
-11
blacklist.js
app/service/credit/blacklist.js
+1
-1
No files found.
app/controller/credit/blacklist.js
View file @
ba107535
...
...
@@ -18,6 +18,24 @@ class BlacklistController extends Controller {
}
/**
* 获取数据报告信息
*/
async
applyBlacklistReport
()
{
const
{
ctx
}
=
this
;
let
inputParams
=
ctx
.
request
.
body
;
const
rule
=
{
name
:
{
type
:
'string'
,
required
:
true
},
phone
:
{
type
:
'string'
,
required
:
true
},
id_card
:
{
type
:
'string'
,
required
:
true
},
code
:
{
type
:
'string'
,
required
:
true
}
}
ctx
.
validate
(
rule
,
inputParams
);
let
ret
=
await
ctx
.
service
.
credit
.
apply
.
applyBlacklist
(
inputParams
);
ctx
.
success
(
ret
);
}
}
module
.
exports
=
BlacklistController
;
app/model/prometheus/credit_apply.js
0 → 100644
View file @
ba107535
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
INTEGER
,
STRING
,
DATE
,
TEXT
}
=
app
.
Sequelize
;
const
CreditApply
=
app
.
prometheusModel
.
define
(
'credit_apply'
,
{
id
:
{
type
:
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
type
:
INTEGER
,
user_id
:
STRING
,
app_user_id
:
STRING
,
app_id
:
STRING
,
app_type_id
:
STRING
,
name
:
STRING
,
phone
:
STRING
,
id_card
:
STRING
,
service_code
:
STRING
,
timestamp
:
STRING
,
appkey
:
STRING
,
sign
:
STRING
,
r_code
:
STRING
,
r_msg
:
STRING
,
r_order_id
:
STRING
,
valid
:
INTEGER
,
created_at
:
{
type
:
DATE
,
get
()
{
const
date
=
this
.
getDataValue
(
'created_at'
);
return
date
?
moment
(
date
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
undefined
;
},
},
updated_at
:
{
type
:
DATE
,
get
()
{
const
date
=
this
.
getDataValue
(
'updated_at'
);
return
date
?
moment
(
date
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
undefined
;
},
}
},
{
timestamps
:
false
,
tableName
:
'credit_apply'
,
});
return
CreditApply
;
};
app/model/prometheus/credit_blacklist_report.js
View file @
ba107535
...
...
@@ -72,7 +72,6 @@ module.exports = app => {
id_card_relevant_mobilephone_count
:
INTEGER
,
id_card_relevant_device_count
:
INTEGER
,
mobilephone_relevant_id_card_count
:
INTEGER
,
mobilephone_relevant_device_count
:
INTEGER
,
relevant_loan_app_count_6month
:
INTEGER
,
relevant_gamble_app_count_6month
:
INTEGER
,
relevant_ip_app_count_6month
:
INTEGER
,
...
...
app/router/credit.js
View file @
ba107535
...
...
@@ -8,6 +8,7 @@ module.exports = app => {
//我的信用-黑名单报告
router
.
get
(
'third'
,
'/blacklist/report/:report_id'
,
'credit.blacklist.getBlacklistReport'
);
router
.
post
(
'third'
,
'/blacklist/report'
,
'credit.blacklist.applyBlacklistReport'
);
//我的信用-个人通话风险
...
...
app/service/credit/apply.js
View file @
ba107535
...
...
@@ -7,29 +7,123 @@ const _ = require('lodash');
class
ApplyService
extends
Service
{
async
applyBlacklist
()
{
//demo
/**
* 从数据接口获取用户的黑名单报告信息
* @param {*} inputParams
*/
async
applyBlacklist
(
inputParams
)
{
const
{
ctx
}
=
this
;
let
params
=
{
sign
:
""
,
signParams
:
{
appKey
:
this
.
config
.
BLACKLIST_APPLY_APPKEY
,
timestamp
:
String
(
new
Date
().
getTime
()),
},
phone
:
"18912345678"
,
name
:
"李四"
,
idcard
:
"150981197202284550"
phone
:
inputParams
.
phone
,
name
:
inputParams
.
name
,
idcard
:
inputParams
.
id_card
}
ctx
.
logger
.
info
(
params
);
params
.
sign
=
await
ctx
.
service
.
credit
.
common
.
sign
(
params
.
signParams
,
this
.
config
.
BLACKLIST_APPLY_APPSECRET
);
ctx
.
logger
.
info
(
params
);
let
url
=
this
.
config
.
BLACKLIST_APPLY_URL
;
let
result
=
await
ctx
.
helper
.
send_request
(
url
,
params
,
{
method
:
'POST'
});
ctx
.
logger
.
info
(
result
);
ctx
.
logger
.
info
(
result
.
data
);
ctx
.
logger
.
info
(
result
.
data
.
data
.
blackList
);
if
(
result
.
status
!=
200
)
{
ctx
.
failed
(
'数据获取接口异常'
);
}
let
applyData
=
{
type
:
1
,
user_id
:
ctx
.
userId
,
app_user_id
:
ctx
.
appUserId
,
app_id
:
ctx
.
appId
,
app_type_id
:
ctx
.
appTypeId
,
name
:
inputParams
.
name
,
phone
:
inputParams
.
dataphone
,
id_card
:
inputParams
.
id_card
,
timestamp
:
params
.
signParams
.
timestamp
,
appkey
:
this
.
config
.
BLACKLIST_APPLY_APPKEY
,
sign
:
params
.
sign
,
r_code
:
result
.
data
.
code
,
r_msg
:
result
.
data
.
msg
,
r_order_id
:
result
.
data
.
data
.
order_id
,
}
let
applyId
=
await
ctx
.
prometheusModel
.
CreditApply
.
create
(
applyData
);
if
(
result
.
data
.
code
===
0
)
{
let
blacklistInfo
=
result
.
data
.
data
.
blackList
;
let
reportData
=
{
name
:
inputParams
.
name
,
id_card
:
inputParams
.
id_card
,
phone
:
inputParams
.
phone
,
age
:
''
,
city
:
''
,
blacklist_of_internet_loans
:
blacklistInfo
.
pre_loan_risk
.
blacklist_of_internet_loans
,
blacklist_of_court_dishonesty
:
blacklistInfo
.
pre_loan_risk
.
blacklist_of_court_dishonesty
,
blacklist_of_industry
:
blacklistInfo
.
pre_loan_risk
.
blacklist_of_industry
,
blacklist_of_ds_industry
:
blacklistInfo
.
pre_loan_risk
.
blacklist_of_ds_industry
,
blacklist_of_bx_industry
:
blacklistInfo
.
pre_loan_risk
.
blacklist_of_bx_industry
,
blacklist_of_zc_industry
:
blacklistInfo
.
pre_loan_risk
.
blacklist_of_zc_industry
,
blacklist_of_zf_industry
:
blacklistInfo
.
pre_loan_risk
.
blacklist_of_zf_industry
,
blacklist_of_jd_industry
:
blacklistInfo
.
pre_loan_risk
.
blacklist_of_jd_industry
,
reg_count_1month
:
blacklistInfo
.
long_lending_risk
.
reg_count_1month
,
reg_count_3month
:
blacklistInfo
.
long_lending_risk
.
reg_count_3month
,
reg_count_6month
:
blacklistInfo
.
long_lending_risk
.
reg_count_6month
,
consume_reg_count_1month
:
blacklistInfo
.
long_lending_risk
.
consume_reg_count_1month
,
consume_reg_count_3month
:
blacklistInfo
.
long_lending_risk
.
consume_reg_count_3month
,
consume_reg_count_6month
:
blacklistInfo
.
long_lending_risk
.
consume_reg_count_6month
,
loan_reg_count_1month
:
blacklistInfo
.
long_lending_risk
.
loan_reg_count_1month
,
loan_reg_count_3month
:
blacklistInfo
.
long_lending_risk
.
loan_reg_count_3month
,
loan_reg_count_6month
:
blacklistInfo
.
long_lending_risk
.
loan_reg_count_6month
,
consume_reg_platform_count_1month
:
blacklistInfo
.
long_lending_risk
.
consume_reg_platform_count_1month
,
consume_reg_platform_count_3month
:
blacklistInfo
.
long_lending_risk
.
consume_reg_platform_count_3month
,
consume_reg_platform_count_6month
:
blacklistInfo
.
long_lending_risk
.
consume_reg_platform_count_6month
,
loan_reg_platform_count_1month
:
blacklistInfo
.
long_lending_risk
.
loan_reg_platform_count_1month
,
loan_reg_platform_count_3month
:
blacklistInfo
.
long_lending_risk
.
loan_reg_platform_count_3month
,
loan_reg_platform_count_6month
:
blacklistInfo
.
long_lending_risk
.
loan_reg_platform_count_6month
,
reg_platform_count_1month
:
blacklistInfo
.
long_lending_risk
.
reg_platform_count_1month
,
reg_platform_count_3month
:
blacklistInfo
.
long_lending_risk
.
reg_platform_count_3month
,
reg_platform_count_6month
:
blacklistInfo
.
long_lending_risk
.
reg_platform_count_6month
,
credit_count_1month
:
blacklistInfo
.
long_lending_risk
.
credit_count_1month
,
credit_count_3month
:
blacklistInfo
.
long_lending_risk
.
credit_count_3month
,
credit_count_6month
:
blacklistInfo
.
long_lending_risk
.
credit_count_6month
,
credit_amount_1month
:
blacklistInfo
.
long_lending_risk
.
credit_amount_1month
,
credit_amount_3month
:
blacklistInfo
.
long_lending_risk
.
credit_amount_3month
,
credit_amount_6month
:
blacklistInfo
.
long_lending_risk
.
credit_amount_6month
,
credit_closed_count_1month
:
blacklistInfo
.
long_lending_risk
.
credit_closed_count_1month
,
credit_closed_count_3month
:
blacklistInfo
.
long_lending_risk
.
credit_closed_count_3month
,
credit_closed_count_6month
:
blacklistInfo
.
long_lending_risk
.
credit_closed_count_6month
,
credit_closed_amount_1month
:
blacklistInfo
.
long_lending_risk
.
credit_closed_amount_1month
,
credit_closed_amount_3month
:
blacklistInfo
.
long_lending_risk
.
credit_closed_amount_3month
,
credit_closed_amount_6month
:
blacklistInfo
.
long_lending_risk
.
credit_closed_amount_6month
,
consume_credit_count_1month
:
blacklistInfo
.
long_lending_risk
.
consume_credit_count_1month
,
consume_credit_count_3month
:
blacklistInfo
.
long_lending_risk
.
consume_credit_count_3month
,
consume_credit_count_6month
:
blacklistInfo
.
long_lending_risk
.
consume_credit_count_6month
,
loan_credit_count_1month
:
blacklistInfo
.
long_lending_risk
.
loan_credit_count_1month
,
loan_credit_count_3month
:
blacklistInfo
.
long_lending_risk
.
loan_credit_count_3month
,
loan_credit_count_6month
:
blacklistInfo
.
long_lending_risk
.
loan_credit_count_6month
,
consume_credit_platform_count_1month
:
blacklistInfo
.
long_lending_risk
.
consume_credit_platform_count_1month
,
consume_credit_platform_count_3month
:
blacklistInfo
.
long_lending_risk
.
consume_credit_platform_count_3month
,
consume_credit_platform_count_6month
:
blacklistInfo
.
long_lending_risk
.
consume_credit_platform_count_6month
,
loan_credit_platform_count_1month
:
blacklistInfo
.
long_lending_risk
.
loan_credit_platform_count_1month
,
loan_credit_platform_count_3month
:
blacklistInfo
.
long_lending_risk
.
loan_credit_platform_count_3month
,
loan_credit_platform_count_6month
:
blacklistInfo
.
long_lending_risk
.
loan_credit_platform_count_6month
,
credit_platform_count_1month
:
blacklistInfo
.
long_lending_risk
.
credit_platform_count_1month
,
credit_platform_count_3month
:
blacklistInfo
.
long_lending_risk
.
credit_platform_count_3month
,
credit_platform_count_6month
:
blacklistInfo
.
long_lending_risk
.
credit_platform_count_6month
,
id_card_relevant_mobilephone_count
:
blacklistInfo
.
identity_related_risk
.
id_card_relevant_mobilephone_count
,
id_card_relevant_device_count
:
blacklistInfo
.
identity_related_risk
.
id_card_relevant_device_count
,
mobilephone_relevant_id_card_count
:
blacklistInfo
.
identity_related_risk
.
mobilephone_relevant_id_card_count
,
relevant_loan_app_count_6month
:
blacklistInfo
.
related_app
.
relevant_loan_app_count_6month
,
relevant_gamble_app_count_6month
:
blacklistInfo
.
related_app
.
relevant_gamble_app_count_6month
,
relevant_ip_app_count_6month
:
blacklistInfo
.
related_app
.
relevant_ip_app_count_6month
,
relevant_other_app_count_6month
:
blacklistInfo
.
related_app
.
relevant_other_app_count_6month
,
overdue
:
JSON
.
stringify
(
blacklistInfo
.
overdue_analysis
)
}
let
reportId
=
await
ctx
.
prometheusModel
.
CreditBlacklistReport
.
create
(
reportData
);
}
}
...
...
app/service/credit/blacklist.js
View file @
ba107535
...
...
@@ -43,7 +43,7 @@ class BlacklistService extends Service {
*/
async
getReport
(
id
)
{
const
{
ctx
}
=
this
;
let
reportData
=
await
ctx
.
prometheusModel
.
CreditBlacklistReport
.
findOne
({
where
:
{
id
:
1
}
});
let
reportData
=
await
ctx
.
prometheusModel
.
CreditBlacklistReport
.
findOne
({
where
:
{
id
:
id
}
});
let
ret
=
{
basic
:
{
risk_index
:
''
,
...
...
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