Commit 8fd9f01b authored by 李尚科's avatar 李尚科

fix

parent b9d5376e
......@@ -104,6 +104,8 @@ class InstitutionService extends Service {
}
if (area.id == area_id && area.institution_id == institution_id) {
institution_detail.travel_tips = travel_tips;
institution_detail.lat = area.lat;
institution_detail.lng = area.lng;
}
areas.push({
id: area.id,
......
......@@ -583,8 +583,12 @@ class CallriskService extends Service {
async queryTaskStatus(order_id) {
const { ctx } = this;
const code_array = [];
const yys_order = await ctx.prometheusModel.CreditYysOrder({ where: { order_id } });
const user_id = ctx.userId;
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 query_resp = await ctx.service.credit.yys.query(order_sn);
const r_code = query_resp.code;
......@@ -596,6 +600,59 @@ class CallriskService extends Service {
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;
}
......
......@@ -83,18 +83,22 @@ class YysService extends Service {
async getData(orderSn) {
const { ctx } = this;
const data = {
sign: '',
params: {
//调用数据接口获取通话检测报告数据
let params = {
sign: "",
signParams: {
appKey: this.config.YYS_APP_KEY,
timestamp: new Date().getTime(),
orderSn,
}
};
let url = this.config.NODE_BASE_URL + '/yys_api/getData' + '?appKey=' + this.config.YYS_APP_KEY;
let resp = await ctx.helper.send_request(url, data, { method: 'POST' });
ctx.logger.info({ url: JSON.stringify(resp) });
return resp.data;
timestamp: String(new Date().getTime()),
},
orderSn,
}
params.sign = await ctx.service.credit.common.sign(params.signParams, this.config.YYS_APPLY_APPSECRET);
const url = this.config.YYS_APPLY_URL;
const result = await ctx.helper.send_request(url, params, { method: 'POST' });
ctx.logger.info(JSON.stringify({ thxdReport_parmas: params, thxdReport_result: result }));
return result.data;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment