Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
zlmy-cloud
Project
Project
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
zlmy
zlmy-cloud
Commits
46128e2e
Commit
46128e2e
authored
Mar 24, 2026
by
鲁鸿波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新监控数据,添加日志
parent
8f295b6b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
10 deletions
+98
-10
VideoAlarmController.java
.../testor/module/video/controller/VideoAlarmController.java
+91
-6
application-dev.yml
...-modules/zlmy-boot/src/main/resources/application-dev.yml
+2
-1
application-pre.yml
...-modules/zlmy-boot/src/main/resources/application-pre.yml
+2
-1
application-prod.yml
...modules/zlmy-boot/src/main/resources/application-prod.yml
+2
-1
application.yml
zlmy-modules/zlmy-boot/src/main/resources/application.yml
+1
-1
No files found.
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/video/controller/VideoAlarmController.java
View file @
46128e2e
...
...
@@ -490,53 +490,138 @@ public class VideoAlarmController extends SuperController {
}
private
BaseResponseList
<
VideoChannelUrl
>
getVideoListInfo
(
Integer
mark
,
String
orgId
,
Page
<
VideoEquipmentInfo
>
resultPage
)
{
log
.
info
(
"========== 开始获取视频列表信息 =========="
);
log
.
info
(
"【传入参数】mark: {}, orgId: {}, page: {}, size: {}"
,
mark
,
orgId
,
resultPage
.
getCurrent
(),
resultPage
.
getSize
());
//根据粮库id查询监控设备信息
QueryWrapper
<
VideoEquipmentInfo
>
queryWrapper
=
new
QueryWrapper
<>();
//查询盯防数据
if
(
mark
==
1
)
{
log
.
info
(
"【查询模式】盯防模式 - 查询用户盯防的设备"
);
List
<
String
>
deviceIdsByUserId
=
careService
.
findDeviceIdsByUserId
(
getUserId
());
log
.
info
(
"【盯防设备】用户盯防的设备ID列表: {}"
,
deviceIdsByUserId
);
//如果用户盯防列表是空的,查空数据
if
(
CollectionUtils
.
isEmpty
(
deviceIdsByUserId
))
{
log
.
warn
(
"【盯防设备】用户无盯防设备,返回空数据"
);
queryWrapper
.
eq
(
"id"
,
-
1
);
}
else
{
queryWrapper
.
in
(
"id"
,
deviceIdsByUserId
);
}
}
else
{
log
.
info
(
"【查询模式】普通模式 - 查询所有设备"
);
}
queryWrapper
.
eq
(
"org_id"
,
orgId
);
queryWrapper
.
eq
(
"status"
,
"0"
);
log
.
info
(
"【查询SQL】条件: org_id={}, status=0"
,
orgId
);
// TODO 根据需求修改查询条件及查询参数
Page
<
VideoEquipmentInfo
>
list
=
videoAlarmService
.
page
(
resultPage
,
queryWrapper
);
log
.
info
(
"【查询结果】总数: {}, 当前页记录数: {}"
,
list
.
getTotal
(),
list
.
getRecords
().
size
());
//可以获取所有的空间类型和场所
//判断是否为空
BaseResponseList
<
VideoChannelUrl
>
resultList
=
new
BaseResponseList
();
List
<
VideoChannelUrl
>
lists
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
list
.
getRecords
()))
{
log
.
info
(
"【开始处理设备】共 {} 个设备"
,
list
.
getRecords
().
size
());
for
(
VideoEquipmentInfo
videoEquipmentInfo
:
list
.
getRecords
())
{
log
.
info
(
"--------------------------------------------------"
);
log
.
info
(
"【设备信息】ID: {}, 名称: {}, deviceId: {}, orgId: {}"
,
videoEquipmentInfo
.
getId
(),
videoEquipmentInfo
.
getEquipmentName
(),
videoEquipmentInfo
.
getDeviceId
(),
videoEquipmentInfo
.
getOrgId
());
VideoChannelUrl
res
=
new
VideoChannelUrl
();
//根据id获取视频地址信息
if
(
videoEquipmentInfo
!=
null
)
{
if
(
StringUtils
.
isNotBlank
(
videoEquipmentInfo
.
getDeviceId
()))
{
ResponseEntity
<
Map
>
result
=
restUtil
.
get
(
IotUrlAttributes
.
START_LIVE_STREAM_PARAMETER_PATH
+
videoEquipmentInfo
.
getDeviceId
(),
Map
.
class
);
HttpStatus
statusCode
=
result
.
getStatusCode
();
if
(
statusCode
==
HttpStatus
.
OK
)
{
Map
body
=
result
.
getBody
();
if
(
"200"
.
equals
(
body
.
get
(
"code"
).
toString
()))
{
res
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
body
.
get
(
"result"
)),
VideoChannelUrl
.
class
);
String
requestUrl
=
IotUrlAttributes
.
START_LIVE_STREAM_PARAMETER_PATH
+
videoEquipmentInfo
.
getDeviceId
();
log
.
info
(
"【调用第三方接口】URL: {}"
,
requestUrl
);
log
.
info
(
"【调用第三方接口】完整地址: http://{}/{}"
,
"threeVideoUrl"
,
requestUrl
);
try
{
ResponseEntity
<
Map
>
result
=
restUtil
.
get
(
requestUrl
,
Map
.
class
);
log
.
info
(
"【第三方接口响应】HTTP状态码: {}"
,
result
.
getStatusCode
());
log
.
info
(
"【第三方接口响应】完整响应体: {}"
,
JSON
.
toJSONString
(
result
.
getBody
()));
HttpStatus
statusCode
=
result
.
getStatusCode
();
if
(
statusCode
==
HttpStatus
.
OK
)
{
Map
body
=
result
.
getBody
();
if
(
body
!=
null
)
{
log
.
info
(
"【第三方接口响应】code: {}"
,
body
.
get
(
"code"
));
log
.
info
(
"【第三方接口响应】message: {}"
,
body
.
get
(
"message"
));
log
.
info
(
"【第三方接口响应】result: {}"
,
JSON
.
toJSONString
(
body
.
get
(
"result"
)));
if
(
body
.
get
(
"code"
)
!=
null
&&
"200"
.
equals
(
body
.
get
(
"code"
).
toString
()))
{
log
.
info
(
"【第三方接口成功】开始解析视频流地址"
);
Object
resultObj
=
body
.
get
(
"result"
);
if
(
resultObj
!=
null
)
{
String
resultJson
=
JSON
.
toJSONString
(
resultObj
);
log
.
info
(
"【JSON解析】待解析的JSON: {}"
,
resultJson
);
res
=
JSONObject
.
parseObject
(
resultJson
,
VideoChannelUrl
.
class
);
log
.
info
(
"【解析结果】HlsUrl: {}"
,
res
.
getHlsUrl
());
log
.
info
(
"【解析结果】HttpFlvUrl: {}"
,
res
.
getHttpFlvUrl
());
log
.
info
(
"【解析结果】RtmpUrl: {}"
,
res
.
getRtmpUrl
());
// 检查URL是否为空
if
(
StringUtils
.
isBlank
(
res
.
getHlsUrl
())
&&
StringUtils
.
isBlank
(
res
.
getHttpFlvUrl
()))
{
log
.
warn
(
"【警告】视频URL均为空,可能原因:设备离线或字段名称不匹配"
);
}
}
else
{
log
.
warn
(
"【第三方接口响应】result字段为空"
);
}
}
else
{
log
.
error
(
"【第三方接口失败】返回码不是200,实际返回码: {}"
,
body
.
get
(
"code"
));
log
.
error
(
"【第三方接口失败】错误信息: {}"
,
body
.
get
(
"message"
));
}
}
else
{
log
.
error
(
"【第三方接口响应】body为空"
);
}
}
else
{
log
.
error
(
"【第三方接口失败】HTTP状态码不是200,实际状态码: {}"
,
statusCode
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"【调用第三方接口异常】deviceId: {}, 异常类型: {}, 异常信息: {}"
,
videoEquipmentInfo
.
getDeviceId
(),
e
.
getClass
().
getName
(),
e
.
getMessage
(),
e
);
}
}
else
{
log
.
warn
(
"【设备deviceId为空】无法调用第三方接口获取视频流"
);
}
}
else
{
log
.
warn
(
"【设备信息为空】跳过处理"
);
}
int
isEye
=
careService
.
count
(
new
LambdaQueryWrapper
<
TVideoEquipmentCare
>().
eq
(
TVideoEquipmentCare:
:
getUserId
,
getUserId
()).
eq
(
TVideoEquipmentCare:
:
getDeviceId
,
videoEquipmentInfo
.
getId
()));
res
.
setId
(
videoEquipmentInfo
.
getId
());
res
.
setDeviceId
(
videoEquipmentInfo
.
getDeviceId
());
res
.
setIsEye
(
isEye
);
res
.
setEquipmentName
(
videoEquipmentInfo
.
getEquipmentName
());
log
.
info
(
"【最终返回数据】ID: {}, deviceId: {}, isEye: {}, equipmentName: {}"
,
res
.
getId
(),
res
.
getDeviceId
(),
res
.
getIsEye
(),
res
.
getEquipmentName
());
log
.
info
(
"【最终返回数据】HlsUrl: {}, HttpFlvUrl: {}"
,
res
.
getHlsUrl
(),
res
.
getHttpFlvUrl
());
lists
.
add
(
res
);
}
}
else
{
log
.
warn
(
"【查询结果为空】没有找到符合条件的设备"
);
}
resultList
.
setData
(
lists
);
resultList
.
setTotal
(
list
.
getTotal
());
log
.
info
(
"========== 结束获取视频列表信息 =========="
);
log
.
info
(
"【返回结果】数据条数: {}, 总数: {}"
,
lists
.
size
(),
list
.
getTotal
());
return
resultList
;
}
...
...
zlmy-modules/zlmy-boot/src/main/resources/application-dev.yml
View file @
46128e2e
...
...
@@ -161,7 +161,8 @@ ureport:
three
:
video
:
#url: http://${THREE_VIDEO_IP:app.cfciot.com}:${THREE_VIDEO_PORT:8080}
url
:
http://iotx.cofcodata.com:12800
#url: http://iotx.cofcodata.com:12800
url
:
http://10.25.140.9:12800
videoinfo
:
url
:
http://${THREE_VIDEODEVICE_IP:123.125.253.26}:${THREE_VIDEODEVICE_PORT:6006}
username
:
${THREE_VIDEODEVICE_USERNAME:anhuan}
...
...
zlmy-modules/zlmy-boot/src/main/resources/application-pre.yml
View file @
46128e2e
...
...
@@ -98,7 +98,8 @@ ureport:
three
:
video
:
#url: http://${THREE_VIDEO_IP:app.cfciot.com}:${THREE_VIDEO_PORT:8080}
url
:
http://iotx.cofcodata.com:12800
#url: http://iotx.cofcodata.com:12800
url
:
http://10.25.140.9:12800
videoinfo
:
url
:
http://${THREE_VIDEODEVICE_IP:123.125.253.26}:${THREE_VIDEODEVICE_PORT:6006}
username
:
${THREE_VIDEODEVICE_USERNAME:anhuan}
...
...
zlmy-modules/zlmy-boot/src/main/resources/application-prod.yml
View file @
46128e2e
...
...
@@ -113,7 +113,8 @@ ureport:
three
:
video
:
#url: http://10.28.161.85:8080
url
:
http://10.28.161.84:12800
#url: http://10.28.161.84:12800
url
:
http://10.25.140.9:12800
videoinfo
:
url
:
http://123.125.253.26:6006
username
:
anhuan
...
...
zlmy-modules/zlmy-boot/src/main/resources/application.yml
View file @
46128e2e
spring
:
profiles
:
active
:
dev
active
:
prod
application
:
name
:
zlmy-boot
servlet
:
...
...
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