feat: 添加生命周期报告和AI规则管理功能

- 在Dockerfile中添加pillow依赖包用于图像处理
- 实现生命周期报告调度任务,支持日报和周报两种类型
- 新增TASK_RUN_LIFECYCLE任务常量和相关配置选项
- 扩展AI Agent服务以支持用户规则,并在分析时应用规则
- 添加AI用户规则创建、更新和查询接口
- 增加项目生命周期和财务需求分析技能
- 扩展现有模型以支持更完整的业务数据字段
- 实现飞书图片上传功能用于报告展示
```
This commit is contained in:
2026-07-12 17:44:49 +08:00
parent bf309ecdf7
commit 9cf7c44393
45 changed files with 5036 additions and 49 deletions

View File

@@ -1,6 +1,7 @@
from app.tasks.app import celery_app
from app.tasks import events as _events # noqa: F401
from app.tasks import legacy as _legacy # noqa: F401
from app.tasks import lifecycle as _lifecycle # noqa: F401
from app.tasks import reports as _reports # noqa: F401
from app.tasks import risk as _risk # noqa: F401

33
app/tasks/lifecycle.py Normal file
View File

@@ -0,0 +1,33 @@
from typing import Any
from app.core.background.task_queue.constants import TASK_RUN_LIFECYCLE
from app.core.constants import ActorValue
from app.core.database import SessionLocal
from app.modules.reports.lifecycle_pipeline import LifecyclePipelineService
from app.tasks.app import celery_app
@celery_app.task(
name=TASK_RUN_LIFECYCLE,
autoretry_for=(Exception,),
retry_backoff=True,
retry_kwargs={"max_retries": 3},
)
def run_lifecycle_report(
report_type: str,
receive_id: str | None = None,
receive_id_type: str = "chat_id",
force: bool = False,
actor: str = ActorValue.SCHEDULER,
) -> dict[str, Any]:
db = SessionLocal()
try:
return LifecyclePipelineService(db).run(
report_type,
receive_id,
receive_id_type,
force,
actor,
)
finally:
db.close()