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
8a2e1465
Commit
8a2e1465
authored
Sep 05, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addd
parent
7e60629c
Pipeline
#13392
passed with stage
in 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
188 additions
and
86 deletions
+188
-86
credit_blacklist_report.js
app/model/prometheus/credit_blacklist_report.js
+103
-0
blacklist.js
app/service/credit/blacklist.js
+85
-86
No files found.
app/model/prometheus/credit_blacklist_report.js
0 → 100644
View file @
8a2e1465
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
INTEGER
,
STRING
,
DATE
,
TEXT
}
=
app
.
Sequelize
;
const
CreditBlackListReport
=
app
.
prometheusModel
.
define
(
'credit_blacklist_report'
,
{
id
:
{
type
:
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
report_no
:
STRING
,
name
:
STRING
,
id_card
:
STRING
,
phone
:
STRING
,
age
:
INTEGER
,
city
:
STRING
,
blacklist_of_internet_loans
:
INTEGER
,
blacklist_of_court_dishonesty
:
INTEGER
,
blacklist_of_industry
:
INTEGER
,
blacklist_of_ds_industry
:
INTEGER
,
blacklist_of_bx_industry
:
INTEGER
,
blacklist_of_zc_industry
:
INTEGER
,
blacklist_of_zf_industry
:
INTEGER
,
blacklist_of_jd_industry
:
INTEGER
,
reg_count_1month
:
INTEGER
,
reg_count_3month
:
INTEGER
,
reg_count_6month
:
INTEGER
,
consume_reg_count_1month
:
INTEGER
,
consume_reg_count_3month
:
INTEGER
,
consume_reg_count_6month
:
INTEGER
,
loan_reg_count_1month
:
INTEGER
,
loan_reg_count_3month
:
INTEGER
,
loan_reg_count_6month
:
INTEGER
,
consume_reg_platform_count_1month
:
INTEGER
,
consume_reg_platform_count_3month
:
INTEGER
,
consume_reg_platform_count_6month
:
INTEGER
,
loan_reg_platform_count_1month
:
INTEGER
,
loan_reg_platform_count_3month
:
INTEGER
,
loan_reg_platform_count_6month
:
INTEGER
,
reg_platform_count_1month
:
INTEGER
,
reg_platform_count_3month
:
INTEGER
,
reg_platform_count_6month
:
INTEGER
,
credit_count_1month
:
INTEGER
,
credit_count_3month
:
INTEGER
,
credit_count_6month
:
INTEGER
,
credit_amount_1month
:
STRING
,
credit_amount_3month
:
STRING
,
credit_amount_6month
:
STRING
,
credit_closed_count_1month
:
INTEGER
,
credit_closed_count_3month
:
INTEGER
,
credit_closed_count_6month
:
INTEGER
,
credit_closed_amount_1month
:
STRING
,
credit_closed_amount_3month
:
STRING
,
credit_closed_amount_6month
:
STRING
,
consume_credit_count_1month
:
INTEGER
,
consume_credit_count_3month
:
INTEGER
,
consume_credit_count_6month
:
INTEGER
,
loan_credit_count_1month
:
INTEGER
,
loan_credit_count_3month
:
INTEGER
,
loan_credit_count_6month
:
INTEGER
,
consume_credit_platform_count_1month
:
INTEGER
,
consume_credit_platform_count_3month
:
INTEGER
,
consume_credit_platform_count_6month
:
INTEGER
,
loan_credit_platform_count_1month
:
INTEGER
,
loan_credit_platform_count_3month
:
INTEGER
,
loan_credit_platform_count_6month
:
INTEGER
,
credit_platform_count_1month
:
INTEGER
,
credit_platform_count_3month
:
INTEGER
,
credit_platform_count_6month
:
INTEGER
,
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
,
relevant_other_app_count_6month
:
INTEGER
,
overdue
:
TEXT
,
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_blacklist_report'
,
});
return
CreditBlackListReport
;
};
app/service/credit/blacklist.js
View file @
8a2e1465
...
@@ -40,108 +40,98 @@ class BlacklistService extends Service {
...
@@ -40,108 +40,98 @@ class BlacklistService extends Service {
/**
/**
* 黑名单报告
* 黑名单报告
*/
*/
async
getReport
()
{
async
getReport
(
id
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
let
reportData
=
await
ctx
.
prometheusModel
.
CreditBlacklistReport
.
findOne
({
where
:
{
id
:
1
}
});
let
ret
=
{
let
ret
=
{
basic
:
{
basic
:
{
risk_index
:
'
10%
'
,
risk_index
:
''
,
risk_standard
:
'
低
'
,
risk_standard
:
''
,
msg
:
''
,
msg
:
''
,
name
:
'李鑫'
,
name
:
reportData
.
name
,
report_no
:
'9527'
,
report_no
:
reportData
.
report_no
,
phone
:
'183****5747'
,
phone
:
reportData
.
phone
.
substring
(
0
,
3
)
+
'****'
+
reportData
.
phone
.
substring
(
7
,
11
),
//手机号(只展示前三位和后四位)
age
:
'21'
,
age
:
reportData
.
age
,
id_card
:
'5101**********4311'
,
id_card
:
reportData
.
id_card
.
substring
(
0
,
3
)
+
'**********'
+
reportData
.
id_card
.
substring
(
15
,
18
),
//身份证号(只展示前四位和后四位)
city
:
'浙江-杭州'
,
city
:
reportData
.
city
,
//城市(省-市)
expire_time
:
'2019-10-30'
,
expire_time
:
moment
(
reportData
.
created_at
).
add
(
30
,
'days'
).
format
(
'YYYY-MM-DD'
),
//报告有效期为报告生成日期往后推30天
},
},
blacklist
:
{
blacklist
:
{
blacklist_of_internet_loans
:
1
,
//是否命中网贷黑名单
blacklist_of_internet_loans
:
reportData
.
blacklist_of_internet_loans
,
//是否命中网贷黑名单
blacklist_of_court_dishonesty
:
1
,
//是否命中法院失信名单
blacklist_of_court_dishonesty
:
reportData
.
blacklist_of_court_dishonesty
,
//是否命中法院失信名单
blacklist_of_industry
:
1
,
//是否命中行业黑名单
blacklist_of_industry
:
reportData
.
blacklist_of_industry
,
//是否命中行业黑名单
blacklist_of_ds_industry
:
1
,
//是否命中电商行业黑名单
blacklist_of_ds_industry
:
reportData
.
blacklist_of_ds_industry
,
//是否命中电商行业黑名单
blacklist_of_bx_industry
:
1
,
//是否命中保险行业黑名单
blacklist_of_bx_industry
:
reportData
.
blacklist_of_bx_industry
,
//是否命中保险行业黑名单
blacklist_of_zc_industry
:
1
,
//是否命中租车行业黑名单
blacklist_of_zc_industry
:
reportData
.
blacklist_of_zc_industry
,
//是否命中租车行业黑名单
blacklist_of_zf_industry
:
1
,
//是否命中三方支付行业黑名单
blacklist_of_zf_industry
:
reportData
.
blacklist_of_zf_industry
,
//是否命中三方支付行业黑名单
blacklist_of_jd_industry
:
1
,
//是否命中酒店行业黑名单
blacklist_of_jd_industry
:
reportData
.
blacklist_of_jd_industry
,
//是否命中酒店行业黑名单
},
},
dtld
:
{
dtld
:
{
reg_count_1month
:
8
,
//近1月注册笔数
dtld_apply_record
:
1
,
//多头申请是不是有记录
reg_count_3month
:
8
,
//近3月注册笔数
dtld_credit_record
:
1
,
//多头放放款是不是有记录
reg_count_6month
:
8
,
//近6月注册笔数
reg_count_1month
:
reportData
.
reg_count_1month
,
//近1月注册笔数
consume_reg_count_1month
:
8
,
//近1月消金机构注册笔数
reg_count_3month
:
reportData
.
reg_count_3month
,
//近3月注册笔数
consume_reg_count_3month
:
8
,
//近3月消金机构注册笔数
reg_count_6month
:
reportData
.
reg_count_6month
,
//近6月注册笔数
consume_reg_count_6month
:
8
,
//近6月消金机构注册笔数
consume_reg_count_1month
:
reportData
.
consume_reg_count_1month
,
//近1月消金机构注册笔数
loan_reg_count_1month
:
8
,
//近1月网贷机构注册笔数
consume_reg_count_3month
:
reportData
.
consume_reg_count_3month
,
//近3月消金机构注册笔数
loan_reg_count_3month
:
8
,
//近3月网贷机构注册笔数
consume_reg_count_6month
:
reportData
.
consume_reg_count_6month
,
//近6月消金机构注册笔数
loan_reg_count_6month
:
8
,
//近6月网贷机构注册笔数
loan_reg_count_1month
:
reportData
.
loan_reg_count_1month
,
//近1月网贷机构注册笔数
consume_reg_platform_count_1month
:
8
,
//近1月注册消金机构数
loan_reg_count_3month
:
reportData
.
loan_reg_count_3month
,
//近3月网贷机构注册笔数
consume_reg_platform_count_3month
:
8
,
//近3月注册消金机构数
loan_reg_count_6month
:
reportData
.
loan_reg_count_6month
,
//近6月网贷机构注册笔数
consume_reg_platform_count_6month
:
8
,
//近6月注册消金机构数
consume_reg_platform_count_1month
:
reportData
.
consume_reg_platform_count_1month
,
//近1月注册消金机构数
loan_reg_platform_count_1month
:
8
,
//近1月注册网贷机构数
consume_reg_platform_count_3month
:
reportData
.
consume_reg_platform_count_3month
,
//近3月注册消金机构数
loan_reg_platform_count_3month
:
8
,
//近3月注册网贷机构数
consume_reg_platform_count_6month
:
reportData
.
consume_reg_platform_count_6month
,
//近6月注册消金机构数
loan_reg_platform_count_6month
:
8
,
//近6月注册网贷机构数
loan_reg_platform_count_1month
:
reportData
.
loan_reg_platform_count_1month
,
//近1月注册网贷机构数
reg_platform_count_1month
:
8
,
//近1月注册机构数
loan_reg_platform_count_3month
:
reportData
.
loan_reg_platform_count_3month
,
//近3月注册网贷机构数
reg_platform_count_3month
:
8
,
//近3月注册机构数
loan_reg_platform_count_6month
:
reportData
.
loan_reg_platform_count_6month
,
//近6月注册网贷机构数
reg_platform_count_6month
:
8
,
//近6月注册机构数
reg_platform_count_1month
:
reportData
.
reg_platform_count_1month
,
//近1月注册机构数
credit_count_1month
:
8
,
//近1月放款笔数
reg_platform_count_3month
:
reportData
.
reg_platform_count_3month
,
//近3月注册机构数
credit_count_3month
:
8
,
//近3月放款笔数
reg_platform_count_6month
:
reportData
.
reg_platform_count_6month
,
//近6月注册机构数
credit_count_6month
:
8
,
//近6月放款笔数
credit_count_1month
:
reportData
.
credit_count_1month
,
//近1月放款笔数
credit_amount_1month
:
'(2000-30000]'
,
//近1月放款金额
credit_count_3month
:
reportData
.
credit_count_3month
,
//近3月放款笔数
credit_amount_3month
:
'(2000-30000]'
,
//近3月放款金额
credit_count_6month
:
reportData
.
credit_count_6month
,
//近6月放款笔数
credit_amount_6month
:
'(2000-30000]'
,
//近6月放款金额
credit_amount_1month
:
reportData
.
credit_amount_1month
,
//近1月放款金额
credit_closed_count_1month
:
8
,
//近1月已结清放款笔数
credit_amount_3month
:
reportData
.
credit_amount_3month
,
//近3月放款金额
credit_closed_count_3month
:
8
,
//近3月已结清放款笔数
credit_amount_6month
:
reportData
.
credit_amount_6month
,
//近6月放款金额
credit_closed_count_6month
:
8
,
//近6月已结清放款笔数
credit_closed_count_1month
:
reportData
.
credit_closed_count_1month
,
//近1月已结清放款笔数
credit_closed_amount_1month
:
'(2000-30000]'
,
//近1月已结清放款金额
credit_closed_count_3month
:
reportData
.
credit_closed_count_3month
,
//近3月已结清放款笔数
credit_closed_amount_3month
:
'(2000-30000]'
,
//近3月已结清放款金额
credit_closed_count_6month
:
reportData
.
credit_closed_count_6month
,
//近6月已结清放款笔数
credit_closed_amount_6month
:
'(2000-30000]'
,
//近6月已结清放款金额
credit_closed_amount_1month
:
reportData
.
credit_closed_amount_1month
,
//近1月已结清放款金额
consume_credit_count_1month
:
8
,
//近1月消金机构放款笔数
credit_closed_amount_3month
:
reportData
.
credit_closed_amount_3month
,
//近3月已结清放款金额
consume_credit_count_3month
:
8
,
//近3月消金机构放款笔数
credit_closed_amount_6month
:
reportData
.
credit_closed_amount_6month
,
//近6月已结清放款金额
consume_credit_count_6month
:
8
,
//近6月消金机构放款笔数
consume_credit_count_1month
:
reportData
.
consume_credit_count_1month
,
//近1月消金机构放款笔数
loan_credit_count_1month
:
8
,
//近1月网贷机构放款笔数
consume_credit_count_3month
:
reportData
.
consume_credit_count_3month
,
//近3月消金机构放款笔数
loan_credit_count_3month
:
8
,
//近3月网贷机构放款笔数
consume_credit_count_6month
:
reportData
.
consume_credit_count_6month
,
//近6月消金机构放款笔数
loan_credit_count_6month
:
8
,
//近6月网贷机构放款笔数
loan_credit_count_1month
:
reportData
.
loan_credit_count_1month
,
//近1月网贷机构放款笔数
consume_credit_platform_count_1month
:
8
,
//近1月放款消金机构数
loan_credit_count_3month
:
reportData
.
loan_credit_count_3month
,
//近3月网贷机构放款笔数
consume_credit_platform_count_3month
:
8
,
//近3月放款消金机构数
loan_credit_count_6month
:
reportData
.
loan_credit_count_6month
,
//近6月网贷机构放款笔数
consume_credit_platform_count_6month
:
8
,
//近6月放款消金机构数
consume_credit_platform_count_1month
:
reportData
.
consume_credit_platform_count_1month
,
//近1月放款消金机构数
loan_credit_platform_count_1month
:
8
,
//近1月放款网贷机构数
consume_credit_platform_count_3month
:
reportData
.
consume_credit_platform_count_3month
,
//近3月放款消金机构数
loan_credit_platform_count_3month
:
8
,
//近3月放款网贷机构数
consume_credit_platform_count_6month
:
reportData
.
consume_credit_platform_count_6month
,
//近6月放款消金机构数
loan_credit_platform_count_6month
:
8
,
//近6月放款网贷机构数
loan_credit_platform_count_1month
:
reportData
.
loan_credit_platform_count_1month
,
//近1月放款网贷机构数
credit_platform_count_1month
:
8
,
//近1月放款机构数
loan_credit_platform_count_3month
:
reportData
.
loan_credit_platform_count_3month
,
//近3月放款网贷机构数
credit_platform_count_3month
:
8
,
//近3月放款机构数
loan_credit_platform_count_6month
:
reportData
.
loan_credit_platform_count_6month
,
//近6月放款网贷机构数
credit_platform_count_6month
:
8
,
//近6月放款机构数
credit_platform_count_1month
:
reportData
.
credit_platform_count_1month
,
//近1月放款机构数
credit_platform_count_3month
:
reportData
.
credit_platform_count_3month
,
//近3月放款机构数
credit_platform_count_6month
:
reportData
.
credit_platform_count_6month
,
//近6月放款机构数
msg
:
''
,
msg
:
''
,
},
},
overdue
:
{
//逾期详情
overdue
:
{
//逾期详情
list
:
[
list
:
!
reportData
?
[]
:
JSON
.
parse
(
reportData
.
overdue
),
{
overdue_date
:
'2019-07'
,
//逾期时间
overdue_amount
:
5000
,
//逾期金额
overdue_time
:
'30-60天'
,
//逾期时长
is_settle
:
'是'
,
//是否已经结清
},
{
overdue_date
:
'2019-07'
,
//逾期时间
overdue_amount
:
5000
,
//逾期金额
overdue_time
:
'30-60天'
,
//逾期时长
is_settle
:
'是'
,
//是否已经结清
},
],
msg
:
''
,
msg
:
''
,
},
},
six_months
:
{
//近6个月关联风险
six_months
:
{
//近6个月关联风险
id_card_relevant
:
{
//身份关联风险
id_card_relevant
:
{
//身份关联风险
id_card_relevant_mobilephone_count
:
1
,
//身份证关联手机号个数
id_card_relevant_mobilephone_count
:
reportData
.
id_card_relevant_mobilephone_count
,
//身份证关联手机号个数
id_card_relevant_device_count
:
3
,
//身份证关联设备号个数
id_card_relevant_device_count
:
reportData
.
id_card_relevant_device_count
,
//身份证关联设备号个数
mobilephone_relevant_id_card_count
:
1
,
//手机号关联身份证个数
mobilephone_relevant_id_card_count
:
reportData
.
mobilephone_relevant_id_card_count
,
//手机号关联身份证个数
msg
:
''
,
msg
:
''
,
},
},
mobilephone_relecvant
:
{
//设备关联风险
mobilephone_relecvant
:
{
//设备关联风险
relevant_loan_app_count_6month
:
3
,
//近6月关联的信贷app个数
relevant_loan_app_count_6month
:
reportData
.
relevant_loan_app_count_6month
,
//近6月关联的信贷app个数
relevant_gamble_app_count_6month
:
2
,
//近6月关联的赌博app个数
relevant_gamble_app_count_6month
:
reportData
.
relevant_gamble_app_count_6month
,
//近6月关联的赌博app个数
relevant_ip_app_count_6month
:
2
,
//近6月关联的代理ip或篡改gps的app个数
relevant_ip_app_count_6month
:
reportData
.
relevant_ip_app_count_6month
,
//近6月关联的代理ip或篡改gps的app个数
relevant_other_app_count_6month
:
1
,
//近6月关联的其他app个数
relevant_other_app_count_6month
:
reportData
.
relevant_other_app_count_6month
,
//近6月关联的其他app个数
msg
:
''
,
msg
:
''
,
}
}
}
}
...
@@ -177,6 +167,13 @@ class BlacklistService extends Service {
...
@@ -177,6 +167,13 @@ class BlacklistService extends Service {
dtldLevel
=
'more'
;
dtldLevel
=
'more'
;
}
}
ret
.
dtld
.
msg
=
DtldConfig
[
dtldLevel
];
ret
.
dtld
.
msg
=
DtldConfig
[
dtldLevel
];
//多头雷达的是否有记录判断,前端需要
if
(
_
.
sum
([
ret
.
dtld
.
reg_count_1month
,
ret
.
dtld
.
reg_count_3month
,
ret
.
dtld
.
reg_count_6month
,
ret
.
dtld
.
reg_platform_count_1month
,
ret
.
dtld
.
reg_platform_count_3month
,
ret
.
dtld
.
reg_platform_count_6month
])
>
0
)
{
ret
.
dtld
.
dtld_apply_record
=
1
;
}
if
(
_
.
sum
([
ret
.
dtld
.
credit_count_1month
,
ret
.
dtld
.
credit_count_3month
,
ret
.
dtld
.
credit_count_6month
,
ret
.
dtld
.
credit_platform_count_1month
,
ret
.
dtld
.
credit_platform_count_3month
,
ret
.
dtld
.
credit_platform_count_6month
])
>
0
)
{
ret
.
dtld
.
dtld_credit_record
=
1
;
}
//逾期msg
//逾期msg
ret
.
overdue
.
msg
=
'逾期次数过多,逾期天数较长,逾期金额较大等,会被认为你的还款能力弱,贷款申请被拒概率较大。如显示无记录,则未查得逾期记录,或贷款平台没有及时上传你的逾期信息。实际逾期情况,请以个人借贷情况为准。'
;
ret
.
overdue
.
msg
=
'逾期次数过多,逾期天数较长,逾期金额较大等,会被认为你的还款能力弱,贷款申请被拒概率较大。如显示无记录,则未查得逾期记录,或贷款平台没有及时上传你的逾期信息。实际逾期情况,请以个人借贷情况为准。'
;
...
@@ -235,8 +232,10 @@ class BlacklistService extends Service {
...
@@ -235,8 +232,10 @@ class BlacklistService extends Service {
}
}
ret
.
six_months
.
mobilephone_relecvant
.
msg
=
DeviceConfig
[
deviceLevel
].
replace
(
/XX/
,
deviceMax
.
type
);
ret
.
six_months
.
mobilephone_relecvant
.
msg
=
DeviceConfig
[
deviceLevel
].
replace
(
/XX/
,
deviceMax
.
type
);
ret
.
basic
.
report_no
=
await
ctx
.
service
.
credit
.
common
.
getReportNo
(
'00'
,
12344
);
if
(
!
ret
.
basic
.
report_no
)
{
ret
.
basic
.
report_no
=
await
ctx
.
service
.
credit
.
common
.
getReportNo
(
'00'
,
reportData
.
id
);
await
ctx
.
prometheusModel
.
CreditBlacklistReport
.
update
({
report_no
:
ret
.
basic
.
report_no
},
{
where
:
{
id
:
reportData
.
id
}
});
}
return
ret
;
return
ret
;
}
}
...
...
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