Commit 66a22ecf by 王栋源

wdy

parents d18ea784 82a716ca
...@@ -8,6 +8,7 @@ class CenterorderService { ...@@ -8,6 +8,7 @@ class CenterorderService {
this.aliclient = system.getObject("util.aliyunClient"); this.aliclient = system.getObject("util.aliyunClient");
this.cacheManager = system.getObject("db.common.cacheManager"); this.cacheManager = system.getObject("db.common.cacheManager");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve"); this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsPushSve = system.getObject("service.utilsSve.utilsPushSve");
}; };
//调用center-order //调用center-order
async reqCenterOrderApi(pobj, reqUrl) { async reqCenterOrderApi(pobj, reqUrl) {
...@@ -130,21 +131,19 @@ class CenterorderService { ...@@ -130,21 +131,19 @@ class CenterorderService {
// } // }
pobj.actionBody.totalSum = pobj.actionBody.orderPrice; pobj.actionBody.totalSum = pobj.actionBody.orderPrice;
pobj.actionBody.payTotalSum = pobj.actionBody.orderPrice; pobj.actionBody.payTotalSum = pobj.actionBody.orderPrice;
pobj.actionBody.quantity=1; pobj.actionBody.quantity = 1;
pobj.actionBody.channelOrder = { pobj.actionBody.channelOrder = {
channelServiceNo: pobj.actionBody.orderNo, channelServiceNo: pobj.actionBody.orderNo,
channelOrderNo: pobj.actionBody.orderNo, channelOrderNo: pobj.actionBody.orderNo,
orderStatus: 2 orderStatus: 2
} }
var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody); var orderrtn = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
if (orderrtn.status != 0) {
if (orderrtn.status != 0) {
return system.getResultFail(-5012, "订单创建失败"); return system.getResultFail(-5012, "订单创建失败");
} }
if(orderrtn.data){ if (orderrtn.data) {
pobj.actionBody.orderNo=orderrtn.data.orderNo pobj.actionBody.orderNo = orderrtn.data.orderNo
} }
if (pobj.actionBody.solutionBizId) { if (pobj.actionBody.solutionBizId) {
pobj.actionType = "receiveSolutionPayInfo"; pobj.actionType = "receiveSolutionPayInfo";
} else { } else {
...@@ -159,9 +158,12 @@ class CenterorderService { ...@@ -159,9 +158,12 @@ class CenterorderService {
if (solutiondata.status != 0) { if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败"); return system.getResultFail(-5011, "方案查询失败");
} }
if (solutiondata.data&&solutiondata.data.channelNeedNo) { if (solutiondata.data && solutiondata.data.channelNeedNo) {
pobj.actionBody.needId = solutiondata.data.channelNeedNo; pobj.actionBody.needId = solutiondata.data.channelNeedNo;
} }
if (solutiondata.status == 0) {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushOrderBusiness");
}
return system.getResultSuccess(); return system.getResultSuccess();
} }
} }
......
...@@ -45,7 +45,7 @@ class UtilsFqAliyunSve extends AppServiceBase { ...@@ -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); 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) { if (!pobj.interface_params) {
return ""; return "";
} }
......
...@@ -21,11 +21,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -21,11 +21,7 @@ class UtilsNeedSve extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) { if (result.status == 0) {
pobj.actionType = "getAppInterface"; this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
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);
} }
return result; return result;
} }
...@@ -52,7 +48,10 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -52,7 +48,10 @@ class UtilsNeedSve extends AppServiceBase {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100380"); return system.getResult(null, "actionBody.intentionBizId can not be empty,100380");
} }
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; 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; module.exports = UtilsNeedSve;
......
...@@ -7,6 +7,15 @@ class UtilsPushService extends AppServiceBase { ...@@ -7,6 +7,15 @@ class UtilsPushService extends AppServiceBase {
super(); super();
this.pushlogSve = system.getObject("service.common.pushlogSve"); 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) {//推送业务信息 async pushBusInfo(pobj, opType, isDelProductInfo) {//推送业务信息
var interface_list = pobj.actionBody.product_info ? pobj.actionBody.product_info.interface_info : pobj.interface_info; var interface_list = pobj.actionBody.product_info ? pobj.actionBody.product_info.interface_info : pobj.interface_info;
if (!interface_list) { 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