Commit 9abff2c7adc92c934ef204d91ec0240d500eb863

Authored by Wanwan
1 parent 71574da2

feat: CRM 客户公海配置

sql/mysql/crm.sql
1 SET NAMES utf8mb4; 1 SET NAMES utf8mb4;
  2 +
  3 +DROP TABLE IF EXISTS `crm_customer_limit_config`;
  4 +CREATE TABLE `crm_customer_limit_config` (
  5 + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  6 + `type` int NOT NULL COMMENT '规则类型 1: 拥有客户数限制,2:锁定客户数限制',
  7 + `user_ids` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '规则适用人群',
  8 + `dept_ids` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '规则适用部门',
  9 + `max_count` int NOT NULL COMMENT '数量上限',
  10 + `deal_count_enabled` tinyint NULL DEFAULT NULL COMMENT '成交客户是否占有拥有客户数(当 type = 1 时)',
  11 + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  12 + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  13 + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  14 + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  15 + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  16 + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  17 + PRIMARY KEY (`id`) USING BTREE
  18 +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '客户限制配置表' ROW_FORMAT = DYNAMIC;
  19 +
  20 +
  21 +DROP TABLE IF EXISTS `crm_customer_pool_config`;
  22 +CREATE TABLE `crm_customer_pool_config` (
  23 + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  24 + `enabled` tinyint(1) NOT NULL COMMENT '是否启用客户公海',
  25 + `contact_expire_days` int NULL DEFAULT NULL COMMENT '未跟进放入公海天数',
  26 + `deal_expire_days` int NULL DEFAULT NULL COMMENT '未成交放入公海天数',
  27 + `notify_enabled` tinyint(1) NULL DEFAULT NULL COMMENT '是否开启提前提醒',
  28 + `notify_days` int NULL DEFAULT NULL COMMENT '提前提醒天数',
  29 + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  30 + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  31 + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  32 + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  33 + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  34 + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  35 + PRIMARY KEY (`id`) USING BTREE
  36 +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '客户公海配置表' ROW_FORMAT = DYNAMIC;
2 \ No newline at end of file 37 \ No newline at end of file
sql/mysql/crm_data.sql
@@ -18,3 +18,6 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st @@ -18,3 +18,6 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
18 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'); 18 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');
19 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'); 19 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');
20 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'); 20 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');
  21 +
  22 +
  23 +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);
21 \ No newline at end of file 24 \ No newline at end of file
sql/mysql/crm_menu.sql
  1 +-- 菜单 SQL
  2 +INSERT INTO system_menu(
  3 + name, permission, type, sort, parent_id,
  4 + path, icon, component, status, component_name
  5 +)
  6 +VALUES (
  7 + '客户公海配置', '', 2, 0, 2397,
  8 + 'customer-pool-config', 'ep:data-analysis', 'crm/customerPoolConf/index', 0, 'CustomerPoolConf'
  9 +);
  10 +
  11 +-- 按钮父菜单ID
  12 +-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
  13 +SELECT @parentId := LAST_INSERT_ID();
  14 +
  15 +-- 按钮 SQL
  16 +INSERT INTO system_menu(
  17 + name, permission, type, sort, parent_id,
  18 + path, icon, component, status
  19 +)
  20 +VALUES (
  21 + '客户公海配置保存', 'crm:customer-pool-config:update', 3, 1, @parentId,
  22 + '', '', '', 0
  23 +);
0 \ No newline at end of file 24 \ No newline at end of file