Commit 82a716ca by 宋毅

tj

parent 44c4d5fd
......@@ -8,6 +8,7 @@ class CenterorderService {
this.aliclient = system.getObject("util.aliyunClient");
this.cacheManager = system.getObject("db.common.cacheManager");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
};
//调用center-order
async reqCenterOrderApi(pobj, reqUrl) {
......@@ -80,7 +81,7 @@ class CenterorderService {
if (!actionBody.phone) {
return system.getResult(null, "phone不能为空");
}
if (pobj.actionBody.companyName) {
if (!actionBody.city) {
return system.getResult(null, "city不能为空");
......@@ -109,10 +110,10 @@ class CenterorderService {
var sobj = {
actionType: "getaliicProduce",
actionBody: pobj.actionBody,
appInfo:pobj.appInfo,
actionProcess:pobj.actionProcess
appInfo: pobj.appInfo,
actionProcess: pobj.actionProcess
}
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
......@@ -122,9 +123,9 @@ class CenterorderService {
if (data.status != 0) {
return system.getResultFail(-5010, "产品查询失败");
}
pobj.actionBody=data.data;
pobj.actionBody = data.data;
// var needNo="";
// if(solutiondata.data){
// needNo=solutiondata.data.channelNeedNo;
// }
......@@ -135,7 +136,7 @@ class CenterorderService {
channelOrderNo: pobj.actionBody.orderNo,
orderStatus: 2
}
var orderrtn=await this.utilsOrderSve.addOrder(pobj,pobj.actionBody);
var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
if (!orderrtn || !orderrtn.stdout) {
return system.getResultFail(-5012, "订单创建失败");
}
......@@ -143,11 +144,11 @@ class CenterorderService {
if (orderdata.status != 0) {
return system.getResultFail(-5012, "订单创建失败");
}
if(pobj.actionBody.solutionBizId){
pobj.actionType="receiveSolutionPayInfo";
}else{
pobj.actionType="createSolutionByOrder";
if (pobj.actionBody.solutionBizId) {
pobj.actionType = "receiveSolutionPayInfo";
} else {
pobj.actionType = "createSolutionByOrder";
}
var url = settings.centerOrderUrl() + "action/icapi/springBoard";
var solutionrtn = await this.execClient.execPost(pobj, url);
......@@ -158,6 +159,9 @@ class CenterorderService {
if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败");
}
if (solutionrtn.status == 0) {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushOrderBusiness");
}
return system.getResultSuccess();
}
}
......
......@@ -45,7 +45,7 @@ class UtilsFqAliyunSve extends AppServiceBase {
var result = this.opAliyunClientPost(pobj, "pushOrderBusiness", interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
}
async pushAliIcNeedBusiness(pobj) {//推送阿里工商需求商机
async pushAliBusiness2Fq(pobj) {//推送阿里工商需求商机
if (!pobj.interface_params) {
return "";
}
......
......@@ -21,11 +21,7 @@ class UtilsNeedSve extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
pobj.actionType = "getAppInterface";
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, url);
pobj.interface_info = productItemInterfaceResult.data;
this.utilsPushSve.pushBusInfo(pobj, "pushNeedBusiness", 1);
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
}
return result;
}
......@@ -52,7 +48,10 @@ class UtilsNeedSve extends AppServiceBase {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
return await this.restPostUrl(pobj, reqUrl);
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseNeed");
}
}
}
module.exports = UtilsNeedSve;
......
......@@ -7,6 +7,15 @@ class UtilsPushService extends AppServiceBase {
super();
this.pushlogSve = system.getObject("service.common.pushlogSve");
};
async aliBusiness2Fq(pobj, opType) {
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
pobj.interface_info = productItemInterfaceResult.data;
this.pushBusInfo(pobj, opType, 1);
}
async pushBusInfo(pobj, opType, isDelProductInfo) {//推送业务信息
var interface_list = pobj.actionBody.product_info ? pobj.actionBody.product_info.interface_info : pobj.interface_info;
if (!interface_list) {
......
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