Commit 1feee055 by 宋毅

优化公共调用

parent 3d4e0959
......@@ -28,7 +28,7 @@ class AccessAuthAPI extends APIBase {
return rtn;
}
async taskAgainFqPushInfo(pobj, qobj, req) {//再次推送蜂擎业务数据
var rtn = await this.utilsPushSve.aliBusiness2Fq(pobj, pobj.opType);
var rtn = await this.utilsPushSve.business2Channel(pobj, pobj.opType);
this.pushlogSve.delDbPushfaillogById(Number(pobj.id || 0));
return rtn;
}
......
......@@ -193,7 +193,7 @@ class BaseCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
await this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
await this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
}
return res;
}
......
......@@ -198,7 +198,7 @@ class CenterorderService extends AppServiceBase {
pobj.actionBody.appName = pobj.appInfo.app_name;
if (solutiondata.status == 0) {
pobj.actionBody.orderNo = pobj.actionBody.channelOrder.channelOrderNo;
this.utilsPushSve.aliBusiness2Fq(pobj, "pushOrderBusiness");
this.utilsPushSve.business2Channel(pobj, "pushOrderBusiness");
}
return system.getResultSuccess();
}
......@@ -337,7 +337,7 @@ class CenterorderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
let aliPushRes = await this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderICPBusiness");
let aliPushRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusiness");
if(pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy=="true"){//直接下单需执行添加订单业务员操作
if(aliPushRes && aliPushRes.status==0){
if(aliPushRes.data && aliPushRes.data.data){
......@@ -357,14 +357,14 @@ class CenterorderService extends AppServiceBase {
var salesmanRes = JSON.parse(addRes.stdout);
if (salesmanRes.status == 0) {
deliveryObj.actionBody.needsolution = salesmanRes.data;
await this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
await this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
}
}
}
}else {
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
return system.getResultSuccess();
}
......@@ -675,7 +675,7 @@ class CenterorderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
var baiduPushRes = await this.utilsPushSve.baiduBusiness2Fq(fqobj, "pushOrderICPBusinessNew");
var baiduPushRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusinessNew");
var deliveryObj = {
actionBody: {
orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
......@@ -709,14 +709,14 @@ class CenterorderService extends AppServiceBase {
var salesmanRes = JSON.parse(addRes.stdout);
if (salesmanRes.status == 0) {
deliveryObj.actionBody.needsolution = salesmanRes.data;
await this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
await this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
}
}
}
}else{
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
return system.getResultSuccess();
}
......
......@@ -123,7 +123,7 @@ class NcService extends AppServiceBase {
appInfo: pobj.appInfo
}
var self = this;
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -225,7 +225,7 @@ class NcService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -246,7 +246,7 @@ class NcService extends AppServiceBase {
var a = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/requirement/update", reqbody: pushObj});
console.log('nc closeNeed+++',a)
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
}
......
......@@ -74,7 +74,7 @@ class QcCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//
return system.getResultSuccess(pushIcpSolutionRes);
}
......
......@@ -126,7 +126,7 @@ class RegCenterOrderService extends AppServiceBase {
appInfo: pobj.appInfo
}
console.log('fqobj----',fqobj)
var baiduPushRes = await this.utilsPushSve.baiduBusiness2Fq(fqobj, "pushOrderICPBusinessNew");
var baiduPushRes = await this.utilsPushSve.business2Channel(fqobj, "pushOrderICPBusinessNew");
var deliveryObj = {
actionBody: {
orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
......@@ -160,14 +160,14 @@ class RegCenterOrderService extends AppServiceBase {
var salesmanRes = JSON.parse(addRes.stdout);
if (salesmanRes.status == 0) {
deliveryObj.actionBody.needsolution = salesmanRes.data;
await this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
await this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
}
}
}
}else{
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
return system.getResultSuccess();
}
......@@ -265,7 +265,7 @@ class RegCenterOrderService extends AppServiceBase {
pobj.actionBody.idempotentId = pobj.actionBody.intentionBizId;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
pobj.actionBody.customerName = pobj.actionBody.userName;
this.utilsPushSve.baiduBusiness2Fq(pobj, "pushNeedICPBusinessNew");
this.utilsPushSve.business2Channel(pobj, "pushNeedICPBusinessNew");
}
return result;
}
......@@ -286,7 +286,7 @@ class RegCenterOrderService extends AppServiceBase {
if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq
if (pobj.intentionStatus == 5) {
self.utilsPushSve.baiduBusiness2Fq(pobj, "pushCloseICPNeed");
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
}
var data = JSON.parse(rtn.stdout);
......@@ -324,7 +324,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(deliveryObj, "pushDeliveryOrder");
}
if (rtn.status == 0 && actionBody.status != 1 && actionBody.status != 2 && rtn.data) {
var tmpObj = {
......@@ -335,7 +335,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
......@@ -343,7 +343,7 @@ class RegCenterOrderService extends AppServiceBase {
return system.getResultFail(-5022, "订单关闭失败");
}
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
self.utilsPushSve.baiduBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......@@ -372,7 +372,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
// tmpObj.actionBody.orderNo = channelOrderNo;
var tmpObj2 = {
actionBody: {
......@@ -382,7 +382,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
};
self.utilsPushSve.baiduBusiness2Fq(tmpObj2, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj2, "pushOrderICPClose");
}//通知更新状态
return rtn;
}
......@@ -474,7 +474,7 @@ class RegCenterOrderService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
await this.utilsPushSve.baiduBusiness2Delivery(reqParams, "updateChanceStatus");
await this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
}
return res;
}
......@@ -532,7 +532,7 @@ class RegCenterOrderService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
this.utilsPushSve.baiduBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -561,7 +561,7 @@ class RegCenterOrderService extends AppServiceBase {
resultInfo: "",
optitle: "推送baidu-reg关闭需求->closeNeed",
});
this.utilsPushSve.baiduBusiness2Fq(pobj, "pushCloseICPNeed");
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
......@@ -638,7 +638,7 @@ class RegCenterOrderService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.baiduBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
var fqobj = {
actionBody: {
"bizId": pobj.actionBody.intentionBizId,
......@@ -648,7 +648,7 @@ class RegCenterOrderService extends AppServiceBase {
opType: "aliFollowup",
appInfo: pobj.appInfo
}
self.utilsPushSve.baiduBusiness2Fq(fqobj, "aliFollowup");
self.utilsPushSve.business2Channel(fqobj, "aliFollowup");
return result
}
......
......@@ -126,7 +126,7 @@ class RtService extends AppServiceBase {
appInfo: pobj.appInfo
}
var self = this;
self.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -228,7 +228,7 @@ class RtService extends AppServiceBase {
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(reqParams, "updateChanceStatus");
this.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
......@@ -249,7 +249,7 @@ class RtService extends AppServiceBase {
var a = await this.baiduclient.baiduReqbyget({ path: "/api/bla/provider/requirement/update", reqbody: pushObj});
console.log('rt closeNeed+++',a)
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
this.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result;
}
......
......@@ -21,7 +21,7 @@ class utilsDeliverSve extends AppServiceBase{
return system.getResultFail();
}
pobj.actionBody = verifyResult.data;
this.utilsPushSve.aliBusiness2Delivery(pobj, "pushTmReDeliver");
this.utilsPushSve.business2Channel(pobj, "pushTmReDeliver");
return system.getResultSuccess();
}catch (e) {
return system.getResultFail();
......@@ -123,7 +123,7 @@ class utilsDeliverSve extends AppServiceBase{
if(orderResult.data && orderResult.data.orderStatus === 2){
// 推送交付中心
pobj.actionBody = verifyResult.data;
this.utilsPushSve.aliBusiness2Delivery(pobj, "pushTmReDeliver");
this.utilsPushSve.business2Channel(pobj, "pushTmReDeliver");
}
return result;
}catch (e) {
......
......@@ -45,7 +45,7 @@ class UtilsFgbusinesschancService extends AppServiceBase {
}
var tmpResult = await self.restPostUrl(tmpPobj, reqUrl);
if (tmpResult.status == 0) {
self.utilsPushSve.aliBusiness2Fq(tmpPobj, "pushRePurchaseBusiness");
self.utilsPushSve.business2Channel(tmpPobj, "pushRePurchaseBusiness");
}
}
}
......
......@@ -81,7 +81,7 @@ class UtilsFqAliyunService extends AppServiceBase {
}
var interface_params_info = verifyResult.data;
if (interface_params_info.opUrl.indexOf("/cts-open-agency/crm/opportunity/submit") >= 0) {
await this.transformNeedActionBody(pobj);
}
var result = await this.opAliyunClientPost(pobj, interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, pobj.actionBody);
return await this.disposePushResult(pobj, result, "fq->pushAliBusiness2Fq->result", this.pushlogFailType.FQ);
......
......@@ -46,7 +46,7 @@ class UtilsOpNeedService extends AppServiceBase {
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if (pobj.actionBody.channel_type_code == "esp.companyreg" || pobj.actionBody.channel_type_code == "esp.companyreg_cloud") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
this.utilsPushSve.business2Channel(pobj, "pushNeedBusiness");
}
}
return result;
......@@ -168,7 +168,7 @@ class UtilsOpNeedService extends AppServiceBase {
},
appInfo: pobj.appInfo
}
this.utilsPushSve.aliBusiness2Delivery(tmpObj, "pushDeliveryStatusNotify");
this.utilsPushSve.business2Channel(tmpObj, "pushDeliveryStatusNotify");
tmpObj.actionBody.orderNo = rtn.data.channelSolutionNo;
pobj.actionBody.orderNo = rtn.data.orderNo;
if (actionBody.status == 11) {
......@@ -176,7 +176,7 @@ class UtilsOpNeedService extends AppServiceBase {
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
self.utilsPushSve.aliBusiness2Fq(tmpObj, "pushOrderICPClose");
self.utilsPushSve.business2Channel(tmpObj, "pushOrderICPClose");
}
}//通知更新状态
return rtn;
......
......@@ -77,7 +77,7 @@ class UtilsOrderService extends AppServiceBase {
fqobj.actionBody.price_desc = opResult.data.product_info.price_item.price_desc;
}
this.execClientNew.execLogs("pushNewFq-3", fqobj, "center-channel-utilsOrderSve-pushNewFqByChannelOrderNo-pushBusInfo", "pushOrder", null);
this.utilsPushSve.aliBusiness2Fq(fqobj, "pushOrderBusiness");
this.utilsPushSve.business2Channel(fqobj, "pushOrderBusiness");
}
}
......@@ -902,7 +902,7 @@ class UtilsOrderService extends AppServiceBase {
pobj.actionType = "updateStausByRefundOrder";
var url = settings.centerOrderUrl() + "action/icapi/springBoard";
await this.execClient.execPost(pobj, url);
this.utilsPushSve.aliBusiness2Fq(pobj, "pushRefundIC");
this.utilsPushSve.business2Channel(pobj, "pushRefundIC");
return system.getResultSuccess();
} catch (e) {
return system.getResultFail(-200, e.stack);
......@@ -1245,7 +1245,7 @@ class UtilsOrderService extends AppServiceBase {
throw new Error('推送失败')
}
pobj.actionBody = pushRet.data;
this.utilsPushSve.aliBusiness2Delivery(pobj, "pushDeliveryOrder");
this.utilsPushSve.business2Channel(pobj, "pushDeliveryOrder");
}
//订单状态 已接单 目前360在用
......
const system = require("../../../system");
var settings = require("../../../../config/settings");
const querystring = require('querystring');
const settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//不要在此类中增加新的方法
class UtilsPushService extends AppServiceBase {
constructor() {
super();
};
async aliBusiness2Delivery(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
async business2Channel(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用,适用所有渠道推送
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
let reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
let 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/aliBusiness2Delivery",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: opType + "推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async business2Channel(pobj, opType) {//供业务调用,在代码中调用,不在db中做配置进行调用
console.log("business2Channel++++++++start++++++++++");
console.log(pobj, "business2Channel++++++++++++++++++");
pobj.actionType = "getAppInterface";
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/business2Channel",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: opType + "推送获取的接口信息->business2Channel",
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async aliBusiness2Fq(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;
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();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
async business2Fq(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;
//日志记录
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/business2Fq",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: pobj.opType + "推送蜂擎获取的接口信息->business2Fq",
});
if (pobj.interface_info) {
this.execClientNew.execLogs(`${pobj.opType}推送蜂擎获取的接口信息->business2Channel->app(getAppInterface)`, pobj, "center-channel-utilsPushSve-business2Channel", productItemInterfaceResult.data, null);
if (pobj.interface_info && pobj.interface_info.length > 0) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
......@@ -97,7 +29,7 @@ class UtilsPushService extends AppServiceBase {
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 + "】的推送配置");
}
......@@ -133,8 +65,7 @@ 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(`pobj=${JSON.stringify(pobj)},interface_info=${JSON.stringify(interface_info)}`, `reflexAction.......opType=${opType}`);
var refResult = null;
pobj.interface_info = interface_info;
pobj.opType = opType;
......@@ -179,56 +110,6 @@ class UtilsPushService extends AppServiceBase {
}
}
//---------百度---zhuangbing--2020.10.28------start--------------------------------------------
async baiduBusiness2Fq(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;
//日志记录
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/baiduBusiness2Fq",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: pobj.opType + "推送蜂擎获取的接口信息->baiduBusiness2Fq",
pobj: pobj
});
if (pobj.interface_info) {
var pushBusInfo = await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess(pushBusInfo);
}
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(productItemInterfaceResult);
//日志记录
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/baiduBusiness2Delivery",
content: JSON.stringify(pobj),
resultInfo: productItemInterfaceResult.data ? JSON.stringify(productItemInterfaceResult.data) : "接口数据为空",
optitle: opType + "推送蜂擎获取的接口信息->baiduBusiness2Delivery",
pobj: pobj
});
if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess();
}
return system.getResult(null, "push Fail,interface_info data is empty");
}
//---------百度---zhuangbing--2020.10.28------end--------------------------------------------
}
module.exports = UtilsPushService;
......@@ -102,7 +102,7 @@ class utils360Sve extends AppServiceBase {
appInfo: pobj.appInfo
}
// 还需要推送fq 需要提醒会计。目前没有
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "submitService");
this.utilsPushSve.business2Channel(deliveryObj, "submitService");
return system.getResultSuccess({orderNo:pobj.actionBody.orderNo});
}
......@@ -160,7 +160,7 @@ class utils360Sve extends AppServiceBase {
deliveryObj.actionBody.serviceStartTime = actionBody.serviceStartTime,
deliveryObj.actionBody.serviceEndTime = actionBody.serviceEndTime
}
this.utilsPushSve.aliBusiness2Delivery(deliveryObj, "notifyService");
this.utilsPushSve.business2Channel(deliveryObj, "notifyService");
return system.getResultSuccess();
}
......
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