Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
dc45166e
提交
dc45166e
authored
4月 24, 2022
作者:
Administrator
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor : 视频监控点位参数变化
上级
9289132c
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
21 行删除
+15
-21
VideoParam.java
app/src/main/java/com/yiring/app/param/video/VideoParam.java
+4
-2
VideoServiceImpl.java
...a/com/yiring/app/service/video/impl/VideoServiceImpl.java
+7
-17
VideoVo.java
app/src/main/java/com/yiring/app/vo/video/VideoVo.java
+4
-2
没有找到文件。
app/src/main/java/com/yiring/app/param/video/VideoParam.java
浏览文件 @
dc45166e
...
...
@@ -3,6 +3,7 @@ package com.yiring.app.param.video;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -24,6 +25,7 @@ import lombok.experimental.FieldDefaults;
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
VideoParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
6031274771790265507L
;
@ApiModelProperty
(
value
=
"编号"
,
example
=
"88888888"
,
required
=
true
)
...
...
@@ -40,11 +42,11 @@ public class VideoParam implements Serializable {
@ApiModelProperty
(
value
=
"经度"
,
example
=
"1.00"
,
required
=
true
)
@NotNull
(
message
=
"经度"
)
d
ouble
lon
;
D
ouble
lon
;
@ApiModelProperty
(
value
=
"纬度"
,
example
=
"1.00"
,
required
=
true
)
@NotNull
(
message
=
"纬度"
)
d
ouble
lat
;
D
ouble
lat
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"厂区摄像头"
)
@Size
(
max
=
100
,
message
=
"备注不能超过100字"
)
...
...
app/src/main/java/com/yiring/app/service/video/impl/VideoServiceImpl.java
浏览文件 @
dc45166e
...
...
@@ -73,13 +73,8 @@ public class VideoServiceImpl implements VideoService {
Video
video
=
Video
.
builder
()
.
createTime
(
LocalDateTime
.
now
())
// .enable(videoParam.getEnable())
// .m3u8(videoParam.getM3u8())
// .point(videoParam.getPoint())
.
m3u8
(
videoParam
.
getM3u8
())
.
point
(
GeoUtils
.
createPoint
(
videoParam
.
getLon
(),
videoParam
.
getLat
()))
// .online(videoParam.getOnline())
// .type(videoParam.getType())
//默认正常
.
videoName
(
videoParam
.
getVideoName
())
.
status
(
"1"
)
...
...
@@ -89,7 +84,6 @@ public class VideoServiceImpl implements VideoService {
videoRepository
.
saveAndFlush
(
video
);
//还需要同步添加国标28181中对应的摄像头信息
//标识uuid对应流id,m3u8对应拉流地址,如m3u8中有标注 则将类型切换为FFmpeg,摄像头名称videoName对应名称,流名称默认"stream",超时时间默认60
new
Thread
(()
->
{
StreamProxyItem
streamProxyItem
=
StreamProxyItem
.
builder
()
.
name
(
video
.
getVideoName
())
...
...
@@ -106,8 +100,6 @@ public class VideoServiceImpl implements VideoService {
if
(!
jsonObject
.
get
(
"code"
).
equals
(
0
))
{
throw
new
RuntimeException
(
jsonObject
.
get
(
"msg"
).
toString
());
}
})
.
start
();
return
Result
.
ok
();
}
...
...
@@ -119,13 +111,10 @@ public class VideoServiceImpl implements VideoService {
}
Video
video
=
optional
.
get
();
//还需要同步删除国标28181中对应的摄像头信息
new
Thread
(()
->
{
JSONObject
jsonObject
=
gbClient
.
proxyDel
(
"stream"
,
video
.
getUuid
(),
gbCookie
());
if
(!
jsonObject
.
get
(
"code"
).
equals
(
0
))
{
throw
new
RuntimeException
(
jsonObject
.
get
(
"msg"
).
toString
());
}
})
.
start
();
videoRepository
.
delete
(
video
);
return
Result
.
ok
();
...
...
@@ -147,16 +136,14 @@ public class VideoServiceImpl implements VideoService {
// if (
// !video.getVideoName().equals(videoParam.getVideoName()) && !video.getM3u8().equals(videoParam.getM3u8())
// ) {
new
Thread
(()
->
{
JSONObject
jsonObject
=
gbClient
.
proxyDel
(
"stream"
,
video
.
getUuid
(),
gbCookie
());
if
(!
jsonObject
.
get
(
"code"
).
equals
(
0
))
{
throw
new
RuntimeException
(
jsonObject
.
get
(
"msg"
).
toString
());
}
})
.
start
();
}
// }
BeanUtils
.
copyProperties
(
videoParam
,
video
);
video
.
setPoint
(
GeoUtils
.
createPoint
(
videoParam
.
getLon
(),
videoParam
.
getLat
()));
videoRepository
.
saveAndFlush
(
video
);
//将信息发送到队列,等待同步至国标
// new Thread(() -> {
...
...
@@ -214,9 +201,10 @@ public class VideoServiceImpl implements VideoService {
List
<
Video
>
all
=
videoRepository
.
findAll
(
condition
(
videoQueryParam
),
sort
);
List
<
VideoVo
>
data
=
all
.
stream
()
.
map
(
car
->
{
.
map
(
video
->
{
VideoVo
vo
=
new
VideoVo
();
BeanUtils
.
copyProperties
(
car
,
vo
);
BeanUtils
.
copyProperties
(
video
,
vo
);
// vo.setPoint(video.getPoint());
return
vo
;
})
.
collect
(
Collectors
.
toList
());
...
...
@@ -287,6 +275,7 @@ public class VideoServiceImpl implements VideoService {
String
fileName
=
URLEncoder
.
encode
(
"监控点位来访信息.xlsx"
,
StandardCharsets
.
UTF_8
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
OutputStream
out
=
response
.
getOutputStream
();
...
...
@@ -324,6 +313,8 @@ public class VideoServiceImpl implements VideoService {
.
map
(
videoImportExcel
->
{
Video
video
=
new
Video
();
BeanUtils
.
copyProperties
(
videoImportExcel
,
video
);
video
.
setPoint
(
GeoUtils
.
createPoint
(
videoImportExcel
.
getLon
(),
videoImportExcel
.
getLat
()));
video
.
setCreateTime
(
LocalDateTime
.
now
());
return
video
;
})
.
toList
();
...
...
@@ -333,7 +324,6 @@ public class VideoServiceImpl implements VideoService {
videoRepository
.
findOne
((
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
new
ArrayList
<>();
if
(
StrUtil
.
isNotBlank
(
video
.
getUuid
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
"uuid"
).
as
(
String
.
class
),
video
.
getUuid
()));
}
...
...
app/src/main/java/com/yiring/app/vo/video/VideoVo.java
浏览文件 @
dc45166e
...
...
@@ -5,10 +5,11 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.
awt.*
;
import
java.
io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
import
org.locationtech.jts.geom.Point
;
/**
* @author tzl
...
...
@@ -22,6 +23,7 @@ import lombok.experimental.FieldDefaults;
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
VideoVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
3968078657827350557L
;
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
...
...
@@ -37,7 +39,7 @@ public class VideoVo implements Serializable {
@ApiModelProperty
(
value
=
"m3u8地址"
,
example
=
"m3u8地址"
)
String
m3u8
;
@ApiModelProperty
(
value
=
"备注"
,
example
=
"
摄像头
"
)
@ApiModelProperty
(
value
=
"备注"
,
example
=
"
备注
"
)
String
remark
;
@ApiModelProperty
(
value
=
"摄像头名称"
,
example
=
"摄像头1"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论