project_task.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from sqlalchemy import Column, Integer, String, DateTime, Text
  2. from sqlalchemy.sql import func
  3. from sqlalchemy.ext.declarative import declarative_base
  4. Base = declarative_base()
  5. class ProjectTaskModel(Base):
  6. __tablename__ = 'project_task'
  7. id = Column(Integer, primary_key=True, autoincrement=True)
  8. task_name = Column(String(255), nullable=False, comment='任务名称')
  9. task_desc = Column(String(1000), comment='任务描述')
  10. project_id = Column(String(50), nullable=False, comment='项目编号')
  11. budget_id = Column(Integer, comment='概算序号')
  12. item_id = Column(Integer, nullable=False, comment='条目序号')
  13. item_code = Column(String(255), nullable=False, comment='条目编号')
  14. file_path = Column(Text, comment='文件路径')
  15. collect_status = Column(Integer, nullable=False, default=0, comment='采集状态(0:未开始, 1:进行中, 2:已完成, 3:采集失败)')
  16. collect_time = Column(DateTime, comment='采集时间')
  17. collect_error = Column(String(1000), comment='采集错误信息')
  18. process_status = Column(Integer, nullable=False, default=0, comment='处理状态(0:未处理,1:处理中, 2:已处理, 3:处理失败)')
  19. process_time = Column(DateTime, comment='处理时间')
  20. process_error = Column(String(1000), comment='处理错误信息')
  21. send_status = Column(Integer, nullable=False, default=0, comment='发送状态(0:未发送,1:发送中 ,2:已发送, 3:发送失败)')
  22. send_time = Column(DateTime, comment='发送时间')
  23. send_error = Column(String(1000), comment='发送错误信息')
  24. is_del = Column(Integer, nullable=False, default=0, comment='是否删除(0:否, 1:是)')
  25. deleted_by = Column(String(50), comment='删除人')
  26. deleted_at = Column(DateTime, comment='删除时间')
  27. created_by = Column(String(50), comment='创建人')
  28. created_at = Column(DateTime, nullable=False, server_default=func.current_timestamp(), comment='创建时间')
  29. updated_by = Column(String(50), comment='更新人')
  30. updated_at = Column(DateTime, nullable=False, server_default=func.current_timestamp(), server_onupdate=func.current_timestamp(), comment='更新时间')
  31. def __repr__(self):
  32. return f"<ProjectTask(id='{self.id}', task_name='{self.task_name}')>"