Commit c9aaa20f authored by Hsinli's avatar Hsinli

add

parent 5327e20c
Pipeline #13688 passed with stage
in 5 seconds
......@@ -241,7 +241,7 @@ class BlacklistService extends Service {
ret.six_months.mobilephone_relecvant.msg = DeviceConfig[deviceLevel].replace(/XX/, deviceMax.type);
if (!ret.basic.report_no) {
ret.basic.report_no = await ctx.service.credit.common.getReportNo('00', reportData.id);
ret.basic.report_no = await ctx.service.credit.common.getReportNo('blacklist', reportData.id);
await ctx.prometheusModel.CreditBlacklistReport.update({ report_no: ret.basic.report_no }, { where: { id: reportData.id } });
}
......
......@@ -13,11 +13,15 @@ class CommonService extends Service {
/**
*
* @param {*} type 黑名单00通话01
* @param {*} type 黑名单blacklist通话callrisk
* @param {*} id 报告自增编号(report_id)
*/
async getReportNo(type, id) {
let prefix = '51GJJ' + moment().format('YYYYMMDD') + type;
if (!TypeConfig.hasOwnProperty(type)) {
this.ctx.failed('getReportNo type undefined');
}
let tip = (type === 'blacklist') ? '00' : '01';
let prefix = '51GJJ' + moment().format('YYYYMMDD') + tip;
let suffix = String(Number(id) + 12580);
if (suffix.length > 5) {
let subStart = suffix.length - 5;
......@@ -29,11 +33,15 @@ class CommonService extends Service {
/**
*
* @param {*} type 黑名单00通话01
* @param {*} type 黑名单blacklist通话callrisk
* @param {*} id 订单自增编号(order_id)
*/
async getOrdertNo(type, id) {
let prefix = '51GJJOD' + moment().format('YYYYMMDD') + type;
if (!TypeConfig.hasOwnProperty(type)) {
this.ctx.failed('getOrdertNo type undefined');
}
let tip = (type === 'blacklist') ? '00' : '01';
let prefix = '51GJJOD' + moment().format('YYYYMMDD') + tip;
let suffix = String(Number(id) + 12580);
if (suffix.length > 5) {
let subStart = suffix.length - 5;
......
......@@ -410,7 +410,7 @@ class OrderService extends Service {
}
let order = await ctx.prometheusModel.CreditOrder.create(data);
//生成order_no
let orderNoType = params.type === 1 ? '00' : '01';
let orderNoType = params.type === 1 ? 'blacklist' : 'callrisk';
let orderNo = await ctx.service.credit.common.getOrdertNo(orderNoType, order.id);
await ctx.prometheusModel.CreditOrder.update({ order_no: orderNo }, { where: { id: order.id } });
return order;
......
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