Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
I
ils-common-video
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
提交
议题看板
打开侧边栏
OpsTeam
ils-common-video
Commits
0bf2d18c
提交
0bf2d18c
authored
5月 06, 2021
作者:
zw.wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 插入数据库字段缺失
上级
988ae036
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
9 行增加
和
4 行删除
+9
-4
mysql.py
hikvision_isc_client/db/mysql.py
+5
-3
merger.py
hikvision_isc_client/merger.py
+3
-1
recorder.py
hikvision_isc_client/recorder.py
+1
-0
没有找到文件。
hikvision_isc_client/db/mysql.py
浏览文件 @
0bf2d18c
...
@@ -101,7 +101,7 @@ def get_camera_info(cursor, conn):
...
@@ -101,7 +101,7 @@ def get_camera_info(cursor, conn):
@query
()
@query
()
def
insert_video_info
(
cursor
,
conn
,
db_table
,
device_code
,
file_name
,
start_time
,
end_time
,
def
insert_video_info
(
cursor
,
conn
,
db_table
,
device_code
,
file_name
,
start_time
,
end_time
,
recovered_time
,
video_url
,
video_resolution
,
status
=
0
):
recovered_time
,
video_url
,
video_resolution
,
biz_type
,
service_type
,
status
=
0
):
sql
=
'''
sql
=
'''
insert {} (
insert {} (
device_code, file_name, start_date, end_date,
device_code, file_name, start_date, end_date,
...
@@ -112,7 +112,7 @@ def insert_video_info(cursor, conn, db_table, device_code, file_name, start_time
...
@@ -112,7 +112,7 @@ def insert_video_info(cursor, conn, db_table, device_code, file_name, start_time
value (
%(device_code)
s,
%(file_name)
s,
%(start_time)
s,
%(end_time)
s,
value (
%(device_code)
s,
%(file_name)
s,
%(start_time)
s,
%(end_time)
s,
%(recovered_time)
s,
%(recovered_time)
s,
%(video_url)
s,
%(video_resolution)
s,
%(video_url)
s,
%(video_resolution)
s,
1, 1
,
%(biz_type)
s,
%(service_type)
s
,
date_add(now(),interval 31 day),
%(status)
s, now(), now()
date_add(now(),interval 31 day),
%(status)
s, now(), now()
)
)
'''
.
format
(
db_table
)
'''
.
format
(
db_table
)
...
@@ -124,7 +124,9 @@ def insert_video_info(cursor, conn, db_table, device_code, file_name, start_time
...
@@ -124,7 +124,9 @@ def insert_video_info(cursor, conn, db_table, device_code, file_name, start_time
'video_url'
:
video_url
,
'video_url'
:
video_url
,
'video_resolution'
:
video_resolution
,
'video_resolution'
:
video_resolution
,
'recovered_time'
:
recovered_time
,
'recovered_time'
:
recovered_time
,
'status'
:
status
'status'
:
status
,
'biz_type'
:
biz_type
,
'service_type'
:
service_type
})
})
video_id
=
cursor
.
lastrowid
video_id
=
cursor
.
lastrowid
conn
.
commit
()
conn
.
commit
()
...
...
hikvision_isc_client/merger.py
浏览文件 @
0bf2d18c
...
@@ -85,7 +85,9 @@ class EventMergerJob:
...
@@ -85,7 +85,9 @@ class EventMergerJob:
'end_time'
:
event
[
'end_time'
]
.
astimezone
(
pytz
.
utc
)
.
strftime
(
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
S'
),
'end_time'
:
event
[
'end_time'
]
.
astimezone
(
pytz
.
utc
)
.
strftime
(
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
S'
),
'event_type'
:
camera
[
'event_type'
],
'event_type'
:
camera
[
'event_type'
],
'camera_code'
:
camera
[
'device_code'
],
'camera_code'
:
camera
[
'device_code'
],
'db_table'
:
camera
[
'db_table'
]
'db_table'
:
camera
[
'db_table'
],
'biz_type'
:
camera
[
'biz_type'
],
'service_type'
:
camera
[
'service_type'
]
}
}
log
.
info
(
body
)
log
.
info
(
body
)
channel
.
basic_publish
(
exchange
=
''
,
routing_key
=
self
.
queue_name
,
channel
.
basic_publish
(
exchange
=
''
,
routing_key
=
self
.
queue_name
,
...
...
hikvision_isc_client/recorder.py
浏览文件 @
0bf2d18c
...
@@ -113,6 +113,7 @@ class StreamRecorder:
...
@@ -113,6 +113,7 @@ class StreamRecorder:
body
[
'start_time'
],
body
[
'end_time'
],
body
[
'start_time'
],
body
[
'end_time'
],
recovered_time
=
record_result
[
'recovered_time'
]
.
astimezone
(
pytz
.
utc
),
recovered_time
=
record_result
[
'recovered_time'
]
.
astimezone
(
pytz
.
utc
),
video_url
=
url
,
video_resolution
=
video_info
[
'resolution'
],
video_url
=
url
,
video_resolution
=
video_info
[
'resolution'
],
biz_type
=
body
[
'biz_type'
],
service_type
=
body
[
'service_type'
],
status
=
1
if
record_result
[
'is_completed'
]
else
2
)
status
=
1
if
record_result
[
'is_completed'
]
else
2
)
log
.
info
(
'video_info:
%
s, url:
%
s, video_id:
%
s.
%
s'
,
video_info
,
url
,
body
[
'db_table'
],
video_id
)
log
.
info
(
'video_info:
%
s, url:
%
s, video_id:
%
s.
%
s'
,
video_info
,
url
,
body
[
'db_table'
],
video_id
)
return
True
return
True
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论