|
@@ -1,34 +1,60 @@
|
|
|
-from sqlalchemy import Column, Integer, String, DateTime, Text
|
|
|
+from sqlalchemy import Column, Integer, String, DateTime, Text
|
|
|
from sqlalchemy.sql import func
|
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
|
|
|
|
Base = declarative_base()
|
|
|
+
|
|
|
+
|
|
|
class ProjectTaskModel(Base):
|
|
|
- __tablename__ = 'project_task'
|
|
|
+ __tablename__ = "project_task"
|
|
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
|
- task_name = Column(String(255), nullable=False, comment='任务名称')
|
|
|
- task_sort = Column(Integer, nullable=False, default=0, comment='任务排序')
|
|
|
- task_desc = Column(String(1000), comment='任务描述')
|
|
|
- is_cover = Column(Integer, nullable=False, default=0, comment='是否覆盖(0:不覆盖, 1:覆盖)')
|
|
|
- project_id = Column(String(50), nullable=False, comment='项目编号')
|
|
|
- budget_id = Column(Integer, comment='概算序号')
|
|
|
- item_id = Column(Integer, nullable=False, comment='条目序号')
|
|
|
- item_code = Column(String(255), nullable=False, comment='条目编号')
|
|
|
- file_path = Column(Text, comment='文件路径')
|
|
|
- process_status = Column(Integer, nullable=False, default=0, comment='处理状态(0:未处理,1:处理中, 2:已处理, 3:处理失败)')
|
|
|
- process_time = Column(DateTime, comment='处理时间')
|
|
|
- process_error = Column(String(5000), comment='处理错误信息')
|
|
|
- send_status = Column(Integer, nullable=False, default=0, comment='发送状态(0:未发送,1:发送中 ,2:已发送, 3:发送失败)')
|
|
|
- send_time = Column(DateTime, comment='发送时间')
|
|
|
- send_error = Column(String(5000), comment='发送错误信息')
|
|
|
- is_del = Column(Integer, nullable=False, default=0, comment='是否删除(0:否, 1:是)')
|
|
|
- deleted_by = Column(String(50), comment='删除人')
|
|
|
- deleted_at = Column(DateTime, comment='删除时间')
|
|
|
- created_by = Column(String(50), comment='创建人')
|
|
|
- created_at = Column(DateTime, nullable=False, server_default=func.current_timestamp(), comment='创建时间')
|
|
|
- updated_by = Column(String(50), comment='更新人')
|
|
|
- updated_at = Column(DateTime, nullable=False, server_default=func.current_timestamp(), server_onupdate=func.current_timestamp(), comment='更新时间')
|
|
|
+ parent_id = Column(Integer, nullable=False, default=0, comment="父任务")
|
|
|
+ task_name = Column(String(255), nullable=False, comment="任务名称")
|
|
|
+ task_sort = Column(Integer, nullable=False, default=0, comment="任务排序")
|
|
|
+ task_desc = Column(String(1000), comment="任务描述")
|
|
|
+ is_cover = Column(
|
|
|
+ Integer, nullable=False, default=0, comment="是否覆盖(0:不覆盖, 1:覆盖)"
|
|
|
+ )
|
|
|
+ project_id = Column(String(50), nullable=False, comment="项目编号")
|
|
|
+ budget_id = Column(Integer, comment="概算序号")
|
|
|
+ item_id = Column(Integer, nullable=False, comment="条目序号")
|
|
|
+ item_code = Column(String(255), nullable=False, comment="条目编号")
|
|
|
+ file_path = Column(Text, comment="文件路径")
|
|
|
+ process_status = Column(
|
|
|
+ Integer,
|
|
|
+ nullable=False,
|
|
|
+ default=0,
|
|
|
+ comment="处理状态(0:未处理,1:处理中, 2:已处理, 3:处理失败)",
|
|
|
+ )
|
|
|
+ process_time = Column(DateTime, comment="处理时间")
|
|
|
+ process_error = Column(String(5000), comment="处理错误信息")
|
|
|
+ send_status = Column(
|
|
|
+ Integer,
|
|
|
+ nullable=False,
|
|
|
+ default=0,
|
|
|
+ comment="发送状态(0:未发送,1:发送中 ,2:已发送, 3:发送失败)",
|
|
|
+ )
|
|
|
+ send_time = Column(DateTime, comment="发送时间")
|
|
|
+ send_error = Column(String(5000), comment="发送错误信息")
|
|
|
+ is_del = Column(Integer, nullable=False, default=0, comment="是否删除(0:否, 1:是)")
|
|
|
+ deleted_by = Column(String(50), comment="删除人")
|
|
|
+ deleted_at = Column(DateTime, comment="删除时间")
|
|
|
+ created_by = Column(String(50), comment="创建人")
|
|
|
+ created_at = Column(
|
|
|
+ DateTime,
|
|
|
+ nullable=False,
|
|
|
+ server_default=func.current_timestamp(),
|
|
|
+ comment="创建时间",
|
|
|
+ )
|
|
|
+ updated_by = Column(String(50), comment="更新人")
|
|
|
+ updated_at = Column(
|
|
|
+ DateTime,
|
|
|
+ nullable=False,
|
|
|
+ server_default=func.current_timestamp(),
|
|
|
+ server_onupdate=func.current_timestamp(),
|
|
|
+ comment="更新时间",
|
|
|
+ )
|
|
|
|
|
|
def __repr__(self):
|
|
|
- return f"<ProjectTask(id='{self.id}', task_name='{self.task_name}')>"
|
|
|
+ return f"<ProjectTask(id='{self.id}', task_name='{self.task_name}')>"
|