Commit e5126399 by 任晓松

360渠道增加钉钉机器人

parent 251b318a
...@@ -18,6 +18,7 @@ class UtilsOrderService extends AppServiceBase { ...@@ -18,6 +18,7 @@ class UtilsOrderService extends AppServiceBase {
this.centerAppPayUrl = settings.centerAppUrl() + "payment/paymentApi/springBoard"; this.centerAppPayUrl = settings.centerAppUrl() + "payment/paymentApi/springBoard";
this.paySecret = settings.paySecret() this.paySecret = settings.paySecret()
this.utils360Sve = system.getObject("service.utilsSve.utils360Sve"); this.utils360Sve = system.getObject("service.utilsSve.utils360Sve");
this.dingClient = system.getObject("util.dingClient");
}; };
/* /*
* 订单验证 * 订单验证
...@@ -1138,7 +1139,9 @@ class UtilsOrderService extends AppServiceBase { ...@@ -1138,7 +1139,9 @@ class UtilsOrderService extends AppServiceBase {
pobj.pushObj = { pobj.pushObj = {
ApplicationStatus ApplicationStatus
}; };
this.utils360Sve.pushOrderStatus(pobj) this.utils360Sve.pushOrderStatus(pobj);
//钉钉机器人
this.dingClient.gatewayPushByChannel(params.orderNo,pobj.appInfo);
} }
opOrderResult.data = null; opOrderResult.data = null;
return opOrderResult; return opOrderResult;
......
...@@ -17,5 +17,20 @@ class dingClient { ...@@ -17,5 +17,20 @@ class dingClient {
}); });
} }
} }
//渠道钉钉提醒
async gatewayPushByChannel(orderNo,appInfo){
let gatewayUrl = setttings.dingRobotUrl(appInfo.uapp_id);
if (process.env.APP_ENV === "prod" && gatewayUrl) {
let c = `注意提醒:${appInfo.app_name}->有订单待处理,订单号${orderNo},老板们加油,加油,加油 !!!`
let t = new Date().toLocaleString()
this.execClient.execPost({
"msgtype": "text",
"text": {"content": t + c}
}, gatewayUrl).catch(err => {
console.log(err)
});
}
}
} }
module.exports = dingClient; module.exports = dingClient;
...@@ -443,6 +443,12 @@ var settings = { ...@@ -443,6 +443,12 @@ var settings = {
// 2020 1119 lin 正式环境已经给出,鲁班发的ip // 2020 1119 lin 正式环境已经给出,鲁班发的ip
return "http://139.196.159.202:8980/" return "http://139.196.159.202:8980/"
} }
},
dingRobotUrl: function(uapp_id) {
if(uapp_id == 50){//360云商机
return "https://oapi.dingtalk.com/robot/send?access_token=2947bdf6163288a5a5c654640e78ea718d21fcae6601efbb4edd53209abc1c45";
}
return "";
} }
}; };
module.exports = settings; module.exports = settings;
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