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
8fd9f01b
Commit
8fd9f01b
authored
Sep 26, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
b9d5376e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
13 deletions
+76
-13
institution.js
app/service/course/institution.js
+2
-0
callrisk.js
app/service/credit/callrisk.js
+59
-2
yys.js
app/service/credit/yys.js
+15
-11
No files found.
app/service/course/institution.js
View file @
8fd9f01b
...
@@ -104,6 +104,8 @@ class InstitutionService extends Service {
...
@@ -104,6 +104,8 @@ class InstitutionService extends Service {
}
}
if
(
area
.
id
==
area_id
&&
area
.
institution_id
==
institution_id
)
{
if
(
area
.
id
==
area_id
&&
area
.
institution_id
==
institution_id
)
{
institution_detail
.
travel_tips
=
travel_tips
;
institution_detail
.
travel_tips
=
travel_tips
;
institution_detail
.
lat
=
area
.
lat
;
institution_detail
.
lng
=
area
.
lng
;
}
}
areas
.
push
({
areas
.
push
({
id
:
area
.
id
,
id
:
area
.
id
,
...
...
app/service/credit/callrisk.js
View file @
8fd9f01b
...
@@ -583,8 +583,12 @@ class CallriskService extends Service {
...
@@ -583,8 +583,12 @@ class CallriskService extends Service {
async
queryTaskStatus
(
order_id
)
{
async
queryTaskStatus
(
order_id
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
code_array
=
[];
const
user_id
=
ctx
.
userId
;
const
yys_order
=
await
ctx
.
prometheusModel
.
CreditYysOrder
({
where
:
{
order_id
}
});
const
app_type_id
=
ctx
.
appTypeId
;
const
app_user_id
=
ctx
.
appUserId
;
const
app_id
=
ctx
.
appId
;
// const code_array = [];
const
yys_order
=
await
ctx
.
prometheusModel
.
CreditYysOrder
({
where
:
{
order_id
,
user_id
}
});
const
order_sn
=
yys_order
.
r_order_sn
;
const
order_sn
=
yys_order
.
r_order_sn
;
const
query_resp
=
await
ctx
.
service
.
credit
.
yys
.
query
(
order_sn
);
const
query_resp
=
await
ctx
.
service
.
credit
.
yys
.
query
(
order_sn
);
const
r_code
=
query_resp
.
code
;
const
r_code
=
query_resp
.
code
;
...
@@ -596,6 +600,59 @@ class CallriskService extends Service {
...
@@ -596,6 +600,59 @@ class CallriskService extends Service {
return
{
code
:
-
1
,
msg
:
yys_report_data
.
msg
}
return
{
code
:
-
1
,
msg
:
yys_report_data
.
msg
}
}
}
//创建报告信息
const
user_brief
=
yys_report_data
.
data
.
user_brief
;
const
report
=
{
report_no
:
''
,
user_id
,
app_type_id
,
app_user_id
,
app_id
,
mobile
:
user_brief
.
mobile
,
operator
:
user_brief
.
operator
,
net_time
:
user_brief
.
net_time
,
call_result_assessment
:
user_brief
.
call_result_assessment
,
}
const
report_id
=
await
ctx
.
prometheusModel
.
CreditCallriskReport
.
add
(
report
);
const
report_no
=
await
ctx
.
service
.
credit
.
common
.
getReportNo
(
'callrisk'
,
report_id
);
await
ctx
.
prometheusModel
.
CreditCallriskReport
.
edit
({
params
:
{
report_no
,
},
where
:
{
id
:
report_id
}
});
//添加通话概览
const
call_overview
=
yys_report_data
.
data
.
call_overview
;
const
call_overview_report
=
[];
for
(
let
i
in
call_overview
)
{
const
call_overview_val
=
call_overview
[
i
];
call_overview_report
.
push
({
report_id
,
month
:
call_overview_val
.
month
,
call_time_month
:
call_overview_val
.
call_time_month
,
call_fee_month
:
call_overview_val
.
call_fee_month
,
call_active_count_month
:
call_overview_val
.
call_active_count_month
,
call_passive_count_month
:
call_overview_val
.
call_passive_count_month
,
call_count_month
:
call_overview_val
.
call_count_month
,
});
}
await
ctx
.
prometheusModel
.
CreditCallriskCallOverview
.
bulkCreate
(
call_overview_report
);
//通话类型分析
const
call_type_analysis
=
yys_report_data
.
data
.
call_type_analysis
;
const
call_type_report
=
{
report_id
,
bank_call_count
:
call_type_analysis
.
bank_call_count
,
bank_call_time
:
call_type_analysis
.
bank_call_time
,
bank_number_count
:
call_type_analysis
.
bank_number_count
,
loan_call_count
:
call_type_analysis
.
loan_call_count
,
loan_call_time
:
call_type_analysis
.
loan_call_time
,
loan_number_count
:
call_type_analysis
.
loan_number_count
,
court_call_count
:
call_type_analysis
.
court_call_count
,
collection_call_count
:
call_type_analysis
.
collection_call_count
,
laywer_call_count
:
call_type_analysis
.
laywer_call_count
,
macao_call_count
:
call_type_analysis
.
macao_call_count
,
c110_call_count
:
call_type_analysis
[
'110_call_count'
],
c120_call_count
:
call_type_analysis
[
'120_call_count'
],
}
await
ctx
.
prometheusModel
.
CreditCallriskCallType
.
add
(
call_type_report
);
return
r_code
;
return
r_code
;
}
}
...
...
app/service/credit/yys.js
View file @
8fd9f01b
...
@@ -83,18 +83,22 @@ class YysService extends Service {
...
@@ -83,18 +83,22 @@ class YysService extends Service {
async
getData
(
orderSn
)
{
async
getData
(
orderSn
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
data
=
{
sign
:
''
,
//调用数据接口获取通话检测报告数据
params
:
{
let
params
=
{
sign
:
""
,
signParams
:
{
appKey
:
this
.
config
.
YYS_APP_KEY
,
appKey
:
this
.
config
.
YYS_APP_KEY
,
timestamp
:
new
Date
().
getTime
(),
timestamp
:
String
(
new
Date
().
getTime
()),
orderSn
,
},
}
orderSn
,
};
}
let
url
=
this
.
config
.
NODE_BASE_URL
+
'/yys_api/getData'
+
'?appKey='
+
this
.
config
.
YYS_APP_KEY
;
params
.
sign
=
await
ctx
.
service
.
credit
.
common
.
sign
(
params
.
signParams
,
this
.
config
.
YYS_APPLY_APPSECRET
);
let
resp
=
await
ctx
.
helper
.
send_request
(
url
,
data
,
{
method
:
'POST'
});
const
url
=
this
.
config
.
YYS_APPLY_URL
;
ctx
.
logger
.
info
({
url
:
JSON
.
stringify
(
resp
)
});
const
result
=
await
ctx
.
helper
.
send_request
(
url
,
params
,
{
method
:
'POST'
});
return
resp
.
data
;
ctx
.
logger
.
info
(
JSON
.
stringify
({
thxdReport_parmas
:
params
,
thxdReport_result
:
result
}));
return
result
.
data
;
}
}
...
...
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