Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hzjtpushdateService
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
建金
hzjtpushdateService
Commits
63d5614f
Commit
63d5614f
authored
Dec 29, 2020
by
高飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重复事件不推送
parent
0f7cd3fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
10 deletions
+39
-10
src/main/java/com/hzjt/controller/TraffController.java
src/main/java/com/hzjt/controller/TraffController.java
+19
-6
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
+2
-0
src/main/java/com/hzjt/util/FTPUtil.java
src/main/java/com/hzjt/util/FTPUtil.java
+4
-4
src/main/resources/mapper/Traffalarmrecord.xml
src/main/resources/mapper/Traffalarmrecord.xml
+14
-0
No files found.
src/main/java/com/hzjt/controller/TraffController.java
View file @
63d5614f
...
...
@@ -159,7 +159,6 @@ public class TraffController {
}
public
void
sendevent
(
Alarm
trffClientMessage
){
List
<
String
>
imgBase64List
=
trffClientMessage
.
getImg_base64
();
Traffalarmrecord
traffAlarmRecord
=
new
Traffalarmrecord
();
String
imgEnumHead
=
"IMG"
;
Ftp
ftp
=
ftpService
.
reloadFtp
();
...
...
@@ -214,6 +213,15 @@ public void sendevent( Alarm trffClientMessage){
if
(
traffAlarmRecord
!=
null
&&
traffAlarmRecord
.
getRecordid
()
!=
null
)
{
traffAlarmRecordMapper
.
updateTraffAlarmRecordUrl
(
traffAlarmRecord
);
}
if
(
traffAlarmRecord
.
getRecordtype
().
equalsIgnoreCase
(
"roadworks"
)
||
traffAlarmRecord
.
getRecordtype
().
equalsIgnoreCase
(
"roadworks_out_of_line"
))
{
//工程类的更新10分钟之前该videoid 下的 工程类和行人闯入和违停的记录施工纠偏类型为1
traffAlarmRecordMapper
.
updateTraffAlarmRectificationType
(
traffAlarmRecord
);
}
//如果监控视频为空,延时加载重新获取
if
(
null
==
recordBak
.
getVideopath
()
||
""
.
equalsIgnoreCase
(
recordBak
.
getVideopath
()))
{
...
...
@@ -241,10 +249,13 @@ public void sendevent( Alarm trffClientMessage){
//推送给第三方
ResultObj
obj
=
eventWriteService
.
updateAndAutoSendEvent
(
traffAlarmRecord
);
log
.
info
(
"调用接口推送给广达返回信息:"
+
obj
.
toString
());
log
.
info
(
"send to guangda:HTTP_OK"
+
obj
.
toString
());
}
}
else
{
ResultObj
obj
=
eventWriteService
.
updateAndAutoSendEvent
(
traffAlarmRecord
);
log
.
info
(
"send to guangda HttpURLConnection.HTTP_Fail--->response message:"
+
obj
.
toString
());
}
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
e
.
toString
());
log
.
error
(
e
.
toString
());
...
...
@@ -254,16 +265,18 @@ public void sendevent( Alarm trffClientMessage){
}
return
1
;
},
30
,
TimeUnit
.
SECONDS
);
//等待30秒钟执行
},
50
,
TimeUnit
.
SECONDS
);
//等待50秒钟执行
}
else
{
//推送给第三方
ResultObj
obj
=
eventWriteService
.
updateAndAutoSendEvent
(
traffAlarmRecord
);
log
.
info
(
"
调用接口推送给广达返回信息:
"
+
obj
.
toString
());
log
.
info
(
"
send to guangda novideopath --->response message
"
+
obj
.
toString
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"
解析事件告警数据异常
:"
+
e
.
getMessage
());
log
.
error
(
"
alarm fail
:"
+
e
.
getMessage
());
}
}
...
...
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
View file @
63d5614f
...
...
@@ -23,4 +23,6 @@ public interface TraffAlarmRecordMapper extends BaseMapper<Traffalarmrecord>, Co
Integer
statisTraffalarmrecordstatByDay
();
int
updateTraffAlarmRectificationType
(
Traffalarmrecord
traffalarmrecord
);
}
\ No newline at end of file
src/main/java/com/hzjt/util/FTPUtil.java
View file @
63d5614f
...
...
@@ -132,9 +132,9 @@ public class FTPUtil {
changeWorkingDirectory
(
ftpClient
,
path
);
flag
=
ftpClient
.
storeFile
(
filename
,
input
);
if
(
flag
)
{
log
.
info
(
"FTP
上传文件成功
!"
);
log
.
info
(
"FTP
upload success
!"
);
}
else
{
log
.
info
(
"FTP
上传文件失败
!"
);
log
.
info
(
"FTP
upload fail
!"
);
}
}
else
{
flag
=
false
;
...
...
@@ -143,10 +143,10 @@ public class FTPUtil {
}
}
catch
(
IOException
e
)
{
flag
=
false
;
log
.
error
(
"FTP
文件上传失败
!"
,
e
);
log
.
error
(
"FTP
upload fail
!"
,
e
);
}
catch
(
Exception
e
)
{
flag
=
false
;
log
.
error
(
"FTP
文件上传失败
!"
,
e
);
log
.
error
(
"FTP
upload fail
!"
,
e
);
}
finally
{
IOUtils
.
closeQuietly
(
input
);
closeConnect
(
ftpClient
);
...
...
src/main/resources/mapper/Traffalarmrecord.xml
View file @
63d5614f
...
...
@@ -126,7 +126,21 @@
and A.RECORDTIME
<![CDATA[ < ]]>
TRUNC(SYSDATE)
group by to_char(A.RECORDTIME,'yyyy-MM-DD'),recordtype,A.FDID,CHANNELID,areaid
</insert>
<update
id=
"updateTraffAlarmRectificationType"
parameterType=
"com.hzjt.domain.Traffalarmrecord"
>
UPDATE TRAFFALARMRECORD
<set>
<if
test=
"item.processstatus != null"
>
rectificationtype=1,
</if>
</set>
from TRAFFALARMRECORD a,
(select * from TRAFFALARMRECORD a,(select * from TRAFFALARMRECORD b where recordid=#{item.recordid,jdbcType=VARCHAR} )b
where a.fdid =b.fdid and a.channelid=b.channelid
AND ( a.recordtime
<![CDATA[ <= ]]>
b.recordtime-10/(24*60))
AND recordtype in ('roadworks_out_of_line','roadworks'))b
where recordtype in('illegal_parking','no_motor_ban') and a.fdid =b.fdid and a.channelid=b.channelid
</update>
</mapper>
\ No newline at end of file
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