fix: standardize summary format to list with primary=id in all models

This commit is contained in:
yumoqing 2026-04-29 14:39:15 +08:00
parent 13b4a5223e
commit a0eac5f516
5 changed files with 541 additions and 489 deletions

View File

@ -1,123 +1,137 @@
{ {
"summary": { "summary": [
"tablename": "financial_vouchers", {
"label": "财务凭证", "name": "financial_vouchers",
"comment": "财务凭证记录,关联合同和订单" "title": "财务凭证",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 64, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "voucher_number", "comments": "主键"
"title": "凭证编号", },
"type": "str", {
"length": 64, "name": "voucher_number",
"nullable": false, "title": "凭证编号",
"comments": "凭证编号" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "voucher_type", "comments": "凭证编号"
"title": "凭证类型", },
"type": "str", {
"length": 32, "name": "voucher_type",
"nullable": false, "title": "凭证类型",
"comments": "凭证类型: receipt(收款), payment(支出)" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "contract_id", "comments": "凭证类型: receipt(收款), payment(支出)"
"title": "合同ID", },
"type": "str", {
"length": 64, "name": "contract_id",
"nullable": false, "title": "合同ID",
"comments": "关联合同ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "order_id", "comments": "关联合同ID"
"title": "订单ID", },
"type": "str", {
"length": 64, "name": "order_id",
"nullable": true, "title": "订单ID",
"comments": "关联订单ID可为空用于合同级凭证" "type": "str",
}, "length": 64,
{ "nullable": true,
"name": "amount", "comments": "关联订单ID可为空用于合同级凭证"
"title": "金额", },
"type": "decimal", {
"length": "15,2", "name": "amount",
"nullable": false, "title": "金额",
"comments": "凭证金额" "type": "decimal",
}, "length": "15,2",
{ "nullable": false,
"name": "voucher_date", "comments": "凭证金额"
"title": "凭证日期", },
"type": "date", {
"nullable": false, "name": "voucher_date",
"comments": "凭证日期" "title": "凭证日期",
}, "type": "date",
{ "nullable": false,
"name": "description", "comments": "凭证日期"
"title": "凭证描述", },
"type": "str", {
"length": 500, "name": "description",
"nullable": false, "title": "凭证描述",
"comments": "凭证描述,包含合同编号和订单编号" "type": "str",
}, "length": 500,
{ "nullable": false,
"name": "reference_id", "comments": "凭证描述,包含合同编号和订单编号"
"title": "引用ID", },
"type": "str", {
"length": 64, "name": "reference_id",
"nullable": false, "title": "引用ID",
"comments": "引用的收款或支出记录ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "org_id", "comments": "引用的收款或支出记录ID"
"title": "组织ID", },
"type": "str", {
"length": 64, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "组织ID用于多租户隔离" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "created_at", "comments": "组织ID用于多租户隔离"
"title": "创建时间", },
"type": "timestamp", {
"nullable": false, "name": "created_at",
"comments": "创建时间" "title": "创建时间",
} "type": "timestamp",
], "nullable": false,
"indexes": [ "comments": "创建时间"
{ }
"name": "idx_vouchers_contract_id", ],
"idxtype": "index", "indexes": [
"columns": ["contract_id"] {
}, "name": "idx_vouchers_contract_id",
{ "idxtype": "index",
"name": "idx_vouchers_order_id", "columns": [
"idxtype": "index", "contract_id"
"columns": ["order_id"] ]
}, },
{ {
"name": "idx_vouchers_voucher_number", "name": "idx_vouchers_order_id",
"idxtype": "unique", "idxtype": "index",
"columns": ["voucher_number", "org_id"] "columns": [
}, "order_id"
{ ]
"name": "idx_vouchers_org_id", },
"idxtype": "index", {
"columns": ["org_id"] "name": "idx_vouchers_voucher_number",
}, "idxtype": "unique",
{ "columns": [
"name": "idx_vouchers_type", "voucher_number",
"idxtype": "index", "org_id"
"columns": ["voucher_type"] ]
} },
], {
"codes": [] "name": "idx_vouchers_org_id",
"idxtype": "index",
"columns": [
"org_id"
]
},
{
"name": "idx_vouchers_type",
"idxtype": "index",
"columns": [
"voucher_type"
]
}
],
"codes": []
} }

View File

@ -1,141 +1,153 @@
{ {
"summary": { "summary": [
"tablename": "payments", {
"label": "支出记录", "name": "payments",
"comment": "支出管理,关联已核销的合同收款" "title": "支出记录",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 64, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "payment_number", "comments": "主键"
"title": "支出编号", },
"type": "str", {
"length": 64, "name": "payment_number",
"nullable": false, "title": "支出编号",
"comments": "支出编号" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "contract_id", "comments": "支出编号"
"title": "合同ID", },
"type": "str", {
"length": 64, "name": "contract_id",
"nullable": false, "title": "合同ID",
"comments": "关联合同ID必须是已核销收款的合同" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "vendor_id", "comments": "关联合同ID必须是已核销收款的合同"
"title": "供应商ID", },
"type": "str", {
"length": 64, "name": "vendor_id",
"nullable": false, "title": "供应商ID",
"comments": "供应商ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "payment_amount", "comments": "供应商ID"
"title": "支出金额", },
"type": "decimal", {
"length": "15,2", "name": "payment_amount",
"nullable": false, "title": "支出金额",
"comments": "支出金额" "type": "decimal",
}, "length": "15,2",
{ "nullable": false,
"name": "payment_date", "comments": "支出金额"
"title": "支出日期", },
"type": "date", {
"nullable": false, "name": "payment_date",
"comments": "实际支出日期" "title": "支出日期",
}, "type": "date",
{ "nullable": false,
"name": "payment_method", "comments": "实际支出日期"
"title": "支出方式", },
"type": "str", {
"length": 32, "name": "payment_method",
"nullable": false, "title": "支出方式",
"comments": "支出方式: bank_transfer, cash, check, other" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "payment_status", "comments": "支出方式: bank_transfer, cash, check, other"
"title": "支出状态", },
"type": "str", {
"length": 32, "name": "payment_status",
"nullable": false, "title": "支出状态",
"comments": "状态: pending(待处理), processed(已处理), verified(已核销)" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "description", "comments": "状态: pending(待处理), processed(已处理), verified(已核销)"
"title": "备注", },
"type": "str", {
"length": 500, "name": "description",
"nullable": true, "title": "备注",
"comments": "备注信息" "type": "str",
}, "length": 500,
{ "nullable": true,
"name": "approved_by", "comments": "备注信息"
"title": "审批人", },
"type": "str", {
"length": 64, "name": "approved_by",
"nullable": true, "title": "审批人",
"comments": "审批人ID" "type": "str",
}, "length": 64,
{ "nullable": true,
"name": "created_by", "comments": "审批人ID"
"title": "创建人", },
"type": "str", {
"length": 64, "name": "created_by",
"nullable": false, "title": "创建人",
"comments": "财务人员ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "org_id", "comments": "财务人员ID"
"title": "组织ID", },
"type": "str", {
"length": 64, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "组织ID用于多租户隔离" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "created_at", "comments": "组织ID用于多租户隔离"
"title": "创建时间", },
"type": "timestamp", {
"nullable": false, "name": "created_at",
"comments": "创建时间" "title": "创建时间",
}, "type": "timestamp",
{ "nullable": false,
"name": "updated_at", "comments": "创建时间"
"title": "更新时间", },
"type": "timestamp", {
"nullable": false, "name": "updated_at",
"comments": "更新时间" "title": "更新时间",
} "type": "timestamp",
], "nullable": false,
"indexes": [ "comments": "更新时间"
{ }
"name": "idx_payments_contract_id", ],
"idxtype": "index", "indexes": [
"columns": ["contract_id"] {
}, "name": "idx_payments_contract_id",
{ "idxtype": "index",
"name": "idx_payments_payment_number", "columns": [
"idxtype": "unique", "contract_id"
"columns": ["payment_number", "org_id"] ]
}, },
{ {
"name": "idx_payments_org_id", "name": "idx_payments_payment_number",
"idxtype": "index", "idxtype": "unique",
"columns": ["org_id"] "columns": [
}, "payment_number",
{ "org_id"
"name": "idx_payments_status", ]
"idxtype": "index", },
"columns": ["payment_status"] {
} "name": "idx_payments_org_id",
], "idxtype": "index",
"codes": [] "columns": [
"org_id"
]
},
{
"name": "idx_payments_status",
"idxtype": "index",
"columns": [
"payment_status"
]
}
],
"codes": []
} }

View File

@ -1,103 +1,114 @@
{ {
"summary": { "summary": [
"tablename": "receipt_allocations", {
"label": "收款分配", "name": "receipt_allocations",
"comment": "收款在多个订单间的分配记录" "title": "收款分配",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 64, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "receipt_id", "comments": "主键"
"title": "收款ID", },
"type": "str", {
"length": 64, "name": "receipt_id",
"nullable": false, "title": "收款ID",
"comments": "关联的收款记录ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "order_id", "comments": "关联的收款记录ID"
"title": "订单ID", },
"type": "str", {
"length": 64, "name": "order_id",
"nullable": false, "title": "订单ID",
"comments": "关联的订单ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "receivable_id", "comments": "关联的订单ID"
"title": "应收ID", },
"type": "str", {
"length": 64, "name": "receivable_id",
"nullable": false, "title": "应收ID",
"comments": "关联的应收记录ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "allocated_amount", "comments": "关联的应收记录ID"
"title": "分配金额", },
"type": "decimal", {
"length": "15,2", "name": "allocated_amount",
"nullable": false, "title": "分配金额",
"comments": "分配给该订单的金额" "type": "decimal",
}, "length": "15,2",
{ "nullable": false,
"name": "allocation_percentage", "comments": "分配给该订单的金额"
"title": "分配比例", },
"type": "decimal", {
"length": "5,4", "name": "allocation_percentage",
"nullable": true, "title": "分配比例",
"comments": "分配比例0-1之间" "type": "decimal",
}, "length": "5,4",
{ "nullable": true,
"name": "contract_id", "comments": "分配比例0-1之间"
"title": "合同ID", },
"type": "str", {
"length": 64, "name": "contract_id",
"nullable": false, "title": "合同ID",
"comments": "关联合同ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "org_id", "comments": "关联合同ID"
"title": "组织ID", },
"type": "str", {
"length": 64, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "组织ID用于多租户隔离" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "created_at", "comments": "组织ID用于多租户隔离"
"title": "创建时间", },
"type": "timestamp", {
"nullable": false, "name": "created_at",
"comments": "创建时间" "title": "创建时间",
} "type": "timestamp",
], "nullable": false,
"indexes": [ "comments": "创建时间"
{ }
"name": "idx_allocations_receipt_id", ],
"idxtype": "index", "indexes": [
"columns": ["receipt_id"] {
}, "name": "idx_allocations_receipt_id",
{ "idxtype": "index",
"name": "idx_allocations_order_id", "columns": [
"idxtype": "index", "receipt_id"
"columns": ["order_id"] ]
}, },
{ {
"name": "idx_allocations_receivable_id", "name": "idx_allocations_order_id",
"idxtype": "index", "idxtype": "index",
"columns": ["receivable_id"] "columns": [
}, "order_id"
{ ]
"name": "idx_allocations_org_id", },
"idxtype": "index", {
"columns": ["org_id"] "name": "idx_allocations_receivable_id",
} "idxtype": "index",
], "columns": [
"codes": [] "receivable_id"
]
},
{
"name": "idx_allocations_org_id",
"idxtype": "index",
"columns": [
"org_id"
]
}
],
"codes": []
} }

View File

@ -1,125 +1,137 @@
{ {
"summary": { "summary": [
"tablename": "receipts", {
"label": "收款记录", "name": "receipts",
"comment": "客户收款记录管理" "title": "收款记录",
}, "primary": "id",
"fields": [ "catelog": "entity"
{ }
"name": "id", ],
"title": "ID", "fields": [
"type": "str", {
"length": 64, "name": "id",
"nullable": false, "title": "ID",
"comments": "主键" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "receipt_number", "comments": "主键"
"title": "收款编号", },
"type": "str", {
"length": 64, "name": "receipt_number",
"nullable": false, "title": "收款编号",
"comments": "收款编号" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "customer_id", "comments": "收款编号"
"title": "客户ID", },
"type": "str", {
"length": 64, "name": "customer_id",
"nullable": false, "title": "客户ID",
"comments": "客户ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "total_amount", "comments": "客户ID"
"title": "收款总额", },
"type": "decimal", {
"length": "15,2", "name": "total_amount",
"nullable": false, "title": "收款总额",
"comments": "本次收款总金额" "type": "decimal",
}, "length": "15,2",
{ "nullable": false,
"name": "receipt_date", "comments": "本次收款总金额"
"title": "收款日期", },
"type": "date", {
"nullable": false, "name": "receipt_date",
"comments": "实际收款日期" "title": "收款日期",
}, "type": "date",
{ "nullable": false,
"name": "receipt_method", "comments": "实际收款日期"
"title": "收款方式", },
"type": "str", {
"length": 32, "name": "receipt_method",
"nullable": false, "title": "收款方式",
"comments": "收款方式: bank_transfer, cash, check, other" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "receipt_status", "comments": "收款方式: bank_transfer, cash, check, other"
"title": "收款状态", },
"type": "str", {
"length": 32, "name": "receipt_status",
"nullable": false, "title": "收款状态",
"comments": "状态: pending(待处理), processed(已处理), verified(已核销)" "type": "str",
}, "length": 32,
{ "nullable": false,
"name": "description", "comments": "状态: pending(待处理), processed(已处理), verified(已核销)"
"title": "备注", },
"type": "str", {
"length": 500, "name": "description",
"nullable": true, "title": "备注",
"comments": "备注信息" "type": "str",
}, "length": 500,
{ "nullable": true,
"name": "created_by", "comments": "备注信息"
"title": "创建人", },
"type": "str", {
"length": 64, "name": "created_by",
"nullable": false, "title": "创建人",
"comments": "财务人员ID" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "org_id", "comments": "财务人员ID"
"title": "组织ID", },
"type": "str", {
"length": 64, "name": "org_id",
"nullable": false, "title": "组织ID",
"comments": "组织ID用于多租户隔离" "type": "str",
}, "length": 64,
{ "nullable": false,
"name": "created_at", "comments": "组织ID用于多租户隔离"
"title": "创建时间", },
"type": "timestamp", {
"nullable": false, "name": "created_at",
"comments": "创建时间" "title": "创建时间",
}, "type": "timestamp",
{ "nullable": false,
"name": "updated_at", "comments": "创建时间"
"title": "更新时间", },
"type": "timestamp", {
"nullable": false, "name": "updated_at",
"comments": "更新时间" "title": "更新时间",
} "type": "timestamp",
], "nullable": false,
"indexes": [ "comments": "更新时间"
{ }
"name": "idx_receipts_customer_id", ],
"idxtype": "index", "indexes": [
"columns": ["customer_id"] {
}, "name": "idx_receipts_customer_id",
{ "idxtype": "index",
"name": "idx_receipts_receipt_number", "columns": [
"idxtype": "unique", "customer_id"
"columns": ["receipt_number", "org_id"] ]
}, },
{ {
"name": "idx_receipts_org_id", "name": "idx_receipts_receipt_number",
"idxtype": "index", "idxtype": "unique",
"columns": ["org_id"] "columns": [
}, "receipt_number",
{ "org_id"
"name": "idx_receipts_status", ]
"idxtype": "index", },
"columns": ["receipt_status"] {
} "name": "idx_receipts_org_id",
], "idxtype": "index",
"codes": [] "columns": [
"org_id"
]
},
{
"name": "idx_receipts_status",
"idxtype": "index",
"columns": [
"receipt_status"
]
}
],
"codes": []
} }

View File

@ -89,9 +89,12 @@
] ]
} }
], ],
"summary": { "summary": [
"tablename": "receivables", {
"label": "应收款项", "name": "receivables",
"comment": "合同应收款项管理" "title": "应收款项",
} "primary": "id",
"catelog": "entity"
}
]
} }