Commit 05589f97 authored by Hsinli's avatar Hsinli

addd

parent 589d067a
Pipeline #13457 passed with stage
in 4 seconds
......@@ -134,7 +134,8 @@ class BlacklistService extends Service {
relevant_other_app_count_6month: reportData.relevant_other_app_count_6month,//近6月关联的其他app个数
msg: '',
}
}
},
retport_valid: 0//报告是否失效
};
//风险分值计算
......@@ -237,9 +238,13 @@ class BlacklistService extends Service {
await ctx.prometheusModel.CreditBlacklistReport.update({ report_no: ret.basic.report_no }, { where: { id: reportData.id } });
}
//订单是否在有效期内
ret.report_valid = await ctx.service.credit.order.getReportValid(id);
return ret;
}
/**
* 获取多头借贷的分值
* @param {*} a 近6月消金机构注册笔数
......
......@@ -7,8 +7,8 @@ const _ = require('lodash');
class OrderService extends Service {
//历史订单
async getHistoryOrders(order_type) {
//历史订单
async getHistoryOrders(order_type) {
const { ctx } = this;
const type_obj = {
......@@ -48,7 +48,31 @@ async getHistoryOrders(order_type) {
return { worth_h, worth_l }
}
}
/**
*
* @param {*} type 报告类型(黑名单1通话2)
* @param {*} orderId 订单编号
*/
async getReportValid(type, orderId) {
const { ctx } = this;
let valid = 0;
let orderFilter = {
where: {
report_id: orderId,
valid: 1
}
};
let orderInfo = await ctx.prometheusModel.CreditOrder.findOne(orderFilter);
if (orderInfo != null) {
let timeLine = (type === 1) ? 15 : 30;
if (orderInfo.state === '已支付' && moment(orderInfo.state_time).add(timeLine, 'days').format('YYYY-MM-DD HH:ii:ss') > moment().format('YYYY-MM-DD HH:ii:ss')) {
valid = 1;
}
}
return valid;
}
}
......
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