feat(qc): add SQLAlchemy models for QC material and usage
This commit is contained in:
1 parent
18132c8034
commit
4137c54588
2 files changed
+148
No files matched your search
@@ -2371,4 +2371,102 @@ class BizProductionTaskOutput(Base):
|
||||
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记")
|
||||
|
||||
|
||||
class BizProtocolFullmoonTodo(Base):
|
||||
"""新生儿满月待办 biz_protocol_fullmoon_todo"""
|
||||
|
||||
__tablename__ = "biz_protocol_fullmoon_todo"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
collection_protocol_id = Column(String(64), nullable=False, comment="采集协议单ID")
|
||||
todo_status = Column(CHAR(1), nullable=False, default="0", comment="1已办报销 0未办保险")
|
||||
handle_date = Column(CHAR(8), nullable=True, comment="办理日期")
|
||||
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="保单费用(元)")
|
||||
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"""
|
||||
|
||||
__tablename__ = "biz_insurance_company"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
company_name = Column(String(200), nullable=False, comment="保险公司名称")
|
||||
company_address = Column(String(512), nullable=True, comment="公司地址")
|
||||
contact_name = Column(String(100), nullable=True, comment="联系人")
|
||||
contact_phone = Column(String(32), nullable=True, comment="联系电话")
|
||||
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 BizInsuranceCompanyInvoice(Base):
|
||||
"""保险公司开票信息 biz_insurance_company_invoice"""
|
||||
|
||||
__tablename__ = "biz_insurance_company_invoice"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
insurance_company_id = Column(String(64), nullable=False, comment="保险公司ID")
|
||||
company_name = Column(String(200), nullable=False, comment="单位名称")
|
||||
tax_no = Column(String(64), nullable=True, comment="税号")
|
||||
company_address = Column(String(512), nullable=True, comment="单位地址")
|
||||
company_phone = Column(String(64), nullable=True, comment="电话")
|
||||
bank_name = Column(String(200), nullable=True, comment="开户银行")
|
||||
bank_account = Column(String(64), 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 BizInsuranceProjectPrice(Base):
|
||||
"""保险项目价格 biz_insurance_project_price"""
|
||||
|
||||
__tablename__ = "biz_insurance_project_price"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
insurance_company_id = Column(String(64), nullable=False, comment="保险公司ID")
|
||||
project_name = Column(String(200), nullable=False, comment="项目名称")
|
||||
project_fee = Column(Numeric(18, 2), nullable=True, comment="项目费用(元)")
|
||||
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="删除标记")
|
||||
|
||||
|
||||
from app.models.qc_param import BizQcItemParam, BizQcTaskResult # noqa: E402,F401
|
||||
from app.models.qc_material import BizQcMaterial, BizQcMaterialUsage # noqa: E402,F401
|
||||
@@ -0,0 +1,50 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, DateTime, Integer, Numeric, SmallInteger, String
|
||||
|
||||
from app.core.database import Base
|
||||
|
||||
|
||||
class BizQcMaterial(Base):
|
||||
__tablename__ = "biz_qc_material"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
material_code = Column(String(64), nullable=False, comment="物料编码")
|
||||
material_name = Column(String(200), nullable=False, comment="物料名称")
|
||||
spec_model = Column(String(200), nullable=True, comment="规格型号")
|
||||
unit = Column(String(32), nullable=True, comment="单位")
|
||||
stock_qty = Column(Numeric(18, 4), nullable=False, default=0, comment="当前库存量")
|
||||
warning_qty = Column(Numeric(18, 4), nullable=False, default=0, comment="预警库存量")
|
||||
status = Column(String(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 BizQcMaterialUsage(Base):
|
||||
__tablename__ = "biz_qc_material_usage"
|
||||
|
||||
id = Column(String(64), primary_key=True, comment="主键ID")
|
||||
material_id = Column(String(64), nullable=False, comment="物料ID")
|
||||
material_code = Column(String(64), nullable=True, comment="物料编码快照")
|
||||
material_name = Column(String(200), nullable=True, comment="物料名称快照")
|
||||
change_type = Column(String(16), nullable=False, comment="变动类型:use使用 / in入库")
|
||||
change_qty = Column(Numeric(18, 4), nullable=False, comment="变动数量")
|
||||
stock_after = Column(Numeric(18, 4), nullable=False, comment="变动后库存量")
|
||||
qc_task_id = Column(String(64), nullable=True, comment="关联质检任务ID")
|
||||
qc_task_no = Column(String(32), nullable=True, comment="质检任务号快照")
|
||||
source_type = Column(String(16), nullable=False, comment="来源类型:task_complete / manual_in")
|
||||
tenant_no = Column(String(64), nullable=False, default="zkxw", 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="删除标记")
|
||||
Reference in new issue
Block a user