Compare commits

..

2 Commits

Author SHA1 Message Date
wangxu d5d8a22862 Merge branch 'wangxu_dev' of http://data01:3000/xuwang/cross_doctor into wangxu_dev 2026-05-20 19:21:09 +08:00
wangxu 6674d6a396 修复路口对比报告bug 2026-05-20 19:21:05 +08:00
1 changed files with 9 additions and 10 deletions

View File

@ -45,11 +45,9 @@ def gen_cross_compare_report(params):
date_list = check_param(params, 'date_list') # 优化后
if not date_list or len(date_list) < 1:
return json.dumps(make_common_res(7, '缺少日期参数,请最少选择一天作为查询日期'))
date_list = list(map(str, date_list))
compare_date_list = check_param(params, 'compare_date_list') # 优化前
if not compare_date_list or len(compare_date_list) < 1:
return json.dumps(make_common_res(6, '缺少对比日期参数,请最少选择一天作为对比日期'))
compare_date_list = list(map(str, compare_date_list))
query_type = check_param(params, 'query_type')
if not query_type:
query_type = 0
@ -618,11 +616,12 @@ def cancel_collect_report(params):
def transition_date_list4screen(date_list):
for i in range(0, len(date_list)):
if len(date_list[i]) == 1:
date_list[i] = [datetime.datetime.strptime(date_list[i][0], '%Y%m%d').strftime('%Y-%m-%d'), datetime.datetime.strptime(date_list[i][0], '%Y%m%d').strftime('%Y-%m-%d')]
elif len(date_list[i]) == 2:
date_list[i] = [datetime.datetime.strptime(date_list[i][0], '%Y%m%d').strftime('%Y-%m-%d'), datetime.datetime.strptime(date_list[i][1], '%Y%m%d').strftime('%Y-%m-%d')]
elif len(date_list[i]) > 2:
date_list[i] = [datetime.datetime.strptime(date_list[i][0], '%Y%m%d').strftime('%Y-%m-%d'), datetime.datetime.strptime(date_list[i][-1], '%Y%m%d').strftime('%Y-%m-%d')]
return date_list
tmp_list = date_list.copy()
for i in range(0, len(tmp_list)):
if len(tmp_list[i]) == 1:
tmp_list[i] = [datetime.strptime(tmp_list[i][0], '%Y%m%d').strftime('%Y-%m-%d'), datetime.strptime(tmp_list[i][0], '%Y%m%d').strftime('%Y-%m-%d')]
elif len(tmp_list[i]) == 2:
tmp_list[i] = [datetime.strptime(tmp_list[i][0], '%Y%m%d').strftime('%Y-%m-%d'), datetime.strptime(tmp_list[i][1], '%Y%m%d').strftime('%Y-%m-%d')]
elif len(tmp_list[i]) > 2:
tmp_list[i] = [datetime.strptime(tmp_list[i][0], '%Y%m%d').strftime('%Y-%m-%d'), datetime.strptime(tmp_list[i][-1], '%Y%m%d').strftime('%Y-%m-%d')]
return tmp_list