Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppMonitorSubscriber
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
Nongyingchen
AppMonitorSubscriber
Commits
fba09362
Commit
fba09362
authored
May 21, 2019
by
trace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加越南/菲律宾贷超数据
parent
0a4e5af8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
play.js
+23
-10
No files found.
play.js
View file @
fba09362
...
@@ -10,7 +10,12 @@ log(`当前奔跑在:${username}`)
...
@@ -10,7 +10,12 @@ log(`当前奔跑在:${username}`)
let
ding
=
'https://oapi.dingtalk.com/robot/send?access_token='
let
ding
=
'https://oapi.dingtalk.com/robot/send?access_token='
let
debugDingding
=
`
${
ding
}
bf03c69128b771107b8715911b8a76db61a55cbd8b00e1a2c955578c2a3da719`
let
debugDingding
=
`
${
ding
}
bf03c69128b771107b8715911b8a76db61a55cbd8b00e1a2c955578c2a3da719`
let
notifyDingding
=
`
${
ding
}
61403ec65efd7a9e40cb6d490e1bfab8aff28800696918a23ec4dffdf5aa1315`
let
notifyDingding
=
`
${
ding
}
61403ec65efd7a9e40cb6d490e1bfab8aff28800696918a23ec4dffdf5aa1315`
let
daichao
=
`http://admin.uuang.co.id/admin/loan/listactive?current=0&size=10000&descs%5B0%5D=priority&packageId=10002`
let
daichao
=
`admin/loan/listactive?current=0&size=10000&descs%5B0%5D=priority&packageId=10002`
let
daichaoRegion
=
[
'http://admin.uuang.co.id/'
,
'http://admin.ph.g-cashing.com/'
,
'http://admin.a.vaylaco.com/'
]
// Config ------------------------------------------------------------
// Config ------------------------------------------------------------
let
sec
=
1000
;
let
sec
=
1000
;
...
@@ -211,7 +216,11 @@ function generateDailyOnlineReport() {
...
@@ -211,7 +216,11 @@ function generateDailyOnlineReport() {
}
}
async
function
getDaichao
()
{
async
function
getDaichao
()
{
await
getPromiss
(
daichao
)
for
(
index
in
daichaoRegion
)
{
let
region
=
daichaoRegion
[
index
]
daichaoApiUrl
=
region
+
daichao
log
(
` 贷超 url:
${
daichaoApiUrl
}
`
)
await
getPromiss
(
daichaoApiUrl
)
.
then
(
val
=>
{
.
then
(
val
=>
{
try
{
try
{
daichaoData
=
JSON
.
parse
(
val
&&
val
.
body
&&
val
.
body
||
"{}"
).
data
daichaoData
=
JSON
.
parse
(
val
&&
val
.
body
&&
val
.
body
||
"{}"
).
data
...
@@ -220,28 +229,32 @@ async function getDaichao() {
...
@@ -220,28 +229,32 @@ async function getDaichao() {
errorLog
.
push
(
errMsg
)
errorLog
.
push
(
errMsg
)
return
return
}
}
log
(
`
${
region
}
贷超获取到
${
daichaoData
.
length
}
个数据`
)
d
aichaoApps
=
daichaoData
&&
daichaoData
.
map
(
app
=>
app
.
packageName
)
||
[]
thisD
aichaoApps
=
daichaoData
&&
daichaoData
.
map
(
app
=>
app
.
packageName
)
||
[]
for
(
index
in
(
daichaoData
&&
daichaoData
||
[]))
{
for
(
index
in
(
daichaoData
&&
daichaoData
||
[]))
{
let
app
=
daichaoData
[
index
]
let
app
=
daichaoData
[
index
]
daichaoAppInfoes
[
app
.
packageName
]
=
{
daichaoAppInfoes
[
app
.
packageName
]
=
{
name
:
app
.
name
,
name
:
app
.
name
,
daichaoId
:
app
.
id
daichaoId
:
app
.
id
,
mgt
:
`
${
region
}
#/loan/`
}
}
}
}
if
(
isTest
())
{
if
(
isTest
())
{
daichaoApps
=
d
aichaoApps
.
slice
(
0
,
1
)
thisDaichaoApps
=
thisD
aichaoApps
.
slice
(
0
,
1
)
}
}
log
(
`代超数据:
${
daichaoApps
.
length
}
个`
)
log
(
`
${
region
}
代超数据:
${
thisDaichaoApps
.
length
}
个`
)
daichaoApps
=
[...
daichaoApps
,
...
thisDaichaoApps
]
monitorNames
[
"daichao"
]
=
daichaoApps
monitorNames
[
"daichao"
]
=
daichaoApps
if
(
daichaoApps
.
length
==
0
)
{
if
(
daichaoApps
.
length
==
0
)
{
log
(
'代超数据为空'
)
log
(
`目前总共贷超数据为空`
)
}
}
log
(
`目前总共贷超数据:
${
daichaoApps
.
length
}
`
)
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
errorLog
.
push
(
`贷超获取失败:
${
err
.
toString
()}
`
)
errorLog
.
push
(
`贷超获取失败:
${
err
.
toString
()}
`
)
return
return
})
})
}
}
}
// async function getDaichao(url) {
// async function getDaichao(url) {
...
@@ -514,7 +527,7 @@ function genMail() {
...
@@ -514,7 +527,7 @@ function genMail() {
let
lastLoopDate
=
status
[
'lastLoopDate'
]
&&
new
Date
(
status
[
'lastLoopDate'
])
||
new
Date
()
let
lastLoopDate
=
status
[
'lastLoopDate'
]
&&
new
Date
(
status
[
'lastLoopDate'
])
||
new
Date
()
let
loopInterval
=
(
new
Date
()).
getHours
()
-
lastLoopDate
.
getHours
()
let
loopInterval
=
(
new
Date
()).
getHours
()
-
lastLoopDate
.
getHours
()
let
lastGenerate
=
`<br/><br/><br/>上次循环时间
${
lastLoopDate
.
toLocaleString
()}
, 间隔:
${
loopInterval
}
小时`
let
lastGenerate
=
`<br/><br/><br/>上次循环时间
${
lastLoopDate
.
toLocaleString
()}
, 间隔:
${
loopInterval
}
小时`
status
[
'lastLoopDate'
]
=
Date
()
if
(
!
isFirstRun
if
(
!
isFirstRun
&&
!
needSendList
&&
!
needSendList
&&
newOffline
.
length
==
0
&&
newOffline
.
length
==
0
...
@@ -664,7 +677,7 @@ function genMail() {
...
@@ -664,7 +677,7 @@ function genMail() {
function
isOurs
(
name
,
countOurs
)
{
function
isOurs
(
name
,
countOurs
)
{
if
(
daichaoApps
.
includes
(
name
))
{
if
(
daichaoApps
.
includes
(
name
))
{
return
`<a href="
http://admin.uuang.co.id/#/loan/
${
daichaoAppInfoes
[
name
]
&&
return
`<a href="
${
daichaoAppInfoes
[
name
].
mgt
}
${
daichaoAppInfoes
[
name
]
&&
daichaoAppInfoes
[
name
].
daichaoId
||
''
}
">🏦(贷超 [
${
daichaoAppInfoes
[
name
].
daichaoId
}
] _ <
${
daichaoAppInfoes
[
name
].
name
}
>(->MGT)) | </a>`
daichaoAppInfoes
[
name
].
daichaoId
||
''
}
">🏦(贷超 [
${
daichaoAppInfoes
[
name
].
daichaoId
}
] _ <
${
daichaoAppInfoes
[
name
].
name
}
>(->MGT)) | </a>`
}
}
if
(
ourAppIds
.
includes
(
name
))
{
if
(
ourAppIds
.
includes
(
name
))
{
...
...
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