Commit dfea7fbf by 宋毅

tj

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