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
77847dff
Commit
77847dff
authored
Oct 05, 2019
by
zt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
7ebac7b6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletions
+25
-1
DbSoundsMonitorTask.java
src/main/java/com/foc/DbSoundsMonitorTask.java
+2
-0
SoundsMaxIdDao.java
src/main/java/com/foc/dao/SoundsMaxIdDao.java
+8
-0
SoundMonitorService.java
src/main/java/com/foc/service/SoundMonitorService.java
+9
-1
SoundsMaxIdMapper.xml
src/main/resources/mapper/SoundsMaxIdMapper.xml
+6
-0
No files found.
src/main/java/com/foc/DbSoundsMonitorTask.java
View file @
77847dff
...
@@ -20,6 +20,7 @@ public class DbSoundsMonitorTask {
...
@@ -20,6 +20,7 @@ public class DbSoundsMonitorTask {
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DbSoundsMonitorTask
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DbSoundsMonitorTask
.
class
);
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(
args
==
null
||
args
.
length
==
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)
//本地启动是可以。到了服务器变成了java.io.FileNotFoundException: file:/data/smsAndEmailTest/task-3.0-SNAPSHOT.jar!/global.properties (No such file or directory)
...
@@ -51,5 +52,6 @@ public class DbSoundsMonitorTask {
...
@@ -51,5 +52,6 @@ public class DbSoundsMonitorTask {
//发送邮件和短信
//发送邮件和短信
SoundMonitorService
.
sendEmailAndSms
(
aicc
,
aicp
,
resultCode
,
mobile
);
SoundMonitorService
.
sendEmailAndSms
(
aicc
,
aicp
,
resultCode
,
mobile
);
}
}
}
}
src/main/java/com/foc/dao/SoundsMaxIdDao.java
View file @
77847dff
...
@@ -83,4 +83,12 @@ public interface SoundsMaxIdDao {
...
@@ -83,4 +83,12 @@ public interface SoundsMaxIdDao {
* @param blackIp
* @param blackIp
*/
*/
void
deleteBlackIp
(
@Param
(
"blackIp"
)
String
blackIp
);
void
deleteBlackIp
(
@Param
(
"blackIp"
)
String
blackIp
);
/**
* 根据时间查询通话记录
*
* @param updateTime
* @return
*/
SoundInfo
getInfoByUpdateTime
(
@Param
(
"updateTime"
)
String
updateTime
);
}
}
src/main/java/com/foc/service/SoundMonitorService.java
View file @
77847dff
...
@@ -12,6 +12,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
...
@@ -12,6 +12,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
import
org.apache.ibatis.session.SqlSessionFactoryBuilder
;
import
org.apache.ibatis.session.SqlSessionFactoryBuilder
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.CollectionUtils
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.Reader
;
import
java.io.Reader
;
...
@@ -70,6 +71,11 @@ public class SoundMonitorService {
...
@@ -70,6 +71,11 @@ public class SoundMonitorService {
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
LocalDateTime
ldt
=
LocalDateTime
.
parse
(
updateTime
,
df
);
LocalDateTime
ldt
=
LocalDateTime
.
parse
(
updateTime
,
df
);
if
(
DateUtils
.
until
(
ldt
)
>
Long
.
parseLong
(
interval
)){
if
(
DateUtils
.
until
(
ldt
)
>
Long
.
parseLong
(
interval
)){
//2019年10月5日14:38:07 zt
SoundInfo
soundInfo
=
soundsMaxIdDao
.
getInfoByUpdateTime
(
updateTime
);
if
(
soundInfo
!=
null
){
log
.
info
(
"更新时间与最新时间间隔大于20分钟,有通话记录start_time:{}"
,
soundInfo
.
getBeginTime
());
}
else
{
log
.
info
(
"更新时间异常,与最新时间间隔大于20分钟,updateTime:{}"
,
updateTime
);
log
.
info
(
"更新时间异常,与最新时间间隔大于20分钟,updateTime:{}"
,
updateTime
);
focSmsEmailRecord
.
setDescription
(
"更新时间异常,与最新时间间隔大于20分钟,updateTime为"
+
updateTime
);
focSmsEmailRecord
.
setDescription
(
"更新时间异常,与最新时间间隔大于20分钟,updateTime为"
+
updateTime
);
focSmsEmailRecord
.
setMonitorState
((
short
)
1
);
focSmsEmailRecord
.
setMonitorState
((
short
)
1
);
...
@@ -77,8 +83,10 @@ public class SoundMonitorService {
...
@@ -77,8 +83,10 @@ public class SoundMonitorService {
session
.
commit
();
session
.
commit
();
return
true
;
return
true
;
}
}
}
List
<
SoundInfo
>
list
=
soundsMaxIdDao
.
getInfo
(
updateTime
);
List
<
SoundInfo
>
list
=
soundsMaxIdDao
.
getInfo
(
updateTime
);
if
(
list
==
null
&&
list
.
size
()
<
1
){
if
(
CollectionUtils
.
isEmpty
(
list
)
){
log
.
info
(
"查询不到记录"
);
log
.
info
(
"查询不到记录"
);
focSmsEmailRecord
.
setDescription
(
"查询不到记录"
);
focSmsEmailRecord
.
setDescription
(
"查询不到记录"
);
focSmsEmailRecord
.
setMonitorState
((
short
)
0
);
focSmsEmailRecord
.
setMonitorState
((
short
)
0
);
...
...
src/main/resources/mapper/SoundsMaxIdMapper.xml
View file @
77847dff
...
@@ -6,6 +6,12 @@
...
@@ -6,6 +6,12 @@
SELECT id,update_date FROM foc_soundmax_id order by id desc limit 1
SELECT id,update_date FROM foc_soundmax_id order by id desc limit 1
</select>
</select>
<select
id=
"getInfoByUpdateTime"
resultType=
"com.foc.entity.SoundInfo"
>
select start_time as beginTime
from foc_sound_records
where start_time
>
=#{updateTime} or end_time
>
=#{updateTime}
</select>
<select
id=
"getInfo"
resultType=
"com.foc.entity.SoundInfo"
>
<select
id=
"getInfo"
resultType=
"com.foc.entity.SoundInfo"
>
SELECT
SELECT
create_phone AS callNo,
create_phone AS callNo,
...
...
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