From 348b3e91989bedf4ae635872f3eac1bd80dc466b Mon Sep 17 00:00:00 2001 From: wangxu <1318272526@qq.com> Date: Mon, 17 Nov 2025 18:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E6=97=B6=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E5=BC=82=E5=B8=B8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/eva_common.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/eva_common.py b/app/eva_common.py index d773a5b..24956d9 100644 --- a/app/eva_common.py +++ b/app/eva_common.py @@ -1480,6 +1480,15 @@ def gen_phase_problems(nodeid, area_id, crossid, time_range, date_list, min_date def gen_err_phase_problems(max_date, crossid, min_date, time_range): cross_examine_records = db_cross.query_cross_examine_records_nostarthm(max_date, crossid, min_date) + final_res = [] + for row in cross_examine_records: + start_hm = convert_time(row['start_hm']) + end_hm = convert_time(row['end_hm']) + if not time_overlap(time_range, [start_hm + '-' + end_hm]): + continue + if row['level_color'] == 4 or row['final_state'] == 6: + continue + final_res.append(row) detail = [] suggestions, total_num = [], 0 color_dict = { @@ -1496,7 +1505,7 @@ def gen_err_phase_problems(max_date, crossid, min_date, time_range): 5: '核查无异常', 6: '自动结束' } - if len(cross_examine_records) > 0: + if len(final_res) > 0: total_num = 1 detail = [] suggestions = [ @@ -1508,13 +1517,9 @@ def gen_err_phase_problems(max_date, crossid, min_date, time_range): ] } ] - for cross_examine_record in cross_examine_records: + for cross_examine_record in final_res: start_hm = convert_time(cross_examine_record['start_hm']) end_hm = convert_time(cross_examine_record['end_hm']) - if not time_overlap(time_range, [start_hm + '-' + end_hm]): - continue - if cross_examine_record['level_color'] == 4 or cross_examine_record['final_state'] == 6: - continue first_date = cross_examine_record['first_date'] color_level = color_dict[cross_examine_record['level_color']] final_state = state_dict[cross_examine_record['final_state']]