|
|
@@ -15,7 +15,7 @@ from sqlalchemy import desc, or_
|
|
|
|
|
|
from examples.demand.changwen_prepare import changwen_prepare
|
|
|
from examples.demand.config import LOG_LEVEL, ENABLED_TOOLS
|
|
|
-from examples.demand.db_manager import DatabaseManager, query_video_ids_by_names
|
|
|
+from examples.demand.db_manager import DatabaseManager, query_video_ids_by_names, query_category_level
|
|
|
from examples.demand.models import TopicPatternExecution
|
|
|
from examples.demand.piaoquan_prepare import prepare, piaoquan_prepare
|
|
|
from examples.demand.demand_agent_context import TopicBuildAgentContext
|
|
|
@@ -292,9 +292,14 @@ def write_demand_items_to_mysql(execution_id: int, merge_level2: str) -> int:
|
|
|
desc_value = di.get("desc")
|
|
|
type = di.get("type")
|
|
|
suggestion = desc_value
|
|
|
+ type_str = str(type).strip() if type is not None else ""
|
|
|
+ if type_str == "分类":
|
|
|
+ category_level = query_category_level(execution_id=execution_id, name=name)
|
|
|
+ if category_level:
|
|
|
+ type_str = type_str + f"L{category_level}"
|
|
|
video_ids = _resolve_video_ids_by_name_and_execution_id(name=name, execution_id=execution_id)
|
|
|
# 兼容旧字段:同时保留 ext_data(reason/desc)JSON,便于旧版消费逻辑迁移期继续使用。
|
|
|
- ext_data = {"reason": reason, "desc": desc_value, "type": type, "video_ids": video_ids}
|
|
|
+ ext_data = {"reason": reason, "desc": desc_value, "type": type_str, "video_ids": video_ids}
|
|
|
|
|
|
rows.append(
|
|
|
{
|