supplychain/models/product_supplier_mapping.json
yumoqing dff8b0de2a feat(supplychain): P0 平台内供应链 - 供销关系/产品映射/跨组织引入
新增3张核心表:
- platform_supply_relations: 平台内org-to-org供销关系(分销/代理/直供)
- platform_supply_products: 供销产品明细(供货价/折扣/佣金)
- product_supplier_mapping: 统一产品供应映射(内部+外部)

新增3个业务API:
- query_platform_suppliers: 查询平台可用供应方机构
- query_platform_products: 查询供应方产品目录
- import_supplier_product: 引入供应方产品到需求方

更新: init/data.json(6组appcodes), load_path.py(RBAC权限), menu.ui(分组菜单)
2026-06-05 22:11:33 +08:00

208 lines
5.3 KiB
JSON

{
"summary": [
{
"name": "product_supplier_mapping",
"title": "产品供应映射表",
"primary": ["id"],
"catelog": "relation"
}
],
"fields": [
{
"name": "id",
"title": "主键ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "product_id",
"title": "产品ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "product_category_id",
"title": "产品分类ID",
"type": "str",
"length": 32
},
{
"name": "supplier_type",
"title": "供应商类型",
"type": "str",
"length": 32,
"nullable": "no",
"default": "internal"
},
{
"name": "supplier_org_id",
"title": "供应方机构ID(平台内)",
"type": "str",
"length": 32
},
{
"name": "external_supplier_id",
"title": "外部供应商ID",
"type": "str",
"length": 32
},
{
"name": "buyer_org_id",
"title": "采购方机构ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "supply_price",
"title": "供货价",
"type": "double",
"length": 15,
"dec": 4
},
{
"name": "currency",
"title": "币种",
"type": "str",
"length": 16,
"default": "CNY"
},
{
"name": "min_order_qty",
"title": "最小订货量",
"type": "int",
"default": "1"
},
{
"name": "lead_time_days",
"title": "交付周期(天)",
"type": "int"
},
{
"name": "is_preferred",
"title": "是否首选",
"type": "char",
"length": 1,
"default": "0"
},
{
"name": "status",
"title": "状态",
"type": "char",
"length": 1,
"nullable": "no",
"default": "1"
},
{
"name": "relation_id",
"title": "关联供销关系ID",
"type": "str",
"length": 32
},
{
"name": "contract_id",
"title": "关联供销合同ID",
"type": "str",
"length": 32
},
{
"name": "created_at",
"title": "创建时间",
"type": "datetime",
"nullable": "no"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "datetime"
}
],
"indexes": [
{
"name": "idx_psm_product",
"idxtype": "index",
"idxfields": ["product_id"]
},
{
"name": "idx_psm_supplier_org",
"idxtype": "index",
"idxfields": ["supplier_org_id"]
},
{
"name": "idx_psm_ext_supplier",
"idxtype": "index",
"idxfields": ["external_supplier_id"]
},
{
"name": "idx_psm_buyer",
"idxtype": "index",
"idxfields": ["buyer_org_id"]
},
{
"name": "idx_psm_unique",
"idxtype": "unique",
"idxfields": ["product_id", "supplier_type", "supplier_org_id", "external_supplier_id", "buyer_org_id"]
}
],
"codes": [
{
"field": "product_id",
"table": "product",
"valuefield": "id",
"textfield": "product_name"
},
{
"field": "product_category_id",
"table": "product_category",
"valuefield": "id",
"textfield": "name"
},
{
"field": "supplier_type",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "parentid='sc_supplier_type'"
},
{
"field": "supplier_org_id",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "external_supplier_id",
"table": "suppliers",
"valuefield": "id",
"textfield": "supplier_name"
},
{
"field": "buyer_org_id",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "relation_id",
"table": "platform_supply_relations",
"valuefield": "id",
"textfield": "relation_name"
},
{
"field": "contract_id",
"table": "supply_contracts",
"valuefield": "id",
"textfield": "contract_name"
},
{
"field": "is_preferred",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "parentid='yn'"
}
]
}