Commit 91fd7d14 by 庄冰

calback

parent 2d2e7c32
...@@ -614,6 +614,7 @@ class CenterorderService extends AppServiceBase { ...@@ -614,6 +614,7 @@ class CenterorderService extends AppServiceBase {
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
} }
var baiduPushRes = await this.utilsPushSve.baiduBusiness2Fq(fqobj, "pushOrderICPBusinessNew");
var deliveryObj = { var deliveryObj = {
actionBody: { actionBody: {
orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo, orderNo: orderrtn.data.orderNo,//pobj.actionBody.channelOrder.channelOrderNo,
...@@ -627,9 +628,35 @@ class CenterorderService extends AppServiceBase { ...@@ -627,9 +628,35 @@ class CenterorderService extends AppServiceBase {
} }
}, },
appInfo: pobj.appInfo appInfo: pobj.appInfo
};
if(pobj.actionBody.isDirectBuy && pobj.actionBody.isDirectBuy==1){//直接下单需执行添加订单业务员操作
if(baiduPushRes && baiduPushRes.status==0){
if(baiduPushRes.data && baiduPushRes.data.data){
var resData = baiduPushRes.data.data;
var salesmanInfo = {
salesmanName:resData.orderList && resData.orderList.length>0?resData.orderList[0].operatorName:"",
salesmanChannelId:resData.orderList && resData.orderList.length>0?resData.orderList[0].operator:"",
};
var salesmanObj={
appInfo:pobj.appInfo,
actionType:"addIcpSalesmanInfo",//添加业务员信息
actionBody:{salesmanInfo:salesmanInfo,orderNo:orderrtn.data.orderNo}
};
var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var addRes = await this.execClient.execPost(salesmanObj, url);
if (addRes && addRes.stdout) {
var salesmanRes = JSON.parse(addRes.stdout);
if (salesmanRes.status == 0) {
deliveryObj.needsolution = salesmanRes.data;
await this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
}
}
}
}
}else{
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
} }
this.utilsPushSve.baiduBusiness2Fq(fqobj, "pushOrderICPBusinessNew");
this.utilsPushSve.baiduBusiness2Delivery(deliveryObj, "pushDeliveryOrder");
return system.getResultSuccess(); return system.getResultSuccess();
} }
} }
......
...@@ -87,7 +87,7 @@ class UtilsFqAliyunService extends AppServiceBase { ...@@ -87,7 +87,7 @@ class UtilsFqAliyunService extends AppServiceBase {
if (rtn.code != 200 && rtn.success != true) { if (rtn.code != 200 && rtn.success != true) {
return system.getResult(null, "推送失败,失败原因:" + rtn.errorMsg + ",selfrequestId=" + pobj.requestId + ",requestId=" + rtn.requestId); return system.getResult(null, "推送失败,失败原因:" + rtn.errorMsg + ",selfrequestId=" + pobj.requestId + ",requestId=" + rtn.requestId);
} }
return system.getResultSuccess(null, "推送成功"); return system.getResultSuccess(rtn.data, "推送成功");
} catch (e) { } catch (e) {
//日志记录 //日志记录
this.logCtl.error({ this.logCtl.error({
......
...@@ -63,10 +63,17 @@ class UtilsPushService extends AppServiceBase { ...@@ -63,10 +63,17 @@ class UtilsPushService extends AppServiceBase {
return system.getResult(null, "暂无【" + opType + "】的推送配置"); return system.getResult(null, "暂无【" + opType + "】的推送配置");
} }
var self = this; var self = this;
for (let index = 0; index < interface_list_temp.length; index++) { if(interface_list_temp && interface_list_temp.length==1){
const element = interface_list_temp[index]; const element = interface_list_temp[0];
await self.reflexAction(element, opType, pobj, isDelProductInfo); var reflexActionRes = await self.reflexAction(element, opType, pobj, isDelProductInfo);
return reflexActionRes;
}else{
for (let index = 0; index < interface_list_temp.length; index++) {
const element = interface_list_temp[index];
await self.reflexAction(element, opType, pobj, isDelProductInfo);
}
} }
} }
async againPushBusInfo(pobj) {//再次推送业务总入口-重试 async againPushBusInfo(pobj) {//再次推送业务总入口-重试
...@@ -97,7 +104,8 @@ class UtilsPushService extends AppServiceBase { ...@@ -97,7 +104,8 @@ class UtilsPushService extends AppServiceBase {
} }
pobj.interface_params = interface_info.params; pobj.interface_params = interface_info.params;
var params = [pobj]; var params = [pobj];
invokeObj[interface_info.method_name].apply(invokeObj, params); 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; var actionBody = pobj.actionBody;
...@@ -142,8 +150,8 @@ class UtilsPushService extends AppServiceBase { ...@@ -142,8 +150,8 @@ class UtilsPushService extends AppServiceBase {
optitle: pobj.opType + "推送蜂擎获取的接口信息->baiduBusiness2Fq", optitle: pobj.opType + "推送蜂擎获取的接口信息->baiduBusiness2Fq",
}); });
if (pobj.interface_info) { if (pobj.interface_info) {
await this.pushBusInfo(pobj, opType, 1); var pushBusInfo = await this.pushBusInfo(pobj, opType, 1);
return system.getResultSuccess(); return system.getResultSuccess(pushBusInfo);
} }
return system.getResult(null, "push Fail,interface_info data is empty"); return system.getResult(null, "push Fail,interface_info data is empty");
} }
......
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