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
babec518
Commit
babec518
authored
May 07, 2019
by
zt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
82af8b3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
DbSoundsMonitorTask.java
src/main/java/com/foc/DbSoundsMonitorTask.java
+9
-3
Sms.java
src/main/java/com/foc/service/Sms.java
+0
-9
No files found.
src/main/java/com/foc/DbSoundsMonitorTask.java
View file @
babec518
package
com
.
foc
;
import
com.alibaba.fastjson.JSON
;
import
com.foc.entity.AccessInfo
;
import
com.foc.entity.SmsResult
;
import
com.foc.service.Sms
;
import
com.foc.service.SoundMonitorService
;
...
...
@@ -9,6 +11,7 @@ import lombok.extern.log4j.Log4j;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.Date
;
import
java.util.Properties
;
/**
...
...
@@ -43,9 +46,12 @@ public class DbSoundsMonitorTask {
accessInfo
.
setAicc
(
"5"
);
accessInfo
.
setAicp
(
"10.68.26.52"
);
String
result
=
Sms
.
sendSms
(
accessInfo
,
properties
.
getProperty
(
"mobile"
),
"预警:智能首航录音记录显示异常,请处理。"
);
System
.
out
.
println
(
result
);
log
.
info
(
result
);
SmsResult
rootEntity
=
JSON
.
parseObject
(
result
,
SmsResult
.
class
);
if
(
rootEntity
.
getResult
().
getResultCode
().
equals
(
"1000"
)){
log
.
info
(
"发送成功,Time:"
+
new
Date
()
+
"result:"
+
result
);
}
else
{
log
.
info
(
"发送失败,Time:"
+
new
Date
()
+
"result:"
+
result
);
}
}
else
{
log
.
info
(
"没有异常!"
);
}
...
...
src/main/java/com/foc/service/Sms.java
View file @
babec518
...
...
@@ -37,15 +37,6 @@ public class Sms {
result
=
HttpClientUtils
.
doGet
(
smsUrl
+
"?ai.cp="
+
accessInfo
.
getAicp
()
+
"&ai.cc="
+
accessInfo
.
getAicc
()
+
"&mobile="
+
mobile
+
"&msg="
+
msg
);
SmsResult
rootEntity
=
JSON
.
parseObject
(
result
,
SmsResult
.
class
);
if
(
rootEntity
.
getResult
().
getResultCode
().
equals
(
"1000"
)){
log
.
info
(
"发送成功,Time:"
+
new
Date
()
+
"result:"
+
result
);
}
else
{
log
.
info
(
"发送失败,Time:"
+
new
Date
()
+
"result:"
+
result
);
}
return
result
;
}
...
...
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