新增打单产品渠道查询与替换功能

This commit is contained in:
wuweihua
2026-11-11 14:50:34 +08:00
parent 41a80f9794
commit 7e1041391a
20 changed files with 603 additions and 109 deletions
+2 -2
View File
@@ -924,8 +924,8 @@ CREATE TABLE `prc_order_bill` (
`weight` decimal(10,3) DEFAULT NULL COMMENT '计费重量KG',
`biz_date` datetime NOT NULL COMMENT '计费时间',
`tms_id` bigint(20) DEFAULT NULL COMMENT '多租户系统ID',
`match_source` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '命中来源',
`match_message` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '命中说明',
`product_floor_code` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '渠道编码',
`product_floor` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '渠道名称',
`price_set_id` bigint(20) DEFAULT NULL COMMENT '价格套餐ID',
`price_set_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '套餐编码',
`price_set_name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '套餐名称',
@@ -0,0 +1,30 @@
-- prc_order_bill: drop match_source / match_message.
-- Idempotent.
SET NAMES utf8mb4;
SET @sql_drop_match_source = (
SELECT IF(
COUNT(*) > 0,
'ALTER TABLE prc_order_bill DROP COLUMN match_source',
'SELECT 1'
)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'prc_order_bill' AND COLUMN_NAME = 'match_source'
);
PREPARE stmt FROM @sql_drop_match_source;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql_drop_match_message = (
SELECT IF(
COUNT(*) > 0,
'ALTER TABLE prc_order_bill DROP COLUMN match_message',
'SELECT 1'
)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'prc_order_bill' AND COLUMN_NAME = 'match_message'
);
PREPARE stmt FROM @sql_drop_match_message;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
@@ -0,0 +1,30 @@
-- prc_order_bill: add product_floor_code / product_floor from upstream.
-- Idempotent.
SET NAMES utf8mb4;
SET @sql_add_floor_code = (
SELECT IF(
COUNT(*) = 0,
'ALTER TABLE prc_order_bill ADD COLUMN product_floor_code varchar(64) DEFAULT NULL COMMENT ''渠道编码'' AFTER tms_id',
'SELECT 1'
)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'prc_order_bill' AND COLUMN_NAME = 'product_floor_code'
);
PREPARE stmt FROM @sql_add_floor_code;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql_add_floor_name = (
SELECT IF(
COUNT(*) = 0,
'ALTER TABLE prc_order_bill ADD COLUMN product_floor varchar(200) DEFAULT NULL COMMENT ''渠道名称'' AFTER product_floor_code',
'SELECT 1'
)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'prc_order_bill' AND COLUMN_NAME = 'product_floor'
);
PREPARE stmt FROM @sql_add_floor_name;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;