feat(oa): add return, resubmit, and multi-round approval progress
Align with DingTalk semantics: reject ends the instance, return keeps it for initiator edits, and revoke-and-resubmit creates a linked new instance. Progress timeline projects rounds via oa_instance_event. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
265d790ea6
commit
26800865cd
13 files changed
+4736
-72
No files matched your search
@@ -26,6 +26,7 @@ class SysUser(Base):
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
dept_id = Column(String(64), nullable=True, comment="部门ID")
|
||||
supervisor_user_id = Column(String(64), nullable=True, comment="直属主管用户ID")
|
||||
user_no = Column(String(30), nullable=False, comment="用户账号")
|
||||
nick_name = Column(String(30), nullable=False, comment="用户名")
|
||||
email = Column(String(50), nullable=False, default="", comment="用户邮箱")
|
||||
@@ -159,6 +160,7 @@ class SysDept(Base):
|
||||
dept_name = Column(String(200), nullable=False, comment="组织名称")
|
||||
dept_category_code = Column(String(64), nullable=True, comment="组织类别编码")
|
||||
status = Column(CHAR(1), nullable=False, default="1", comment="部门状态")
|
||||
leader_user_id = Column(String(64), nullable=True, comment="部门负责人用户ID")
|
||||
leader = Column(String(100), nullable=True, comment="部门负责人")
|
||||
leader_phone = Column(String(32), nullable=True, comment="部门负责人联系电话")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
@@ -728,6 +730,221 @@ class WfTask(Base):
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# OA 审批(钉钉交互,oa_*)
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class OaAppGroup(Base):
|
||||
"""OA审批分组 oa_app_group"""
|
||||
|
||||
__tablename__ = "oa_app_group"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
group_name = Column(String(100), nullable=False, comment="分组名称")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class OaApp(Base):
|
||||
"""OA审批应用 oa_app"""
|
||||
|
||||
__tablename__ = "oa_app"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
group_id = Column(String(64), nullable=True, comment="分组ID")
|
||||
app_name = Column(String(50), nullable=False, comment="表单/应用名称")
|
||||
icon_url = Column(String(512), nullable=True, comment="图标")
|
||||
description = Column(String(100), nullable=True, comment="表单说明")
|
||||
initiator_scope = Column(String(32), nullable=False, default="all", comment="发起范围")
|
||||
initiator_user_ids = Column(Text, nullable=True, comment="指定发起人JSON")
|
||||
admin_scope = Column(String(32), nullable=False, default="all_oa_admin", comment="管理员范围")
|
||||
admin_user_ids = Column(Text, nullable=True, comment="指定管理员JSON")
|
||||
status = Column(CHAR(1), nullable=False, default="1", comment="1启用 0停用")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class OaAppVersion(Base):
|
||||
"""OA审批应用版本 oa_app_version"""
|
||||
|
||||
__tablename__ = "oa_app_version"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
app_id = Column(String(64), nullable=False, comment="应用ID")
|
||||
version_no = Column(Integer, nullable=False, comment="版本号")
|
||||
status = Column(String(16), nullable=False, default="draft", comment="draft/published")
|
||||
is_latest_published = Column(CHAR(1), nullable=False, default="0", comment="是否最新已发布")
|
||||
form_schema_json = Column(Text, nullable=True, comment="表单Schema JSON")
|
||||
flow_tree_json = Column(Text, nullable=True, comment="流程树 JSON")
|
||||
advanced_settings_json = Column(Text, nullable=True, comment="高级设置 JSON")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class OaRole(Base):
|
||||
"""OA工作流角色 oa_role"""
|
||||
|
||||
__tablename__ = "oa_role"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
role_name = Column(String(100), nullable=False, comment="角色名称")
|
||||
role_code = Column(String(64), nullable=False, comment="角色编码")
|
||||
role_kind = Column(String(16), nullable=False, default="custom", comment="custom/preset")
|
||||
status = Column(CHAR(1), nullable=False, default="1", comment="1启用 0停用")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class OaRoleUser(Base):
|
||||
"""OA工作流角色成员 oa_role_user"""
|
||||
|
||||
__tablename__ = "oa_role_user"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
oa_role_id = Column(String(64), nullable=False, comment="工作流角色ID")
|
||||
user_id = Column(String(64), nullable=False, comment="用户ID")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class OaInstance(Base):
|
||||
"""OA审批实例 oa_instance"""
|
||||
|
||||
__tablename__ = "oa_instance"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
app_id = Column(String(64), nullable=False, comment="应用ID")
|
||||
app_version_id = Column(String(64), nullable=False, comment="锁定版本ID")
|
||||
title = Column(String(200), nullable=True, comment="实例标题")
|
||||
initiator_user_id = Column(String(64), nullable=False, comment="发起人")
|
||||
initiator_dept_id = Column(String(64), nullable=True, comment="发起人部门")
|
||||
form_data_json = Column(Text, nullable=True, comment="表单数据 JSON")
|
||||
status = Column(
|
||||
String(32),
|
||||
nullable=False,
|
||||
default="running",
|
||||
comment="running/returned/completed/rejected/cancelled",
|
||||
)
|
||||
source_instance_id = Column(String(64), nullable=True, comment="撤销重提原实例ID")
|
||||
current_round = Column(Integer, nullable=False, default=1, comment="当前提交轮次")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class OaTask(Base):
|
||||
"""OA审批任务 oa_task"""
|
||||
|
||||
__tablename__ = "oa_task"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
instance_id = Column(String(64), nullable=False, comment="实例ID")
|
||||
node_key = Column(String(64), nullable=True, comment="节点key")
|
||||
node_name = Column(String(200), nullable=True, comment="节点名称")
|
||||
task_type = Column(String(16), nullable=False, default="approval", comment="approval/cc")
|
||||
assignee_user_id = Column(String(64), nullable=False, comment="处理人")
|
||||
status = Column(String(32), nullable=False, default="pending", comment="任务状态")
|
||||
comment_text = Column(String(512), nullable=True, comment="意见")
|
||||
resolve_source = Column(String(64), nullable=True, comment="解析来源")
|
||||
sign_mode = Column(String(8), nullable=True, comment="or/and")
|
||||
round_no = Column(Integer, nullable=False, default=1, comment="所属提交轮次")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class OaInstanceEvent(Base):
|
||||
"""OA实例操作事件 oa_instance_event"""
|
||||
|
||||
__tablename__ = "oa_instance_event"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
instance_id = Column(String(64), nullable=False, comment="实例ID")
|
||||
round_no = Column(Integer, nullable=False, default=1, comment="轮次")
|
||||
event_type = Column(String(32), nullable=False, comment="submit/return/withdraw/…")
|
||||
actor_user_id = Column(String(64), nullable=True, comment="操作人")
|
||||
task_id = Column(String(64), nullable=True, comment="关联任务")
|
||||
node_key = Column(String(64), nullable=True, comment="节点key")
|
||||
comment_text = Column(String(512), nullable=True, comment="意见")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class OaRelation(Base):
|
||||
"""OA关联审批 oa_relation"""
|
||||
|
||||
__tablename__ = "oa_relation"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
from_instance_id = Column(String(64), nullable=False, comment="本实例ID")
|
||||
to_instance_id = Column(String(64), nullable=False, comment="被关联实例ID")
|
||||
field_key = Column(String(64), nullable=True, comment="表单字段key")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", comment="租户编号")
|
||||
order_num = Column(Integer, nullable=True, comment="排序号")
|
||||
remark = Column(String(512), nullable=True, comment="备注")
|
||||
create_by = Column(String(64), nullable=True, comment="创建人id")
|
||||
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
|
||||
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
|
||||
update_by = Column(String(64), nullable=True, comment="更新人id")
|
||||
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# 细胞存储 — 采集协议单(biz_collection_protocol / audit / payment)
|
||||
# =============================================================================
|
||||
|
||||
Reference in new issue
Block a user