supplychain/models/sub_resellers.json
yumoqing 1303b48685 fix: sub_reseller_code → sub_resellerid (存org_id,修复多层分销链遍历)
- sub_resellers.json 模型: sub_reseller_code(varchar 64) → sub_resellerid(varchar 32)
- 唯一索引: idx_sr_code → idx_sr_sub_resellerid
- codes 关联: sub_resellerid 关联 organization.orgname
- init.py create_sub_reseller: 写入 sub_resellers 表(非 sub_distributors),字段 sub_resellerid
- init.py get_distribution_chain: SQL SELECT sub_resellerid(非 orgid)
- JSON/UI/dspy 字段引用同步更新
- DDL 重新生成
2026-07-20 15:25:38 +08:00

139 lines
3.2 KiB
JSON

{
"summary": [
{
"name": "sub_resellers",
"title": "二级分销商表",
"primary": ["id"],
"catelog": "entity"
}
],
"fields": [
{
"name": "id",
"title": "主键ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "resellerid",
"title": "所属分销商机构ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "sub_resellerid",
"title": "二级分销商机构ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "sub_reseller_name",
"title": "二级分销商名称",
"type": "str",
"length": 255,
"nullable": "no"
},
{
"name": "contact_person",
"title": "联系人",
"type": "str",
"length": 100
},
{
"name": "contact_phone",
"title": "联系电话",
"type": "str",
"length": 50
},
{
"name": "contact_email",
"title": "联系邮箱",
"type": "str",
"length": 255
},
{
"name": "address",
"title": "地址",
"type": "str",
"length": 500
},
{
"name": "tax_number",
"title": "税号",
"type": "str",
"length": 64
},
{
"name": "bank_name",
"title": "开户银行",
"type": "str",
"length": 255
},
{
"name": "bank_account",
"title": "银行账号",
"type": "str",
"length": 64
},
{
"name": "status",
"title": "状态",
"type": "char",
"length": 1,
"nullable": "no",
"default": "1"
},
{
"name": "remark",
"title": "备注",
"type": "text"
},
{
"name": "created_by",
"title": "创建人",
"type": "str",
"length": 32
},
{
"name": "created_at",
"title": "创建时间",
"type": "datetime",
"nullable": "no"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "datetime"
}
],
"indexes": [
{
"name": "idx_sr_reseller",
"idxtype": "index",
"idxfields": ["resellerid"]
},
{
"name": "idx_sr_sub_resellerid",
"idxtype": "unique",
"idxfields": ["resellerid", "sub_resellerid"]
}
],
"codes": [
{
"field": "resellerid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "sub_resellerid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
}
]
}