修复路口问题诊断详情bug

This commit is contained in:
wangxu 2025-11-14 14:46:15 +08:00
parent 97405d8d80
commit 51e5e591fe
3 changed files with 11 additions and 3 deletions

View File

@ -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, '当前路口在所选时段无异常情况'))

View File

@ -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)

View File

@ -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,