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
7208731a
Commit
7208731a
authored
Dec 29, 2020
by
wangjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重复实践不推送
parent
ad01b18a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
152 additions
and
108 deletions
+152
-108
src/main/java/com/hzjt/controller/TraffController.java
src/main/java/com/hzjt/controller/TraffController.java
+26
-16
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
+6
-2
src/main/resources/mapper/Traffalarmrecord.xml
src/main/resources/mapper/Traffalarmrecord.xml
+120
-90
No files found.
src/main/java/com/hzjt/controller/TraffController.java
View file @
7208731a
...
...
@@ -151,10 +151,6 @@ public class TraffController {
// importService.cleanCache();
// 将参数result中的部分数据存入redis中,并把格式校验成功的数据发布至对应频道中
// importService.cacheAndPublish(JsonUtil.beanToString(trffClientMessage));
//判断该事件在规定事件内是否发生过,发生过不需要入库
sendevent
(
trffClientMessage
);
}
catch
(
Exception
e
)
{
log
.
error
(
"MessageController receive putData error:"
+
e
.
toString
());
...
...
@@ -162,23 +158,42 @@ public class TraffController {
return
ResultObj
.
ok
(
trffClientMessage
);
}
public
void
sendevent
(
Alarm
trffClientMessage
){
List
<
String
>
imgBase64List
=
trffClientMessage
.
getImg_base64
();
Traffalarmrecord
traffAlarmRecord
=
new
Traffalarmrecord
();
String
imgEnumHead
=
"IMG"
;
traffAlarmRecord
.
setAreaid
(
Long
.
valueOf
(
trffClientMessage
.
getDept
()));
traffAlarmRecord
.
setRecordtype
(
trffClientMessage
.
getIncident_type
().
toLowerCase
());
traffAlarmRecord
.
setVideourlfrom
(
trffClientMessage
.
getVideo_record_url
());
traffAlarmRecord
.
setRecordtime
(
new
Date
(
Long
.
valueOf
(
trffClientMessage
.
getTs
())));
traffAlarmRecord
.
setCreatetime
(
new
Date
());
traffAlarmRecord
.
setObjlable
(
trffClientMessage
.
getObjLabel
());
traffAlarmRecord
.
setPushstatus
(
9
);
//设置为未推送
String
[]
videoIdArr
=
trffClientMessage
.
getVideo_id
().
split
(
"_"
);
traffAlarmRecord
.
setFdid
(
videoIdArr
[
0
]);
Integer
channelid
=
Integer
.
valueOf
(
videoIdArr
[
1
])
+
1
;
traffAlarmRecord
.
setChannelid
(
channelid
);
//判断该事件在规定事件内是否发生过,发生过不需要入库
int
exists
=
traffAlarmRecordMapper
.
selectExitsTraffAlarm
(
traffAlarmRecord
);
if
(
exists
>
0
){
//存在直接返回
return
;
}
else
{
//判断是否在正检时间内
exists
=
traffAlarmRecordMapper
.
selectInChecktimeTraffAlarm
(
traffAlarmRecord
);
if
(
exists
>
0
)
return
;
}
traffAlarmRecord
.
setVideourlfrom
(
trffClientMessage
.
getVideo_record_url
());
traffAlarmRecord
.
setCreatetime
(
new
Date
());
traffAlarmRecord
.
setObjlable
(
trffClientMessage
.
getObjLabel
());
traffAlarmRecord
.
setPushstatus
(
9
);
//设置为未推送
//支持对某一个点位报施工事件后 倒推RECTIFYTIME 查看是否是施工事件 一段时间(时间可以配置)之前的停车事件和行人闯入事件矫正为施工事件
exists
=
traffAlarmRecordMapper
.
selectInworkRectifytimeTraffAlarm
(
traffAlarmRecord
);
if
(
exists
>
0
&&
(
traffAlarmRecord
.
getRecordtype
().
equalsIgnoreCase
(
"no_motor_ban"
)
||
traffAlarmRecord
.
getRecordtype
().
equalsIgnoreCase
(
"illegal_parking"
)
))
{
//这个事件如果为停车事件或者行人闯入事件时,设置纠偏状态为1
}
List
<
String
>
imgBase64List
=
trffClientMessage
.
getImg_base64
();
String
imgEnumHead
=
"IMG"
;
Ftp
ftp
=
ftpService
.
reloadFtp
();
for
(
int
i
=
0
;
i
<
imgBase64List
.
size
();
i
++)
{
/* 图片上传 */
...
...
@@ -192,11 +207,6 @@ public void sendevent( Alarm trffClientMessage){
for
(
int
i
=
0
;
i
<
imgUrls
.
size
();
i
++)
{
TraffAlarmRecordFromImgEnum
.
valueOf
(
imgEnumHead
+
i
).
setImg
(
traffAlarmRecord
,
imgUrls
.
get
(
i
));
}
String
[]
videoIdArr
=
trffClientMessage
.
getVideo_id
().
split
(
"_"
);
String
fdid
=
videoIdArr
[
0
];
traffAlarmRecord
.
setFdid
(
fdid
);
Integer
channelid
=
Integer
.
valueOf
(
videoIdArr
[
1
])
+
1
;
traffAlarmRecord
.
setChannelid
(
channelid
);
if
(
StringEnum
.
ONE
.
getValue
().
equals
(
checkEnable
))
{
/* 9:免审 */
...
...
src/main/java/com/hzjt/mapper/TraffAlarmRecordMapper.java
View file @
7208731a
...
...
@@ -23,8 +23,12 @@ public interface TraffAlarmRecordMapper extends BaseMapper<Traffalarmrecord>, Co
Integer
statisTraffalarmrecordstatByDay
();
int
updateTraffAlarmRectificationType
(
Traffalarmrecord
traffalarmrecord
);
Integer
updateTraffAlarmRectificationType
(
Traffalarmrecord
traffalarmrecord
);
int
selectExitsTraffAlarm
(
Traffalarmrecord
traffalarmrecord
);
Integer
selectExitsTraffAlarm
(
Traffalarmrecord
traffalarmrecord
);
Integer
selectInChecktimeTraffAlarm
(
Traffalarmrecord
traffalarmrecord
);
Integer
selectInworkRectifytimeTraffAlarm
(
Traffalarmrecord
traffalarmrecord
);
}
\ No newline at end of file
src/main/resources/mapper/Traffalarmrecord.xml
View file @
7208731a
This diff is collapsed.
Click to expand it.
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