Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
aa51c37a
Commit
aa51c37a
authored
Mar 19, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加订单推送状态修改
parent
c0cc7f46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
45 deletions
+49
-45
center-channel/app/base/service/app.base.js
+0
-0
center-channel/app/base/utils/dingClient.js
+49
-45
No files found.
center-channel/app/base/service/app.base.js
View file @
aa51c37a
This diff is collapsed.
Click to expand it.
center-channel/app/base/utils/dingClient.js
View file @
aa51c37a
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
)
{
if
(
process
.
env
.
APP_ENV
===
"prod"
)
{
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
)
});
}
}
}
//渠道钉钉
提醒
//推送峰擎异常
提醒
async
gatewayPushByChannel
(
orderNo
,
appInfo
)
{
async
gatewayPushError
(
err
)
{
let
gatewayUrl
=
setttings
.
dingRobotUrl
(
appInfo
.
uapp_id
);
if
(
process
.
env
.
APP_ENV
===
"prod"
)
{
if
(
settings
.
env
!=
"dev"
&&
gatewayUrl
)
{
let
c
=
`注意提醒:阿里->推送峰擎异常,老板们加油,加油,加油 !!!
${
JSON
.
stringify
(
err
)}
`
let
c
=
`注意提醒:
${
appInfo
.
app_name
}
->有订单待处理,订单号
${
orderNo
}
,老板们加油,加油,加油 !!!`
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
}
},
this
.
gatewayurl
).
catch
(
alierr
=>
{
},
gatewayUrl
).
catch
(
err
=>
{
console
.
log
(
alierr
)
console
.
log
(
err
)
});
});
}
}
}
}
//渠道订单到峰擎--sku没有查询到
//渠道钉钉提醒
async
businessPushFqByChannel
(
params
){
async
gatewayPushByChannel
(
orderNo
,
appInfo
)
{
if
(
process
.
env
.
APP_ENV
!=
"dev"
)
{
let
gatewayUrl
=
setttings
.
dingRobotUrl
(
appInfo
.
uapp_id
);
let
c
=
`注意提醒:
${
appInfo
.
app_name
}
->有订单待处理,sku为空,参数:
${
JSON
.
stringify
(
params
)}
,老板们加油,加油,加油 !!!`
if
(
settings
.
env
!=
"dev"
&&
gatewayUrl
)
{
let
t
=
new
Date
().
toLocaleString
()
let
c
=
`注意提醒:
${
appInfo
.
app_name
}
->有订单待处理,订单号
${
orderNo
}
,老板们加油,加油,加油 !!!`
this
.
execClient
.
execPost
({
let
t
=
new
Date
().
toLocaleString
()
"msgtype"
:
"text"
,
this
.
execClient
.
execPost
({
"text"
:
{
"content"
:
t
+
c
},
"msgtype"
:
"text"
,
at
:
{
"text"
:
{
"content"
:
t
+
c
}
atMobiles
:
[
"13051727697"
,
"13453222948"
,
"18201231253"
]
//孟令强、王斌、郭峰
},
gatewayUrl
).
catch
(
err
=>
{
},
console
.
log
(
err
)
},
this
.
businessToFqUrl
).
catch
(
err
=>
{
});
console
.
log
(
err
)
}
});
}
//渠道订单到峰擎--sku没有查询到
async
businessPushFqByChannel
(
params
)
{
if
(
process
.
env
.
APP_ENV
!=
"dev"
)
{
let
c
=
`注意提醒:
${
appInfo
.
app_name
}
->有订单待处理,渠道下sku查询不到,参数:
${
JSON
.
stringify
(
params
)}
,老板们加油,加油,加油 !!!`
let
t
=
new
Date
().
toLocaleString
()
this
.
execClient
.
execPost
({
"msgtype"
:
"text"
,
"text"
:
{
"content"
:
t
+
c
},
at
:
{
atMobiles
:
[
"13051727697"
,
"13453222948"
,
"18201231253"
]
//孟令强、王斌、郭峰
},
},
this
.
businessToFqUrl
).
catch
(
err
=>
{
console
.
log
(
err
)
});
}
}
}
}
}
}
module
.
exports
=
dingClient
;
module
.
exports
=
dingClient
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment