Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
my-kafka-project
Project
Project
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
AI算法平台
my-kafka-project
Commits
94894346
Commit
94894346
authored
Nov 29, 2023
by
薄玉虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.更新大华icc配置文件为乌海矿平台
2.修改mapper中SQL 3.修改布控球暂时不截取视频的逻辑
parent
d8d9e368
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
12 deletions
+25
-12
src/main/java/com/example/mykafkaproject/server/WarnPushBaseServer.java
...com/example/mykafkaproject/server/WarnPushBaseServer.java
+18
-9
src/main/java/com/example/mykafkaproject/utils/RtspToMP4.java
...main/java/com/example/mykafkaproject/utils/RtspToMP4.java
+1
-0
src/main/resources/config/iccSdk.properties
src/main/resources/config/iccSdk.properties
+4
-3
src/main/resources/mapper/WarnPushBaseMapper.xml
src/main/resources/mapper/WarnPushBaseMapper.xml
+2
-0
No files found.
src/main/java/com/example/mykafkaproject/server/WarnPushBaseServer.java
View file @
94894346
...
@@ -41,19 +41,26 @@ public class WarnPushBaseServer {
...
@@ -41,19 +41,26 @@ public class WarnPushBaseServer {
public
void
addMessage
(
String
message
)
{
public
void
addMessage
(
String
message
)
{
LOGGER
.
info
(
"预警信息:"
+
message
);
LOGGER
.
info
(
"预警信息:"
+
message
);
WarnPushBase
warnPushBase
=
JSON
.
parseObject
(
message
,
WarnPushBase
.
class
);
WarnPushBase
warnPushBase
=
JSON
.
parseObject
(
message
,
WarnPushBase
.
class
);
// if("乌海矿".equals(warnPushBase.getBelong())){
//获取视频地址 先不截取布控球的视频
String
video
;
if
(!
warnPushBase
.
getAlarmDeviceName
().
contains
(
"布控球"
)){
//获取前后五秒时间戳
Date
alarmTime
=
warnPushBase
.
getAlarmTime
();
video
=
getVideo
(
warnPushBase
.
getChannelId
(),
alarmTime
.
getTime
()
/
1000
-
3
,
alarmTime
.
getTime
()
/
1000
+
3
);
}
else
{
video
=
"http://172.16.20.211:8080/profile/MP4/1001952$1$0$0_1698988966.mp4"
;
}
//获取视频地址
// String video ="F:\\ruoyi\\uploadPath\\MP4";
//获取前后五秒时间戳
Date
alarmTime
=
warnPushBase
.
getAlarmTime
();
String
video
=
getVideo
(
warnPushBase
.
getChannelId
(),
alarmTime
.
getTime
()
/
1000
-
5
,
alarmTime
.
getTime
()
/
1000
+
5
);
warnPushBase
.
setAlarmMsg
(
warnPushBase
.
getGradeType
());
warnPushBase
.
setAlarmMsg
(
warnPushBase
.
getGradeType
());
warnPushBase
.
setGradeType
(
"摄像头预警"
);
warnPushBase
.
setGradeType
(
warnPushBase
.
getGradeType
()
);
warnPushBase
.
setVideo
(
video
);
warnPushBase
.
setVideo
(
video
);
warnPushBaseMapper
.
add
(
warnPushBase
);
warnPushBaseMapper
.
add
(
warnPushBase
);
//发送iot的http请求
//发送iot的http请求
iotPush
(
warnPushBase
);
iotPush
(
warnPushBase
);
// }
}
}
public
String
getVideo
(
String
channelId
,
Long
startTime
,
Long
endTime
)
{
public
String
getVideo
(
String
channelId
,
Long
startTime
,
Long
endTime
)
{
...
@@ -73,7 +80,7 @@ public class WarnPushBaseServer {
...
@@ -73,7 +80,7 @@ public class WarnPushBaseServer {
}).
start
();
}).
start
();
Thread
.
sleep
(
3
*
1000
);
Thread
.
sleep
(
6
*
1000
);
rtspToMP4
.
stopRecord
(
process
[
0
]);
rtspToMP4
.
stopRecord
(
process
[
0
]);
...
@@ -115,7 +122,7 @@ public class WarnPushBaseServer {
...
@@ -115,7 +122,7 @@ public class WarnPushBaseServer {
public
void
iotPush
(
WarnPushBase
warnPushBase
)
{
public
void
iotPush
(
WarnPushBase
warnPushBase
)
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
url
=
"http://172.16.20.170:8089/api/v1"
;
String
url
=
"http://172.16.20.170:8089/api/v1
/aqgl/warn
"
;
String
result_info
=
null
;
String
result_info
=
null
;
try
{
try
{
//同步IOT
//同步IOT
...
@@ -123,12 +130,14 @@ public class WarnPushBaseServer {
...
@@ -123,12 +130,14 @@ public class WarnPushBaseServer {
bodys
.
put
(
"order_name"
,
"AI预警平台"
);
bodys
.
put
(
"order_name"
,
"AI预警平台"
);
bodys
.
put
(
"alarm_device_name"
,
warnPushBase
.
getAlarmDeviceName
());
bodys
.
put
(
"alarm_device_name"
,
warnPushBase
.
getAlarmDeviceName
());
bodys
.
put
(
"grade_name"
,
warnPushBase
.
getGradeName
());
bodys
.
put
(
"grade_name"
,
warnPushBase
.
getGradeName
());
bodys
.
put
(
"grade_type"
,
"摄像头预警"
);
bodys
.
put
(
"grade_type"
,
warnPushBase
.
getGradeType
()
);
bodys
.
put
(
"grade_type_code"
,
PinYinUtil
.
getPinYinHeadChar
(
warnPushBase
.
getGradeType
()));
bodys
.
put
(
"grade_type_code"
,
PinYinUtil
.
getPinYinHeadChar
(
warnPushBase
.
getGradeType
()));
bodys
.
put
(
"alarm_time"
,
simpleDateFormat
.
format
(
warnPushBase
.
getAlarmTime
()));
bodys
.
put
(
"alarm_time"
,
simpleDateFormat
.
format
(
warnPushBase
.
getAlarmTime
()));
bodys
.
put
(
"alarm_msg"
,
warnPushBase
.
getAlarmMsg
());
bodys
.
put
(
"alarm_msg"
,
warnPushBase
.
getAlarmMsg
());
bodys
.
put
(
"picture"
,
warnPushBase
.
getPicture
());
bodys
.
put
(
"picture"
,
warnPushBase
.
getPicture
());
bodys
.
put
(
"mine"
,
warnPushBase
.
getBelong
());
bodys
.
put
(
"mine"
,
warnPushBase
.
getBelong
());
bodys
.
put
(
"video"
,
warnPushBase
.
getVideo
());
bodys
.
put
(
"channel_id"
,
warnPushBase
.
getChannelId
());
bodys
.
put
(
"create_time"
,
simpleDateFormat
.
format
(
new
Date
()));
bodys
.
put
(
"create_time"
,
simpleDateFormat
.
format
(
new
Date
()));
result_info
=
HttpUtils
.
doPostJson
(
url
,
null
,
JsonUtil
.
getObjectToString
(
bodys
));
result_info
=
HttpUtils
.
doPostJson
(
url
,
null
,
JsonUtil
.
getObjectToString
(
bodys
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/example/mykafkaproject/utils/RtspToMP4.java
View file @
94894346
...
@@ -46,6 +46,7 @@ public class RtspToMP4 {
...
@@ -46,6 +46,7 @@ public class RtspToMP4 {
command
.
add
(
streamUrl
);
command
.
add
(
streamUrl
);
command
.
add
(
"-c:v"
);
command
.
add
(
"-c:v"
);
command
.
add
(
"copy"
);
command
.
add
(
"copy"
);
// command.add("libx264");
command
.
add
(
"-an"
);
command
.
add
(
"-an"
);
command
.
add
(
"-reset_timestamps"
);
command
.
add
(
"-reset_timestamps"
);
command
.
add
(
"1"
);
command
.
add
(
"1"
);
...
...
src/main/resources/config/iccSdk.properties
View file @
94894346
#服务地址 端口默认是443
#服务地址 端口默认是443
#icc.sdk.host=115.236.17.59:9021
#icc.sdk.host=115.236.17.59:9021
icc.sdk.host
=
172.16.51.2
#icc.sdk.host=172.16.51.2
icc.sdk.host
=
172.16.51.4
#是否启用https访问,默认:是
#是否启用https访问,默认:是
#icc.sdk.enable.https=false
#icc.sdk.enable.https=false
#认证类型=[client_credentials],[password],client_credentials:客户端鉴权模式;password:用户密码鉴权模式
#认证类型=[client_credentials],[password],client_credentials:客户端鉴权模式;password:用户密码鉴权模式
...
@@ -14,9 +15,9 @@ icc.sdk.clientSecret=67987667-8651-44f1-a3da-f6796e5f23e6
...
@@ -14,9 +15,9 @@ icc.sdk.clientSecret=67987667-8651-44f1-a3da-f6796e5f23e6
#icc.sdk.config.client.userId=1
#icc.sdk.config.client.userId=1
#-----------用户密码鉴权模式--------------
#-----------用户密码鉴权模式--------------
#用户密码鉴权模式申请访问凭证id
#用户密码鉴权模式申请访问凭证id
icc.sdk.pwdClientId
=
CompanyName
icc.sdk.pwdClientId
=
aqpt
#用户密码鉴权模式申请访问凭证密钥
#用户密码鉴权模式申请访问凭证密钥
icc.sdk.pwdClientSecret
=
67987667-8651-44f1-a3da-f6796e5f23e6
icc.sdk.pwdClientSecret
=
2faa3446-7e32-4fff-b661-a54d2c4cec7f
#用户名
#用户名
icc.sdk.username
=
system
icc.sdk.username
=
system
#密码
#密码
...
...
src/main/resources/mapper/WarnPushBaseMapper.xml
View file @
94894346
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
<if
test=
"sendUserIds != null and sendUserIds != ''"
>
send_user_ids,
</if>
<if
test=
"sendUserIds != null and sendUserIds != ''"
>
send_user_ids,
</if>
<if
test=
"delFlag != null "
>
del_flag,
</if>
<if
test=
"delFlag != null "
>
del_flag,
</if>
<if
test=
"remark != null "
>
remark,
</if>
<if
test=
"remark != null "
>
remark,
</if>
<if
test=
"alarmMsg != null and alarmMsg != ''"
>
alarm_msg,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"orderName != null and orderName != ''"
>
#{orderName},
</if>
<if
test=
"orderName != null and orderName != ''"
>
#{orderName},
</if>
...
@@ -33,6 +34,7 @@
...
@@ -33,6 +34,7 @@
<if
test=
"sendUserIds != null and sendUserIds != ''"
>
#{sendUserIds},
</if>
<if
test=
"sendUserIds != null and sendUserIds != ''"
>
#{sendUserIds},
</if>
<if
test=
"delFlag != null "
>
#{delFlag},
</if>
<if
test=
"delFlag != null "
>
#{delFlag},
</if>
<if
test=
"remark != null "
>
#{remark},
</if>
<if
test=
"remark != null "
>
#{remark},
</if>
<if
test=
"alarmMsg != null and alarmMsg != ''"
>
#{alarmMsg},
</if>
</trim>
</trim>
</insert>
</insert>
...
...
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