From a4aa40faf5b501067e23dc6c69f93c60ec8c66fb Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 24 Jul 2026 23:44:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20llm=E4=B8=8A=E7=BA=BF=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=AE=9A=E4=BB=B7=E6=95=B0=E6=8D=AE=E6=98=BE=E7=A4=BA=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E5=86=85=E5=AE=B9=E8=80=8C=E9=9D=9E=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 改用 pricing.pricing.get_pricing_display() 获取格式化定价明细, 替换原来的 select count(*) 只显示记录条数 --- wwwroot/check_pricing_data.dspy | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/wwwroot/check_pricing_data.dspy b/wwwroot/check_pricing_data.dspy index 59bcc61..af8876f 100644 --- a/wwwroot/check_pricing_data.dspy +++ b/wwwroot/check_pricing_data.dspy @@ -1,3 +1,5 @@ +from pricing.pricing import get_pricing_display + llmid = params_kw.get('llmid', '') if not llmid: @@ -16,23 +18,18 @@ if not ppids: else: ppid = ppids[0] try: - async with get_sor_context(request._run_ns, 'pricing') as psor: - pregs = await psor.sqlExe( - "select * from pricing_program where id=${ppid}$", {'ppid': ppid}) - if not pregs: - text = "❌ 定价数据: 依赖定价项目未通过" - else: - # 检查 pricing_program_timing 表 - try: - timings = await psor.sqlExe( - "select count(*) as cnt from pricing_program_timing where ppid=${ppid}$", {'ppid': ppid}) - cnt = timings[0].cnt if timings else 0 - if cnt > 0: - text = f"✅ 定价数据(pricing_program_timing): {cnt}条记录" - else: - text = "❌ 定价数据: pricing_program_timing 无记录" - except Exception as e: - text = f"❌ 定价数据: {e}" + result = await get_pricing_display(ppid) + if not result: + text = "❌ 定价数据: 无当前生效的定价记录" + elif result.get('display_text'): + lines = [f"✅ 定价项目: {result.get('name', ppid)}"] + if result.get('pricing_type'): + lines.append(f" 类型: {result['pricing_type']}") + lines.append("") + lines.append(result['display_text']) + text = '\n'.join(lines) + else: + text = f"✅ 定价项目: {result.get('name', ppid)} (无定价明细)" except Exception as e: text = f"❌ 定价数据: {e}"