Files
JiuContinent 9cf7c44393 ```
feat: 添加生命周期报告和AI规则管理功能

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

37 lines
2.1 KiB
Python

from datetime import date, datetime
from sqlalchemy import Boolean, Date, DateTime, Integer, String, Text
from sqlalchemy.orm import Mapped, mapped_column
from app.core.database import Base
from app.modules.business.constants import (
SourceSystem,
StatusValue,
)
from app.modules.business.models.common import TimestampMixin
class AttendanceRecord(Base, TimestampMixin):
__tablename__ = "attendance_records"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
code: Mapped[str] = mapped_column(String(64), unique=True, index=True)
employee_name: Mapped[str] = mapped_column(String(128), index=True)
employee_id: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
department: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
project_code: Mapped[str | None] = mapped_column(String(64), nullable=True, index=True)
work_date: Mapped[date] = mapped_column(Date, index=True)
check_in_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
check_out_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
status: Mapped[str] = mapped_column(String(64), default=StatusValue.NORMAL_CN, index=True)
location: Mapped[str | None] = mapped_column(String(255), nullable=True)
source_system: Mapped[str] = mapped_column(String(64), default=SourceSystem.INTERNAL)
external_id: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
note: Mapped[str | None] = mapped_column(Text, nullable=True)
attendance_scope: Mapped[str] = mapped_column(String(32), default="company", index=True)
source_status: Mapped[str | None] = mapped_column(String(64), nullable=True, index=True)
source_location_status: Mapped[str | None] = mapped_column(String(64), nullable=True)
source_updated_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True, index=True)
last_seen_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True, index=True)
is_active: Mapped[bool] = mapped_column(Boolean, default=True, index=True)