Commit 16cf47e3 by 兰国旗

closedNeedAndAddPathUrl

parent 63598c4a
...@@ -41,7 +41,7 @@ class Need2 extends APIBase { ...@@ -41,7 +41,7 @@ class Need2 extends APIBase {
opResult = await this.utilsNeedSve.needClose(pobj, pobj.actionBody); opResult = await this.utilsNeedSve.needClose(pobj, pobj.actionBody);
break; break;
case "needCloseIcp"://关闭需求 case "needCloseIcp"://关闭需求
opResult = await this.utilsNeedSve.needCloseIcp(pobj, pobj.actionBody); opResult = await this.utilsNeedSve2.needCloseIcp(pobj, pobj.actionBody);
break; break;
case "needDetailByChannelNo": case "needDetailByChannelNo":
opResult = await this.utilsNeedSve.needDetailByChannelNo(pobj, pobj.actionBody); opResult = await this.utilsNeedSve.needDetailByChannelNo(pobj, pobj.actionBody);
......
...@@ -230,17 +230,30 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -230,17 +230,30 @@ class BaseCenterOrderService extends AppServiceBase {
console.log("pushRes++++",pushRes) console.log("pushRes++++",pushRes)
if (pushRes && pushRes.status == 0 && pushRes.data) { if (pushRes && pushRes.status == 0 && pushRes.data) {
var resData = pushRes.data; var resData = pushRes.data;
if (resData.result) { if (resData.planId) {
var reqObj2 = { var reqObj2 = {
actionType: "receiveProgrammeNo", actionType: "receiveProgrammeNo",
appInfo: appInfo, appInfo: appInfo,
actionBody: { actionBody: {
solutionNo: solutionNo, solutionNo: solutionNo,
solutionBizId: resData.result solutionBizId: resData.planId
} }
}; };
var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id var a = await self.reqCenterOrderApi(reqObj2);//保存渠道方案id
return pushRes; console.log("保存渠道方案id aaaa++ ",a)
if (a && a.status == 0 && resData.path) {
var reqObj3 = {
actionType: "receiveIcpConfirmUrl",
appInfo: appInfo,
actionBody: {
solutionNo: solutionNo,
confirmUrl: resData.path
}
};
var url = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
console.log('save confirmUrl ++ ',url)
return pushRes;
}
} }
} }
} }
......
...@@ -259,16 +259,19 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -259,16 +259,19 @@ class UtilsNeedService2 extends AppServiceBase {
* @param {*} actionBody * @param {*} actionBody
*/ */
async needCloseIcp(pobj, actionBody) { async needCloseIcp(pobj, actionBody) {
if (!actionBody.channelNeedNo) { console.log('guanbi icp xuqiu pobj+++',pobj)
return system.getResult(null, "actionBody.channelNeedNo can not be empty,100395"); if(actionBody.uapp_id == uappId.ali){
} if (!actionBody.channelNeedNo) {
if (!actionBody.note) { return system.getResult(null, "actionBody.channelNeedNo can not be empty,100395");
return system.getResult(null, "actionBody.note can not be empty,100395"); }
if (!actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100395");
}
} }
var self = this; var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.channelNeedNo; pobj.actionBody.intentionBizId = pobj.actionBody.channelNeedNo;
pobj.actionType = "abolishIcpProgrammeByNeed" pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard"; var reqUrl = this.centerOrderUrl + "action/baseapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
this.logCtl.info({ this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
...@@ -279,9 +282,10 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -279,9 +282,10 @@ class UtilsNeedService2 extends AppServiceBase {
resultInfo: JSON.stringify(result), resultInfo: JSON.stringify(result),
optitle: "abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery", optitle: "abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery",
}); });
console.log('result close',result)
if (result.status == 0) { if (result.status == 0) {
if (result.data) { if (result.data && result.data.orderNo ) {
pobj.actionBody.orderNo = result.data; pobj.actionBody.orderNo = result.data.orderNo;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody); var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) { if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败"); return system.getResultFail(-5022, "订单关闭失败");
...@@ -308,9 +312,15 @@ class UtilsNeedService2 extends AppServiceBase { ...@@ -308,9 +312,15 @@ class UtilsNeedService2 extends AppServiceBase {
resultInfo: "", resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery", optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
}); });
// 推送ali // 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" }); if(result.data.uapp_id == uappId.ali){
console.log(a); var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" });
}
// 推送baidu
if(result.data.uapp_id == uappId.baidu){
var a = await self.baiduclient.baiduReqbyget({ path : "/api/bla/provider/requirement/update", reqbody : { requirementId : actionBody.channelNeedNo, status: "CLOSED" ,note: actionBody.note }});
}
console.log("closed need a+++",a);
self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed"); self.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseICPNeed");
return system.getResultSuccess(); return system.getResultSuccess();
} else { } else {
......
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