From a7a61e03bfb291c2cf8ed00aba19489b03992906 Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 17 Aug 2026 19:34:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20batch=5Freassess=E8=A1=8C=E4=B8=9A?= =?UTF-8?q?=E5=9B=9E=E9=80=80stock=5Fsectors=5Fem(300668=E7=AD=896?= =?UTF-8?q?=E5=8F=AAactive=E6=AD=A4=E5=89=8D=E6=97=A0=E8=A1=8C=E4=B8=9A)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/batch_reassess.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy/profile-scripts/batch_reassess.py b/deploy/profile-scripts/batch_reassess.py index b94ed8a2..71d9b6a5 100644 --- a/deploy/profile-scripts/batch_reassess.py +++ b/deploy/profile-scripts/batch_reassess.py @@ -136,9 +136,14 @@ def collect_data(code): try: _sdb = sqlite3.connect(DB, timeout=30) _sr = _sdb.execute("SELECT sector_name FROM stock_sectors WHERE code=? LIMIT 1", (code,)).fetchone() - _sdb.close() if _sr and _sr[0]: _resolved = f"行业{_sr[0]}" + else: + # 2026-08-17 修复:stock_sectors 仅898只覆盖不全,回退 stock_sectors_em(5061只) + _sr2 = _sdb.execute("SELECT sector FROM stock_sectors_em WHERE code=? LIMIT 1", (code,)).fetchone() + if _sr2 and _sr2[0]: + _resolved = f"行业{_sr2[0]}" + _sdb.close() except Exception: pass _sector_ctx = _resolved if _resolved else "行业未映射(仅大盘环境参考)"