Commit f98174f1 by 潘建波

Merge branch 'develop' of http://192.168.9.26/platform/tx1_box_serv into develop

# Conflicts:
#	code/tx1_box_serv/apps/api/http_serv.py
#	code/tx1_box_serv/apps/api/ws_serv.py
#	code/tx1_box_serv/apps/api/ws_serv.pyc
#	code/tx1_box_serv/apps/gbvar/database_global.pyc
#	code/tx1_box_serv/apps/main.py
2 parents 72dfbc75 4865325a
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# coding=utf-8 # coding=utf-8
from flask import Blueprint, request from flask import Blueprint, request
import time,json import time,json
import apps.gbvar.dict_properties as dict_p import gbvar.dict_properties as dict_p
login = Blueprint('login', __name__) login = Blueprint('login', __name__)
register = Blueprint('register', __name__) register = Blueprint('register', __name__)
...@@ -31,4 +31,4 @@ def get_recv_url(): ...@@ -31,4 +31,4 @@ def get_recv_url():
url = 'http://{}:{}/api/v1/tx1_box/events'.format(dict_p.get_value()['tx1_host'],dict_p.get_value()['tx1_http_port']) url = 'http://{}:{}/api/v1/tx1_box/events'.format(dict_p.get_value()['tx1_host'],dict_p.get_value()['tx1_http_port'])
print(url) print(url)
result = {"http_url": url} result = {"http_url": url}
return json.dumps ( result, ensure_ascii=False )
\ No newline at end of file \ No newline at end of file
return json.dumps ( result, ensure_ascii=False )
...@@ -50,7 +50,7 @@ class EventToLocalUtil(object): ...@@ -50,7 +50,7 @@ class EventToLocalUtil(object):
if index == 0: if index == 0:
infoPath = (pic['ofilename'].split('.'))[0] infoPath = (pic['ofilename'].split('.'))[0]
# infoPath = pic['ofilename'] # infoPath = pic['ofilename']
picPath = basePath + '/' + pic['ofilename'] picPath = basePath + '/' + pic['ofilename']
elif 'event_refid' in dataDict: elif 'event_refid' in dataDict:
if(len(dataDict['event_refid'])<=0): if(len(dataDict['event_refid'])<=0):
dataDict['event_refid'] = str(uuid.uuid1()) dataDict['event_refid'] = str(uuid.uuid1())
...@@ -63,6 +63,7 @@ class EventToLocalUtil(object): ...@@ -63,6 +63,7 @@ class EventToLocalUtil(object):
if(len(picPath) >0): if(len(picPath) >0):
if 'pic_base64' in pic: if 'pic_base64' in pic:
try: try:
picPath= picPath.decode('utf8').encode('gb2312')
with open(picPath, 'wb') as f: with open(picPath, 'wb') as f:
f.write(base64.b64decode(pic['pic_base64'])) f.write(base64.b64decode(pic['pic_base64']))
outPicsPath.append(picPath) outPicsPath.append(picPath)
...@@ -87,6 +88,7 @@ class EventToLocalUtil(object): ...@@ -87,6 +88,7 @@ class EventToLocalUtil(object):
infoPath = basePath + '/' + infoPath + '.json' infoPath = basePath + '/' + infoPath + '.json'
try: try:
infoPath = infoPath.decode('utf8').encode('gb2312')
with open(infoPath, 'w') as f: with open(infoPath, 'w') as f:
json.dump(dataDict, f) json.dump(dataDict, f)
outInfoPath.append(infoPath) outInfoPath.append(infoPath)
...@@ -141,13 +143,16 @@ class EventToLocalUtil(object): ...@@ -141,13 +143,16 @@ class EventToLocalUtil(object):
eventCate = dataDict['event_cate'] eventCate = dataDict['event_cate']
if eventType == 'vehicle' : if eventType == 'vehicle' :
# 卡口 # 卡口
if 'illegal' not in dataDict: if 'illegal' not in dataDict['event_data'] or dataDict['event_data']['illegal']['state'] == 0:
genPath = '%s/kakou/%s/%04d%02d%02d/%02d/%02d'%(self.rootPath,vid,et.year, \ genPath = '%s/kakou/%s/%04d%02d%02d/%02d/%02d'%(self.rootPath,vid,et.year, \
et.month,et.day,et.hour, et.minute) et.month,et.day,et.hour, et.minute)
else: else:
#违法 #违法
illegalType = 'unknow'
if 'code' in dataDict['event_data']['illegal']:
illegalType = 'code' + str(dataDict['event_data']['illegal']['code'])
genPath = '%s/weifa/%s/%04d%02d%02d/%s/%02d'%(self.rootPath,vid,et.year, \ genPath = '%s/weifa/%s/%04d%02d%02d/%s/%02d'%(self.rootPath,vid,et.year, \
et.month,et.day,dataDict['event_type'], et.hour) et.month,et.day,illegalType, et.hour)
# 交通参数 # 交通参数
elif eventType == 'tflow' \ elif eventType == 'tflow' \
or eventType == 'pflow' or eventType == 'pdensity': or eventType == 'pflow' or eventType == 'pdensity':
...@@ -168,4 +173,4 @@ class EventToLocalUtil(object): ...@@ -168,4 +173,4 @@ class EventToLocalUtil(object):
print('[error][event_to_local]:{}'.format(logstr)) print('[error][event_to_local]:{}'.format(logstr))
eventToLocal = EventToLocalUtil()
\ No newline at end of file \ No newline at end of file
eventToLocal = EventToLocalUtil()
...@@ -7,16 +7,17 @@ tx1_ws_port=20080 ...@@ -7,16 +7,17 @@ tx1_ws_port=20080
datasource_url=F:\ssss\ss\TF.FDB datasource_url=F:\ssss\ss\TF.FDB
#初始化任务列表(说明:路径@任务名称 #初始化任务列表(说明:路径@任务名称
task_1=F:\公司项目目录\mini_fanxin\config\TASK1\tasks.xml@F:\公司项目目录\mini_fanxin\config\TASK1\TASK1\@F:\公司项目目录\mini_fanxin\config\TASK1\TASK1\TASK1\@F:\公司项目目录\mini_fanxin\config\TrafficConfig.xml task_1=/root/UserApp/vioncfg/Device/TASK1/tasks.xml@/root/UserApp/vioncfg/Device/TASK1/TASK1/@/root/UserApp/vioncfg/Device/TASK1/TASK1/TASK1/@/root/UserApp/services/analysis_service/VAServer/TrafficConfig.xml
task_2= #task_1=/root/UserApp/vioncfg/Device/d8802881b1fa40a0bca979214acb78d7/tasks.xml@/root/UserApp/vioncfg/Device/d8802881b1fa40a0bca979214acb78d7/d1f69df819a0472bbbe2e5a34806d1a0/@/root/UserApp/vioncfg/Device/d8802881b1fa40a0bca979214acb78d7/d1f69df819a0472bbbe2e5a34806d1a0/ea3ade4d66d04cfa94c289285b05df96/@/root/UserApp/services/analysis_service/VAServer/TrafficConfig.xml
task_2=/root/UserApp/vioncfg/Device/TASK2/tasks.xml@/root/UserApp/vioncfg/Device/TASK2/TASK2/@/root/UserApp/vioncfg/Device/TASK2/TASK2/TASK2/@/root/UserApp/services/analysis_service/VAServer/TrafficConfig.xml
task_3= task_3=
task_4=/root/UserApp/vioncfg/Ops/ServerConfig.xml@运维服务@./start.sh task_4=
#截图接口地址 #截图接口地址
cut_pic_url=http://192.168.88.109:10088/apiv1/capture cut_pic_url=http://127.0.0.1:10088/apiv1/capture
#重启任务指令 #重启任务指令
start_task=./task_start.sh start_task=./task_start.sh
save_root_path=./datasave
\ No newline at end of file \ No newline at end of file
save_root_path=/root/Log/saveresult
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!