Commit aa51c37a by 宋毅

增加订单推送状态修改

parent c0cc7f46
const system = require("../system"); const system = require("../system");
class dingClient { class dingClient {
constructor() { constructor() {
this.execClient = system.getObject('util.execClient'); this.execClient = system.getObject('util.execClient');
this.gatewayurl = "https://oapi.dingtalk.com/robot/send?access_token=2f1ada261ea84f6c621db487ac18d11eba8984202bd82adda8810770a8240572" this.gatewayurl = "https://oapi.dingtalk.com/robot/send?access_token=2f1ada261ea84f6c621db487ac18d11eba8984202bd82adda8810770a8240572"
this.businessToFqUrl = "https://oapi.dingtalk.com/robot/send?access_token=9e215f0f1d77980ee6b39e88a82a7c6e5d290775f76d9a8346e97697f8df9788" this.businessToFqUrl = "https://oapi.dingtalk.com/robot/send?access_token=9e215f0f1d77980ee6b39e88a82a7c6e5d290775f76d9a8346e97697f8df9788"
} }
//推送峰擎异常提醒 //推送峰擎异常提醒
async gatewayPushError(err) { async gatewayPushError(err) {
if (process.env.APP_ENV === "prod") { if (process.env.APP_ENV === "prod") {
...@@ -20,7 +22,7 @@ class dingClient { ...@@ -20,7 +22,7 @@ class dingClient {
} }
//渠道钉钉提醒 //渠道钉钉提醒
async gatewayPushByChannel(orderNo,appInfo){ async gatewayPushByChannel(orderNo, appInfo) {
let gatewayUrl = setttings.dingRobotUrl(appInfo.uapp_id); let gatewayUrl = setttings.dingRobotUrl(appInfo.uapp_id);
if (settings.env != "dev" && gatewayUrl) { if (settings.env != "dev" && gatewayUrl) {
let c = `注意提醒:${appInfo.app_name}->有订单待处理,订单号${orderNo},老板们加油,加油,加油 !!!` let c = `注意提醒:${appInfo.app_name}->有订单待处理,订单号${orderNo},老板们加油,加油,加油 !!!`
...@@ -33,16 +35,17 @@ class dingClient { ...@@ -33,16 +35,17 @@ class dingClient {
}); });
} }
} }
//渠道订单到峰擎--sku没有查询到 //渠道订单到峰擎--sku没有查询到
async businessPushFqByChannel(params){ async businessPushFqByChannel(params) {
if (process.env.APP_ENV != "dev") { if (process.env.APP_ENV != "dev") {
let c = `注意提醒:${appInfo.app_name}->有订单待处理,sku为空,参数:${JSON.stringify(params)},老板们加油,加油,加油 !!!` let c = `注意提醒:${appInfo.app_name}->有订单待处理,渠道下sku查询不到,参数:${JSON.stringify(params)},老板们加油,加油,加油 !!!`
let t = new Date().toLocaleString() let t = new Date().toLocaleString()
this.execClient.execPost({ this.execClient.execPost({
"msgtype": "text", "msgtype": "text",
"text": {"content": t + c}, "text": {"content": t + c},
at: { at: {
atMobiles: ["13051727697","13453222948","18201231253"]//孟令强、王斌、郭峰 atMobiles: ["13051727697", "13453222948", "18201231253"]//孟令强、王斌、郭峰
}, },
}, this.businessToFqUrl).catch(err => { }, this.businessToFqUrl).catch(err => {
console.log(err) console.log(err)
...@@ -50,4 +53,5 @@ class dingClient { ...@@ -50,4 +53,5 @@ class dingClient {
} }
} }
} }
module.exports = dingClient; module.exports = dingClient;
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