From eee70e417cff1e1e8c801ac08d0c2b45dc7c9bae Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Tue, 13 Oct 2026 10:45:54 +0800 Subject: [PATCH] feat(backend): add models for customer-service and sample-level cert/insurance. Co-authored-by: Cursor --- backend/app/models/models.py | 107 +++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/backend/app/models/models.py b/backend/app/models/models.py index d8778a0e..d5788a39 100644 --- a/backend/app/models/models.py +++ b/backend/app/models/models.py @@ -1672,6 +1672,31 @@ class BizProtocolStorageCert(Base): del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记") +class BizSampleStorageCert(Base): + """样本储存证办理 biz_sample_storage_cert""" + + __tablename__ = "biz_sample_storage_cert" + + id = Column(String(64), primary_key=True, comment="主键ID") + sample_code = Column(String(32), nullable=False, comment="样本编码") + collection_protocol_id = Column(String(64), nullable=True, comment="采集协议单ID冗余") + make_status = Column(CHAR(1), nullable=True, default="0", comment="制作状态 0-未制作 1-已制作") + cert_image_urls = Column(String(4000), nullable=True, comment="证书图片URLs") + make_date = Column(CHAR(8), nullable=True, comment="制作日期YYYYMMDD") + handle_time = Column(DateTime, nullable=True, comment="办理时间") + handler_user_id = Column(String(64), nullable=True, comment="办理人用户ID") + mail_cert_time = Column(DateTime, 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 BizSampleStorageCertQc(Base): """样本储存证质检信息 biz_sample_storage_cert_qc""" @@ -1695,6 +1720,54 @@ class BizSampleStorageCertQc(Base): del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记") +class BizSampleCustomerService(Base): + """样本客户服务扩展 biz_sample_customer_service""" + + __tablename__ = "biz_sample_customer_service" + + id = Column(String(64), primary_key=True, comment="主键ID") + sample_code = Column(String(32), nullable=False, comment="样本编码") + collection_protocol_id = Column(String(64), nullable=True, comment="采集协议单ID冗余") + sms_send_date = Column(Date, nullable=True, comment="短信发送日期") + sms_send_status = Column(String(64), nullable=True, comment="短信发送情况") + microbe_followup_date = Column(Date, nullable=True, comment="微生物回访日期") + microbe_followup_status = Column(String(64), nullable=True, comment="微生物回访情况") + fullmoon_followup_date = Column(Date, nullable=True, comment="满月回访时间") + fullmoon_followup_status = Column(String(64), nullable=True, comment="满月回访情况") + household_registered = Column(String(64), nullable=True, comment="是否上户口") + einvoice_send_time = Column(DateTime, nullable=True, comment="电子发票发送时间") + effective_address = 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 BizCustomerServiceDict(Base): + """客户服务字典 biz_customer_service_dict""" + + __tablename__ = "biz_customer_service_dict" + + id = Column(String(64), primary_key=True, comment="主键ID") + dict_type = Column(String(64), nullable=False, comment="字典类型") + dict_value = Column(String(128), nullable=False, comment="选项值") + is_system = Column(CHAR(1), nullable=False, default="0", 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 BizSampleReceptionCheckItem(Base): """样本接收检查项配置 biz_sample_reception_check_item""" @@ -3724,6 +3797,40 @@ class BizProtocolFullmoonTodo(Base): del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记") +class BizSampleInsurance(Base): + """样本保险办理 biz_sample_insurance""" + + __tablename__ = "biz_sample_insurance" + + id = Column(String(64), primary_key=True, comment="主键ID") + sample_code = Column(String(32), nullable=False, comment="样本编码") + collection_protocol_id = Column(String(64), nullable=True, comment="采集协议单ID冗余") + todo_status = Column(CHAR(1), nullable=False, default="0", comment="1已办保险 0未办保险") + handle_date = Column(CHAR(8), nullable=True, comment="办理日期") + handle_time = Column(DateTime, nullable=True, comment="办理时间") + handler_user_id = Column(String(64), nullable=True, comment="办理人用户ID") + handle_remark = Column(String(512), nullable=True, comment="办理备注") + insurance_attachments = Column(String(4000), nullable=True, comment="保险附件逗号分隔") + insurance_company_id = Column(String(64), nullable=True, comment="保险公司ID") + insurance_company_name = Column(String(200), nullable=True, comment="保险公司名称(冗余快照)") + insurance_type = Column(String(200), nullable=True, comment="保险险种") + insurance_policy_no = Column(String(100), nullable=True, comment="保险单号") + insurance_effective_date = Column(CHAR(8), nullable=True, comment="保险单生效时间YYYYMMDD") + insurance_expiry_date = Column(CHAR(8), nullable=True, comment="保险单失效时间YYYYMMDD") + insurance_subscribed = Column(CHAR(1), nullable=True, default="0", comment="是否已订购保险") + insurance_fee = Column(Numeric(18, 2), nullable=True, comment="保单费用(元)") + policy_send_time = Column(DateTime, 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 BizInsuranceCompany(Base): """保险公司 biz_insurance_company"""