Commit bff0bc50 by 任晓松

Merge remote-tracking branch 'origin/center-channel' into center-channel

parents aa149257 2a2a6471
...@@ -110,6 +110,11 @@ class Need extends APIBase { ...@@ -110,6 +110,11 @@ class Need extends APIBase {
case "icpOrderClose"://关闭ICP订单 case "icpOrderClose"://关闭ICP订单
opResult = await this.utilsNeedSve.icpOrderClose(pobj, pobj.actionBody); opResult = await this.utilsNeedSve.icpOrderClose(pobj, pobj.actionBody);
break; break;
case "getSolutionByChannelOrderNo"://根据渠道订单获取方案信息
opResult = await this.utilsNeedSve.getSolutionByChannelOrderNo(pobj, pobj.actionBody);
// opResult = await this.utilsNeedSve.getItemByChannelSolutionNo(pobj, pobj.actionBody);
// break;
break;
//-----------接入百度ICP------end---------------------------------- //-----------接入百度ICP------end----------------------------------
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
......
...@@ -7,6 +7,7 @@ class GatewaypushlogService extends ServiceBase { ...@@ -7,6 +7,7 @@ class GatewaypushlogService extends ServiceBase {
constructor() { constructor() {
super("common", ServiceBase.getDaoName(GatewaypushlogService)); super("common", ServiceBase.getDaoName(GatewaypushlogService));
this.execClient = system.getObject("util.execClient"); this.execClient = system.getObject("util.execClient");
this.dingClient = system.getObject("util.dingClient");
} }
async taskAliIcapi() { async taskAliIcapi() {
...@@ -31,6 +32,7 @@ class GatewaypushlogService extends ServiceBase { ...@@ -31,6 +32,7 @@ class GatewaypushlogService extends ServiceBase {
if (data.success) { if (data.success) {
icloginfo.pushStatus = "yts"; icloginfo.pushStatus = "yts";
} else { } else {
this.dingClient.gatewayPushError(data)
icloginfo.pushtimes += 1; icloginfo.pushtimes += 1;
} }
await this.update(icloginfo); await this.update(icloginfo);
...@@ -39,6 +41,7 @@ class GatewaypushlogService extends ServiceBase { ...@@ -39,6 +41,7 @@ class GatewaypushlogService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} catch (error) { } catch (error) {
this.dingClient.gatewayPushError({message:"Exception"})
return system.getResultFail(-1,error); return system.getResultFail(-1,error);
} }
} }
......
...@@ -201,6 +201,19 @@ class UtilsNeedService extends AppServiceBase { ...@@ -201,6 +201,19 @@ class UtilsNeedService extends AppServiceBase {
var itemResult = await this.restPostUrl(pobj, reqUrl); var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult; return itemResult;
} }
/**
* 获取方案详情
* @param {*} pobj
* @param {*} actionBody bizId 渠道方案号
*/
async getSolutionByChannelOrderNo(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,100390");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
/** /**
* 关闭需求 * 关闭需求
* @param {*} pobj * @param {*} pobj
...@@ -1438,15 +1451,16 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1438,15 +1451,16 @@ class UtilsNeedService extends AppServiceBase {
} }
//关闭icp订单 //关闭icp订单
async icpOrderClose(pobj) { async icpOrderClose(pobj) {
var actionBody = pobj; var actionBody = pobj.actionBody;
var self = this; var self = this;
var url = settings.centerOrderUrl() + "action/qcapi/springBoard"; var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var rtn = await this.restPostUrl(pobj, url); var rtn = await this.restPostUrl(pobj, url);
if (rtn.status == 0 && rtn.data) { if (rtn.status == 0 && rtn.data) {
pobj.actionBody.orderNo = rtn.data.orderNo; pobj.actionBody.orderNo = rtn.data.orderNo;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj); pobj.actionType="delOrder";
var orderrtn = await self.utilsOrderSve.delOrder(pobj, actionBody);
if (orderrtn.status < 0) { if (orderrtn.status < 0) {
// return system.getResultFail(-5022, "订单关闭失败"); return system.getResultFail(-5022, "订单关闭失败");
} }
var tmpObj = { var tmpObj = {
actionBody: { actionBody: {
......
const system = require("../system");
class dingClient {
constructor() {
this.execClient = system.getObject('util.execClient');
this.gatewayurl = "https://oapi.dingtalk.com/robot/send?access_token=2f1ada261ea84f6c621db487ac18d11eba8984202bd82adda8810770a8240572"
}
//推送峰擎异常提醒
async gatewayPushError(err) {
let c = `注意提醒:阿里->推送峰擎异常,老板们加油,加油,加油 !!!${JSON.stringify(err)}`
let t = new Date().toLocaleString()
this.execClient.execPost({
"msgtype": "text",
"text": {"content": t + c}
}, this.gatewayurl).catch(alierr=>{
console.log(alierr)
});
}
}
module.exports = dingClient;
...@@ -19,6 +19,7 @@ module.exports = { ...@@ -19,6 +19,7 @@ module.exports = {
"putUserPwdByMobile", "icpNotifyNew" "putUserPwdByMobile", "icpNotifyNew"
], ],
apiMustUserpinList: [ apiMustUserpinList: [
"icpOrderClose",
"submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme","serviceProviderSubmitMaterial","abolishIcpProgramme", "submitNeed", "paySuccess", "icpNotify", "getLoginInfo", "icpNotifyNew", "submitIcpProgramme","serviceProviderSubmitMaterial","abolishIcpProgramme",
"submitService","serviceProviderNotification", "submitService","serviceProviderNotification",
"ncServiceSubmitOption", "ncSubmitSolution", "ncCloseNeed", "ncWriteCommunicationRecord", "ncGetCommunicationRecord", "rtServiceSubmitOption", "rtSubmitSolution", "ncServiceSubmitOption", "ncSubmitSolution", "ncCloseNeed", "ncWriteCommunicationRecord", "ncGetCommunicationRecord", "rtServiceSubmitOption", "rtSubmitSolution",
......
...@@ -121,7 +121,7 @@ var settings = { ...@@ -121,7 +121,7 @@ var settings = {
if (this.env == "dev") { if (this.env == "dev") {
return "http://centerTmtransactioon.apps.com:4006/"; return "http://centerTmtransactioon.apps.com:4006/";
} else { } else {
return "http://center-app-service/"; return "http://center-tmtransaction-service/";
} }
}, },
zzzdUrl: function () { zzzdUrl: function () {
......
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