{ "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'" } ] }