From 51e5e591fea5555a6f8dec7b03d203122b1d577c Mon Sep 17 00:00:00 2001 From: wangxu <1318272526@qq.com> Date: Fri, 14 Nov 2025 14:46:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=8F=A3=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E8=AF=8A=E6=96=AD=E8=AF=A6=E6=83=85bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/cross_evaluate_worker.py | 7 ++++--- app/db_cross_delay.py | 6 ++++++ app/eva_common.py | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/cross_evaluate_worker.py b/app/cross_evaluate_worker.py index 408bec7..4ca930c 100644 --- a/app/cross_evaluate_worker.py +++ b/app/cross_evaluate_worker.py @@ -345,11 +345,12 @@ def query_cross_examine_records_detail(params): start_time = check_param(params, 'start_time') if not start_time: return json.dumps(make_common_res(9, '缺少开始时间,请选择开始时间')) + first_date = check_param(params, 'first_date') + if not first_date: + return json.dumps(make_common_res(10, '缺少开始日期,请选择开始日期')) - max_date = max(date_list) - min_date = min(date_list) tp_start = int(str(start_time).split(':')[0]) * 100 + int(str(start_time).split(':')[1]) - cross_examine_records = db_cross.query_cross_examine_records(tp_start, max_date, crossid, min_date) + cross_examine_records = db_cross.query_cross_examine_record_detail(tp_start, first_date, crossid) prev_day = (datetime.now() - timedelta(days=1)).strftime('%Y%m%d') if not cross_examine_records: return json.dumps(make_common_res(9, '当前路口在所选时段无异常情况')) diff --git a/app/db_cross_delay.py b/app/db_cross_delay.py index e9b5086..e3cac3b 100644 --- a/app/db_cross_delay.py +++ b/app/db_cross_delay.py @@ -37,6 +37,12 @@ class CrossDbHelper(TableDbHelperBase): """ % (crossid, start_hm, first_date, end_date) return self.do_select(sql) + def query_cross_examine_record_detail(self, start_hm, first_date, crossid): + sql = """ + select * from cross_doctor_matedata.cross_phase_problems_record_detail where crossid = '%s' and start_hm = '%s' and first_date = %s + """ % (crossid, start_hm, first_date) + return self.do_select(sql) + def query_cross_examine_records_nostarthm(self, first_date, crossid, end_date): sql = """ select * from cross_doctor_matedata.cross_phase_problems_record where crossid = '%s' and first_date <= %s and (end_date >= '%s' or end_date is null) diff --git a/app/eva_common.py b/app/eva_common.py index d454189..cf26ca9 100644 --- a/app/eva_common.py +++ b/app/eva_common.py @@ -1522,6 +1522,7 @@ def gen_err_phase_problems(max_date, crossid, min_date, time_range): { 'text': f'从{first_date}起在{start_hm}-{end_hm}时段运行的配时方案有异常变动风险,异常等级为', 'start_hm': start_hm, + 'first_date': first_date }, { 'level_color': color_level,