Commit dfea7fbf by 宋毅

tj

parent e39384f2
......@@ -76,7 +76,7 @@ class UtilsOrderService extends AppServiceBase {
fqobj.actionBody.sku = opResult.data.product_info.price_item.service_code;
fqobj.actionBody.price_desc = opResult.data.product_info.price_item.price_desc;
}
this.execClientNew.execLogs("pushNewFq-3", tmpPobj, "center-channel-utilsOrderSve-pushNewFqByChannelOrderNo-pushBusInfo", "pushOrder", null);
this.execClientNew.execLogs("pushNewFq-3", fqobj, "center-channel-utilsOrderSve-pushNewFqByChannelOrderNo-pushBusInfo", "pushOrder", null);
this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderBusiness");
}
}
......
......@@ -2,6 +2,7 @@ const system = require("../../../system");
var settings = require("../../../../config/settings");
const querystring = require('querystring');
const AppServiceBase = require("../../app.base");
class UtilsPushService extends AppServiceBase {
constructor() {
super();
......@@ -31,7 +32,7 @@ class UtilsPushService extends AppServiceBase {
async business2Channel(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
console.log("business2Channel++++++++start++++++++++");
console.log(pobj,"business2Channel++++++++++++++++++");
console.log(pobj, "business2Channel++++++++++++++++++");
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
......@@ -59,16 +60,7 @@ class UtilsPushService extends AppServiceBase {
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsPushSve.js/service/app.base.js/aliBusiness2Fq",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: pobj.opType + "推送蜂擎获取的接口信息->aliBusiness2Fq",
});
this.execClientNew.execLogs(`${pobj.opType}推送蜂擎获取的接口信息->aliBusiness2Fq->app(getAppInterface)`, pobj, "center-channel-utilsPushSve-aliBusiness2Fq", productItemInterfaceResult.data, null);
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
......@@ -99,13 +91,13 @@ class UtilsPushService extends AppServiceBase {
}
async pushBusInfo(pobj, opType, isDelProductInfo) {//推送业务总入口,不在db中做配置进行调用
console.log(JSON.stringify(pobj), ".......pushBusInfo........................."+opType);
console.log(JSON.stringify(pobj), ".......pushBusInfo........................." + opType);
var interface_list = pobj.interface_info ? pobj.interface_info : pobj.actionBody.product_info.interface_info;
if (!interface_list) {
return system.getResult(null, "暂无推送配置");
}
var interface_list_temp = interface_list.filter(f => f.op_type == opType);
console.log(interface_list_temp,"interface_list_temp+++++++++++++++");
console.log(interface_list_temp, "interface_list_temp+++++++++++++++");
if (!interface_list_temp || interface_list_temp.length == 0) {
return system.getResult(null, "暂无【" + opType + "】的推送配置");
}
......@@ -141,8 +133,8 @@ class UtilsPushService extends AppServiceBase {
}
async reflexAction(interface_info, opType, pobj, isDelProductInfo) {
console.log(interface_info,"reflexAction+++++++++++++++"+opType);
console.log(pobj,"reflexAction++++++2+++++++++"+opType);
console.log(interface_info, "reflexAction+++++++++++++++" + opType);
console.log(pobj, "reflexAction++++++2+++++++++" + opType);
var refResult = null;
pobj.interface_info = interface_info;
pobj.opType = opType;
......@@ -160,8 +152,7 @@ class UtilsPushService extends AppServiceBase {
var params = [pobj];
var doRes = await invokeObj[interface_info.method_name].apply(invokeObj, params);
return doRes;
}
else if (interface_info.interface_type == "yc") {
} else if (interface_info.interface_type == "yc") {
var actionBody = pobj.actionBody;
if (!interface_info.interface_url) {
return system.getResult(null, "产品接口interface_url参数不能为空,100370");
......@@ -187,6 +178,7 @@ class UtilsPushService extends AppServiceBase {
return await this.disposePushResultFail(pobj, errorResult, "数据推送异常-->reflexAction-->errorResult", this.pushlogFailType.FAILLOG);
}
}
//---------百度---zhuangbing--2020.10.28------start--------------------------------------------
async baiduBusiness2Fq(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
......@@ -202,7 +194,7 @@ class UtilsPushService extends AppServiceBase {
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: pobj.opType + "推送蜂擎获取的接口信息->baiduBusiness2Fq",
pobj:pobj
pobj: pobj
});
if (pobj.interface_info) {
var pushBusInfo = await this.pushBusInfo(pobj, opType, 1);
......@@ -210,12 +202,13 @@ class UtilsPushService extends AppServiceBase {
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async baiduBusiness2Delivery(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
console.log(pobj,"baiduBusiness2Delivery-zhuangbing------------------------------"+opType);
console.log(pobj, "baiduBusiness2Delivery-zhuangbing------------------------------" + opType);
console.log(productItemInterfaceResult);
//日志记录
this.logCtl.info({
......@@ -226,7 +219,7 @@ class UtilsPushService extends AppServiceBase {
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: opType + "推送蜂擎获取的接口信息->baiduBusiness2Delivery",
pobj:pobj
pobj: pobj
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
......@@ -234,6 +227,8 @@ class UtilsPushService extends AppServiceBase {
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
//---------百度---zhuangbing--2020.10.28------end--------------------------------------------
}
module.exports = UtilsPushService;
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