Compare commits
2 Commits
78b6d0425b
...
d5d8a22862
| Author | SHA1 | Date |
|---|---|---|
|
|
d5d8a22862 | |
|
|
6674d6a396 |
|
|
@ -45,11 +45,9 @@ def gen_cross_compare_report(params):
|
||||||
date_list = check_param(params, 'date_list') # 优化后
|
date_list = check_param(params, 'date_list') # 优化后
|
||||||
if not date_list or len(date_list) < 1:
|
if not date_list or len(date_list) < 1:
|
||||||
return json.dumps(make_common_res(7, '缺少日期参数,请最少选择一天作为查询日期'))
|
return json.dumps(make_common_res(7, '缺少日期参数,请最少选择一天作为查询日期'))
|
||||||
date_list = list(map(str, date_list))
|
|
||||||
compare_date_list = check_param(params, 'compare_date_list') # 优化前
|
compare_date_list = check_param(params, 'compare_date_list') # 优化前
|
||||||
if not compare_date_list or len(compare_date_list) < 1:
|
if not compare_date_list or len(compare_date_list) < 1:
|
||||||
return json.dumps(make_common_res(6, '缺少对比日期参数,请最少选择一天作为对比日期'))
|
return json.dumps(make_common_res(6, '缺少对比日期参数,请最少选择一天作为对比日期'))
|
||||||
compare_date_list = list(map(str, compare_date_list))
|
|
||||||
query_type = check_param(params, 'query_type')
|
query_type = check_param(params, 'query_type')
|
||||||
if not query_type:
|
if not query_type:
|
||||||
query_type = 0
|
query_type = 0
|
||||||
|
|
@ -618,11 +616,12 @@ def cancel_collect_report(params):
|
||||||
|
|
||||||
|
|
||||||
def transition_date_list4screen(date_list):
|
def transition_date_list4screen(date_list):
|
||||||
for i in range(0, len(date_list)):
|
tmp_list = date_list.copy()
|
||||||
if len(date_list[i]) == 1:
|
for i in range(0, len(tmp_list)):
|
||||||
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')]
|
if len(tmp_list[i]) == 1:
|
||||||
elif len(date_list[i]) == 2:
|
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')]
|
||||||
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(tmp_list[i]) == 2:
|
||||||
elif len(date_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')]
|
||||||
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(tmp_list[i]) > 2:
|
||||||
return date_list
|
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
|
||||||
Loading…
Reference in New Issue