feat(crm): 客户增加同市标记,装卸段选客户时默认带入。

同市客户在运输计划装货、卸货段自动带出同市,同市运输只要求购买证。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-18 13:50:41 +08:00
1 parent a7b9386e79
commit 643221c61f
15 files changed
+152 -7

No files matched your search

@@ -0,0 +1,18 @@
-- 客户主数据增加「是否同市」,运输计划装/送段选客户时默认带入段次勾选。
-- MySQL 5.7。可重复执行。存量客户默认 0。
SET NAMES utf8mb4;
SET @schema_name = DATABASE();
SET @col_exists = (
SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @schema_name AND TABLE_NAME = 'crm_customer' AND COLUMN_NAME = 'same_city'
);
SET @alter_sql = IF(
@col_exists = 0,
'ALTER TABLE crm_customer ADD COLUMN same_city tinyint NOT NULL DEFAULT 0 COMMENT ''是否同市 0-否 1-是;相对本公司业务所在市,运输计划段次默认带入'' AFTER address',
'SELECT 1'
);
PREPARE alter_stmt FROM @alter_sql;
EXECUTE alter_stmt;
DEALLOCATE PREPARE alter_stmt;
@@ -0,0 +1,18 @@
-- 客户主数据增加「是否同市」,运输计划装/送段选客户时默认带入段次勾选。
-- MySQL 5.7。可重复执行。存量客户默认 0。
SET NAMES utf8mb4;
SET @schema_name = DATABASE();
SET @col_exists = (
SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @schema_name AND TABLE_NAME = 'crm_customer' AND COLUMN_NAME = 'same_city'
);
SET @alter_sql = IF(
@col_exists = 0,
'ALTER TABLE crm_customer ADD COLUMN same_city tinyint NOT NULL DEFAULT 0 COMMENT ''是否同市 0-否 1-是;相对本公司业务所在市,运输计划段次默认带入'' AFTER address',
'SELECT 1'
);
PREPARE alter_stmt FROM @alter_sql;
EXECUTE alter_stmt;
DEALLOCATE PREPARE alter_stmt;
+1
View File
@@ -9792,6 +9792,7 @@ CREATE TABLE `crm_customer` (
`city` varchar(50) DEFAULT NULL COMMENT '市',
`district` varchar(50) DEFAULT NULL COMMENT '区',
`address` varchar(255) DEFAULT NULL COMMENT '详细地址',
`same_city` tinyint NOT NULL DEFAULT 0 COMMENT '是否同市 0-否 1-是;相对本公司业务所在市,运输计划段次默认带入',
`status` varchar(20) DEFAULT 'normal' COMMENT '客户状态(字典 crm_customer_status: normal/pool/invalid)',
`deal_status` varchar(20) DEFAULT 'not_deal' COMMENT '成交状态(字典 crm_deal_status: not_deal/dealed/lost)',
`owner_user_id` varchar(64) DEFAULT NULL COMMENT '负责人ID',