From ab83f05d6335a2d9cfe981bfaead16a5f77c148e Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 16 Jun 2026 17:19:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dcheck=5F*.dspy?= =?UTF-8?q?=E7=9A=84false/False=E9=94=99=E8=AF=AF=E5=92=8Cpricingdata?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/check_date_status.dspy | 6 ++--- wwwroot/check_llm_api_map.dspy | 4 ++-- wwwroot/check_model_record.dspy | 4 ++-- wwwroot/check_pricing_data.dspy | 38 +++++++++++++++++------------- wwwroot/check_pricing_program.dspy | 4 ++-- wwwroot/check_uapi.dspy | 4 ++-- wwwroot/check_uapiio.dspy | 4 ++-- wwwroot/check_upapp.dspy | 4 ++-- 8 files changed, 37 insertions(+), 31 deletions(-) diff --git a/wwwroot/check_date_status.dspy b/wwwroot/check_date_status.dspy index 0215732..9ef71e2 100644 --- a/wwwroot/check_date_status.dspy +++ b/wwwroot/check_date_status.dspy @@ -3,7 +3,7 @@ llmid = params_kw.get('llmid', '') if not llmid: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ 日期与状态: 缺少llmid参数", "i18n": false} + "options": {"text": "❌ 日期与状态: 缺少llmid参数", "i18n": False} }, ensure_ascii=False) async with get_sor_context(request._run_ns, 'llmage') as sor: @@ -13,7 +13,7 @@ async with get_sor_context(request._run_ns, 'llmage') as sor: if not recs: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ 日期与状态: 模型不存在", "i18n": false} + "options": {"text": "❌ 日期与状态: 模型不存在", "i18n": False} }, ensure_ascii=False) llm = recs[0] @@ -27,5 +27,5 @@ else: return json.dumps({ "widgettype": "Text", - "options": {"text": text, "i18n": false} + "options": {"text": text, "i18n": False} }, ensure_ascii=False) diff --git a/wwwroot/check_llm_api_map.dspy b/wwwroot/check_llm_api_map.dspy index fa7c6c9..6a2552d 100644 --- a/wwwroot/check_llm_api_map.dspy +++ b/wwwroot/check_llm_api_map.dspy @@ -3,7 +3,7 @@ llmid = params_kw.get('llmid', '') if not llmid: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ 能力映射(llm_api_map): 缺少llmid参数", "i18n": false} + "options": {"text": "❌ 能力映射(llm_api_map): 缺少llmid参数", "i18n": False} }, ensure_ascii=False) async with get_sor_context(request._run_ns, 'llmage') as sor: @@ -18,5 +18,5 @@ else: return json.dumps({ "widgettype": "Text", - "options": {"text": text, "i18n": false} + "options": {"text": text, "i18n": False} }, ensure_ascii=False) diff --git a/wwwroot/check_model_record.dspy b/wwwroot/check_model_record.dspy index 984d5c9..7c9e302 100644 --- a/wwwroot/check_model_record.dspy +++ b/wwwroot/check_model_record.dspy @@ -3,7 +3,7 @@ llmid = params_kw.get('llmid', '') if not llmid: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ 模型记录: 缺少llmid参数", "i18n": false} + "options": {"text": "❌ 模型记录: 缺少llmid参数", "i18n": False} }, ensure_ascii=False) async with get_sor_context(request._run_ns, 'llmage') as sor: @@ -18,5 +18,5 @@ else: return json.dumps({ "widgettype": "Text", - "options": {"text": text, "i18n": false} + "options": {"text": text, "i18n": False} }, ensure_ascii=False) diff --git a/wwwroot/check_pricing_data.dspy b/wwwroot/check_pricing_data.dspy index 93d5e7c..59bcc61 100644 --- a/wwwroot/check_pricing_data.dspy +++ b/wwwroot/check_pricing_data.dspy @@ -3,7 +3,7 @@ llmid = params_kw.get('llmid', '') if not llmid: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ 定价数据(pricingdata): 缺少llmid参数", "i18n": false} + "options": {"text": "❌ 定价数据: 缺少llmid参数", "i18n": False} }, ensure_ascii=False) async with get_sor_context(request._run_ns, 'llmage') as sor: @@ -12,25 +12,31 @@ async with get_sor_context(request._run_ns, 'llmage') as sor: ppids = [m.ppid for m in maps if m.ppid] if maps else [] if not ppids: - text = "❌ 定价数据(pricingdata): 无定价项目" + text = "❌ 定价数据: 无定价项目" else: ppid = ppids[0] - async with get_sor_context(request._run_ns, 'pricing') as psor: - # First check if pricing_program exists - pregs = await psor.sqlExe( - "select * from pricing_program where id=${ppid}$", {'ppid': ppid}) - if not pregs: - text = "❌ 定价数据(pricingdata): 依赖定价项目未通过" - else: - datas = await psor.sqlExe( - "select count(*) as cnt from pricingdata where ppid=${ppid}$", {'ppid': ppid}) - cnt = datas[0].cnt if datas else 0 - if cnt > 0: - text = f"✅ 定价数据(pricingdata): {cnt}条记录" + 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: - text = "❌ 定价数据(pricingdata): 无定价数据" + # 检查 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}" + except Exception as e: + text = f"❌ 定价数据: {e}" return json.dumps({ "widgettype": "Text", - "options": {"text": text, "i18n": false} + "options": {"text": text, "i18n": False} }, ensure_ascii=False) diff --git a/wwwroot/check_pricing_program.dspy b/wwwroot/check_pricing_program.dspy index aab1c5f..7f9a6fe 100644 --- a/wwwroot/check_pricing_program.dspy +++ b/wwwroot/check_pricing_program.dspy @@ -3,7 +3,7 @@ llmid = params_kw.get('llmid', '') if not llmid: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ 定价项目(pricing_program): 缺少llmid参数", "i18n": false} + "options": {"text": "❌ 定价项目(pricing_program): 缺少llmid参数", "i18n": False} }, ensure_ascii=False) async with get_sor_context(request._run_ns, 'llmage') as sor: @@ -25,5 +25,5 @@ else: return json.dumps({ "widgettype": "Text", - "options": {"text": text, "i18n": false} + "options": {"text": text, "i18n": False} }, ensure_ascii=False) diff --git a/wwwroot/check_uapi.dspy b/wwwroot/check_uapi.dspy index 43b0511..1dfa241 100644 --- a/wwwroot/check_uapi.dspy +++ b/wwwroot/check_uapi.dspy @@ -3,7 +3,7 @@ llmid = params_kw.get('llmid', '') if not llmid: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ API映射(uapi): 缺少llmid参数", "i18n": false} + "options": {"text": "❌ API映射(uapi): 缺少llmid参数", "i18n": False} }, ensure_ascii=False) async with get_sor_context(request._run_ns, 'llmage') as sor: @@ -26,5 +26,5 @@ else: return json.dumps({ "widgettype": "Text", - "options": {"text": text, "i18n": false} + "options": {"text": text, "i18n": False} }, ensure_ascii=False) diff --git a/wwwroot/check_uapiio.dspy b/wwwroot/check_uapiio.dspy index 8d89f40..6348d83 100644 --- a/wwwroot/check_uapiio.dspy +++ b/wwwroot/check_uapiio.dspy @@ -3,7 +3,7 @@ llmid = params_kw.get('llmid', '') if not llmid: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ IO定义(uapiio): 缺少llmid参数", "i18n": false} + "options": {"text": "❌ IO定义(uapiio): 缺少llmid参数", "i18n": False} }, ensure_ascii=False) async with get_sor_context(request._run_ns, 'llmage') as sor: @@ -29,5 +29,5 @@ async with get_sor_context(request._run_ns, 'llmage') as sor: return json.dumps({ "widgettype": "Text", - "options": {"text": text, "i18n": false} + "options": {"text": text, "i18n": False} }, ensure_ascii=False) diff --git a/wwwroot/check_upapp.dspy b/wwwroot/check_upapp.dspy index 16a4680..c2c1154 100644 --- a/wwwroot/check_upapp.dspy +++ b/wwwroot/check_upapp.dspy @@ -3,7 +3,7 @@ llmid = params_kw.get('llmid', '') if not llmid: return json.dumps({ "widgettype": "Text", - "options": {"text": "❌ 上位系统(upapp): 缺少llmid参数", "i18n": false} + "options": {"text": "❌ 上位系统(upapp): 缺少llmid参数", "i18n": False} }, ensure_ascii=False) async with get_sor_context(request._run_ns, 'llmage') as sor: @@ -23,5 +23,5 @@ async with get_sor_context(request._run_ns, 'llmage') as sor: return json.dumps({ "widgettype": "Text", - "options": {"text": text, "i18n": false} + "options": {"text": text, "i18n": False} }, ensure_ascii=False)