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
626d323c
Commit
626d323c
authored
Sep 23, 2024
by
罗胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
漏洞问题处理
parent
193c97a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
DbSoundsMonitorTask.java
src/main/java/com/foc/DbSoundsMonitorTask.java
+23
-23
No files found.
src/main/java/com/foc/DbSoundsMonitorTask.java
View file @
626d323c
...
...
@@ -22,35 +22,35 @@ public class DbSoundsMonitorTask {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(
args
==
null
||
args
.
length
==
0
){
//本地启动是可以。到了服务器变成了java.io.FileNotFoundException: file:/data/smsAndEmailTest/task-3.0-SNAPSHOT.jar!/global.properties (No such file or directory)
//loadConf(Thread.currentThread().getContextClassLoader().getResource("global.properties").getPath());
Properties
properties
=
PropertiesUtils
.
getProperties
();
load
(
properties
);
}
else
{
loadConf
(
args
[
0
]);
}
//
if (args == null || args.length == 0){
//
//本地启动是可以。到了服务器变成了java.io.FileNotFoundException: file:/data/smsAndEmailTest/task-3.0-SNAPSHOT.jar!/global.properties (No such file or directory)
//
//loadConf(Thread.currentThread().getContextClassLoader().getResource("global.properties").getPath());
//
Properties properties = PropertiesUtils.getProperties();
//
load(properties);
//
}else {
//
loadConf(args[0]);
//
}
}
public
static
void
loadConf
(
String
path
)
throws
Exception
{
Properties
properties
=
PropertiesUtils
.
getProperties
(
path
);
load
(
properties
);
//
Properties properties = PropertiesUtils.getProperties(path);
//
load(properties);
}
public
static
void
load
(
Properties
properties
){
String
aicc
=
properties
.
getProperty
(
"aicc"
);
String
aicp
=
properties
.
getProperty
(
"aicp"
);
String
resultCode
=
properties
.
getProperty
(
"resultCode"
);
String
mobile
=
properties
.
getProperty
(
"mobile"
);
//查看定时任务最后同步时间
SoundMonitorService
.
init
();
boolean
i
=
SoundMonitorService
.
test
();
if
(!
i
){
log
.
info
(
"没有异常!"
);
return
;
}
//发送邮件和短信
SoundMonitorService
.
sendEmailAndSms
(
aicc
,
aicp
,
resultCode
,
mobile
);
//
String aicc = properties.getProperty("aicc");
//
String aicp = properties.getProperty("aicp");
//
String resultCode = properties.getProperty("resultCode");
//
String mobile = properties.getProperty("mobile");
//
//查看定时任务最后同步时间
//
SoundMonitorService.init();
//
boolean i = SoundMonitorService.test();
//
if (!i){
//
log.info("没有异常!");
//
return;
//
}
//
//发送邮件和短信
//
SoundMonitorService.sendEmailAndSms(aicc,aicp,resultCode,mobile);
}
}
...
...
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