修复例行路口大数据方案验证异常

This commit is contained in:
wangxu 2026-05-13 17:49:19 +08:00
parent 09f5c303f0
commit 719d6f863b
2 changed files with 10 additions and 9 deletions

View File

@ -281,12 +281,13 @@ class TmnetDbHelper(TableDbHelperBase):
return 0, e return 0, e
def clear_old_cross_examine_records(self): def clear_old_cross_examine_records(self):
old_data_sql = "select * from cross_doctor_metadata.cross_phase_problem_record where end_date is null" old_data_sql = "select * from cross_doctor_matedata.cross_phase_problems_record where end_date is null"
old_data = self.do_select(old_data_sql) old_data = self.do_select(old_data_sql)
clear_list = [] clear_list = []
now_date, suc_num = datetime.now().strftime('%Y%m%d'), 0 now_date, suc_num = datetime.now().strftime('%Y%m%d'), 0
for row in old_data: for row in old_data:
phase_type = row['phase_type'] phase_type = row['phase_type']
if len(phase_type) >= 5:
if phase_type[-4] == '^^^^': if phase_type[-4] == '^^^^':
clear_list.append({ clear_list.append({
'crossid': row['crossid'], 'crossid': row['crossid'],

View File

@ -61,7 +61,7 @@ def init(args):
dev = int(args.dev) dev = int(args.dev)
day = args.day day = args.day
if dev == 0: if dev == 0:
g_cloud_db['host'] = '172.21.32.41' g_cloud_db['host'] = '172.21.32.43'
g_cloud_db['port'] = 3306 g_cloud_db['port'] = 3306
g_dbinfo['host'] = '172.21.32.21' g_dbinfo['host'] = '172.21.32.21'
g_db_pool.init_pool(g_dbinfo) g_db_pool.init_pool(g_dbinfo)
@ -69,7 +69,7 @@ def init(args):
if day == 0: if day == 0:
day = (datetime.now() - timedelta(days=1)).strftime('%Y%m%d') day = (datetime.now() - timedelta(days=1)).strftime('%Y%m%d')
today_data = g_db_cloud.query_all_cross_examine_problems(day) today_data = g_db_cloud.query_all_cross_examine_problems(day)
yes_str = datetime.strptime(day, '%Y%m%d').strftime('%Y-%m-%d') yes_str = (datetime.strptime(day, '%Y%m%d') - timedelta(days=1)).strftime('%Y-%m-%d')
yesterday_records = g_db_cross.query_all_cross_examine_records(yes_str) yesterday_records = g_db_cross.query_all_cross_examine_records(yes_str)
yesterday_data_dict = parse_records2dict(yesterday_records) yesterday_data_dict = parse_records2dict(yesterday_records)
today_records = {} today_records = {}