Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
task3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
首航-临时账号
task3.0
Commits
d0d8d0d6
Commit
d0d8d0d6
authored
May 06, 2019
by
zt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
2a1b40ca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
19 deletions
+6
-19
DbSoundsMonitorTask.java
src/main/java/com/foc/DbSoundsMonitorTask.java
+2
-0
SoundMonitorService.java
src/main/java/com/foc/service/SoundMonitorService.java
+4
-19
No files found.
src/main/java/com/foc/DbSoundsMonitorTask.java
View file @
d0d8d0d6
...
...
@@ -41,6 +41,8 @@ public class DbSoundsMonitorTask {
Properties
properties
=
PropertiesUtil
.
getProperties
(
path
);
String
result
=
Sms
.
sendSms
(
accessInfo
,
properties
.
getProperty
(
"mobile"
),
"警告"
);
logger
.
info
(
result
);
}
else
{
logger
.
info
(
"没有异常!"
);
}
}
}
src/main/java/com/foc/service/SoundMonitorService.java
View file @
d0d8d0d6
...
...
@@ -49,33 +49,18 @@ public class SoundMonitorService {
String
updateTime
=
maxId
.
getUpdateDate
();
log
.
info
(
"当前系统时间:"
+
new
Date
());
//比较时间,如果相差20分钟没有执行
//计数
int
i
=
0
;
List
<
SoundInfo
>
list
=
soundsMaxIdDao
.
getInfo
(
updateTime
);
for
(
SoundInfo
soundInfo
:
list
){
//成功且没有url的
if
(
soundInfo
.
getResult
().
equals
(
"SUCCESS"
)
&&
StringUtils
.
isEmpty
(
soundInfo
.
getDownloadUrl
()
)
){
i
++;
}
}
if
(
i
!=
0
&&
list
!=
null
){
double
d
=
i
/
list
.
size
();
if
(
d
>
0.8
){
log
.
info
(
"成功率不足80%"
);
log
.
info
(
"{}"
+
soundInfo
.
toString
());
return
1
;
}
}
else
{
}
log
.
info
(
"全部成功"
);
return
2
;
}
return
null
;
}
// public static void main(String[] args) {
// init();
// System.out.println(test());
// }
}
}
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