From 9abff2c7adc92c934ef204d91ec0240d500eb863 Mon Sep 17 00:00:00 2001 From: Wanwan <913752709@qq.com> Date: Wed, 8 Nov 2023 23:16:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20CRM=20=E5=AE=A2=E6=88=B7=E5=85=AC?= =?UTF-8?q?=E6=B5=B7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/mysql/crm.sql | 35 +++++++++++++++++++++++++++++++++++ sql/mysql/crm_data.sql | 3 +++ sql/mysql/crm_menu.sql | 23 +++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/sql/mysql/crm.sql b/sql/mysql/crm.sql index e3e2ca0a0..2392ef482 100644 --- a/sql/mysql/crm.sql +++ b/sql/mysql/crm.sql @@ -1 +1,36 @@ SET NAMES utf8mb4; + +DROP TABLE IF EXISTS `crm_customer_limit_config`; +CREATE TABLE `crm_customer_limit_config` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', + `type` int NOT NULL COMMENT '规则类型 1: 拥有客户数限制,2:锁定客户数限制', + `user_ids` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '规则适用人群', + `dept_ids` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '规则适用部门', + `max_count` int NOT NULL COMMENT '数量上限', + `deal_count_enabled` tinyint NULL DEFAULT NULL COMMENT '成交客户是否占有拥有客户数(当 type = 1 时)', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '客户限制配置表' ROW_FORMAT = DYNAMIC; + + +DROP TABLE IF EXISTS `crm_customer_pool_config`; +CREATE TABLE `crm_customer_pool_config` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', + `enabled` tinyint(1) NOT NULL COMMENT '是否启用客户公海', + `contact_expire_days` int NULL DEFAULT NULL COMMENT '未跟进放入公海天数', + `deal_expire_days` int NULL DEFAULT NULL COMMENT '未成交放入公海天数', + `notify_enabled` tinyint(1) NULL DEFAULT NULL COMMENT '是否开启提前提醒', + `notify_days` int NULL DEFAULT NULL COMMENT '提前提醒天数', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '客户公海配置表' ROW_FORMAT = DYNAMIC; \ No newline at end of file diff --git a/sql/mysql/crm_data.sql b/sql/mysql/crm_data.sql index b5be1e691..7453f8d25 100644 --- a/sql/mysql/crm_data.sql +++ b/sql/mysql/crm_data.sql @@ -18,3 +18,6 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1399, 6, '支付宝', '6', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:55:38', '1', '2023-10-18 21:55:38', b'0'); INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1400, 7, '微信支付', '7', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:55:53', '1', '2023-10-18 21:55:53', b'0'); INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1401, 8, '其他', '8', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:56:06', '1', '2023-10-18 21:56:06', b'0'); + + +INSERT INTO `crm_customer_pool_config` (`id`, `enabled`, `contact_expire_days`, `deal_expire_days`, `notify_enabled`, `notify_days`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 1, 15, 30, 1, 3, '1', NOW(), '1', NOW(), b'0', 1); \ No newline at end of file diff --git a/sql/mysql/crm_menu.sql b/sql/mysql/crm_menu.sql index e69de29bb..a72507544 100644 --- a/sql/mysql/crm_menu.sql +++ b/sql/mysql/crm_menu.sql @@ -0,0 +1,23 @@ +-- 菜单 SQL +INSERT INTO system_menu( + name, permission, type, sort, parent_id, + path, icon, component, status, component_name +) +VALUES ( + '客户公海配置', '', 2, 0, 2397, + 'customer-pool-config', 'ep:data-analysis', 'crm/customerPoolConf/index', 0, 'CustomerPoolConf' +); + +-- 按钮父菜单ID +-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +INSERT INTO system_menu( + name, permission, type, sort, parent_id, + path, icon, component, status +) +VALUES ( + '客户公海配置保存', 'crm:customer-pool-config:update', 3, 1, @parentId, + '', '', '', 0 +); \ No newline at end of file