Commit 1e5e63bd by 王悦

下单钉钉通知

parent 371a084c
...@@ -8,6 +8,7 @@ var moment = require("moment"); ...@@ -8,6 +8,7 @@ var moment = require("moment");
class TradetransferService extends ServiceBase { class TradetransferService extends ServiceBase {
constructor() { constructor() {
super("transfer", ServiceBase.getDaoName(TradetransferService)); super("transfer", ServiceBase.getDaoName(TradetransferService));
this.dingClient = system.getObject("util.dingClient");
} }
//订单创建 //订单创建
...@@ -90,6 +91,8 @@ class TradetransferService extends ServiceBase { ...@@ -90,6 +91,8 @@ class TradetransferService extends ServiceBase {
} }
var rtn = await this.create(source); var rtn = await this.create(source);
if (rtn) { if (rtn) {
let content = `商标有新订单:注册号【${obj.RegisterNumber}】`;
this.dingClient.tmNotify(content)
return { return {
"status": 0, "status": 0,
"msg": "success", "msg": "success",
...@@ -510,6 +513,25 @@ class TradetransferService extends ServiceBase { ...@@ -510,6 +513,25 @@ class TradetransferService extends ServiceBase {
return await self.aliclient(gobj); return await self.aliclient(gobj);
} }
/**
* 买家状态 BuyerStatus
0:"预付款已支付"
1:"用户已取消订单"
2:"服务商已确认订单"
3:"合作方拒绝订单"
10:"合作方已提交转让文件"
11:"用户已支付尾款,已确认资料"
20:"合作方已邮寄转让文件,用户待接收"
21:"用户已邮寄转让资料"
22:"阿里云资料已收到"
23:"审核资料"
30:"递交到商标局"
31:"商标局已接收"
32:"转让失败"
33:"转让成功"
40:"交易成功"
41:"交易失败"
*/
async uppaymentstatus() { async uppaymentstatus() {
var selsql = "select * from trade_transfer where transfer_status='PROVIDE_MATERIAL' or transfer_status='BUYER_EXPRESS'"; var selsql = "select * from trade_transfer where transfer_status='PROVIDE_MATERIAL' or transfer_status='BUYER_EXPRESS'";
var transferinfos = await this.dao.customQuery(selsql); var transferinfos = await this.dao.customQuery(selsql);
......
const system = require("../system");
class dingClient {
constructor() {
this.execClient = system.getObject('util.execClient');
this.dingurl = "https://oapi.dingtalk.com/robot/send?access_token=ff86b791b66e41380a5e2f108ed95024fcc37002093f97d3ffa8c4df1f336f1a"
}
//推送订单提醒
async tmNotify(content) {
let t = new Date().toLocaleString()
var rtn = await this.execClient.execPost({
"msgtype": "text",
"text": {"content": t + content},
}, this.dingurl);
console.log(rtn)
return rtn
}
}
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