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
f9514670
Commit
f9514670
authored
Jul 21, 2021
by
王悦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 需求未推送预警
parent
d1fb9d83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
taskexecutor/app/base/db/task/tmtransfer/pushAliTmStatus2Fq.js
+34
-2
taskexecutor/app/base/utils/smsClient.js
+16
-0
No files found.
taskexecutor/app/base/db/task/tmtransfer/pushAliTmStatus2Fq.js
View file @
f9514670
//tag规则 release-v188.19.* 同步fqboss状态到峰擎
//tag规则 release-v188.19.* 同步fqboss状态到峰擎
/检查10分钟未推送的任务并发短信
const
TaskBase
=
require
(
"../../task.base"
);
const
TaskBase
=
require
(
"../../task.base"
);
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
pushAliTmStatus2Fq
extends
TaskBase
{
class
pushAliTmStatus2Fq
extends
TaskBase
{
constructor
()
{
constructor
()
{
super
(
TaskBase
.
getServiceName
(
TmtransferTask
));
super
(
TaskBase
.
getServiceName
(
pushAliTmStatus2Fq
));
this
.
restclient
=
system
.
getObject
(
"util.restClient"
);
this
.
restclient
=
system
.
getObject
(
"util.restClient"
);
this
.
smsClient
=
system
.
getObject
(
"util.smsClient"
);
this
.
fqbossUrl
=
settings
.
fqbossUrl
();
this
.
fqbossUrl
=
settings
.
fqbossUrl
();
this
.
centerchannel
=
"https://gsbweb.qifu-dev.gongsibao.com/"
//settings.centerChannelUrl();
this
.
phone
=
[
"17001277629"
,
"13381139519"
,
"15010929366"
]
//李学超 蒋勇 宋毅
}
}
async
beforeTask
(
params
)
{
async
beforeTask
(
params
)
{
console
.
log
(
"前置操作......"
,
this
.
serviceName
);
console
.
log
(
"前置操作......"
,
this
.
serviceName
);
...
@@ -19,6 +22,32 @@ class pushAliTmStatus2Fq extends TaskBase {
...
@@ -19,6 +22,32 @@ class pushAliTmStatus2Fq extends TaskBase {
try
{
try
{
var
url
=
this
.
fqbossUrl
+
"api/tmInfoPusherApi/collectInfo"
;
var
url
=
this
.
fqbossUrl
+
"api/tmInfoPusherApi/collectInfo"
;
this
.
restclient
.
execGet
(
null
,
url
);
this
.
restclient
.
execGet
(
null
,
url
);
let
now
=
Date
.
now
()
var
needurl
=
this
.
centerchannel
+
"web/action/opNeed/springBoard"
;
this
.
restclient
.
execPost
({
actionType
:
"getNeedComparisonList"
,
actionBody
:{
"start"
:
new
Date
(
now
-
10
*
60
*
1000
),
"end"
:
new
Date
(
now
),
"status"
:
"wts"
,
"listType"
:
"business"
,
"pageNum"
:
1
,
"pageSize"
:
10
,
tag
:
"need"
}
},
needurl
).
then
(
res
=>
{
if
(
res
.
stdout
){
var
data
=
JSON
.
parse
(
res
.
stdout
);
if
(
data
.
data
&&
data
.
data
.
rows
&&
data
.
data
.
total
>
0
){
let
content
=
`⚠️⚠️⚠️️报警⚠️⚠️⚠️️ : ️️10分钟内有
${
data
.
data
.
total
}
条未推送的需求❗️❗️❗️`
this
.
phone
.
forEach
(
phone
=>
{
this
.
smsClient
.
sendMsg
(
phone
,
content
)
})
}
}
}).
catch
(
e
=>
{
console
.
log
(
e
)
})
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -26,4 +55,6 @@ class pushAliTmStatus2Fq extends TaskBase {
...
@@ -26,4 +55,6 @@ class pushAliTmStatus2Fq extends TaskBase {
}
}
}
}
}
}
let
a
=
new
pushAliTmStatus2Fq
()
a
.
subDoTask
()
module
.
exports
=
pushAliTmStatus2Fq
;
module
.
exports
=
pushAliTmStatus2Fq
;
\ No newline at end of file
taskexecutor/app/base/utils/smsClient.js
0 → 100644
View file @
f9514670
const
system
=
require
(
"../system"
);
class
SmsClient
{
constructor
(){
this
.
smsTeml
=
"http://123.57.156.109:4103/api/Send"
;
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
}
async
sendMsg
(
to
,
content
){
var
txtObj
=
{
"appId"
:
8
,
"mobilePhone"
:
to
,
"content"
:
content
}
return
this
.
restClient
.
execPost
(
txtObj
,
this
.
smsTeml
);
}
}
module
.
exports
=
SmsClient
;
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