套餐加分区功能

This commit is contained in:
wuweihua
2026-09-15 14:10:44 +08:00
parent 76208604bb
commit 7679a7d091
26 changed files with 1279 additions and 597 deletions
+6 -1
View File
@@ -34,6 +34,9 @@ CREATE TABLE IF NOT EXISTS bms_product_country (
product_code varchar(20) NOT NULL COMMENT '产品代码',
country_name varchar(50) NOT NULL COMMENT '国家中文名',
country_code char(2) DEFAULT NULL COMMENT 'ISO2,可空待补齐',
zone_id bigint DEFAULT NULL COMMENT 'prc_zone.zone_id',
zone_code varchar(50) DEFAULT NULL COMMENT 'zone code e.g. Z1',
zone_name varchar(100) DEFAULT NULL COMMENT 'zone display name',
weight_min decimal(10,3) DEFAULT NULL COMMENT '重量段最小值KG(含)',
weight_max decimal(10,3) DEFAULT NULL COMMENT '重量段最大值KG(含)',
freight_price decimal(10,4) DEFAULT NULL COMMENT '运费 RMB/KG',
@@ -47,9 +50,11 @@ CREATE TABLE IF NOT EXISTS bms_product_country (
create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (detail_id),
UNIQUE KEY uk_product_country_weight_eff (product_code, country_name, weight_min, weight_max, effective_date),
UNIQUE KEY uk_product_country_zone_weight_eff (product_code, country_name, zone_code, weight_min, weight_max, effective_date),
KEY idx_product_country_pid (product_id),
KEY idx_country_code (country_code),
KEY idx_product_country_zone (zone_id),
KEY idx_product_country_zone_code (country_code, zone_code),
KEY idx_weight_match (product_code, country_code, weight_min, weight_max),
KEY idx_product_eff (product_code, effective_date, expire_date)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='产品国家明细-重量段+运费挂号费+尺寸/尾程/时效';