修复延误数据查询bug
This commit is contained in:
parent
81c2459b77
commit
ccecfe75c6
|
|
@ -30,7 +30,7 @@ def query_cross_list(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(4, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
|
||||
# 查询路口列表
|
||||
|
|
@ -79,7 +79,7 @@ def query_cross_usable_date(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
|
||||
row_list = db_cross.query_cross_usable_date_sql(crossid, nodeid)
|
||||
|
|
@ -107,7 +107,7 @@ def query_cross_delay_info_controller(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
date_list = check_param(params, 'date_list')
|
||||
if not date_list or len(date_list) < 1:
|
||||
|
|
@ -187,7 +187,7 @@ def query_cross_problems(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
date_list = check_param(params, 'date_list')
|
||||
if not date_list or len(date_list) < 1:
|
||||
|
|
@ -244,7 +244,7 @@ def query_cross_index_trend_controller(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
date_list = check_param(params, 'date_list')
|
||||
if not date_list or len(date_list) < 1:
|
||||
|
|
@ -334,7 +334,7 @@ def query_cross_examine_records_detail(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
date_list = check_param(params, 'date_list')
|
||||
if not date_list:
|
||||
|
|
@ -428,7 +428,7 @@ def update_cross_examine_record_state(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
final_state = check_param(params, 'final_state')
|
||||
if not final_state:
|
||||
|
|
|
|||
|
|
@ -178,8 +178,8 @@ def gen_avg_cross_delay_pb(cross_delay_data_list):
|
|||
inroad_delay_info.delay_info.turn_ratio_2 = turn_ratio_2
|
||||
inroad_delay_info.delay_info.turn_ratio_3 = turn_ratio_3
|
||||
inroad_delay_pb_list.append(inroad_delay_info)
|
||||
avg_road_stop_times = sum(item.delay_info.stop_times for item in inroad_delay_pb_list) / len(inroad_delay_pb_list)
|
||||
cross_imbalance_index = round((round(max_stop_times, 2) - round(min_stop_times, 2)) / round(avg_road_stop_times, 2), 2) if avg_cross_delay.delay_info.stop_times != 0 else 0
|
||||
avg_road_stop_times = sum(item.delay_info.stop_times for item in inroad_delay_pb_list) / len(inroad_delay_pb_list) if len(inroad_delay_pb_list) > 0 else 0
|
||||
cross_imbalance_index = round((round(max_stop_times, 2) - round(min_stop_times, 2)) / round(avg_road_stop_times, 2), 2) if round(avg_road_stop_times, 2) != 0 else 0
|
||||
avg_cross_delay.delay_info.imbalance_index = cross_imbalance_index
|
||||
|
||||
for flow_delay_info in flow_delay_list:
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ def phase_cross_list(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(4, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ def do_query_task_list_parameter(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
|
||||
res = make_common_res(0, 'ok')
|
||||
|
|
@ -83,7 +83,7 @@ def do_query_task_list(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
|
||||
#任务名称`task_name` varchar(300) DEFAULT NULL COMMENT '任务名称',
|
||||
|
|
@ -241,7 +241,7 @@ def do_remove_task(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
tasknos = check_param(params, 'tasknos')
|
||||
if not tasknos or len(tasknos) < 1:
|
||||
|
|
@ -272,7 +272,7 @@ def do_distribute_task(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
taskno = check_param(params, 'taskno')
|
||||
if not taskno:
|
||||
|
|
@ -340,7 +340,7 @@ def do_approval(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
taskno = check_param(params, 'taskno')
|
||||
if not taskno:
|
||||
|
|
@ -399,7 +399,7 @@ def do_complete_task(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
taskno = check_param(params, 'taskno')
|
||||
if not taskno:
|
||||
|
|
@ -450,7 +450,7 @@ def do_add_task(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
|
||||
task_type = check_param(params, 'task_type')
|
||||
|
|
@ -572,7 +572,7 @@ def do_query_completed_task_cross_list(params):
|
|||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
|
||||
task_list = db_task.query_completed_task_cross_list(nodeid, area_id)
|
||||
|
|
@ -603,7 +603,7 @@ def do_query_completed_task_by_cross(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
crossid = check_param(params, 'crossid')
|
||||
if not crossid:
|
||||
|
|
@ -678,7 +678,7 @@ def do_update_task(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
taskno = check_param(params, 'taskno')
|
||||
if not taskno:
|
||||
|
|
@ -788,7 +788,7 @@ def do_task_file_download(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
taskno = check_param(params, 'taskno')
|
||||
if not taskno:
|
||||
|
|
@ -819,7 +819,7 @@ def do_query_task_history(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
taskno = check_param(params, 'taskno')
|
||||
if not taskno:
|
||||
|
|
@ -854,7 +854,7 @@ def del_task_file_api(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
taskno = check_param(params, 'taskno')
|
||||
if not taskno:
|
||||
|
|
@ -889,7 +889,7 @@ def do_query_task_progress_history(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
# taskno = params.get('taskno')
|
||||
yesterday_date = check_param(params, 'yesterday_date')
|
||||
|
|
@ -920,7 +920,7 @@ def do_query_task_detail(params):
|
|||
if not area_list or len(area_list) < 1:
|
||||
return json.dumps(make_common_res(5, '用户信息异常'))
|
||||
area_list = map(int, area_list)
|
||||
if not area_id.lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
if not str(area_id).lstrip('-').isdigit() or int(area_id) not in area_list:
|
||||
return json.dumps(make_common_res(5, '辖区id异常,请检查后重试'))
|
||||
|
||||
res = make_common_res(0, 'ok')
|
||||
|
|
|
|||
Loading…
Reference in New Issue