From 72a8a0a1ad6b79b8e9fb2facef121f9b5d584666 Mon Sep 17 00:00:00 2001
From: xuyonghao <898441624@qq.com>
Date: 星期六, 08 二月 2025 10:56:30 +0800
Subject: [PATCH] 报表合并历史记录功能

---
 app/task/fetch_agent.py |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/app/task/fetch_agent.py b/app/task/fetch_agent.py
index 3ac6125..f77e013 100644
--- a/app/task/fetch_agent.py
+++ b/app/task/fetch_agent.py
@@ -108,14 +108,21 @@
     try:
         count = db.query(AgentModel).count()
         if count > 0:
-            return
+            # 鍒犻櫎琛ㄤ腑鐨勬墍鏈夋暟鎹�
+            result = db.query(AgentModel).delete()
+            db.commit()  # 鎻愪氦浜嬪姟
+
         initial_agents = [
-            ('80ee430a-e396-48c4-a12c-7c7cdf5eda51', 1, '鎶ュ憡鐢熸垚', 'BISHENG', 'report'),
+            # ('80ee430a-e396-48c4-a12c-7c7cdf5eda51', 1, '鎶ュ憡鐢熸垚', 'BISHENG', 'report'),
             ('basic_excel_merge', 2, '鎶ヨ〃鍚堝苟', 'BASIC', 'excelMerge'),
-            ('bfd090d589d811efb3630242ac190006', 4, '鏂囨。鏅鸿兘', 'BISHENG', 'report'),
+            ('7638f006-38a2-4c21-a68e-c6c49b304a35', 4, '鏂囨。鏅鸿兘', 'DIFY', 'documentIa'),
             ('da3451da89d911efb9490242ac190006', 3, '鐭ヨ瘑闂瓟', 'RAGFLOW', 'knowledgeQA'),
             ('e96eb7a589db11ef87d20242ac190006', 5, '鏅鸿兘闂瓟', 'RAGFLOW', 'chat'),
-            ('basic_excel_talk', 6, '鏅鸿兘鏁版嵁', 'BASIC', 'excelTalk')
+            ('basic_report_clean', 6, '鎶ュ憡鐢熸垚', 'DIFY', 'reportWorkflow'),
+            # ('basic_excel_talk', 6, '鏅鸿兘鏁版嵁', 'BASIC', 'excelTalk'),
+            # ('basic_question_talk', 7, '鍑洪缁勫嵎', 'BASIC', 'questionTalk'),
+            # ('9d75142a-66eb-4e23-b7d4-03efe4584915', 8, '灏忔暟缁樺浘', 'DIFY', 'imageTalk'),
+            # ('basic_paper_talk', 8, '鏂囨。鍑哄嵎', 'BASIC', 'paperTalk')
         ]
 
         for agent in initial_agents:
@@ -133,10 +140,10 @@
 
 def sync_agents():
     try:
-        bisheng_data = get_data_from_bisheng(BISHENG_NAMES_TO_SYNC)
+        # bisheng_data = get_data_from_bisheng(BISHENG_NAMES_TO_SYNC)
         ragflow_data = get_data_from_ragflow(RAGFLOW_NAMES_TO_SYNC)
 
-        update_ids_in_local(bisheng_data)
+        # update_ids_in_local(bisheng_data)
         update_ids_in_local(ragflow_data)
 
         print("Agents synchronized successfully")

--
Gitblit v1.8.0