Commit fdaa08c25880dddc12a2e8cbaf5b93365b5b3432

Authored by Joey
2 parents 497d826a 4dab376c

Merge remote-tracking branch 'origin/feature/crm'

Showing 212 changed files with 10806 additions and 16 deletions

Too many changes.

To preserve performance only 100 of 212 files are displayed.

... ... @@ -21,6 +21,7 @@
21 21 <!-- <module>yudao-module-mp</module>-->
22 22 <!-- <module>yudao-module-pay</module>-->
23 23 <!-- <module>yudao-module-mall</module>-->
  24 + <module>yudao-module-crm</module>
24 25 <!-- 示例项目 -->
25 26 <!-- <module>yudao-example</module>-->
26 27 </modules>
... ...
sql/mysql/crm.sql 0 → 100644
  1 +SET NAMES utf8mb4;
  2 +
  3 +
  4 +
  5 +
  6 +-- ----------------------------
  7 +-- 回款表
  8 +-- ----------------------------
  9 +DROP TABLE IF EXISTS `crm_receivable`;
  10 +CREATE TABLE `crm_receivable` (
  11 + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  12 + `no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '回款编号',
  13 + `plan_id` bigint(20) NULL DEFAULT NULL COMMENT '回款计划ID',
  14 + `customer_id` bigint(20) NULL DEFAULT NULL COMMENT '客户ID',
  15 + `contract_id` bigint(20) NULL DEFAULT NULL COMMENT '合同ID',
  16 + `check_status` tinyint(4) NULL DEFAULT NULL COMMENT '审批状态',
  17 + `process_instance_id` bigint(20) NULL DEFAULT NULL COMMENT '工作流编号',
  18 + `return_time` datetime NULL DEFAULT NULL COMMENT '回款日期',
  19 + `return_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '回款方式',
  20 + `price` decimal(10, 2) NULL DEFAULT NULL COMMENT '回款金额',
  21 + `owner_user_id` bigint(20) NULL DEFAULT NULL COMMENT '负责人的用户编号',
  22 + `batch_id` bigint(20) NULL DEFAULT NULL COMMENT '批次',
  23 + `sort` int(11) NULL DEFAULT NULL COMMENT '显示顺序',
  24 + `data_scope` tinyint(4) NULL DEFAULT 1 COMMENT '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)',
  25 + `data_scope_dept_ids` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '数据范围(指定部门数组)',
  26 + `status` tinyint(4) NOT NULL COMMENT '状态(0正常 1停用)',
  27 + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  28 + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  29 + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  30 + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  31 + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  32 + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  33 + `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户编号',
  34 + PRIMARY KEY (`id`) USING BTREE
  35 +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '回款管理' ROW_FORMAT = DYNAMIC;
  36 +
  37 +
  38 +-- ----------------------------
  39 +-- 回款计划表
  40 +-- ----------------------------
  41 +DROP TABLE IF EXISTS `crm_receivable_plan`;
  42 +CREATE TABLE `crm_receivable_plan` (
  43 + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  44 + `index_no` bigint(20) NULL DEFAULT NULL COMMENT '期数',
  45 + `receivable_id` bigint(20) NULL DEFAULT NULL COMMENT '回款ID',
  46 + `status` tinyint(4) NOT NULL COMMENT '完成状态',
  47 + `check_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批状态',
  48 + `process_instance_id` bigint(20) NULL DEFAULT NULL COMMENT '工作流编号',
  49 + `price` decimal(10, 2) NULL DEFAULT NULL COMMENT '计划回款金额',
  50 + `return_time` datetime NULL DEFAULT NULL COMMENT '计划回款日期',
  51 + `remind_days` bigint(20) NULL DEFAULT NULL COMMENT '提前几天提醒',
  52 + `remind_time` datetime NULL DEFAULT NULL COMMENT '提醒日期',
  53 + `customer_id` bigint(20) NULL DEFAULT NULL COMMENT '客户ID',
  54 + `contract_id` bigint(20) NULL DEFAULT NULL COMMENT '合同ID',
  55 + `owner_user_id` bigint(20) NULL DEFAULT NULL COMMENT '负责人',
  56 + `sort` int(11) NULL DEFAULT NULL COMMENT '显示顺序',
  57 + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  58 + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  59 + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  60 + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  61 + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  62 + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  63 + `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户编号',
  64 + PRIMARY KEY (`id`) USING BTREE
  65 +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '回款计划' ROW_FORMAT = DYNAMIC;
... ...
sql/mysql/crm_data.sql 0 → 100644
  1 +
  2 +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (184, '回款管理审批状态', 'crm_receivable_check_status', 0, '回款管理审批状态(0 未审核 1 审核通过 2 审核拒绝 3 审核中 4 已撤回)', '1', '2023-10-18 21:44:24', '1', '2023-10-18 21:44:24', b'0', '1970-01-01 00:00:00');
  3 +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (185, '回款管理-回款方式', 'crm_return_type', 0, '回款管理-回款方式', '1', '2023-10-18 21:54:10', '1', '2023-10-18 21:54:10', b'0', '1970-01-01 00:00:00');
  4 +
  5 +
  6 +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 (1389, 0, '未审核', '0', 'crm_receivable_check_status', 0, 'default', '', '0 未审核 ', '1', '2023-10-18 21:46:00', '1', '2023-10-18 21:47:16', b'0');
  7 +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 (1390, 1, '审核通过', '1', 'crm_receivable_check_status', 0, 'default', '', '1 审核通过', '1', '2023-10-18 21:46:18', '1', '2023-10-18 21:47:08', b'0');
  8 +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 (1391, 2, '审核拒绝', '2', 'crm_receivable_check_status', 0, 'default', '', ' 2 审核拒绝', '1', '2023-10-18 21:46:58', '1', '2023-10-18 21:47:21', b'0');
  9 +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 (1392, 3, '审核中', '3', 'crm_receivable_check_status', 0, 'default', '', ' 3 审核中', '1', '2023-10-18 21:47:35', '1', '2023-10-18 21:47:35', b'0');
  10 +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 (1393, 4, '已撤回', '4', 'crm_receivable_check_status', 0, 'default', '', ' 4 已撤回', '1', '2023-10-18 21:47:46', '1', '2023-10-18 21:47:46', b'0');
  11 +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 (1394, 1, '支票', '1', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:54:29', '1', '2023-10-18 21:54:29', b'0');
  12 +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 (1395, 2, '现金', '2', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:54:41', '1', '2023-10-18 21:54:41', b'0');
  13 +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 (1396, 3, '邮政汇款', '3', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:54:53', '1', '2023-10-18 21:54:53', b'0');
  14 +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 (1397, 4, '电汇', '4', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:55:07', '1', '2023-10-18 21:55:07', b'0');
  15 +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 (1398, 5, '网上转账', '5', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:55:24', '1', '2023-10-18 21:55:24', b'0');
  16 +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');
  17 +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');
  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 (1401, 8, '其他', '8', 'crm_return_type', 0, 'default', '', '', '1', '2023-10-18 21:56:06', '1', '2023-10-18 21:56:06', b'0');
  19 +
  20 +
... ...
sql/mysql/crm_menu.sql 0 → 100644
sql/mysql/ruoyi-vue-pro.sql
... ... @@ -11,7 +11,7 @@
11 11 Target Server Version : 80034
12 12 File Encoding : 65001
13 13  
14   - Date: 24/10/2023 20:48:38
  14 + Date: 29/10/2023 19:22:42
15 15 */
16 16  
17 17 SET NAMES utf8mb4;
... ... @@ -341,7 +341,8 @@ CREATE TABLE `infra_api_access_log` (
341 341 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
342 342 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
343 343 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
344   - PRIMARY KEY (`id`) USING BTREE
  344 + PRIMARY KEY (`id`) USING BTREE,
  345 + INDEX `idx_create_time`(`create_time` ASC) USING BTREE
345 346 ) ENGINE = InnoDB AUTO_INCREMENT = 35832 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'API 访问日志表';
346 347  
347 348 -- ----------------------------
... ... @@ -384,7 +385,7 @@ CREATE TABLE `infra_api_error_log` (
384 385 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
385 386 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
386 387 PRIMARY KEY (`id`) USING BTREE
387   -) ENGINE = InnoDB AUTO_INCREMENT = 1745 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
  388 +) ENGINE = InnoDB AUTO_INCREMENT = 1750 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
388 389  
389 390 -- ----------------------------
390 391 -- Records of infra_api_error_log
... ... @@ -538,7 +539,7 @@ CREATE TABLE `infra_file` (
538 539 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
539 540 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
540 541 PRIMARY KEY (`id`) USING BTREE
541   -) ENGINE = InnoDB AUTO_INCREMENT = 1108 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
  542 +) ENGINE = InnoDB AUTO_INCREMENT = 1109 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
542 543  
543 544 -- ----------------------------
544 545 -- Records of infra_file
... ... @@ -587,7 +588,7 @@ CREATE TABLE `infra_file_content` (
587 588 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
588 589 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
589 590 PRIMARY KEY (`id`) USING BTREE
590   -) ENGINE = InnoDB AUTO_INCREMENT = 201 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
  591 +) ENGINE = InnoDB AUTO_INCREMENT = 202 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
591 592  
592 593 -- ----------------------------
593 594 -- Records of infra_file_content
... ... @@ -768,7 +769,7 @@ CREATE TABLE `member_experience_record` (
768 769 PRIMARY KEY (`id`) USING BTREE,
769 770 INDEX `idx_user_id`(`user_id` ASC) USING BTREE COMMENT '会员经验记录-用户编号',
770 771 INDEX `idx_user_biz_type`(`user_id` ASC, `biz_type` ASC) USING BTREE COMMENT '会员经验记录-用户业务类型'
771   -) ENGINE = InnoDB AUTO_INCREMENT = 41 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员经验记录';
  772 +) ENGINE = InnoDB AUTO_INCREMENT = 42 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员经验记录';
772 773  
773 774 -- ----------------------------
774 775 -- Records of member_experience_record
... ... @@ -884,7 +885,7 @@ CREATE TABLE `member_level_record` (
884 885 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
885 886 PRIMARY KEY (`id`) USING BTREE,
886 887 INDEX `idx_user_id`(`user_id` ASC) USING BTREE COMMENT '会员等级记录-用户编号'
887   -) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员等级记录';
  888 +) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员等级记录';
888 889  
889 890 -- ----------------------------
890 891 -- Records of member_level_record
... ... @@ -914,7 +915,7 @@ CREATE TABLE `member_point_record` (
914 915 PRIMARY KEY (`id`) USING BTREE,
915 916 INDEX `index_userId`(`user_id` ASC) USING BTREE,
916 917 INDEX `index_title`(`title` ASC) USING BTREE
917   -) ENGINE = InnoDB AUTO_INCREMENT = 60 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户积分记录';
  918 +) ENGINE = InnoDB AUTO_INCREMENT = 61 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户积分记录';
918 919  
919 920 -- ----------------------------
920 921 -- Records of member_point_record
... ... @@ -1434,6 +1435,39 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
1434 1435 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 (1395, 22, '订单积分奖励(整单取消)', '22', 'member_point_biz_type', 0, 'default', '', '', '1', '2023-10-11 07:42:55', '1', '2023-10-11 07:43:01', b'0');
1435 1436 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 (1396, 23, '订单积分奖励(单个退款)', '23', 'member_point_biz_type', 0, 'default', '', '', '1', '2023-10-11 07:43:16', '1', '2023-10-11 07:43:16', b'0');
1436 1437 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 (1397, 13, '下单奖励(单个退款)', '13', 'member_experience_biz_type', 0, 'warning', '', '', '1', '2023-10-11 07:45:24', '1', '2023-10-11 07:45:38', b'0');
  1438 +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 (1402, 1, 'A 农、林、牧、渔业', '1', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:02:15', '1', '2023-10-28 23:02:15', b'0');
  1439 +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 (1403, 2, 'B 采矿业', '2', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:02:29', '1', '2023-10-28 23:02:29', b'0');
  1440 +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 (1404, 3, 'C 制造业', '3', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:02:41', '1', '2023-10-28 23:02:41', b'0');
  1441 +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 (1405, 4, 'D 电力、热力、燃气及水生产和供应业', '4', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:02:54', '1', '2023-10-28 23:02:54', b'0');
  1442 +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 (1406, 5, 'E 建筑业', '5', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:03:03', '1', '2023-10-28 23:03:03', b'0');
  1443 +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 (1407, 6, 'F 批发和零售业', '6', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:03:13', '1', '2023-10-28 23:03:13', b'0');
  1444 +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 (1408, 7, 'G 交通运输、仓储和邮政业', '7', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:03:27', '1', '2023-10-28 23:03:27', b'0');
  1445 +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 (1409, 8, 'H 住宿和餐饮业', '8', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:03:37', '1', '2023-10-28 23:03:37', b'0');
  1446 +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 (1410, 9, 'I 信息传输、软件和信息技术服务业', '9', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:03:47', '1', '2023-10-28 23:03:47', b'0');
  1447 +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 (1411, 10, 'J 金融业', '10', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:03:57', '1', '2023-10-28 23:03:57', b'0');
  1448 +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 (1412, 11, 'K 房地产业', '11', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:04:15', '1', '2023-10-28 23:04:22', b'0');
  1449 +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 (1413, 12, 'L 租赁和商务服务业', '12', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:04:33', '1', '2023-10-28 23:04:33', b'0');
  1450 +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 (1414, 13, 'M 科学研究和技术服务业', '13', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:04:43', '1', '2023-10-28 23:04:43', b'0');
  1451 +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 (1415, 14, 'N 水利、环境和公共设施管理业', '14', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:04:53', '1', '2023-10-28 23:04:53', b'0');
  1452 +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 (1416, 15, 'O 居民服务、修理和其他服务业', '15', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:05:05', '1', '2023-10-28 23:05:05', b'0');
  1453 +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 (1417, 16, 'P 教育', '16', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:05:15', '1', '2023-10-28 23:05:15', b'0');
  1454 +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 (1418, 17, 'Q 卫生和社会工作', '17', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:05:44', '1', '2023-10-28 23:05:44', b'0');
  1455 +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 (1419, 18, 'R 文化、体育和娱乐业', '18', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:05:55', '1', '2023-10-28 23:05:55', b'0');
  1456 +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 (1420, 19, 'S 公共管理、社会保障和社会组织', '19', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:06:05', '1', '2023-10-28 23:06:05', b'0');
  1457 +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 (1421, 20, 'T 国际组织', '20', 'crm_customer_industry', 0, 'default', '', '', '1', '2023-10-28 23:06:15', '1', '2023-10-28 23:06:15', b'0');
  1458 +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 (1422, 1, 'A (重点客户)', '1', 'crm_customer_level', 0, 'primary', '', '', '1', '2023-10-28 23:07:13', '1', '2023-10-28 23:07:13', b'0');
  1459 +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 (1423, 2, 'B (普通客户)', '2', 'crm_customer_level', 0, 'info', '', '', '1', '2023-10-28 23:07:35', '1', '2023-10-28 23:07:35', b'0');
  1460 +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 (1424, 3, 'C (非优先客户)', '3', 'crm_customer_level', 0, 'default', '', '', '1', '2023-10-28 23:07:53', '1', '2023-10-28 23:07:53', b'0');
  1461 +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 (1425, 1, '促销', '1', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:08:29', '1', '2023-10-28 23:08:29', b'0');
  1462 +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 (1426, 2, '搜索引擎', '2', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:08:39', '1', '2023-10-28 23:08:39', b'0');
  1463 +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 (1427, 3, '广告', '3', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:08:47', '1', '2023-10-28 23:08:47', b'0');
  1464 +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 (1428, 4, '转介绍', '4', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:08:58', '1', '2023-10-28 23:08:58', b'0');
  1465 +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 (1429, 5, '线上注册', '5', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:09:12', '1', '2023-10-28 23:09:12', b'0');
  1466 +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 (1430, 6, '线上咨询', '6', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:09:22', '1', '2023-10-28 23:09:22', b'0');
  1467 +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 (1431, 7, '预约上门', '7', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:09:39', '1', '2023-10-28 23:09:39', b'0');
  1468 +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 (1432, 8, '陌拜', '8', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:10:04', '1', '2023-10-28 23:10:04', b'0');
  1469 +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 (1433, 9, '电话咨询', '9', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:10:18', '1', '2023-10-28 23:10:18', b'0');
  1470 +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 (1434, 10, '邮件咨询', '10', 'crm_customer_source', 0, 'default', '', '', '1', '2023-10-28 23:10:33', '1', '2023-10-28 23:10:33', b'0');
1437 1471 COMMIT;
1438 1472  
1439 1473 -- ----------------------------
... ... @@ -1454,7 +1488,7 @@ CREATE TABLE `system_dict_type` (
1454 1488 `deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间',
1455 1489 PRIMARY KEY (`id`) USING BTREE,
1456 1490 UNIQUE INDEX `dict_type`(`type` ASC) USING BTREE
1457   -) ENGINE = InnoDB AUTO_INCREMENT = 185 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
  1491 +) ENGINE = InnoDB AUTO_INCREMENT = 601 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
1458 1492  
1459 1493 -- ----------------------------
1460 1494 -- Records of system_dict_type
... ... @@ -1528,6 +1562,9 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat
1528 1562 INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (182, '佣金提现银行', 'brokerage_bank_name', 0, NULL, '', '2023-09-28 02:46:05', '', '2023-09-28 02:46:05', b'0', NULL);
1529 1563 INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (183, '砍价记录的状态', 'promotion_bargain_record_status', 0, '', '1', '2023-10-05 10:41:08', '1', '2023-10-05 10:41:08', b'0', '1970-01-01 00:00:00');
1530 1564 INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (184, '拼团记录的状态', 'promotion_combination_record_status', 0, '', '1', '2023-10-08 07:24:25', '1', '2023-10-08 07:24:25', b'0', '1970-01-01 00:00:00');
  1565 +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (186, '客户所属行业', 'crm_customer_industry', 0, 'CRM 客户所属行业', '1', '2023-10-28 22:57:07', '1', '2023-10-28 15:11:16', b'0', NULL);
  1566 +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (187, '客户等级', 'crm_customer_level', 0, 'CRM 客户等级', '1', '2023-10-28 22:59:12', '1', '2023-10-28 15:11:16', b'0', NULL);
  1567 +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (188, '客户来源', 'crm_customer_source', 0, 'CRM 客户来源', '1', '2023-10-28 23:00:34', '1', '2023-10-28 15:11:16', b'0', NULL);
1531 1568 INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (600, 'Banner Position', 'promotion_banner_position', 0, '', '1', '2023-10-08 07:24:25', '1', '2023-10-08 07:24:25', b'0', '1970-01-01 00:00:00');
1532 1569 COMMIT;
1533 1570  
... ... @@ -1577,7 +1614,7 @@ CREATE TABLE `system_login_log` (
1577 1614 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1578 1615 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
1579 1616 PRIMARY KEY (`id`) USING BTREE
1580   -) ENGINE = InnoDB AUTO_INCREMENT = 2620 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
  1617 +) ENGINE = InnoDB AUTO_INCREMENT = 2626 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
1581 1618  
1582 1619 -- ----------------------------
1583 1620 -- Records of system_login_log
... ... @@ -2203,6 +2240,49 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
2203 2240 INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2388, '商城首页', '', 2, 1, 2362, 'home', 'ep:home-filled', 'mall/home/index', 'MallHome', 0, b'1', b'1', b'1', '', '2023-10-16 12:10:33', '', '2023-10-16 12:10:33', b'0');
2204 2241 INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2389, '核销订单', '', 2, 2, 2166, 'pick-up-order', 'ep:list', 'mall/trade/delivery/pickUpOrder/index', 'PickUpOrder', 0, b'1', b'1', b'1', '', '2023-10-19 16:09:51', '', '2023-10-19 16:09:51', b'0');
2205 2242 INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2390, '优惠活动', '', 1, 99, 2030, 'youhui', 'ep:aim', '', '', 0, b'1', b'1', b'1', '1', '2023-10-21 19:23:49', '1', '2023-10-21 19:23:49', b'0');
  2243 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2391, '客户管理', '', 2, 0, 2397, 'customer', 'fa:address-book-o', 'crm/customer/index', 'CrmCustomer', 0, b'1', b'1', b'1', '', '2023-10-29 09:04:21', '1', '2023-10-29 17:11:03', b'0');
  2244 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2392, '客户查询', 'crm:customer:query', 3, 1, 2391, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 09:04:21', '', '2023-10-29 09:04:21', b'0');
  2245 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2393, '客户创建', 'crm:customer:create', 3, 2, 2391, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 09:04:21', '', '2023-10-29 09:04:21', b'0');
  2246 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2394, '客户更新', 'crm:customer:update', 3, 3, 2391, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 09:04:21', '', '2023-10-29 09:04:21', b'0');
  2247 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2395, '客户删除', 'crm:customer:delete', 3, 4, 2391, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 09:04:21', '', '2023-10-29 09:04:21', b'0');
  2248 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2396, '客户导出', 'crm:customer:export', 3, 5, 2391, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 09:04:21', '', '2023-10-29 09:04:21', b'0');
  2249 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2397, '客户管理系统', '', 1, 200, 0, '/crm', 'ep:avatar', '', '', 0, b'1', b'1', b'1', '1', '2023-10-29 17:08:30', '1', '2023-10-29 17:08:30', b'0');
  2250 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2398, '合同管理', '', 2, 1, 2397, 'contract', 'ep:notebook', 'crm/contract/index', 'CrmContract', 0, b'1', b'1', b'1', '', '2023-10-29 10:50:41', '1', '2023-10-29 18:55:53', b'0');
  2251 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2399, '合同查询', 'crm:contract:query', 3, 1, 2398, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 10:50:41', '', '2023-10-29 10:50:41', b'0');
  2252 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2400, '合同创建', 'crm:contract:create', 3, 2, 2398, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 10:50:41', '', '2023-10-29 10:50:41', b'0');
  2253 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2401, '合同更新', 'crm:contract:update', 3, 3, 2398, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 10:50:41', '', '2023-10-29 10:50:41', b'0');
  2254 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2402, '合同删除', 'crm:contract:delete', 3, 4, 2398, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 10:50:41', '', '2023-10-29 10:50:41', b'0');
  2255 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2403, '合同导出', 'crm:contract:export', 3, 5, 2398, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 10:50:41', '', '2023-10-29 10:50:41', b'0');
  2256 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2404, '线索管理', '', 2, 0, 2397, 'clue', 'fa:pagelines', 'crm/clue/index', 'CrmClue', 0, b'1', b'1', b'1', '', '2023-10-29 11:06:29', '1', '2023-10-29 19:08:35', b'0');
  2257 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2405, '线索查询', 'crm:clue:query', 3, 1, 2404, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:06:29', '', '2023-10-29 11:06:29', b'0');
  2258 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2406, '线索创建', 'crm:clue:create', 3, 2, 2404, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:06:29', '', '2023-10-29 11:06:29', b'0');
  2259 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2407, '线索更新', 'crm:clue:update', 3, 3, 2404, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:06:29', '', '2023-10-29 11:06:29', b'0');
  2260 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2408, '线索删除', 'crm:clue:delete', 3, 4, 2404, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:06:29', '', '2023-10-29 11:06:29', b'0');
  2261 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2409, '线索导出', 'crm:clue:export', 3, 5, 2404, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:06:29', '', '2023-10-29 11:06:29', b'0');
  2262 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2410, '商机管理', '', 2, 0, 2397, 'business', 'fa:bus', 'crm/business/index', 'CrmBusiness', 0, b'1', b'1', b'1', '', '2023-10-29 11:12:35', '1', '2023-10-29 19:13:01', b'0');
  2263 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2411, '商机查询', 'crm:business:query', 3, 1, 2410, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:12:35', '', '2023-10-29 11:12:35', b'0');
  2264 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2412, '商机创建', 'crm:business:create', 3, 2, 2410, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:12:35', '', '2023-10-29 11:12:35', b'0');
  2265 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2413, '商机更新', 'crm:business:update', 3, 3, 2410, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:12:35', '', '2023-10-29 11:12:35', b'0');
  2266 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2414, '商机删除', 'crm:business:delete', 3, 4, 2410, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:12:35', '', '2023-10-29 11:12:35', b'0');
  2267 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2415, '商机导出', 'crm:business:export', 3, 5, 2410, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:12:35', '', '2023-10-29 11:12:35', b'0');
  2268 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2416, '联系人管理', '', 2, 0, 2397, 'contact', 'fa:address-book-o', 'crm/contact/index', 'Contact', 0, b'1', b'1', b'1', '', '2023-10-29 11:14:56', '1', '2023-10-29 19:15:32', b'0');
  2269 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2417, '联系人查询', 'crm:contact:query', 3, 1, 2416, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:14:56', '', '2023-10-29 11:14:56', b'0');
  2270 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2418, '联系人创建', 'crm:contact:create', 3, 2, 2416, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:14:56', '', '2023-10-29 11:14:56', b'0');
  2271 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2419, '联系人更新', 'crm:contact:update', 3, 3, 2416, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:14:56', '', '2023-10-29 11:14:56', b'0');
  2272 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2420, '联系人删除', 'crm:contact:delete', 3, 4, 2416, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:14:56', '', '2023-10-29 11:14:56', b'0');
  2273 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2421, '联系人导出', 'crm:contact:export', 3, 5, 2416, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:14:56', '', '2023-10-29 11:14:56', b'0');
  2274 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2422, '回款管理', '', 2, 0, 2397, 'receivable', 'ep:money', 'crm/receivable/index', 'CrmReceivable', 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '1', '2023-10-29 19:18:52', b'0');
  2275 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2423, '回款管理查询', 'crm:receivable:query', 3, 1, 2422, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2276 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2424, '回款管理创建', 'crm:receivable:create', 3, 2, 2422, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2277 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2425, '回款管理更新', 'crm:receivable:update', 3, 3, 2422, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2278 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2426, '回款管理删除', 'crm:receivable:delete', 3, 4, 2422, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2279 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2427, '回款管理导出', 'crm:receivable:export', 3, 5, 2422, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2280 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2428, '回款计划管理', '', 2, 0, 2397, 'receivable-plan', 'fa:money', 'crm/receivablePlan/index', 'CrmReceivablePlan', 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '1', '2023-10-29 19:19:08', b'0');
  2281 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2429, '回款计划查询', 'crm:receivable-plan:query', 3, 1, 2428, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2282 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2430, '回款计划创建', 'crm:receivable-plan:create', 3, 2, 2428, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2283 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2431, '回款计划更新', 'crm:receivable-plan:update', 3, 3, 2428, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2284 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2432, '回款计划删除', 'crm:receivable-plan:delete', 3, 4, 2428, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
  2285 +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2433, '回款计划导出', 'crm:receivable-plan:export', 3, 5, 2428, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-29 11:18:09', '', '2023-10-29 11:18:09', b'0');
2206 2286 COMMIT;
2207 2287  
2208 2288 -- ----------------------------
... ... @@ -2320,8 +2400,10 @@ CREATE TABLE `system_oauth2_access_token` (
2320 2400 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
2321 2401 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
2322 2402 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
2323   - PRIMARY KEY (`id`) USING BTREE
2324   -) ENGINE = InnoDB AUTO_INCREMENT = 3130 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
  2403 + PRIMARY KEY (`id`) USING BTREE,
  2404 + INDEX `idx_access_token`(`access_token` ASC) USING BTREE,
  2405 + INDEX `idx_refresh_token`(`refresh_token` ASC) USING BTREE
  2406 +) ENGINE = InnoDB AUTO_INCREMENT = 3137 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
2325 2407  
2326 2408 -- ----------------------------
2327 2409 -- Records of system_oauth2_access_token
... ... @@ -2443,7 +2525,7 @@ CREATE TABLE `system_oauth2_refresh_token` (
2443 2525 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
2444 2526 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
2445 2527 PRIMARY KEY (`id`) USING BTREE
2446   -) ENGINE = InnoDB AUTO_INCREMENT = 1089 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
  2528 +) ENGINE = InnoDB AUTO_INCREMENT = 1094 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
2447 2529  
2448 2530 -- ----------------------------
2449 2531 -- Records of system_oauth2_refresh_token
... ... @@ -2483,7 +2565,7 @@ CREATE TABLE `system_operate_log` (
2483 2565 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
2484 2566 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
2485 2567 PRIMARY KEY (`id`) USING BTREE
2486   -) ENGINE = InnoDB AUTO_INCREMENT = 8757 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录';
  2568 +) ENGINE = InnoDB AUTO_INCREMENT = 8766 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录';
2487 2569  
2488 2570 -- ----------------------------
2489 2571 -- Records of system_operate_log
... ... @@ -3834,7 +3916,7 @@ CREATE TABLE `system_users` (
3834 3916 -- Records of system_users
3835 3917 -- ----------------------------
3836 3918 BEGIN;
3837   -INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://127.0.0.1:48080/admin-api/infra/file/4/get/37e56010ecbee472cdd821ac4b608e151e62a74d9633f15d085aee026eedeb60.png', 0, '0:0:0:0:0:0:0:1', '2023-10-24 20:20:54', 'admin', '2021-01-05 17:03:47', NULL, '2023-10-24 20:20:54', b'0', 1);
  3919 +INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://127.0.0.1:48080/admin-api/infra/file/4/get/37e56010ecbee472cdd821ac4b608e151e62a74d9633f15d085aee026eedeb60.png', 0, '0:0:0:0:0:0:0:1', '2023-10-29 17:06:12', 'admin', '2021-01-05 17:03:47', NULL, '2023-10-29 17:06:12', b'0', 1);
3838 3920 INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '127.0.0.1', '2022-07-09 23:03:33', '', '2021-01-07 09:07:17', NULL, '2022-07-09 23:03:33', b'0', 1);
3839 3921 INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (103, 'yuanma', '$2a$10$YMpimV4T6BtDhIaA8jSW.u8UTGBeGhc/qwXP4oxoMr4mOw9.qttt6', '源码', NULL, 106, NULL, 'yuanma@iocoder.cn', '15601701300', 0, '', 0, '127.0.0.1', '2022-07-08 01:26:27', '', '2021-01-13 23:50:35', NULL, '2022-07-08 01:26:27', b'0', 1);
3840 3922 INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (104, 'test', '$2a$10$GP8zvqHB//TekuzYZSBYAuBQJiNq1.fxQVDYJ.uBCOnWCtDVKE4H6', '测试号', NULL, 107, '[1,2]', '111@qq.com', '15601691200', 1, '', 0, '0:0:0:0:0:0:0:1', '2023-09-24 18:21:19', '', '2021-01-21 02:13:53', NULL, '2023-09-24 18:21:19', b'0', 1);
... ...
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/ServiceErrorCodeRange.java
... ... @@ -35,9 +35,12 @@ public class ServiceErrorCodeRange {
35 35 // 模块 member 错误码区间 [1-004-000-000 ~ 1-005-000-000)
36 36 // 模块 mp 错误码区间 [1-006-000-000 ~ 1-007-000-000)
37 37 // 模块 pay 错误码区间 [1-007-000-000 ~ 1-008-000-000)
38   - // 模块 product 错误码区间 [1-008-000-000 ~ 1-009-000-000)
39 38 // 模块 bpm 错误码区间 [1-009-000-000 ~ 1-010-000-000)
  39 +
  40 + // 模块 product 错误码区间 [1-008-000-000 ~ 1-009-000-000)
40 41 // 模块 trade 错误码区间 [1-011-000-000 ~ 1-012-000-000)
41 42 // 模块 promotion 错误码区间 [1-013-000-000 ~ 1-014-000-000)
42 43  
  44 + // 模块 crm 错误码区间 [1-020-000-000 ~ 1-021-000-000)
  45 +
43 46 }
... ...
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/validation/Telephone.java 0 → 100644
  1 +package cn.iocoder.yudao.framework.common.validation;
  2 +
  3 +import javax.validation.Constraint;
  4 +import javax.validation.Payload;
  5 +import java.lang.annotation.*;
  6 +
  7 +@Target({
  8 + ElementType.METHOD,
  9 + ElementType.FIELD,
  10 + ElementType.ANNOTATION_TYPE,
  11 + ElementType.CONSTRUCTOR,
  12 + ElementType.PARAMETER,
  13 + ElementType.TYPE_USE
  14 +})
  15 +@Retention(RetentionPolicy.RUNTIME)
  16 +@Documented
  17 +@Constraint(
  18 + validatedBy = TelephoneValidator.class
  19 +)
  20 +public @interface Telephone {
  21 +
  22 + String message() default "电话格式不正确";
  23 +
  24 + Class<?>[] groups() default {};
  25 +
  26 + Class<? extends Payload>[] payload() default {};
  27 +
  28 +}
... ...
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/validation/TelephoneValidator.java 0 → 100644
  1 +package cn.iocoder.yudao.framework.common.validation;
  2 +
  3 +import cn.hutool.core.text.CharSequenceUtil;
  4 +import cn.hutool.core.util.PhoneUtil;
  5 +
  6 +import javax.validation.ConstraintValidator;
  7 +import javax.validation.ConstraintValidatorContext;
  8 +
  9 +public class TelephoneValidator implements ConstraintValidator<Telephone, String> {
  10 +
  11 + @Override
  12 + public void initialize(Telephone annotation) {
  13 + }
  14 +
  15 + @Override
  16 + public boolean isValid(String value, ConstraintValidatorContext context) {
  17 + // 如果手机号为空,默认不校验,即校验通过
  18 + if (CharSequenceUtil.isEmpty(value)) {
  19 + return true;
  20 + }
  21 + // 校验手机
  22 + return PhoneUtil.isTel(value) || PhoneUtil.isPhone(value);
  23 + }
  24 +
  25 +}
... ...
yudao-module-crm/pom.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.iocoder.boot</groupId>
  7 + <artifactId>yudao</artifactId>
  8 + <version>${revision}</version>
  9 + </parent>
  10 + <modules>
  11 + <module>yudao-module-crm-api</module>
  12 + <module>yudao-module-crm-biz</module>
  13 + </modules>
  14 + <modelVersion>4.0.0</modelVersion>
  15 + <artifactId>yudao-module-crm</artifactId>
  16 + <packaging>pom</packaging>
  17 +
  18 + <name>${project.artifactId}</name>
  19 +
  20 + <description>
  21 + crm 包下,客户关系管理(Customer Relationship Management)。
  22 + 例如说:客户、联系人、商机、合同、回款等等
  23 + </description>
  24 +
  25 +</project>
... ...
yudao-module-crm/yudao-module-crm-api/pom.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.iocoder.boot</groupId>
  7 + <artifactId>yudao-module-crm</artifactId>
  8 + <version>${revision}</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 + <artifactId>yudao-module-crm-api</artifactId>
  12 + <packaging>jar</packaging>
  13 +
  14 + <name>${project.artifactId}</name>
  15 + <description>
  16 + crm 模块 API,暴露给其它模块调用
  17 + </description>
  18 +
  19 + <dependencies>
  20 + <dependency>
  21 + <groupId>cn.iocoder.boot</groupId>
  22 + <artifactId>yudao-common</artifactId>
  23 + </dependency>
  24 +
  25 + <!-- 参数校验 -->
  26 + <dependency>
  27 + <groupId>org.springframework.boot</groupId>
  28 + <artifactId>spring-boot-starter-validation</artifactId>
  29 + <optional>true</optional>
  30 + </dependency>
  31 + </dependencies>
  32 +
  33 +</project>
... ...
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/api/package-info.java 0 → 100644
  1 +/**
  2 + * crm API 包,定义暴露给其它模块的 API
  3 + */
  4 +package cn.iocoder.yudao.module.crm.api;
... ...
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/DictTypeConstants.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.enums;
  2 +
  3 +/**
  4 + * CRM 字典类型的枚举类
  5 + *
  6 + * @author 芋道源码
  7 + */
  8 +public interface DictTypeConstants {
  9 +
  10 + // ========== CRM 模块 ==========
  11 + String CRM_CUSTOMER_INDUSTRY = "crm_customer_industry"; // CRM 客户所属行业
  12 + String CRM_CUSTOMER_LEVEL = "crm_customer_level"; // CRM 客户等级
  13 + String CRM_CUSTOMER_SOURCE = "crm_customer_source"; // CRM 客户来源
  14 +
  15 +}
... ...
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.enums;
  2 +
  3 +import cn.iocoder.yudao.framework.common.exception.ErrorCode;
  4 +
  5 +/**
  6 + * CRM 错误码枚举类
  7 + * <p>
  8 + * crm 系统,使用 1-020-000-000 段
  9 + */
  10 +public interface ErrorCodeConstants {
  11 +
  12 + // ========== 合同管理 1-020-000-000 ==========
  13 + ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_020_000_000, "合同不存在");
  14 +
  15 + // ========== 线索管理 1-020-001-000 ==========
  16 + ErrorCode CLUE_NOT_EXISTS = new ErrorCode(1_020_001_000, "线索不存在");
  17 +
  18 + // ========== 商机管理 1-020-002-000 ==========
  19 + ErrorCode BUSINESS_NOT_EXISTS = new ErrorCode(1_020_002_000, "商机不存在");
  20 +
  21 + // TODO @lilleo:商机状态、商机类型,都单独错误码段
  22 +
  23 + ErrorCode BUSINESS_STATUS_TYPE_NOT_EXISTS = new ErrorCode(1_020_002_001, "商机状态类型不存在");
  24 + ErrorCode BUSINESS_STATUS_NOT_EXISTS = new ErrorCode(1_020_002_002, "商机状态不存在");
  25 +
  26 + // ========== 联系人管理 1-020-003-000 ==========
  27 + ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_020_003_000, "联系人不存在");
  28 +
  29 + // TODO @liuhongfeng:错误码分段;
  30 + ErrorCode RECEIVABLE_NOT_EXISTS = new ErrorCode(1_030_000_001, "回款管理不存在");
  31 +
  32 + ErrorCode RECEIVABLE_PLAN_NOT_EXISTS = new ErrorCode(1_040_000_001, "回款计划不存在");
  33 +
  34 + // ========== 客户管理 1_020_006_000 ==========
  35 + ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_020_006_000, "客户不存在");
  36 +
  37 + // TODO @puhui999:权限管理???
  38 + // ========== 客户管理 1_020_007_000 ==========
  39 + ErrorCode CRM_PERMISSION_NOT_EXISTS = new ErrorCode(1_020_007_000, "数据权限不存在");
  40 + ErrorCode CRM_PERMISSION_DENIED = new ErrorCode(1_020_007_001, "{}操作失败,原因:没有权限");
  41 + ErrorCode CRM_PERMISSION_MODEL_NOT_EXISTS = new ErrorCode(1_020_007_002, "{}不存在");
  42 + ErrorCode CRM_PERMISSION_MODEL_TRANSFER_FAIL_OWNER_USER_NOT_EXISTS = new ErrorCode(1_020_007_003, "{}操作失败,原因:负责人不存在");
  43 + ErrorCode CRM_PERMISSION_MODEL_TRANSFER_FAIL_OWNER_USER_EXISTS = new ErrorCode(1_020_007_004, "{}操作失败,原因:转移对象已经是该负责人");
  44 +
  45 +}
... ...
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/common/PermissionTypeEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.enums.common;
  2 +
  3 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  4 +import lombok.AllArgsConstructor;
  5 +import lombok.Getter;
  6 +
  7 +import java.util.Arrays;
  8 +
  9 +@Getter
  10 +@AllArgsConstructor
  11 +public enum PermissionTypeEnum implements IntArrayValuable {
  12 +
  13 + READONLY(1, "只读"),
  14 + READ_AND_WRITE(2, "读写");
  15 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PermissionTypeEnum::getType).toArray();
  16 +
  17 + /**
  18 + * 类型
  19 + */
  20 + private final Integer type;
  21 + /**
  22 + * 类型名
  23 + */
  24 + private final String name;
  25 +
  26 + @Override
  27 + public int[] array() {
  28 + return ARRAYS;
  29 + }
  30 +
  31 +}
... ...
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/common/TransferTypeEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.enums.common;
  2 +
  3 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  4 +import lombok.AllArgsConstructor;
  5 +import lombok.Getter;
  6 +
  7 +import java.util.Arrays;
  8 +
  9 +// TODO @puhui999:这个可以不用哈
  10 +/**
  11 + * Crm 负责人转移后原负责人的处理方式
  12 + *
  13 + * @author HUIHUI
  14 + */
  15 +@Getter
  16 +@AllArgsConstructor
  17 +public enum TransferTypeEnum implements IntArrayValuable {
  18 +
  19 + REMOVE(1, "移除"),
  20 + TEAM(2, "转为团队成员");
  21 +
  22 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TransferTypeEnum::getType).toArray();
  23 +
  24 + /**
  25 + * 类型
  26 + */
  27 + private final Integer type;
  28 + /**
  29 + * 类型名
  30 + */
  31 + private final String name;
  32 +
  33 + @Override
  34 + public int[] array() {
  35 + return ARRAYS;
  36 + }
  37 +
  38 +}
... ...
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/customer/CrmCustomerLevelEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.enums.customer;
  2 +
  3 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  4 +import lombok.AllArgsConstructor;
  5 +import lombok.Getter;
  6 +
  7 +import java.util.Arrays;
  8 +
  9 +/**
  10 + * CRM 客户等级
  11 + *
  12 + * @author Wanwan
  13 + */
  14 +@Getter
  15 +@AllArgsConstructor
  16 +public enum CrmCustomerLevelEnum implements IntArrayValuable {
  17 +
  18 + IMPORTANT(1, "A(重点客户)"),
  19 + GENERAL(2, "B(普通客户)"),
  20 + LOW_PRIORITY(3, "C(非优先客户)");
  21 +
  22 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmCustomerLevelEnum::getStatus).toArray();
  23 +
  24 + // TODO @wanwan:这里的 status 字段,可以考虑改成 level
  25 + /**
  26 + * 状态
  27 + */
  28 + private final Integer status;
  29 + /**
  30 + * 状态名
  31 + */
  32 + private final String name;
  33 +
  34 + @Override
  35 + public int[] array() {
  36 + return ARRAYS;
  37 + }
  38 +
  39 +}
... ...
yudao-module-crm/yudao-module-crm-biz/pom.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + xmlns="http://maven.apache.org/POM/4.0.0"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.iocoder.boot</groupId>
  7 + <artifactId>yudao-module-crm</artifactId>
  8 + <version>${revision}</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 + <artifactId>yudao-module-crm-biz</artifactId>
  12 +
  13 + <name>${project.artifactId}</name>
  14 + <description>
  15 + crm 包下,客户关系管理(Customer Relationship Management)。
  16 + 例如说:客户、联系人、商机、合同、回款等等
  17 + </description>
  18 +
  19 + <dependencies>
  20 + <dependency>
  21 + <groupId>cn.iocoder.boot</groupId>
  22 + <artifactId>yudao-module-system-api</artifactId>
  23 + <version>${revision}</version>
  24 + </dependency>
  25 + <dependency>
  26 + <groupId>cn.iocoder.boot</groupId>
  27 + <artifactId>yudao-module-crm-api</artifactId>
  28 + <version>${revision}</version>
  29 + </dependency>
  30 +
  31 + <!-- 业务组件 -->
  32 + <dependency>
  33 + <groupId>cn.iocoder.boot</groupId>
  34 + <artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
  35 + </dependency>
  36 +
  37 + <!-- Web 相关 -->
  38 + <dependency>
  39 + <groupId>cn.iocoder.boot</groupId>
  40 + <artifactId>yudao-spring-boot-starter-web</artifactId>
  41 + </dependency>
  42 +
  43 + <dependency>
  44 + <groupId>cn.iocoder.boot</groupId>
  45 + <artifactId>yudao-spring-boot-starter-security</artifactId>
  46 + </dependency>
  47 +
  48 + <!-- DB 相关 -->
  49 + <dependency>
  50 + <groupId>cn.iocoder.boot</groupId>
  51 + <artifactId>yudao-spring-boot-starter-mybatis</artifactId>
  52 + </dependency>
  53 +
  54 + <!-- 工具类相关 -->
  55 + <dependency>
  56 + <groupId>cn.iocoder.boot</groupId>
  57 + <artifactId>yudao-spring-boot-starter-excel</artifactId>
  58 + </dependency>
  59 +
  60 + <!-- Test 测试相关 -->
  61 + <dependency>
  62 + <groupId>cn.iocoder.boot</groupId>
  63 + <artifactId>yudao-spring-boot-starter-test</artifactId>
  64 + </dependency>
  65 + </dependencies>
  66 +</project>
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/api/package-info.java 0 → 100644
  1 +/**
  2 + * crm API 实现类,定义暴露给其它模块的 API
  3 + */
  4 +package cn.iocoder.yudao.module.crm.api;
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/CrmBusinessController.http 0 → 100644
  1 +PUT {{baseUrl}}/crm/business/transfer
  2 +Content-Type: application/json
  3 +Authorization: Bearer {{token}}
  4 +tenant-id: {{adminTenentId}}
  5 +
  6 +{
  7 + "id": 1,
  8 + "ownerUserId": 2,
  9 + "transferType": 2,
  10 + "permissionType": 2
  11 +}
0 12 \ No newline at end of file
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/CrmBusinessController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.*;
  8 +import cn.iocoder.yudao.module.crm.convert.business.CrmBusinessConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO;
  10 +import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService;
  11 +import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.List;
  23 +
  24 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  25 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  26 +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
  27 +
  28 +@Tag(name = "管理后台 - 商机")
  29 +@RestController
  30 +@RequestMapping("/crm/business")
  31 +@Validated
  32 +public class CrmBusinessController {
  33 +
  34 + @Resource
  35 + private CrmBusinessService businessService;
  36 +
  37 + @PostMapping("/create")
  38 + @Operation(summary = "创建商机")
  39 + @PreAuthorize("@ss.hasPermission('crm:business:create')")
  40 + public CommonResult<Long> createBusiness(@Valid @RequestBody CrmBusinessCreateReqVO createReqVO) {
  41 + return success(businessService.createBusiness(createReqVO, getLoginUserId()));
  42 + }
  43 +
  44 + @PutMapping("/update")
  45 + @Operation(summary = "更新商机")
  46 + @PreAuthorize("@ss.hasPermission('crm:business:update')")
  47 + public CommonResult<Boolean> updateBusiness(@Valid @RequestBody CrmBusinessUpdateReqVO updateReqVO) {
  48 + businessService.updateBusiness(updateReqVO);
  49 + return success(true);
  50 + }
  51 +
  52 + @DeleteMapping("/delete")
  53 + @Operation(summary = "删除商机")
  54 + @Parameter(name = "id", description = "编号", required = true)
  55 + @PreAuthorize("@ss.hasPermission('crm:business:delete')")
  56 + public CommonResult<Boolean> deleteBusiness(@RequestParam("id") Long id) {
  57 + businessService.deleteBusiness(id);
  58 + return success(true);
  59 + }
  60 +
  61 + @GetMapping("/get")
  62 + @Operation(summary = "获得商机")
  63 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  64 + @PreAuthorize("@ss.hasPermission('crm:business:query')")
  65 + public CommonResult<CrmBusinessRespVO> getBusiness(@RequestParam("id") Long id) {
  66 + CrmBusinessDO business = businessService.getBusiness(id);
  67 + return success(CrmBusinessConvert.INSTANCE.convert(business));
  68 + }
  69 +
  70 + @GetMapping("/page")
  71 + @Operation(summary = "获得商机分页")
  72 + @PreAuthorize("@ss.hasPermission('crm:business:query')")
  73 + public CommonResult<PageResult<CrmBusinessRespVO>> getBusinessPage(@Valid CrmBusinessPageReqVO pageVO) {
  74 + PageResult<CrmBusinessDO> pageResult = businessService.getBusinessPage(pageVO);
  75 +
  76 + return success(CrmBusinessConvert.INSTANCE.convertPage(pageResult));
  77 + }
  78 +
  79 + @GetMapping("/export-excel")
  80 + @Operation(summary = "导出商机 Excel")
  81 + @PreAuthorize("@ss.hasPermission('crm:business:export')")
  82 + @OperateLog(type = EXPORT)
  83 + public void exportBusinessExcel(@Valid CrmBusinessExportReqVO exportReqVO,
  84 + HttpServletResponse response) throws IOException {
  85 + List<CrmBusinessDO> list = businessService.getBusinessList(exportReqVO);
  86 + // 导出 Excel
  87 + List<CrmBusinessExcelVO> datas = CrmBusinessConvert.INSTANCE.convertList02(list);
  88 + ExcelUtils.write(response, "商机.xls", "数据", CrmBusinessExcelVO.class, datas);
  89 + }
  90 +
  91 + @PutMapping("/transfer")
  92 + @Operation(summary = "商机转移")
  93 + @PreAuthorize("@ss.hasPermission('crm:business:update')")
  94 + public CommonResult<Boolean> transfer(@Valid @RequestBody CrmTransferBusinessReqVO reqVO) {
  95 + businessService.transferBusiness(reqVO, getLoginUserId());
  96 + return success(true);
  97 + }
  98 +
  99 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/package-info.java 0 → 100644
  1 +/**
  2 + * 商机(销售机会)
  3 + */
  4 +package cn.iocoder.yudao.module.crm.controller.admin.business;
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import javax.validation.constraints.NotNull;
  8 +import java.math.BigDecimal;
  9 +import java.time.LocalDateTime;
  10 +
  11 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  12 +
  13 +/**
  14 + * 商机 Base VO,提供给添加、修改、详细的子 VO 使用
  15 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  16 + */
  17 +@Data
  18 +public class CrmBusinessBaseVO {
  19 +
  20 + @Schema(description = "商机名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
  21 + @NotNull(message = "商机名称不能为空")
  22 + private String name;
  23 +
  24 + @Schema(description = "商机状态类型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "25714")
  25 + @NotNull(message = "商机状态类型不能为空")
  26 + private Long statusTypeId;
  27 +
  28 + @Schema(description = "商机状态编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30320")
  29 + @NotNull(message = "商机状态不能为空")
  30 + private Long statusId;
  31 +
  32 + @Schema(description = "下次联系时间")
  33 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  34 + private LocalDateTime contactNextTime;
  35 +
  36 + @Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10299")
  37 + @NotNull(message = "客户不能为空")
  38 + private Long customerId;
  39 +
  40 + @Schema(description = "预计成交日期")
  41 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  42 + private LocalDateTime dealTime;
  43 +
  44 + @Schema(description = "商机金额", example = "12371")
  45 + private Integer price;
  46 +
  47 + // TODO @ljileo:折扣使用 Integer 类型,存储时,默认 * 100;展示的时候,前端需要 / 100;避免精度丢失问题
  48 + @Schema(description = "整单折扣")
  49 + private Integer discountPercent;
  50 +
  51 + @Schema(description = "产品总金额", example = "12025")
  52 + private BigDecimal productPrice;
  53 +
  54 + @Schema(description = "备注", example = "随便")
  55 + private String remark;
  56 +
  57 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +@Schema(description = "管理后台 - 商机创建 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class CrmBusinessCreateReqVO extends CrmBusinessBaseVO {
  13 +
  14 + // TODO @ljileo:新建的时候,应该可以传递添加的产品;
  15 +
  16 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
  2 +
  3 +import com.alibaba.excel.annotation.ExcelProperty;
  4 +import lombok.Data;
  5 +
  6 +import java.math.BigDecimal;
  7 +import java.time.LocalDateTime;
  8 +import java.util.Set;
  9 +
  10 +/**
  11 + * 商机 Excel VO
  12 + *
  13 + * @author ljlleo
  14 + */
  15 +@Data
  16 +public class CrmBusinessExcelVO {
  17 +
  18 + @ExcelProperty("主键")
  19 + private Long id;
  20 +
  21 + @ExcelProperty("商机名称")
  22 + private String name;
  23 +
  24 + @ExcelProperty("商机状态类型编号")
  25 + private Long statusTypeId;
  26 +
  27 + @ExcelProperty("商机状态编号")
  28 + private Long statusId;
  29 +
  30 + @ExcelProperty("下次联系时间")
  31 + private LocalDateTime contactNextTime;
  32 +
  33 + @ExcelProperty("客户编号")
  34 + private Long customerId;
  35 +
  36 + @ExcelProperty("预计成交日期")
  37 + private LocalDateTime dealTime;
  38 +
  39 + @ExcelProperty("商机金额")
  40 + private BigDecimal price;
  41 +
  42 + @ExcelProperty("整单折扣")
  43 + private BigDecimal discountPercent;
  44 +
  45 + @ExcelProperty("产品总金额")
  46 + private BigDecimal productPrice;
  47 +
  48 + @ExcelProperty("备注")
  49 + private String remark;
  50 +
  51 + @ExcelProperty("负责人的用户编号")
  52 + private Long ownerUserId;
  53 +
  54 + @ExcelProperty("创建时间")
  55 + private LocalDateTime createTime;
  56 +
  57 + @ExcelProperty("只读权限的用户编号数组")
  58 + private Set<Long> roUserIds;
  59 +
  60 + @ExcelProperty("读写权限的用户编号数组")
  61 + private Set<Long> rwUserIds;
  62 +
  63 + @ExcelProperty("1赢单2输单3无效")
  64 + private Integer endStatus;
  65 +
  66 + @ExcelProperty("结束时的备注")
  67 + private String endRemark;
  68 +
  69 + @ExcelProperty("最后跟进时间")
  70 + private LocalDateTime contactLastTime;
  71 +
  72 + @ExcelProperty("跟进状态")
  73 + private Integer followUpStatus;
  74 +
  75 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import java.math.BigDecimal;
  8 +import java.time.LocalDateTime;
  9 +
  10 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  11 +
  12 +@Schema(description = "管理后台 - 商机 Excel 导出 Request VO,参数和 CrmBusinessPageReqVO 是一致的")
  13 +@Data
  14 +public class CrmBusinessExportReqVO {
  15 +
  16 + @Schema(description = "商机名称", example = "李四")
  17 + private String name;
  18 +
  19 + @Schema(description = "商机状态类型编号", example = "25714")
  20 + private Long statusTypeId;
  21 +
  22 + @Schema(description = "商机状态编号", example = "30320")
  23 + private Long statusId;
  24 +
  25 + @Schema(description = "下次联系时间")
  26 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  27 + private LocalDateTime[] contactNextTime;
  28 +
  29 + @Schema(description = "客户编号", example = "10299")
  30 + private Long customerId;
  31 +
  32 + @Schema(description = "预计成交日期")
  33 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  34 + private LocalDateTime[] dealTime;
  35 +
  36 + @Schema(description = "商机金额", example = "12371")
  37 + private BigDecimal price;
  38 +
  39 + @Schema(description = "整单折扣")
  40 + private BigDecimal discountPercent;
  41 +
  42 + @Schema(description = "产品总金额", example = "12025")
  43 + private BigDecimal productPrice;
  44 +
  45 + @Schema(description = "备注", example = "随便")
  46 + private String remark;
  47 +
  48 + @Schema(description = "负责人的用户编号", example = "25562")
  49 + private Long ownerUserId;
  50 +
  51 + @Schema(description = "创建时间")
  52 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  53 + private LocalDateTime[] createTime;
  54 +
  55 + @Schema(description = "只读权限的用户编号数组")
  56 + private String roUserIds;
  57 +
  58 + @Schema(description = "读写权限的用户编号数组")
  59 + private String rwUserIds;
  60 +
  61 + @Schema(description = "1赢单2输单3无效", example = "1")
  62 + private Integer endStatus;
  63 +
  64 + @Schema(description = "结束时的备注", example = "你说的对")
  65 + private String endRemark;
  66 +
  67 + @Schema(description = "最后跟进时间")
  68 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  69 + private LocalDateTime[] contactLastTime;
  70 +
  71 + @Schema(description = "跟进状态", example = "1")
  72 + private Integer followUpStatus;
  73 +
  74 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessPageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +
  9 +@Schema(description = "管理后台 - 商机分页 Request VO")
  10 +@Data
  11 +@EqualsAndHashCode(callSuper = true)
  12 +@ToString(callSuper = true)
  13 +public class CrmBusinessPageReqVO extends PageParam {
  14 +
  15 + @Schema(description = "商机名称", example = "李四")
  16 + private String name;
  17 +
  18 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.time.LocalDateTime;
  6 +
  7 +@Schema(description = "管理后台 - 商机 Response VO")
  8 +@Data
  9 +@EqualsAndHashCode(callSuper = true)
  10 +@ToString(callSuper = true)
  11 +public class CrmBusinessRespVO extends CrmBusinessBaseVO {
  12 +
  13 + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32129")
  14 + private Long id;
  15 +
  16 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  17 + private LocalDateTime createTime;
  18 +
  19 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +import javax.validation.constraints.NotNull;
  9 +
  10 +@Schema(description = "管理后台 - 商机更新 Request VO")
  11 +@Data
  12 +@EqualsAndHashCode(callSuper = true)
  13 +@ToString(callSuper = true)
  14 +public class CrmBusinessUpdateReqVO extends CrmBusinessBaseVO {
  15 +
  16 + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32129")
  17 + @NotNull(message = "主键不能为空")
  18 + private Long id;
  19 +
  20 + // TODO @ljileo:修改的时候,应该可以传递添加的产品;
  21 +
  22 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmTransferBusinessReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  4 +import cn.iocoder.yudao.module.crm.enums.common.PermissionTypeEnum;
  5 +import cn.iocoder.yudao.module.crm.enums.common.TransferTypeEnum;
  6 +import io.swagger.v3.oas.annotations.media.Schema;
  7 +import lombok.Data;
  8 +
  9 +import javax.validation.constraints.NotNull;
  10 +
  11 +@Schema(description = "管理后台 - 商机转移 Request VO")
  12 +@Data
  13 +public class CrmTransferBusinessReqVO {
  14 +
  15 + @Schema(description = "商机编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  16 + @NotNull(message = "联系人编号不能为空")
  17 + private Long id;
  18 +
  19 + @Schema(description = "新负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  20 + @NotNull(message = "新负责人的用户编号不能为空")
  21 + private Long ownerUserId;
  22 +
  23 + @Schema(description = "原负责人移除方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  24 + @InEnum(TransferTypeEnum.class)
  25 + @NotNull(message = "原负责人移除方式不能为空")
  26 + private Integer transferType;
  27 +
  28 + @Schema(description = "权限类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  29 + @InEnum(PermissionTypeEnum.class)
  30 + @NotNull(message = "权限类型不能为空")
  31 + private Integer permissionType;
  32 +
  33 +
  34 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatus/CrmBusinessStatusController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatus;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.*;
  8 +import cn.iocoder.yudao.module.crm.convert.businessstatus.CrmBusinessStatusConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatus.CrmBusinessStatusDO;
  10 +import cn.iocoder.yudao.module.crm.service.businessstatus.CrmBusinessStatusService;
  11 +import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.Collection;
  23 +import java.util.List;
  24 +
  25 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  26 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  27 +
  28 +// TODO @lilleo:这个模块,可以挪到 business 下;这样我打开 business 包下,就知道,噢~原来里面有 business 商机、有 type 状态类型、status 具体状态;
  29 +@Tag(name = "管理后台 - 商机状态")
  30 +@RestController
  31 +@RequestMapping("/crm/business-status")
  32 +@Validated
  33 +public class CrmBusinessStatusController {
  34 +
  35 + @Resource
  36 + private CrmBusinessStatusService businessStatusService;
  37 +
  38 + @PostMapping("/create")
  39 + @Operation(summary = "创建商机状态")
  40 + @PreAuthorize("@ss.hasPermission('crm:business-status:create')")
  41 + public CommonResult<Long> createBusinessStatus(@Valid @RequestBody CrmBusinessStatusCreateReqVO createReqVO) {
  42 + return success(businessStatusService.createBusinessStatus(createReqVO));
  43 + }
  44 +
  45 + @PutMapping("/update")
  46 + @Operation(summary = "更新商机状态")
  47 + @PreAuthorize("@ss.hasPermission('crm:business-status:update')")
  48 + public CommonResult<Boolean> updateBusinessStatus(@Valid @RequestBody CrmBusinessStatusUpdateReqVO updateReqVO) {
  49 + businessStatusService.updateBusinessStatus(updateReqVO);
  50 + return success(true);
  51 + }
  52 +
  53 + @DeleteMapping("/delete")
  54 + @Operation(summary = "删除商机状态")
  55 + @Parameter(name = "id", description = "编号", required = true)
  56 + @PreAuthorize("@ss.hasPermission('crm:business-status:delete')")
  57 + public CommonResult<Boolean> deleteBusinessStatus(@RequestParam("id") Long id) {
  58 + businessStatusService.deleteBusinessStatus(id);
  59 + return success(true);
  60 + }
  61 +
  62 + @GetMapping("/get")
  63 + @Operation(summary = "获得商机状态")
  64 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  65 + @PreAuthorize("@ss.hasPermission('crm:business-status:query')")
  66 + public CommonResult<CrmBusinessStatusRespVO> getBusinessStatus(@RequestParam("id") Long id) {
  67 + CrmBusinessStatusDO businessStatus = businessStatusService.getBusinessStatus(id);
  68 + return success(CrmBusinessStatusConvert.INSTANCE.convert(businessStatus));
  69 + }
  70 +
  71 + // TODO @lilleo:这个接口,暂时用不到,可以考虑先删除掉
  72 + @GetMapping("/list")
  73 + @Operation(summary = "获得商机状态列表")
  74 + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
  75 + @PreAuthorize("@ss.hasPermission('crm:business-status:query')")
  76 + public CommonResult<List<CrmBusinessStatusRespVO>> getBusinessStatusList(@RequestParam("ids") Collection<Long> ids) {
  77 + List<CrmBusinessStatusDO> list = businessStatusService.getBusinessStatusList(ids);
  78 + return success(CrmBusinessStatusConvert.INSTANCE.convertList(list));
  79 + }
  80 +
  81 + @GetMapping("/page")
  82 + @Operation(summary = "获得商机状态分页")
  83 + @PreAuthorize("@ss.hasPermission('crm:business-status:query')")
  84 + public CommonResult<PageResult<CrmBusinessStatusRespVO>> getBusinessStatusPage(@Valid CrmBusinessStatusPageReqVO pageVO) {
  85 + PageResult<CrmBusinessStatusDO> pageResult = businessStatusService.getBusinessStatusPage(pageVO);
  86 + return success(CrmBusinessStatusConvert.INSTANCE.convertPage(pageResult));
  87 + }
  88 +
  89 + @GetMapping("/export-excel")
  90 + @Operation(summary = "导出商机状态 Excel")
  91 + @PreAuthorize("@ss.hasPermission('crm:business-status:export')")
  92 + @OperateLog(type = EXPORT)
  93 + public void exportBusinessStatusExcel(@Valid CrmBusinessStatusExportReqVO exportReqVO,
  94 + HttpServletResponse response) throws IOException {
  95 + List<CrmBusinessStatusDO> list = businessStatusService.getBusinessStatusList(exportReqVO);
  96 + // 导出 Excel
  97 + List<CrmBusinessStatusExcelVO> datas = CrmBusinessStatusConvert.INSTANCE.convertList02(list);
  98 + ExcelUtils.write(response, "商机状态.xls", "数据", CrmBusinessStatusExcelVO.class, datas);
  99 + }
  100 +
  101 + // TODO 芋艿:后续再看看
  102 + @GetMapping("/get-simple-list")
  103 + @Operation(summary = "获得商机状态列表")
  104 + @PreAuthorize("@ss.hasPermission('crm:business-status:query')")
  105 + public CommonResult<List<CrmBusinessStatusRespVO>> getBusinessStatusListByTypeId(@RequestParam("typeId") Integer typeId) {
  106 + List<CrmBusinessStatusDO> list = businessStatusService.getBusinessStatusListByTypeId(typeId);
  107 + return success(CrmBusinessStatusConvert.INSTANCE.convertList(list));
  108 + }
  109 +
  110 + // TODO 芋艿:后续再看看
  111 + @GetMapping("/get-all-list")
  112 + @Operation(summary = "获得商机状态列表")
  113 + @PreAuthorize("@ss.hasPermission('crm:business-status:query')")
  114 + public CommonResult<List<CrmBusinessStatusRespVO>> getBusinessStatusList() {
  115 + List<CrmBusinessStatusDO> list = businessStatusService.getBusinessStatusList();
  116 + return success(CrmBusinessStatusConvert.INSTANCE.convertList(list));
  117 + }
  118 +
  119 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatus/vo/CrmBusinessStatusBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +import javax.validation.constraints.NotNull;
  7 +
  8 +/**
  9 + * 商机状态 Base VO,提供给添加、修改、详细的子 VO 使用
  10 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  11 + */
  12 +@Data
  13 +public class CrmBusinessStatusBaseVO {
  14 +
  15 + // TODO @lilleo:example 要写下
  16 +
  17 + @Schema(description = "状态类型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22882")
  18 + @NotNull(message = "状态类型编号不能为空")
  19 + private Long typeId;
  20 +
  21 + @Schema(description = "状态名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
  22 + @NotNull(message = "状态名不能为空")
  23 + private String name;
  24 +
  25 + // TODO @lilleo:percent 应该是 Integer;
  26 + @Schema(description = "赢单率")
  27 + private String percent;
  28 +
  29 + // TODO @lilleo:这个是不是不用前端新增和修改的时候传递,交给顺序计算出来,存储起来就好了;
  30 + @Schema(description = "排序")
  31 + private Integer sort;
  32 +
  33 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatus/vo/CrmBusinessStatusCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import javax.validation.constraints.*;
  7 +
  8 +@Schema(description = "管理后台 - 商机状态创建 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class CrmBusinessStatusCreateReqVO extends CrmBusinessStatusBaseVO {
  13 +
  14 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatus/vo/CrmBusinessStatusExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
  2 +
  3 +import com.alibaba.excel.annotation.ExcelProperty;
  4 +import lombok.Data;
  5 +
  6 +// TODO @lilleo:这个暂时不需要;嘿嘿~不是每个模块都需要导出哈
  7 +/**
  8 + * 商机状态 Excel VO
  9 + *
  10 + * @author ljlleo
  11 + */
  12 +@Data
  13 +public class CrmBusinessStatusExcelVO {
  14 +
  15 + @ExcelProperty("主键")
  16 + private Long id;
  17 +
  18 + @ExcelProperty("状态类型编号")
  19 + private Long typeId;
  20 +
  21 + @ExcelProperty("状态名")
  22 + private String name;
  23 +
  24 + @ExcelProperty("赢单率")
  25 + private String percent;
  26 +
  27 + @ExcelProperty("排序")
  28 + private Integer sort;
  29 +
  30 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatus/vo/CrmBusinessStatusExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +// TODO @lilleo:这个暂时不需要;嘿嘿~不是每个模块都需要导出哈
  7 +@Schema(description = "管理后台 - 商机状态 Excel 导出 Request VO,参数和 CrmBusinessStatusPageReqVO 是一致的")
  8 +@Data
  9 +public class CrmBusinessStatusExportReqVO {
  10 +
  11 + @Schema(description = "状态类型编号", example = "22882")
  12 + private Long typeId;
  13 +
  14 + @Schema(description = "状态名", example = "李四")
  15 + private String name;
  16 +
  17 + @Schema(description = "赢单率")
  18 + private String percent;
  19 +
  20 + @Schema(description = "排序")
  21 + private Integer sort;
  22 +
  23 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatus/vo/CrmBusinessStatusPageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +
  9 +@Schema(description = "管理后台 - 商机状态分页 Request VO")
  10 +@Data
  11 +@EqualsAndHashCode(callSuper = true)
  12 +@ToString(callSuper = true)
  13 +public class CrmBusinessStatusPageReqVO extends PageParam {
  14 +
  15 + @Schema(description = "状态类型编号", example = "22882")
  16 + private Long typeId;
  17 +
  18 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatus/vo/CrmBusinessStatusRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +
  6 +@Schema(description = "管理后台 - 商机状态 Response VO")
  7 +@Data
  8 +@EqualsAndHashCode(callSuper = true)
  9 +@ToString(callSuper = true)
  10 +public class CrmBusinessStatusRespVO extends CrmBusinessStatusBaseVO {
  11 +
  12 + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6802")
  13 + private Long id;
  14 +
  15 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatus/vo/CrmBusinessStatusUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +import javax.validation.constraints.NotNull;
  9 +
  10 +@Schema(description = "管理后台 - 商机状态更新 Request VO")
  11 +@Data
  12 +@EqualsAndHashCode(callSuper = true)
  13 +@ToString(callSuper = true)
  14 +public class CrmBusinessStatusUpdateReqVO extends CrmBusinessStatusBaseVO {
  15 +
  16 + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6802")
  17 + @NotNull(message = "编号不能为空")
  18 + private Long id;
  19 +
  20 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatustype/CrmBusinessStatusTypeController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype;
  2 +
  3 +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  4 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  5 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  6 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  7 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  8 +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.*;
  9 +import cn.iocoder.yudao.module.crm.convert.businessstatustype.CrmBusinessStatusTypeConvert;
  10 +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatustype.CrmBusinessStatusTypeDO;
  11 +import cn.iocoder.yudao.module.crm.service.businessstatustype.CrmBusinessStatusTypeService;
  12 +import io.swagger.v3.oas.annotations.Operation;
  13 +import io.swagger.v3.oas.annotations.Parameter;
  14 +import io.swagger.v3.oas.annotations.tags.Tag;
  15 +import org.springframework.security.access.prepost.PreAuthorize;
  16 +import org.springframework.validation.annotation.Validated;
  17 +import org.springframework.web.bind.annotation.*;
  18 +
  19 +import javax.annotation.Resource;
  20 +import javax.servlet.http.HttpServletResponse;
  21 +import javax.validation.Valid;
  22 +import java.io.IOException;
  23 +import java.util.Collection;
  24 +import java.util.List;
  25 +
  26 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  27 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  28 +
  29 +// TODO @lilleo:这个模块,可以挪到 business 下;这样我打开 business 包下,就知道,噢~原来里面有 business 商机、有 type 状态类型、status 具体状态;
  30 +@Tag(name = "管理后台 - 商机状态类型")
  31 +@RestController
  32 +@RequestMapping("/crm/business-status-type")
  33 +@Validated
  34 +public class CrmBusinessStatusTypeController {
  35 +
  36 + @Resource
  37 + private CrmBusinessStatusTypeService businessStatusTypeService;
  38 +
  39 + @PostMapping("/create")
  40 + @Operation(summary = "创建商机状态类型")
  41 + @PreAuthorize("@ss.hasPermission('crm:business-status-type:create')")
  42 + public CommonResult<Long> createBusinessStatusType(@Valid @RequestBody CrmBusinessStatusTypeCreateReqVO createReqVO) {
  43 + return success(businessStatusTypeService.createBusinessStatusType(createReqVO));
  44 + }
  45 +
  46 + @PutMapping("/update")
  47 + @Operation(summary = "更新商机状态类型")
  48 + @PreAuthorize("@ss.hasPermission('crm:business-status-type:update')")
  49 + public CommonResult<Boolean> updateBusinessStatusType(@Valid @RequestBody CrmBusinessStatusTypeUpdateReqVO updateReqVO) {
  50 + businessStatusTypeService.updateBusinessStatusType(updateReqVO);
  51 + return success(true);
  52 + }
  53 +
  54 + @DeleteMapping("/delete")
  55 + @Operation(summary = "删除商机状态类型")
  56 + @Parameter(name = "id", description = "编号", required = true)
  57 + @PreAuthorize("@ss.hasPermission('crm:business-status-type:delete')")
  58 + public CommonResult<Boolean> deleteBusinessStatusType(@RequestParam("id") Long id) {
  59 + businessStatusTypeService.deleteBusinessStatusType(id);
  60 + return success(true);
  61 + }
  62 +
  63 + @GetMapping("/get")
  64 + @Operation(summary = "获得商机状态类型")
  65 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  66 + @PreAuthorize("@ss.hasPermission('crm:business-status-type:query')")
  67 + public CommonResult<CrmBusinessStatusTypeRespVO> getBusinessStatusType(@RequestParam("id") Long id) {
  68 + CrmBusinessStatusTypeDO businessStatusType = businessStatusTypeService.getBusinessStatusType(id);
  69 + return success(CrmBusinessStatusTypeConvert.INSTANCE.convert(businessStatusType));
  70 + }
  71 +
  72 + // TODO @lilleo:这个接口,暂时用不到,可以考虑先删除掉
  73 + @GetMapping("/list")
  74 + @Operation(summary = "获得商机状态类型列表")
  75 + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
  76 + @PreAuthorize("@ss.hasPermission('crm:business-status-type:query')")
  77 + public CommonResult<List<CrmBusinessStatusTypeRespVO>> getBusinessStatusTypeList(@RequestParam("ids") Collection<Long> ids) {
  78 + List<CrmBusinessStatusTypeDO> list = businessStatusTypeService.getBusinessStatusTypeList(ids);
  79 + return success(CrmBusinessStatusTypeConvert.INSTANCE.convertList(list));
  80 + }
  81 +
  82 + @GetMapping("/page")
  83 + @Operation(summary = "获得商机状态类型分页")
  84 + @PreAuthorize("@ss.hasPermission('crm:business-status-type:query')")
  85 + public CommonResult<PageResult<CrmBusinessStatusTypeRespVO>> getBusinessStatusTypePage(@Valid CrmBusinessStatusTypePageReqVO pageVO) {
  86 + PageResult<CrmBusinessStatusTypeDO> pageResult = businessStatusTypeService.getBusinessStatusTypePage(pageVO);
  87 + return success(CrmBusinessStatusTypeConvert.INSTANCE.convertPage(pageResult));
  88 + }
  89 +
  90 + @GetMapping("/export-excel")
  91 + @Operation(summary = "导出商机状态类型 Excel")
  92 + @PreAuthorize("@ss.hasPermission('crm:business-status-type:export')")
  93 + @OperateLog(type = EXPORT)
  94 + public void exportBusinessStatusTypeExcel(@Valid CrmBusinessStatusTypeExportReqVO exportReqVO,
  95 + HttpServletResponse response) throws IOException {
  96 + List<CrmBusinessStatusTypeDO> list = businessStatusTypeService.getBusinessStatusTypeList(exportReqVO);
  97 + // 导出 Excel
  98 + List<CrmBusinessStatusTypeExcelVO> datas = CrmBusinessStatusTypeConvert.INSTANCE.convertList02(list);
  99 + ExcelUtils.write(response, "商机状态类型.xls", "数据", CrmBusinessStatusTypeExcelVO.class, datas);
  100 + }
  101 +
  102 + @GetMapping("/get-simple-list")
  103 + @Operation(summary = "获得商机状态类型列表")
  104 + @PreAuthorize("@ss.hasPermission('crm:business-status-type:query')")
  105 + public CommonResult<List<CrmBusinessStatusTypeRespVO>> getBusinessStatusTypeList() {
  106 + List<CrmBusinessStatusTypeDO> list = businessStatusTypeService.getBusinessStatusTypeListByStatus(CommonStatusEnum.ENABLE.getStatus());
  107 + return success(CrmBusinessStatusTypeConvert.INSTANCE.convertList(list));
  108 + }
  109 +
  110 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatustype/vo/CrmBusinessStatusTypeBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +import javax.validation.constraints.NotNull;
  7 +
  8 +/**
  9 + * 商机状态类型 Base VO,提供给添加、修改、详细的子 VO 使用
  10 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  11 + */
  12 +@Data
  13 +public class CrmBusinessStatusTypeBaseVO {
  14 +
  15 + @Schema(description = "状态类型名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
  16 + @NotNull(message = "状态类型名不能为空")
  17 + private String name;
  18 +
  19 + @Schema(description = "使用的部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
  20 + @NotNull(message = "使用的部门编号不能为空")
  21 + private String deptIds;
  22 +
  23 + @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  24 + @NotNull(message = "开启状态不能为空")
  25 + private Boolean status;
  26 +
  27 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatustype/vo/CrmBusinessStatusTypeCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +// TODO 状态类型和状态添加,是在一个请求里,所以需要把 CrmBusinessStatusCreateReqVO 融合进来;
  9 +@Schema(description = "管理后台 - 商机状态类型创建 Request VO")
  10 +@Data
  11 +@EqualsAndHashCode(callSuper = true)
  12 +@ToString(callSuper = true)
  13 +public class CrmBusinessStatusTypeCreateReqVO extends CrmBusinessStatusTypeBaseVO {
  14 +
  15 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatustype/vo/CrmBusinessStatusTypeExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
  2 +
  3 +import com.alibaba.excel.annotation.ExcelProperty;
  4 +import lombok.Data;
  5 +
  6 +import java.time.LocalDateTime;
  7 +
  8 +// TODO @lilleo:这个暂时不需要;嘿嘿~不是每个模块都需要导出哈
  9 +/**
  10 + * 商机状态类型 Excel VO
  11 + *
  12 + * @author ljlleo
  13 + */
  14 +@Data
  15 +public class CrmBusinessStatusTypeExcelVO {
  16 +
  17 + @ExcelProperty("主键")
  18 + private Long id;
  19 +
  20 + @ExcelProperty("状态类型名")
  21 + private String name;
  22 +
  23 + @ExcelProperty("使用的部门编号")
  24 + private String deptIds;
  25 +
  26 + @ExcelProperty("开启状态")
  27 + private Boolean status;
  28 +
  29 + @ExcelProperty("创建时间")
  30 + private LocalDateTime createTime;
  31 +
  32 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatustype/vo/CrmBusinessStatusTypeExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import java.time.LocalDateTime;
  8 +
  9 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  10 +
  11 +// TODO @lilleo:这个暂时不需要;嘿嘿~不是每个模块都需要导出哈
  12 +@Schema(description = "管理后台 - 商机状态类型 Excel 导出 Request VO,参数和 CrmBusinessStatusTypePageReqVO 是一致的")
  13 +@Data
  14 +public class CrmBusinessStatusTypeExportReqVO {
  15 +
  16 + @Schema(description = "状态类型名", example = "芋艿")
  17 + private String name;
  18 +
  19 + @Schema(description = "使用的部门编号")
  20 + private String deptIds;
  21 +
  22 + @Schema(description = "开启状态", example = "1")
  23 + private Boolean status;
  24 +
  25 + @Schema(description = "创建时间")
  26 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  27 + private LocalDateTime[] createTime;
  28 +
  29 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatustype/vo/CrmBusinessStatusTypePageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +
  9 +@Schema(description = "管理后台 - 商机状态类型分页 Request VO")
  10 +@Data
  11 +@EqualsAndHashCode(callSuper = true)
  12 +@ToString(callSuper = true)
  13 +public class CrmBusinessStatusTypePageReqVO extends PageParam {
  14 +
  15 + @Schema(description = "状态类型名", example = "芋艿")
  16 + private String name;
  17 +
  18 + @Schema(description = "开启状态", example = "1")
  19 + private Boolean status;
  20 +
  21 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatustype/vo/CrmBusinessStatusTypeRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.time.LocalDateTime;
  6 +
  7 +@Schema(description = "管理后台 - 商机状态类型 Response VO")
  8 +@Data
  9 +@EqualsAndHashCode(callSuper = true)
  10 +@ToString(callSuper = true)
  11 +public class CrmBusinessStatusTypeRespVO extends CrmBusinessStatusTypeBaseVO {
  12 +
  13 + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24019")
  14 + private Long id;
  15 +
  16 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  17 + private LocalDateTime createTime;
  18 +
  19 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/businessstatustype/vo/CrmBusinessStatusTypeUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +import javax.validation.constraints.NotNull;
  9 +
  10 +// TODO 状态类型和状态添加,是在一个请求里,所以需要把 CrmBusinessStatusUpdateReqVO 融合进来;
  11 +@Schema(description = "管理后台 - 商机状态类型更新 Request VO")
  12 +@Data
  13 +@EqualsAndHashCode(callSuper = true)
  14 +@ToString(callSuper = true)
  15 +public class CrmBusinessStatusTypeUpdateReqVO extends CrmBusinessStatusTypeBaseVO {
  16 +
  17 + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24019")
  18 + @NotNull(message = "主键不能为空")
  19 + private Long id;
  20 +
  21 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/CrmClueController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.clue;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.*;
  8 +import cn.iocoder.yudao.module.crm.convert.clue.CrmClueConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO;
  10 +import cn.iocoder.yudao.module.crm.service.clue.CrmClueService;
  11 +import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.List;
  23 +
  24 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  25 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  26 +
  27 +@Tag(name = "管理后台 - 线索")
  28 +@RestController
  29 +@RequestMapping("/crm/clue")
  30 +@Validated
  31 +public class CrmClueController {
  32 +
  33 + @Resource
  34 + private CrmClueService clueService;
  35 +
  36 + @PostMapping("/create")
  37 + @Operation(summary = "创建线索")
  38 + @PreAuthorize("@ss.hasPermission('crm:clue:create')")
  39 + public CommonResult<Long> createClue(@Valid @RequestBody CrmClueCreateReqVO createReqVO) {
  40 + return success(clueService.createClue(createReqVO));
  41 + }
  42 +
  43 + @PutMapping("/update")
  44 + @Operation(summary = "更新线索")
  45 + @PreAuthorize("@ss.hasPermission('crm:clue:update')")
  46 + public CommonResult<Boolean> updateClue(@Valid @RequestBody CrmClueUpdateReqVO updateReqVO) {
  47 + clueService.updateClue(updateReqVO);
  48 + return success(true);
  49 + }
  50 +
  51 + @DeleteMapping("/delete")
  52 + @Operation(summary = "删除线索")
  53 + @Parameter(name = "id", description = "编号", required = true)
  54 + @PreAuthorize("@ss.hasPermission('crm:clue:delete')")
  55 + public CommonResult<Boolean> deleteClue(@RequestParam("id") Long id) {
  56 + clueService.deleteClue(id);
  57 + return success(true);
  58 + }
  59 +
  60 + @GetMapping("/get")
  61 + @Operation(summary = "获得线索")
  62 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  63 + @PreAuthorize("@ss.hasPermission('crm:clue:query')")
  64 + public CommonResult<CrmClueRespVO> getClue(@RequestParam("id") Long id) {
  65 + CrmClueDO clue = clueService.getClue(id);
  66 + return success(CrmClueConvert.INSTANCE.convert(clue));
  67 + }
  68 +
  69 + @GetMapping("/page")
  70 + @Operation(summary = "获得线索分页")
  71 + @PreAuthorize("@ss.hasPermission('crm:clue:query')")
  72 + public CommonResult<PageResult<CrmClueRespVO>> getCluePage(@Valid CrmCluePageReqVO pageVO) {
  73 + PageResult<CrmClueDO> pageResult = clueService.getCluePage(pageVO);
  74 + return success(CrmClueConvert.INSTANCE.convertPage(pageResult));
  75 + }
  76 +
  77 + @GetMapping("/export-excel")
  78 + @Operation(summary = "导出线索 Excel")
  79 + @PreAuthorize("@ss.hasPermission('crm:clue:export')")
  80 + @OperateLog(type = EXPORT)
  81 + public void exportClueExcel(@Valid CrmClueExportReqVO exportReqVO,
  82 + HttpServletResponse response) throws IOException {
  83 + List<CrmClueDO> list = clueService.getClueList(exportReqVO);
  84 + // 导出 Excel
  85 + List<CrmClueExcelVO> datas = CrmClueConvert.INSTANCE.convertList02(list);
  86 + ExcelUtils.write(response, "线索.xls", "数据", CrmClueExcelVO.class, datas);
  87 + }
  88 +
  89 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/package-info.java 0 → 100644
  1 +/**
  2 + * 线索
  3 + */
  4 +package cn.iocoder.yudao.module.crm.controller.admin.clue;
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.Mobile;
  4 +import cn.iocoder.yudao.framework.common.validation.Telephone;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import lombok.Data;
  7 +import org.springframework.format.annotation.DateTimeFormat;
  8 +
  9 +import javax.validation.constraints.NotEmpty;
  10 +import javax.validation.constraints.NotNull;
  11 +import java.time.LocalDateTime;
  12 +
  13 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  14 +
  15 +/**
  16 + * 线索 Base VO,提供给添加、修改、详细的子 VO 使用
  17 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  18 + */
  19 +@Data
  20 +public class CrmClueBaseVO {
  21 +
  22 + @Schema(description = "线索名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "线索xxx")
  23 + @NotEmpty(message = "线索名称不能为空")
  24 + private String name;
  25 +
  26 + @Schema(description = "客户 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "520")
  27 + @NotNull(message = "客户不能为空")
  28 + private Long customerId;
  29 +
  30 + @Schema(description = "下次联系时间", example = "2023-10-18 01:00:00")
  31 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  32 + private LocalDateTime contactNextTime;
  33 +
  34 + @Schema(description = "电话", example = "18000000000")
  35 + @Telephone
  36 + private String telephone;
  37 +
  38 + @Schema(description = "手机号", example = "18000000000")
  39 + @Mobile
  40 + private String mobile;
  41 +
  42 + @Schema(description = "地址", example = "北京市海淀区")
  43 + private String address;
  44 +
  45 + @Schema(description = "最后跟进时间")
  46 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  47 + private LocalDateTime contactLastTime;
  48 +
  49 + @Schema(description = "备注", example = "随便")
  50 + private String remark;
  51 +
  52 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import javax.validation.constraints.*;
  7 +
  8 +@Schema(description = "管理后台 - 线索创建 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class CrmClueCreateReqVO extends CrmClueBaseVO {
  13 +
  14 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
  2 +
  3 +import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.*;
  6 +import java.util.*;
  7 +import java.time.LocalDateTime;
  8 +import java.time.LocalDateTime;
  9 +import java.time.LocalDateTime;
  10 +import java.time.LocalDateTime;
  11 +
  12 +import com.alibaba.excel.annotation.ExcelProperty;
  13 +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
  14 +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
  15 +
  16 +/**
  17 + * 线索 Excel VO
  18 + *
  19 + * @author Wanwan
  20 + */
  21 +@Data
  22 +public class CrmClueExcelVO {
  23 +
  24 + @ExcelProperty("编号")
  25 + private Long id;
  26 +
  27 + @ExcelProperty(value = "转化状态", converter = DictConvert.class)
  28 + @DictFormat(DictTypeConstants.BOOLEAN_STRING)
  29 + private Boolean transformStatus;
  30 +
  31 + @ExcelProperty(value = "跟进状态", converter = DictConvert.class)
  32 + @DictFormat(DictTypeConstants.BOOLEAN_STRING)
  33 + private Boolean followUpStatus;
  34 +
  35 + @ExcelProperty("线索名称")
  36 + private String name;
  37 +
  38 + // TODO 这里需要导出成客户名称
  39 + @ExcelProperty("客户id")
  40 + private Long customerId;
  41 +
  42 + @ExcelProperty("下次联系时间")
  43 + private LocalDateTime contactNextTime;
  44 +
  45 + @ExcelProperty("电话")
  46 + private String telephone;
  47 +
  48 + @ExcelProperty("手机号")
  49 + private String mobile;
  50 +
  51 + @ExcelProperty("地址")
  52 + private String address;
  53 +
  54 + @ExcelProperty("负责人的用户编号")
  55 + private Long ownerUserId;
  56 +
  57 + @ExcelProperty("最后跟进时间")
  58 + private LocalDateTime contactLastTime;
  59 +
  60 + @ExcelProperty("备注")
  61 + private String remark;
  62 +
  63 + @ExcelProperty("创建时间")
  64 + private LocalDateTime createTime;
  65 +
  66 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  7 +import java.time.LocalDateTime;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +
  10 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  11 +
  12 +@Schema(description = "管理后台 - 线索 Excel 导出 Request VO,参数和 CrmCluePageReqVO 是一致的")
  13 +@Data
  14 +public class CrmClueExportReqVO {
  15 +
  16 + @Schema(description = "转化状态", example = "true")
  17 + private Boolean transformStatus;
  18 +
  19 + @Schema(description = "跟进状态", example = "true")
  20 + private Boolean followUpStatus;
  21 +
  22 + @Schema(description = "线索名称", example = "线索xxx")
  23 + private String name;
  24 +
  25 + @Schema(description = "客户id", example = "520")
  26 + private Long customerId;
  27 +
  28 + @Schema(description = "下次联系时间", example = "2023-10-18 01:00:00")
  29 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  30 + private LocalDateTime[] contactNextTime;
  31 +
  32 + @Schema(description = "电话", example = "18000000000")
  33 + private String telephone;
  34 +
  35 + @Schema(description = "手机号", example = "18000000000")
  36 + private String mobile;
  37 +
  38 + @Schema(description = "地址", example = "北京市海淀区")
  39 + private String address;
  40 +
  41 + @Schema(description = "负责人的用户编号", example = "27199")
  42 + private Long ownerUserId;
  43 +
  44 + @Schema(description = "最后跟进时间")
  45 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  46 + private LocalDateTime[] contactLastTime;
  47 +
  48 + @Schema(description = "创建时间")
  49 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  50 + private LocalDateTime[] createTime;
  51 +
  52 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmCluePageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +
  9 +@Schema(description = "管理后台 - 线索分页 Request VO")
  10 +@Data
  11 +@EqualsAndHashCode(callSuper = true)
  12 +@ToString(callSuper = true)
  13 +public class CrmCluePageReqVO extends PageParam {
  14 +
  15 + @Schema(description = "线索名称", example = "线索xxx")
  16 + private String name;
  17 +
  18 + @Schema(description = "电话", example = "18000000000")
  19 + private String telephone;
  20 +
  21 + @Schema(description = "手机号", example = "18000000000")
  22 + private String mobile;
  23 +
  24 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +
  6 +import javax.validation.constraints.NotNull;
  7 +import java.time.LocalDateTime;
  8 +
  9 +@Schema(description = "管理后台 - 线索 Response VO")
  10 +@Data
  11 +@EqualsAndHashCode(callSuper = true)
  12 +@ToString(callSuper = true)
  13 +public class CrmClueRespVO extends CrmClueBaseVO {
  14 +
  15 + @Schema(description = "编号,主键自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "10969")
  16 + private Long id;
  17 +
  18 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  19 + private LocalDateTime createTime;
  20 +
  21 + @Schema(description = "转化状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  22 + private Boolean transformStatus;
  23 +
  24 + @Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  25 + private Boolean followUpStatus;
  26 +
  27 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +import javax.validation.constraints.NotNull;
  9 +
  10 +@Schema(description = "管理后台 - 线索更新 Request VO")
  11 +@Data
  12 +@EqualsAndHashCode(callSuper = true)
  13 +@ToString(callSuper = true)
  14 +public class CrmClueUpdateReqVO extends CrmClueBaseVO {
  15 +
  16 + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10969")
  17 + @NotNull(message = "编号不能为空")
  18 + private Long id;
  19 +
  20 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/ContactController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.*;
  8 +import cn.iocoder.yudao.module.crm.convert.contact.ContactConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.contact.ContactDO;
  10 +import cn.iocoder.yudao.module.crm.service.contact.ContactService;
  11 +import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.Collection;
  23 +import java.util.List;
  24 +
  25 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  26 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  27 +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
  28 +
  29 +@Tag(name = "管理后台 - CRM 联系人")
  30 +@RestController
  31 +@RequestMapping("/crm/contact")
  32 +@Validated
  33 +public class ContactController {
  34 +
  35 + @Resource
  36 + private ContactService contactService;
  37 +
  38 + @PostMapping("/create")
  39 + @Operation(summary = "创建crm联系人")
  40 + @PreAuthorize("@ss.hasPermission('crm:contact:create')")
  41 + public CommonResult<Long> createContact(@Valid @RequestBody ContactCreateReqVO createReqVO) {
  42 + return success(contactService.createContact(createReqVO, getLoginUserId()));
  43 + }
  44 +
  45 + @PutMapping("/update")
  46 + @Operation(summary = "更新crm联系人")
  47 + @PreAuthorize("@ss.hasPermission('crm:contact:update')")
  48 + public CommonResult<Boolean> updateContact(@Valid @RequestBody ContactUpdateReqVO updateReqVO) {
  49 + contactService.updateContact(updateReqVO);
  50 + return success(true);
  51 + }
  52 +
  53 + @DeleteMapping("/delete")
  54 + @Operation(summary = "删除crm联系人")
  55 + @Parameter(name = "id", description = "编号", required = true)
  56 + @PreAuthorize("@ss.hasPermission('crm:contact:delete')")
  57 + public CommonResult<Boolean> deleteContact(@RequestParam("id") Long id) {
  58 + contactService.deleteContact(id);
  59 + return success(true);
  60 + }
  61 +
  62 + @GetMapping("/get")
  63 + @Operation(summary = "获得crm联系人")
  64 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  65 + @PreAuthorize("@ss.hasPermission('crm:contact:query')")
  66 + public CommonResult<ContactRespVO> getContact(@RequestParam("id") Long id) {
  67 + ContactDO contact = contactService.getContact(id);
  68 + return success(ContactConvert.INSTANCE.convert(contact));
  69 + }
  70 +
  71 + @GetMapping("/list")
  72 + @Operation(summary = "获得crm联系人列表")
  73 + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
  74 + @PreAuthorize("@ss.hasPermission('crm:contact:query')")
  75 + public CommonResult<List<ContactRespVO>> getContactList(@RequestParam("ids") Collection<Long> ids) {
  76 + List<ContactDO> list = contactService.getContactList(ids);
  77 + return success(ContactConvert.INSTANCE.convertList(list));
  78 + }
  79 +
  80 + @GetMapping("/page")
  81 + @Operation(summary = "获得crm联系人分页")
  82 + @PreAuthorize("@ss.hasPermission('crm:contact:query')")
  83 + public CommonResult<PageResult<ContactRespVO>> getContactPage(@Valid ContactPageReqVO pageVO) {
  84 + PageResult<ContactDO> pageResult = contactService.getContactPage(pageVO);
  85 + return success(ContactConvert.INSTANCE.convertPage(pageResult));
  86 + }
  87 +
  88 + @GetMapping("/export-excel")
  89 + @Operation(summary = "导出crm联系人 Excel")
  90 + @PreAuthorize("@ss.hasPermission('crm:contact:export')")
  91 + @OperateLog(type = EXPORT)
  92 + public void exportContactExcel(@Valid ContactExportReqVO exportReqVO,
  93 + HttpServletResponse response) throws IOException {
  94 + List<ContactDO> list = contactService.getContactList(exportReqVO);
  95 + // 导出 Excel
  96 + List<ContactExcelVO> datas = ContactConvert.INSTANCE.convertList02(list);
  97 + ExcelUtils.write(response, "crm联系人.xls", "数据", ContactExcelVO.class, datas);
  98 + }
  99 +
  100 + @PutMapping("/transfer")
  101 + @Operation(summary = "联系人转移")
  102 + @PreAuthorize("@ss.hasPermission('crm:contact:update')")
  103 + public CommonResult<Boolean> transfer(@Valid @RequestBody CrmTransferContactReqVO reqVO) {
  104 + contactService.transferContact(reqVO, getLoginUserId());
  105 + return success(true);
  106 + }
  107 +
  108 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/ContactBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import javax.validation.constraints.NotNull;
  8 +import java.time.LocalDateTime;
  9 +
  10 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  11 +
  12 +/**
  13 + * crm联系人 Base VO,提供给添加、修改、详细的子 VO 使用
  14 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  15 + */
  16 +@Data
  17 +public class ContactBaseVO {
  18 +
  19 + // TODO @zyna:部分字段,缺少 example,需要补充;
  20 +
  21 + @Schema(description = "联系人名称", example = "张三")
  22 + @NotNull(message = "姓名不能为空")
  23 + private String name;
  24 +
  25 + @Schema(description = "下次联系时间")
  26 + private LocalDateTime nextTime;
  27 +
  28 + // TODO @zyna:缺少 validator 的校验
  29 + @Schema(description = "手机号")
  30 + private String mobile;
  31 +
  32 + // TODO @zyna:缺少 validator 的校验
  33 + @Schema(description = "电话")
  34 + private String telephone;
  35 +
  36 + // TODO @zyna:缺少 validator 的校验
  37 + @Schema(description = "电子邮箱")
  38 + private String email;
  39 +
  40 + @Schema(description = "职务")
  41 + private String post;
  42 +
  43 + // TODO @zyna:非空校验
  44 + @Schema(description = "客户编号", example = "10795")
  45 + private Long customerId;
  46 +
  47 + @Schema(description = "地址")
  48 + private String address;
  49 +
  50 + @Schema(description = "备注", example = "你说的对")
  51 + private String remark;
  52 +
  53 + // TODO @zyna:这个新建的时候,应该不会传递;而是后端默认设置自己为负责人;
  54 + @Schema(description = "负责人用户编号", example = "7648")
  55 + private Long ownerUserId;
  56 +
  57 + @Schema(description = "最后跟进时间")
  58 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  59 + private LocalDateTime lastTime;
  60 +
  61 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/ContactCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +@Schema(description = "管理后台 - CRM 联系人创建 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class ContactCreateReqVO extends ContactBaseVO {
  13 +
  14 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/ContactExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.util.*;
  6 +import java.time.LocalDateTime;
  7 +import java.time.LocalDateTime;
  8 +import java.time.LocalDateTime;
  9 +
  10 +import com.alibaba.excel.annotation.ExcelProperty;
  11 +
  12 +/**
  13 + * crm联系人 Excel VO
  14 + *
  15 + * @author 芋道源码
  16 + */
  17 +@Data
  18 +public class ContactExcelVO {
  19 +
  20 + @ExcelProperty("主键")
  21 + private Long id;
  22 +
  23 + @ExcelProperty("联系人名称")
  24 + private String name;
  25 +
  26 + @ExcelProperty("下次联系时间")
  27 + private LocalDateTime nextTime;
  28 +
  29 + @ExcelProperty("手机号")
  30 + private String mobile;
  31 +
  32 + @ExcelProperty("电话")
  33 + private String telephone;
  34 +
  35 + @ExcelProperty("电子邮箱")
  36 + private String email;
  37 +
  38 + @ExcelProperty("职务")
  39 + private String post;
  40 +
  41 + @ExcelProperty("客户编号")
  42 + private Long customerId;
  43 +
  44 + @ExcelProperty("地址")
  45 + private String address;
  46 +
  47 + @ExcelProperty("备注")
  48 + private String remark;
  49 +
  50 + @ExcelProperty("负责人用户编号")
  51 + private Long ownerUserId;
  52 +
  53 + @ExcelProperty("创建时间")
  54 + private LocalDateTime createTime;
  55 +
  56 + @ExcelProperty("最后跟进时间")
  57 + private LocalDateTime lastTime;
  58 +
  59 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/ContactExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact.vo;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  7 +import java.time.LocalDateTime;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +
  10 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  11 +
  12 +@Schema(description = "管理后台 - CRM 联系人 Excel 导出 Request VO,参数和 ContactPageReqVO 是一致的")
  13 +@Data
  14 +public class ContactExportReqVO {
  15 +
  16 + @Schema(description = "联系人名称", example = "张三")
  17 + private String name;
  18 +
  19 + @Schema(description = "下次联系时间")
  20 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  21 + private LocalDateTime[] nextTime;
  22 +
  23 + @Schema(description = "手机号")
  24 + private String mobile;
  25 +
  26 + @Schema(description = "电话")
  27 + private String telephone;
  28 +
  29 + @Schema(description = "电子邮箱")
  30 + private String email;
  31 +
  32 + @Schema(description = "职务")
  33 + private String post;
  34 +
  35 + @Schema(description = "客户编号", example = "10795")
  36 + private Long customerId;
  37 +
  38 + @Schema(description = "地址")
  39 + private String address;
  40 +
  41 + @Schema(description = "备注", example = "你说的对")
  42 + private String remark;
  43 +
  44 + @Schema(description = "负责人用户编号", example = "7648")
  45 + private Long ownerUserId;
  46 +
  47 + @Schema(description = "创建时间")
  48 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  49 + private LocalDateTime[] createTime;
  50 +
  51 + @Schema(description = "最后跟进时间")
  52 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  53 + private LocalDateTime[] lastTime;
  54 +
  55 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/ContactPageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +
  10 +import java.time.LocalDateTime;
  11 +
  12 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  13 +
  14 +@Schema(description = "管理后台 - CRM 联系人分页 Request VO")
  15 +@Data
  16 +@EqualsAndHashCode(callSuper = true)
  17 +@ToString(callSuper = true)
  18 +public class ContactPageReqVO extends PageParam {
  19 +
  20 + // TODO @芋艿:需要查询的字段;
  21 +
  22 + @Schema(description = "联系人名称", example = "张三")
  23 + private String name;
  24 +
  25 + @Schema(description = "下次联系时间")
  26 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  27 + private LocalDateTime[] nextTime;
  28 +
  29 + @Schema(description = "手机号")
  30 + private String mobile;
  31 +
  32 + @Schema(description = "电话")
  33 + private String telephone;
  34 +
  35 + @Schema(description = "电子邮箱")
  36 + private String email;
  37 +
  38 + @Schema(description = "职务")
  39 + private String post;
  40 +
  41 + @Schema(description = "客户编号", example = "10795")
  42 + private Long customerId;
  43 +
  44 + @Schema(description = "地址")
  45 + private String address;
  46 +
  47 + @Schema(description = "备注", example = "你说的对")
  48 + private String remark;
  49 +
  50 + @Schema(description = "负责人用户编号", example = "7648")
  51 + private Long ownerUserId;
  52 +
  53 + @Schema(description = "创建时间")
  54 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  55 + private LocalDateTime[] createTime;
  56 +
  57 + @Schema(description = "最后跟进时间")
  58 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  59 + private LocalDateTime[] lastTime;
  60 +
  61 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/ContactRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.time.LocalDateTime;
  6 +
  7 +@Schema(description = "管理后台 - CRM 联系人 Response VO")
  8 +@Data
  9 +@EqualsAndHashCode(callSuper = true)
  10 +@ToString(callSuper = true)
  11 +public class ContactRespVO extends ContactBaseVO {
  12 +
  13 + @Schema(description = "主键", example = "23210")
  14 + private Long id;
  15 +
  16 + @Schema(description = "创建时间")
  17 + private LocalDateTime createTime;
  18 + @Schema(description = "创建人")
  19 + private String creator;
  20 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/ContactUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +@Schema(description = "管理后台 - CRM 联系人更新 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class ContactUpdateReqVO extends ContactBaseVO {
  13 +
  14 + @Schema(description = "主键", example = "23210")
  15 + private Long id;
  16 +
  17 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/CrmTransferContactReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contact.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +import javax.validation.constraints.NotNull;
  7 +
  8 +@Schema(description = "管理后台 - CRM 联系人转移 Request VO")
  9 +@Data
  10 +public class CrmTransferContactReqVO {
  11 +
  12 + @Schema(description = "联系人编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  13 + @NotNull(message = "联系人编号不能为空")
  14 + private Long id;
  15 +
  16 + @Schema(description = "新负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  17 + @NotNull(message = "新负责人的用户编号不能为空")
  18 + private Long ownerUserId;
  19 +
  20 + @Schema(description = "原负责人移除方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  21 + @NotNull(message = "原负责人移除方式不能为空")
  22 + private Integer transferType;
  23 +
  24 + @Schema(description = "权限类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  25 + @NotNull(message = "权限类型不能为空")
  26 + private Integer permissionType;
  27 +
  28 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/ContractController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.*;
  8 +import cn.iocoder.yudao.module.crm.convert.contract.ContractConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO;
  10 +import cn.iocoder.yudao.module.crm.service.contract.ContractService;
  11 +import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.List;
  23 +
  24 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  25 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  26 +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
  27 +
  28 +@Tag(name = "管理后台 - CRM 合同")
  29 +@RestController
  30 +@RequestMapping("/crm/contract")
  31 +@Validated
  32 +public class ContractController {
  33 +
  34 + @Resource
  35 + private ContractService contractService;
  36 +
  37 + @PostMapping("/create")
  38 + @Operation(summary = "创建合同")
  39 + @PreAuthorize("@ss.hasPermission('crm:contract:create')")
  40 + public CommonResult<Long> createContract(@Valid @RequestBody ContractCreateReqVO createReqVO) {
  41 + return success(contractService.createContract(createReqVO, getLoginUserId()));
  42 + }
  43 +
  44 + @PutMapping("/update")
  45 + @Operation(summary = "更新合同")
  46 + @PreAuthorize("@ss.hasPermission('crm:contract:update')")
  47 + public CommonResult<Boolean> updateContract(@Valid @RequestBody ContractUpdateReqVO updateReqVO) {
  48 + contractService.updateContract(updateReqVO);
  49 + return success(true);
  50 + }
  51 +
  52 + @DeleteMapping("/delete")
  53 + @Operation(summary = "删除合同")
  54 + @Parameter(name = "id", description = "编号", required = true)
  55 + @PreAuthorize("@ss.hasPermission('crm:contract:delete')")
  56 + public CommonResult<Boolean> deleteContract(@RequestParam("id") Long id) {
  57 + contractService.deleteContract(id);
  58 + return success(true);
  59 + }
  60 +
  61 + @GetMapping("/get")
  62 + @Operation(summary = "获得合同")
  63 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  64 + @PreAuthorize("@ss.hasPermission('crm:contract:query')")
  65 + public CommonResult<ContractRespVO> getContract(@RequestParam("id") Long id) {
  66 + ContractDO contract = contractService.getContract(id);
  67 + return success(ContractConvert.INSTANCE.convert(contract));
  68 + }
  69 +
  70 + @GetMapping("/page")
  71 + @Operation(summary = "获得合同分页")
  72 + @PreAuthorize("@ss.hasPermission('crm:contract:query')")
  73 + public CommonResult<PageResult<ContractRespVO>> getContractPage(@Valid ContractPageReqVO pageVO) {
  74 + PageResult<ContractDO> pageResult = contractService.getContractPage(pageVO);
  75 + return success(ContractConvert.INSTANCE.convertPage(pageResult));
  76 + }
  77 +
  78 + @GetMapping("/export-excel")
  79 + @Operation(summary = "导出合同 Excel")
  80 + @PreAuthorize("@ss.hasPermission('crm:contract:export')")
  81 + @OperateLog(type = EXPORT)
  82 + public void exportContractExcel(@Valid ContractExportReqVO exportReqVO,
  83 + HttpServletResponse response) throws IOException {
  84 + List<ContractDO> list = contractService.getContractList(exportReqVO);
  85 + // 导出 Excel
  86 + List<ContractExcelVO> datas = ContractConvert.INSTANCE.convertList02(list);
  87 + ExcelUtils.write(response, "合同.xls", "数据", ContractExcelVO.class, datas);
  88 + }
  89 +
  90 + @PutMapping("/transfer")
  91 + @Operation(summary = "合同转移")
  92 + @PreAuthorize("@ss.hasPermission('crm:contract:update')")
  93 + public CommonResult<Boolean> transfer(@Valid @RequestBody CrmTransferContractReqVO reqVO) {
  94 + contractService.transferContract(reqVO, getLoginUserId());
  95 + return success(true);
  96 + }
  97 +
  98 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/ContractBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import javax.validation.constraints.NotNull;
  8 +import java.time.LocalDateTime;
  9 +
  10 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  11 +
  12 +// TODO @dhb52:所有类,带下 Crm 前缀,避免和别的模块重复
  13 +/**
  14 + * 合同 Base VO,提供给添加、修改、详细的子 VO 使用
  15 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  16 + */
  17 +@Data
  18 +public class ContractBaseVO {
  19 +
  20 + // TODO @dhb52:类似 no 字段的 example 要写xia 哈;
  21 +
  22 + @Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
  23 + @NotNull(message = "合同名称不能为空")
  24 + private String name;
  25 +
  26 + // TODO @dhb52:这个必须传递
  27 + @Schema(description = "客户编号", example = "18336")
  28 + private Long customerId;
  29 +
  30 + @Schema(description = "商机编号", example = "10864")
  31 + private Long businessId;
  32 +
  33 + @Schema(description = "工作流编号", example = "1043")
  34 + private Long processInstanceId;
  35 +
  36 + // TODO @dhb52:这个必须传递
  37 + @Schema(description = "下单日期")
  38 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  39 + private LocalDateTime orderDate;
  40 +
  41 + // TODO @dhb52:这个必须传递
  42 + @Schema(description = "负责人的用户编号", example = "17144")
  43 + private Long ownerUserId;
  44 +
  45 + // TODO @芋艿:未来应该支持自动生成;
  46 + // TODO @dhb52:这个必须传递;
  47 + @Schema(description = "合同编号")
  48 + private String no;
  49 +
  50 + @Schema(description = "开始时间")
  51 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  52 + private LocalDateTime startTime;
  53 +
  54 + @Schema(description = "结束时间")
  55 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  56 + private LocalDateTime endTime;
  57 +
  58 + @Schema(description = "合同金额", example = "5617")
  59 + private Integer price;
  60 +
  61 + @Schema(description = "整单折扣")
  62 + private Integer discountPercent;
  63 +
  64 + @Schema(description = "产品总金额", example = "19510")
  65 + private Integer productPrice;
  66 +
  67 + @Schema(description = "联系人编号", example = "18546")
  68 + private Long contactId;
  69 +
  70 + @Schema(description = "公司签约人", example = "14036")
  71 + private Long signUserId;
  72 +
  73 + @Schema(description = "最后跟进时间")
  74 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  75 + private LocalDateTime contactLastTime;
  76 +
  77 + @Schema(description = "备注", example = "你猜")
  78 + private String remark;
  79 +
  80 + // TODO @dhb52:增加一个 status 字段:具体有哪些值,你来枚举下;主要页面上有个【草稿】【提交审核】的流程,可以看看。然后要对接工作流,这块也可以看看,不确定的地方问我。
  81 +
  82 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/ContractCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +@Schema(description = "管理后台 - CRM 合同创建 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class ContractCreateReqVO extends ContractBaseVO {
  13 +
  14 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/ContractExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
  2 +
  3 +import com.alibaba.excel.annotation.ExcelProperty;
  4 +import lombok.Data;
  5 +
  6 +import java.time.LocalDateTime;
  7 +
  8 +/**
  9 + * CRM 合同 Excel VO
  10 + *
  11 + * @author dhb52
  12 + */
  13 +@Data
  14 +public class ContractExcelVO {
  15 +
  16 + @ExcelProperty("合同编号")
  17 + private Long id;
  18 +
  19 + @ExcelProperty("合同名称")
  20 + private String name;
  21 +
  22 + @ExcelProperty("客户编号")
  23 + private Long customerId;
  24 +
  25 + @ExcelProperty("商机编号")
  26 + private Long businessId;
  27 +
  28 + @ExcelProperty("工作流编号")
  29 + private Long processInstanceId;
  30 +
  31 + @ExcelProperty("下单日期")
  32 + private LocalDateTime orderDate;
  33 +
  34 + @ExcelProperty("负责人的用户编号")
  35 + private Long ownerUserId;
  36 +
  37 + @ExcelProperty("合同编号")
  38 + private String no;
  39 +
  40 + @ExcelProperty("开始时间")
  41 + private LocalDateTime startTime;
  42 +
  43 + @ExcelProperty("结束时间")
  44 + private LocalDateTime endTime;
  45 +
  46 + @ExcelProperty("合同金额")
  47 + private Integer price;
  48 +
  49 + @ExcelProperty("整单折扣")
  50 + private Integer discountPercent;
  51 +
  52 + @ExcelProperty("产品总金额")
  53 + private Integer productPrice;
  54 +
  55 + @ExcelProperty("联系人编号")
  56 + private Long contactId;
  57 +
  58 + @ExcelProperty("公司签约人")
  59 + private Long signUserId;
  60 +
  61 + @ExcelProperty("最后跟进时间")
  62 + private LocalDateTime contactLastTime;
  63 +
  64 + @ExcelProperty("备注")
  65 + private String remark;
  66 +
  67 + @ExcelProperty("创建时间")
  68 + private LocalDateTime createTime;
  69 +
  70 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/ContractExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import java.time.LocalDateTime;
  8 +
  9 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  10 +
  11 +@Schema(description = "管理后台 - CRM 合同 Excel 导出 Request VO,参数和 ContractPageReqVO 是一致的")
  12 +@Data
  13 +public class ContractExportReqVO {
  14 +
  15 + @Schema(description = "合同名称", example = "王五")
  16 + private String name;
  17 +
  18 + @Schema(description = "客户编号", example = "18336")
  19 + private Long customerId;
  20 +
  21 + @Schema(description = "商机编号", example = "10864")
  22 + private Long businessId;
  23 +
  24 + @Schema(description = "下单日期")
  25 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  26 + private LocalDateTime[] orderDate;
  27 +
  28 + @Schema(description = "合同编号")
  29 + private String no;
  30 +
  31 + @Schema(description = "整单折扣")
  32 + private Integer discountPercent;
  33 +
  34 + @Schema(description = "产品总金额", example = "19510")
  35 + private Integer productPrice;
  36 +
  37 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/ContractPageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +
  10 +import java.time.LocalDateTime;
  11 +
  12 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  13 +
  14 +@Schema(description = "管理后台 - CRM 合同分页 Request VO")
  15 +@Data
  16 +@EqualsAndHashCode(callSuper = true)
  17 +@ToString(callSuper = true)
  18 +public class ContractPageReqVO extends PageParam {
  19 +
  20 + @Schema(description = "合同名称", example = "王五")
  21 + private String name;
  22 +
  23 + @Schema(description = "客户编号", example = "18336")
  24 + private Long customerId;
  25 +
  26 + @Schema(description = "商机编号", example = "10864")
  27 + private Long businessId;
  28 +
  29 + @Schema(description = "下单日期")
  30 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  31 + private LocalDateTime[] orderDate;
  32 +
  33 + @Schema(description = "合同编号")
  34 + private String no;
  35 +
  36 + @Schema(description = "整单折扣")
  37 + private Integer discountPercent;
  38 +
  39 + @Schema(description = "产品总金额", example = "19510")
  40 + private Integer productPrice;
  41 +
  42 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/ContractRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +import java.time.LocalDateTime;
  9 +
  10 +@Schema(description = "管理后台 - CRM 合同 Response VO")
  11 +@Data
  12 +@EqualsAndHashCode(callSuper = true)
  13 +@ToString(callSuper = true)
  14 +public class ContractRespVO extends ContractBaseVO {
  15 +
  16 + @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  17 + private Long id;
  18 +
  19 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  20 + private LocalDateTime createTime;
  21 +
  22 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/ContractUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +import javax.validation.constraints.NotNull;
  9 +
  10 +@Schema(description = "管理后台 - CRM 合同更新 Request VO")
  11 +@Data
  12 +@EqualsAndHashCode(callSuper = true)
  13 +@ToString(callSuper = true)
  14 +public class ContractUpdateReqVO extends ContractBaseVO {
  15 +
  16 + @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  17 + @NotNull(message = "合同编号不能为空")
  18 + private Long id;
  19 +
  20 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmTransferContractReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +import javax.validation.constraints.NotNull;
  7 +
  8 +// TODO @puhui999:CrmContractTransferReqVO,模块名字要放前面;看看还有没其它类似的
  9 +@Schema(description = "管理后台 - CRM 合同转移 Request VO")
  10 +@Data
  11 +public class CrmTransferContractReqVO {
  12 +
  13 + @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  14 + @NotNull(message = "合同编号不能为空")
  15 + private Long id;
  16 +
  17 + @Schema(description = "新负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  18 + @NotNull(message = "新负责人的用户编号不能为空")
  19 + private Long ownerUserId;
  20 +
  21 + @Schema(description = "原负责人移除方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  22 + @NotNull(message = "原负责人移除方式不能为空")
  23 + private Integer transferType;
  24 +
  25 + @Schema(description = "权限类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  26 + @NotNull(message = "权限类型不能为空")
  27 + private Integer permissionType;
  28 +
  29 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.http 0 → 100644
  1 +### 请求 /crm/customer/test 接口 => 成功
  2 +GET {{baseUrl}}/crm/customer/test
  3 +tenant-id: 1
  4 +Authorization: Bearer {{token}}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.*;
  8 +import cn.iocoder.yudao.module.crm.convert.customer.CrmCustomerConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO;
  10 +import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService;
  11 +import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.List;
  23 +
  24 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  25 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  26 +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
  27 +
  28 +@Tag(name = "管理后台 - CRM 客户")
  29 +@RestController
  30 +@RequestMapping("/crm/customer")
  31 +@Validated
  32 +public class CrmCustomerController {
  33 +
  34 + @Resource
  35 + private CrmCustomerService customerService;
  36 +
  37 + @PostMapping("/create")
  38 + @Operation(summary = "创建客户")
  39 + @PreAuthorize("@ss.hasPermission('crm:customer:create')")
  40 + public CommonResult<Long> createCustomer(@Valid @RequestBody CrmCustomerCreateReqVO createReqVO) {
  41 + return success(customerService.createCustomer(createReqVO, getLoginUserId()));
  42 + }
  43 +
  44 + @PutMapping("/update")
  45 + @Operation(summary = "更新客户")
  46 + @PreAuthorize("@ss.hasPermission('crm:customer:update')")
  47 + public CommonResult<Boolean> updateCustomer(@Valid @RequestBody CrmCustomerUpdateReqVO updateReqVO) {
  48 + customerService.updateCustomer(updateReqVO);
  49 + return success(true);
  50 + }
  51 +
  52 + @DeleteMapping("/delete")
  53 + @Operation(summary = "删除客户")
  54 + @Parameter(name = "id", description = "编号", required = true)
  55 + @PreAuthorize("@ss.hasPermission('crm:customer:delete')")
  56 + public CommonResult<Boolean> deleteCustomer(@RequestParam("id") Long id) {
  57 + customerService.deleteCustomer(id);
  58 + return success(true);
  59 + }
  60 +
  61 + @GetMapping("/get")
  62 + @Operation(summary = "获得客户")
  63 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  64 + @PreAuthorize("@ss.hasPermission('crm:customer:query')")
  65 + public CommonResult<CrmCustomerRespVO> getCustomer(@RequestParam("id") Long id) {
  66 + CrmCustomerDO customer = customerService.getCustomer(id);
  67 + return success(CrmCustomerConvert.INSTANCE.convert(customer));
  68 + }
  69 +
  70 + @GetMapping("/page")
  71 + @Operation(summary = "获得客户分页")
  72 + @PreAuthorize("@ss.hasPermission('crm:customer:query')")
  73 + public CommonResult<PageResult<CrmCustomerRespVO>> getCustomerPage(@Valid CrmCustomerPageReqVO pageVO) {
  74 + PageResult<CrmCustomerDO> pageResult = customerService.getCustomerPage(pageVO);
  75 + return success(CrmCustomerConvert.INSTANCE.convertPage(pageResult));
  76 + }
  77 +
  78 + @GetMapping("/export-excel")
  79 + @Operation(summary = "导出客户 Excel")
  80 + @PreAuthorize("@ss.hasPermission('crm:customer:export')")
  81 + @OperateLog(type = EXPORT)
  82 + public void exportCustomerExcel(@Valid CrmCustomerExportReqVO exportReqVO,
  83 + HttpServletResponse response) throws IOException {
  84 + List<CrmCustomerDO> list = customerService.getCustomerList(exportReqVO);
  85 + // 导出 Excel
  86 + List<CrmCustomerExcelVO> datas = CrmCustomerConvert.INSTANCE.convertList02(list);
  87 + ExcelUtils.write(response, "客户.xls", "数据", CrmCustomerExcelVO.class, datas);
  88 + }
  89 +
  90 + @PutMapping("/transfer")
  91 + @Operation(summary = "客户转移")
  92 + @PreAuthorize("@ss.hasPermission('crm:customer:update')")
  93 + public CommonResult<Boolean> transfer(@Valid @RequestBody CrmTransferCustomerReqVO reqVO) {
  94 + customerService.transferCustomer(reqVO, getLoginUserId());
  95 + return success(true);
  96 + }
  97 +
  98 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  4 +import cn.iocoder.yudao.framework.common.validation.Mobile;
  5 +import cn.iocoder.yudao.framework.common.validation.Telephone;
  6 +import cn.iocoder.yudao.module.crm.enums.customer.CrmCustomerLevelEnum;
  7 +import io.swagger.v3.oas.annotations.media.Schema;
  8 +import lombok.Data;
  9 +import org.springframework.format.annotation.DateTimeFormat;
  10 +
  11 +import javax.validation.constraints.Email;
  12 +import javax.validation.constraints.NotEmpty;
  13 +import javax.validation.constraints.Size;
  14 +import java.time.LocalDateTime;
  15 +
  16 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  17 +
  18 +/**
  19 + * 客户 Base VO,提供给添加、修改、详细的子 VO 使用
  20 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  21 + */
  22 +@Data
  23 +public class CrmCustomerBaseVO {
  24 +
  25 + @Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
  26 + @NotEmpty(message = "客户名称不能为空")
  27 + private String name;
  28 +
  29 + @Schema(description = "所属行业", example = "1")
  30 + private Integer industryId;
  31 +
  32 + @Schema(description = "客户等级", example = "2")
  33 + @InEnum(CrmCustomerLevelEnum.class)
  34 + private Integer level;
  35 +
  36 + @Schema(description = "客户来源", example = "3")
  37 + private Integer source;
  38 +
  39 + @Schema(description = "手机", example = "18000000000")
  40 + @Mobile
  41 + private String mobile;
  42 +
  43 + @Schema(description = "电话", example = "18000000000")
  44 + @Telephone
  45 + private String telephone;
  46 +
  47 + @Schema(description = "网址", example = "https://www.baidu.com")
  48 + private String website;
  49 +
  50 + @Schema(description = "QQ", example = "123456789")
  51 + @Size(max = 20, message = "QQ长度不能超过 20 个字符")
  52 + private String qq;
  53 +
  54 + @Schema(description = "wechat", example = "123456789")
  55 + @Size(max = 255, message = "微信长度不能超过 255 个字符")
  56 + private String wechat;
  57 +
  58 + @Schema(description = "email", example = "123456789@qq.com")
  59 + @Email(message = "邮箱格式不正确")
  60 + @Size(max = 255, message = "邮箱长度不能超过 255 个字符")
  61 + private String email;
  62 +
  63 + @Schema(description = "客户描述", example = "任意文字")
  64 + @Size(max = 4096, message = "客户描述长度不能超过 4096 个字符")
  65 + private String description;
  66 +
  67 + @Schema(description = "备注", example = "随便")
  68 + private String remark;
  69 +
  70 + @Schema(description = "地区编号", example = "20158")
  71 + private Long areaId;
  72 +
  73 + @Schema(description = "详细地址", example = "北京市海淀区")
  74 + private String detailAddress;
  75 +
  76 + @Schema(description = "下次联系时间")
  77 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  78 + private LocalDateTime contactNextTime;
  79 +
  80 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +@Schema(description = "管理后台 - CRM 客户创建 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class CrmCustomerCreateReqVO extends CrmCustomerBaseVO {
  13 +
  14 + // TODO @wanwan:负责人
  15 +
  16 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
  4 +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
  5 +import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
  6 +import com.alibaba.excel.annotation.ExcelProperty;
  7 +import io.swagger.v3.oas.annotations.media.Schema;
  8 +import lombok.Data;
  9 +
  10 +import java.time.LocalDateTime;
  11 +
  12 +// TODO 芋艿:导出最后做,等基本确认的差不多之后;
  13 +/**
  14 + * CRM 客户 Excel VO
  15 + *
  16 + * @author Wanwan
  17 + */
  18 +@Data
  19 +public class CrmCustomerExcelVO {
  20 +
  21 + @ExcelProperty("编号")
  22 + private Long id;
  23 +
  24 + @ExcelProperty("客户名称")
  25 + private String name;
  26 +
  27 + @ExcelProperty(value = "跟进状态", converter = DictConvert.class)
  28 + @DictFormat(DictTypeConstants.BOOLEAN_STRING)
  29 + private Boolean followUpStatus;
  30 +
  31 + @ExcelProperty(value = "锁定状态", converter = DictConvert.class)
  32 + @DictFormat(DictTypeConstants.BOOLEAN_STRING)
  33 + private Boolean lockStatus;
  34 +
  35 + @ExcelProperty(value = "成交状态", converter = DictConvert.class)
  36 + @DictFormat(DictTypeConstants.BOOLEAN_STRING)
  37 + private Boolean dealStatus;
  38 +
  39 + @ExcelProperty(value = "所属行业", converter = DictConvert.class)
  40 + @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_INDUSTRY)
  41 + private Integer industryId;
  42 +
  43 + @ExcelProperty(value = "客户等级", converter = DictConvert.class)
  44 + @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_LEVEL)
  45 + private Integer level;
  46 +
  47 + @ExcelProperty(value = "客户来源", converter = DictConvert.class)
  48 + @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_CUSTOMER_SOURCE)
  49 + private Integer source;
  50 +
  51 + @ExcelProperty("手机")
  52 + private String mobile;
  53 +
  54 + @ExcelProperty("电话")
  55 + private String telephone;
  56 +
  57 + @ExcelProperty("网址")
  58 + private String website;
  59 +
  60 + @ExcelProperty("QQ")
  61 + private String qq;
  62 +
  63 + @ExcelProperty("wechat")
  64 + private String wechat;
  65 +
  66 + @ExcelProperty("email")
  67 + private String email;
  68 +
  69 + @ExcelProperty("客户描述")
  70 + private String description;
  71 +
  72 + @ExcelProperty("备注")
  73 + private String remark;
  74 +
  75 + @ExcelProperty("负责人的用户编号")
  76 + private Long ownerUserId;
  77 +
  78 + @ExcelProperty("地区编号")
  79 + private Long areaId;
  80 +
  81 + @ExcelProperty("详细地址")
  82 + private String detailAddress;
  83 +
  84 + @ExcelProperty("最后跟进时间")
  85 + private LocalDateTime contactLastTime;
  86 +
  87 + @ExcelProperty("下次联系时间")
  88 + private LocalDateTime contactNextTime;
  89 +
  90 + @ExcelProperty("创建时间")
  91 + private LocalDateTime createTime;
  92 +
  93 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +// TODO 芋艿:导出最后做,等基本确认的差不多之后;
  7 +@Schema(description = "管理后台 - CRM 客户 Excel 导出 Request VO,参数和 CrmCustomerPageReqVO 是一致的")
  8 +@Data
  9 +public class CrmCustomerExportReqVO {
  10 +
  11 + @Schema(description = "客户名称", example = "赵六")
  12 + private String name;
  13 +
  14 + @Schema(description = "手机", example = "18000000000")
  15 + private String mobile;
  16 +
  17 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerPageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +
  9 +@Schema(description = "管理后台 - CRM 客户分页 Request VO")
  10 +@Data
  11 +@EqualsAndHashCode(callSuper = true)
  12 +@ToString(callSuper = true)
  13 +public class CrmCustomerPageReqVO extends PageParam {
  14 +
  15 + @Schema(description = "客户名称", example = "赵六")
  16 + private String name;
  17 +
  18 + @Schema(description = "手机", example = "18000000000")
  19 + private String mobile;
  20 +
  21 + // TODO @芋艿:场景;
  22 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +import org.springframework.format.annotation.DateTimeFormat;
  8 +
  9 +import java.time.LocalDateTime;
  10 +
  11 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  12 +
  13 +@Schema(description = "管理后台 - CRM 客户 Response VO")
  14 +@Data
  15 +@EqualsAndHashCode(callSuper = true)
  16 +@ToString(callSuper = true)
  17 +public class CrmCustomerRespVO extends CrmCustomerBaseVO {
  18 +
  19 + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13563")
  20 + private Long id;
  21 +
  22 + @Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  23 + private Boolean followUpStatus;
  24 +
  25 + @Schema(description = "锁定状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  26 + private Boolean lockStatus;
  27 +
  28 + @Schema(description = "成交状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  29 + private Boolean dealStatus;
  30 +
  31 + @Schema(description = "负责人的用户编号", example = "25682")
  32 + private Long ownerUserId;
  33 +
  34 + @Schema(description = "最后跟进时间")
  35 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  36 + private LocalDateTime contactLastTime;
  37 +
  38 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  39 + private LocalDateTime createTime;
  40 +
  41 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +import javax.validation.constraints.NotNull;
  9 +
  10 +@Schema(description = "管理后台 - CRM 客户更新 Request VO")
  11 +@Data
  12 +@EqualsAndHashCode(callSuper = true)
  13 +@ToString(callSuper = true)
  14 +public class CrmCustomerUpdateReqVO extends CrmCustomerBaseVO {
  15 +
  16 + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13563")
  17 + @NotNull(message = "编号不能为空")
  18 + private Long id;
  19 +
  20 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmTransferCustomerReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +import javax.validation.constraints.NotNull;
  7 +
  8 +@Schema(description = "管理后台 - CRM 客户转移 Request VO")
  9 +@Data
  10 +public class CrmTransferCustomerReqVO {
  11 +
  12 + @Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  13 + @NotNull(message = "客户编号不能为空")
  14 + private Long id;
  15 +
  16 + @Schema(description = "新负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  17 + @NotNull(message = "新负责人的用户编号不能为空")
  18 + private Long ownerUserId;
  19 +
  20 + @Schema(description = "原负责人移除方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  21 + @NotNull(message = "原负责人移除方式不能为空")
  22 + private Integer transferType;
  23 +
  24 + @Schema(description = "权限类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  25 + @NotNull(message = "权限类型不能为空")
  26 + private Integer permissionType;
  27 +
  28 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/product/package-info.java 0 → 100644
  1 +/**
  2 + * 产品表
  3 + */
  4 +package cn.iocoder.yudao.module.crm.controller.admin.product;
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivableController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
  8 +import cn.iocoder.yudao.module.crm.convert.receivable.ReceivableConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;
  10 +import cn.iocoder.yudao.module.crm.service.receivable.ReceivableService;
  11 +import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.List;
  23 +
  24 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  25 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  26 +
  27 +@Tag(name = "管理后台 - CRM 回款管理")
  28 +@RestController
  29 +@RequestMapping("/crm/receivable")
  30 +@Validated
  31 +public class ReceivableController {
  32 +
  33 + @Resource
  34 + private ReceivableService receivableService;
  35 +
  36 + @PostMapping("/create")
  37 + @Operation(summary = "创建回款管理")
  38 + @PreAuthorize("@ss.hasPermission('crm:receivable:create')")
  39 + public CommonResult<Long> createReceivable(@Valid @RequestBody ReceivableCreateReqVO createReqVO) {
  40 + return success(receivableService.createReceivable(createReqVO));
  41 + }
  42 +
  43 + @PutMapping("/update")
  44 + @Operation(summary = "更新回款管理")
  45 + @PreAuthorize("@ss.hasPermission('crm:receivable:update')")
  46 + public CommonResult<Boolean> updateReceivable(@Valid @RequestBody ReceivableUpdateReqVO updateReqVO) {
  47 + receivableService.updateReceivable(updateReqVO);
  48 + return success(true);
  49 + }
  50 +
  51 + @DeleteMapping("/delete")
  52 + @Operation(summary = "删除回款管理")
  53 + @Parameter(name = "id", description = "编号", required = true)
  54 + @PreAuthorize("@ss.hasPermission('crm:receivable:delete')")
  55 + public CommonResult<Boolean> deleteReceivable(@RequestParam("id") Long id) {
  56 + receivableService.deleteReceivable(id);
  57 + return success(true);
  58 + }
  59 +
  60 + @GetMapping("/get")
  61 + @Operation(summary = "获得回款管理")
  62 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  63 + @PreAuthorize("@ss.hasPermission('crm:receivable:query')")
  64 + public CommonResult<ReceivableRespVO> getReceivable(@RequestParam("id") Long id) {
  65 + ReceivableDO receivable = receivableService.getReceivable(id);
  66 + return success(ReceivableConvert.INSTANCE.convert(receivable));
  67 + }
  68 +
  69 + @GetMapping("/page")
  70 + @Operation(summary = "获得回款管理分页")
  71 + @PreAuthorize("@ss.hasPermission('crm:receivable:query')")
  72 + public CommonResult<PageResult<ReceivableRespVO>> getReceivablePage(@Valid ReceivablePageReqVO pageVO) {
  73 + PageResult<ReceivableDO> pageResult = receivableService.getReceivablePage(pageVO);
  74 + return success(ReceivableConvert.INSTANCE.convertPage(pageResult));
  75 + }
  76 +
  77 + @GetMapping("/export-excel")
  78 + @Operation(summary = "导出回款管理 Excel")
  79 + @PreAuthorize("@ss.hasPermission('crm:receivable:export')")
  80 + @OperateLog(type = EXPORT)
  81 + public void exportReceivableExcel(@Valid ReceivableExportReqVO exportReqVO,
  82 + HttpServletResponse response) throws IOException {
  83 + List<ReceivableDO> list = receivableService.getReceivableList(exportReqVO);
  84 + // 导出 Excel
  85 + List<ReceivableExcelVO> datas = ReceivableConvert.INSTANCE.convertList02(list);
  86 + ExcelUtils.write(response, "回款管理.xls", "数据", ReceivableExcelVO.class, datas);
  87 + }
  88 +
  89 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivablePlanController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
  8 +import cn.iocoder.yudao.module.crm.convert.receivable.ReceivablePlanConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;
  10 +import cn.iocoder.yudao.module.crm.service.receivable.ReceivablePlanService;
  11 +import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.List;
  23 +
  24 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  25 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
  26 +
  27 +@Tag(name = "管理后台 - CRM 回款计划")
  28 +@RestController
  29 +@RequestMapping("/crm/receivable-plan")
  30 +@Validated
  31 +public class ReceivablePlanController {
  32 +
  33 + @Resource
  34 + private ReceivablePlanService receivablePlanService;
  35 +
  36 + @PostMapping("/create")
  37 + @Operation(summary = "创建回款计划")
  38 + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:create')")
  39 + public CommonResult<Long> createReceivablePlan(@Valid @RequestBody ReceivablePlanCreateReqVO createReqVO) {
  40 + return success(receivablePlanService.createReceivablePlan(createReqVO));
  41 + }
  42 +
  43 + @PutMapping("/update")
  44 + @Operation(summary = "更新回款计划")
  45 + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:update')")
  46 + public CommonResult<Boolean> updateReceivablePlan(@Valid @RequestBody ReceivablePlanUpdateReqVO updateReqVO) {
  47 + receivablePlanService.updateReceivablePlan(updateReqVO);
  48 + return success(true);
  49 + }
  50 +
  51 + @DeleteMapping("/delete")
  52 + @Operation(summary = "删除回款计划")
  53 + @Parameter(name = "id", description = "编号", required = true)
  54 + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:delete')")
  55 + public CommonResult<Boolean> deleteReceivablePlan(@RequestParam("id") Long id) {
  56 + receivablePlanService.deleteReceivablePlan(id);
  57 + return success(true);
  58 + }
  59 +
  60 + @GetMapping("/get")
  61 + @Operation(summary = "获得回款计划")
  62 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  63 + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')")
  64 + public CommonResult<ReceivablePlanRespVO> getReceivablePlan(@RequestParam("id") Long id) {
  65 + ReceivablePlanDO receivablePlan = receivablePlanService.getReceivablePlan(id);
  66 + return success(ReceivablePlanConvert.INSTANCE.convert(receivablePlan));
  67 + }
  68 +
  69 + @GetMapping("/page")
  70 + @Operation(summary = "获得回款计划分页")
  71 + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')")
  72 + public CommonResult<PageResult<ReceivablePlanRespVO>> getReceivablePlanPage(@Valid ReceivablePlanPageReqVO pageVO) {
  73 + PageResult<ReceivablePlanDO> pageResult = receivablePlanService.getReceivablePlanPage(pageVO);
  74 + return success(ReceivablePlanConvert.INSTANCE.convertPage(pageResult));
  75 + }
  76 +
  77 + @GetMapping("/export-excel")
  78 + @Operation(summary = "导出回款计划 Excel")
  79 + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:export')")
  80 + @OperateLog(type = EXPORT)
  81 + public void exportReceivablePlanExcel(@Valid ReceivablePlanExportReqVO exportReqVO,
  82 + HttpServletResponse response) throws IOException {
  83 + List<ReceivablePlanDO> list = receivablePlanService.getReceivablePlanList(exportReqVO);
  84 + // 导出 Excel
  85 + List<ReceivablePlanExcelVO> datas = ReceivablePlanConvert.INSTANCE.convertList02(list);
  86 + ExcelUtils.write(response, "回款计划.xls", "数据", ReceivablePlanExcelVO.class, datas);
  87 + }
  88 +
  89 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/package-info.java 0 → 100644
  1 +/**
  2 + * 回款
  3 + */
  4 +package cn.iocoder.yudao.module.crm.controller.admin.receivable;
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import javax.validation.constraints.NotNull;
  8 +import java.math.BigDecimal;
  9 +import java.time.LocalDateTime;
  10 +
  11 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  12 +
  13 +/**
  14 + * 回款管理 Base VO,提供给添加、修改、详细的子 VO 使用
  15 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  16 + */
  17 +@Data
  18 +public class ReceivableBaseVO {
  19 +
  20 + // TODO @liuhongfeng:部分缺少 example 的字段,要补充下;
  21 + // TODO @liuhongfeng:部分字段,需要必传,要写 requiredMode = Schema.RequiredMode.REQUIRED,以及对应的 validator 非空校验
  22 +
  23 + @Schema(description = "回款编号")
  24 + private String no;
  25 +
  26 + // TODO @liuhongfeng:中英文之间,有个空格,这样更干净;
  27 + @Schema(description = "回款计划ID", example = "31177")
  28 + private Long planId;
  29 +
  30 + @Schema(description = "客户ID", example = "4963")
  31 + private Long customerId;
  32 +
  33 + @Schema(description = "合同ID", example = "30305")
  34 + private Long contractId;
  35 +
  36 + // TODO @liuhongfeng:这个字段,可以写个枚举,然后 InEnum 去校验下;
  37 + // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的
  38 + @Schema(description = "审批状态", example = "1")
  39 + private Integer checkStatus;
  40 +
  41 + // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的,所以不适合放在 base 里面;
  42 + @Schema(description = "工作流编号", example = "16568")
  43 + private Long processInstanceId;
  44 +
  45 + @Schema(description = "回款日期")
  46 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  47 + private LocalDateTime returnTime;
  48 +
  49 + @Schema(description = "回款方式", example = "2")
  50 + private String returnType;
  51 +
  52 + // TODO @liuhongfeng:使用 Int 哈,分;
  53 + @Schema(description = "回款金额", example = "31859")
  54 + private BigDecimal price;
  55 +
  56 + @Schema(description = "负责人", example = "22202")
  57 + private Long ownerUserId;
  58 +
  59 + @Schema(description = "批次", example = "2539")
  60 + private Long batchId;
  61 +
  62 + @Schema(description = "显示顺序")
  63 + private Integer sort;
  64 +
  65 + // TODO @芋艿:这个字段在看看;dataScope、dataScopeDeptIds
  66 + @Schema(description = "数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")
  67 + private Integer dataScope;
  68 +
  69 + @Schema(description = "数据范围(指定部门数组)")
  70 + private String dataScopeDeptIds;
  71 +
  72 + // TODO @liuhongfeng:这个字段,这个字段,应该不是前端传递的噢,而是后端自己生成的,所以不适合放在 base 里面;
  73 + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  74 + @NotNull(message = "状态不能为空")
  75 + private Integer status;
  76 +
  77 + @Schema(description = "备注", example = "随便")
  78 + private String remark;
  79 +
  80 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import javax.validation.constraints.*;
  7 +
  8 +@Schema(description = "管理后台 - CRM 回款创建 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class ReceivableCreateReqVO extends ReceivableBaseVO {
  13 +
  14 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.util.*;
  6 +import java.time.LocalDateTime;
  7 +import java.math.BigDecimal;
  8 +import java.time.LocalDateTime;
  9 +import java.time.LocalDateTime;
  10 +
  11 +import com.alibaba.excel.annotation.ExcelProperty;
  12 +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
  13 +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
  14 +
  15 +
  16 +/**
  17 + * CRM 回款管理 Excel VO
  18 + *
  19 + * @author 赤焰
  20 + */
  21 +@Data
  22 +public class ReceivableExcelVO {
  23 +
  24 + @ExcelProperty("ID")
  25 + private Long id;
  26 +
  27 + @ExcelProperty("回款编号")
  28 + private String no;
  29 +
  30 + @ExcelProperty("回款计划ID")
  31 + private Long planId;
  32 +
  33 + @ExcelProperty("客户ID")
  34 + private Long customerId;
  35 +
  36 + @ExcelProperty("合同ID")
  37 + private Long contractId;
  38 +
  39 + @ExcelProperty(value = "审批状态", converter = DictConvert.class)
  40 + @DictFormat("crm_receivable_check_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
  41 + private Integer checkStatus;
  42 +
  43 + @ExcelProperty("工作流编号")
  44 + private Long processInstanceId;
  45 +
  46 + @ExcelProperty("回款日期")
  47 + private LocalDateTime returnTime;
  48 +
  49 + @ExcelProperty("回款方式")
  50 + private String returnType;
  51 +
  52 + @ExcelProperty("回款金额")
  53 + private BigDecimal price;
  54 +
  55 + @ExcelProperty("负责人")
  56 + private Long ownerUserId;
  57 +
  58 + @ExcelProperty("批次")
  59 + private Long batchId;
  60 +
  61 + //@ExcelProperty("显示顺序")
  62 + //private Integer sort;
  63 +
  64 + //@ExcelProperty("数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")
  65 + //private Integer dataScope;
  66 +
  67 + //@ExcelProperty("数据范围(指定部门数组)")
  68 + //private String dataScopeDeptIds;
  69 +
  70 + @ExcelProperty(value = "状态", converter = DictConvert.class)
  71 + @DictFormat("common_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
  72 + private Integer status;
  73 +
  74 + @ExcelProperty("备注")
  75 + private String remark;
  76 +
  77 + @ExcelProperty("创建时间")
  78 + private LocalDateTime createTime;
  79 +
  80 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import java.math.BigDecimal;
  8 +import java.time.LocalDateTime;
  9 +
  10 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  11 +
  12 +/**
  13 + * @author 赤焰
  14 + */
  15 +@Schema(description = "管理后台 - CRM 回款 Excel 导出 Request VO,参数和 ReceivablePageReqVO 是一致的")
  16 +@Data
  17 +public class ReceivableExportReqVO {
  18 +
  19 + @Schema(description = "回款编号")
  20 + private String no;
  21 +
  22 + @Schema(description = "回款计划ID", example = "31177")
  23 + private Long planId;
  24 +
  25 + @Schema(description = "客户ID", example = "4963")
  26 + private Long customerId;
  27 +
  28 + @Schema(description = "合同ID", example = "30305")
  29 + private Long contractId;
  30 +
  31 + @Schema(description = "审批状态", example = "1")
  32 + private Integer checkStatus;
  33 +
  34 + @Schema(description = "工作流编号", example = "16568")
  35 + private Long processInstanceId;
  36 +
  37 + @Schema(description = "回款日期")
  38 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  39 + private LocalDateTime[] returnTime;
  40 +
  41 + @Schema(description = "回款方式", example = "2")
  42 + private String returnType;
  43 +
  44 + @Schema(description = "回款金额", example = "31859")
  45 + private BigDecimal price;
  46 +
  47 + @Schema(description = "负责人", example = "22202")
  48 + private Long ownerUserId;
  49 +
  50 + @Schema(description = "批次", example = "2539")
  51 + private Long batchId;
  52 +
  53 + @Schema(description = "显示顺序")
  54 + private Integer sort;
  55 +
  56 + @Schema(description = "数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")
  57 + private Integer dataScope;
  58 +
  59 + @Schema(description = "数据范围(指定部门数组)")
  60 + private String dataScopeDeptIds;
  61 +
  62 + @Schema(description = "状态", example = "1")
  63 + private Integer status;
  64 +
  65 + @Schema(description = "备注", example = "随便")
  66 + private String remark;
  67 +
  68 + @Schema(description = "创建时间")
  69 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  70 + private LocalDateTime[] createTime;
  71 +
  72 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +
  10 +import java.math.BigDecimal;
  11 +import java.time.LocalDateTime;
  12 +
  13 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  14 +
  15 +@Schema(description = "管理后台 - CRM 回款分页 Request VO")
  16 +@Data
  17 +@EqualsAndHashCode(callSuper = true)
  18 +@ToString(callSuper = true)
  19 +public class ReceivablePageReqVO extends PageParam {
  20 +
  21 + // TODO @liuhongfeng:目前就使用 no 检索即可;
  22 + @Schema(description = "回款编号")
  23 + private String no;
  24 +
  25 + @Schema(description = "回款计划ID", example = "31177")
  26 + private Long planId;
  27 +
  28 + @Schema(description = "客户ID", example = "4963")
  29 + private Long customerId;
  30 +
  31 + @Schema(description = "合同ID", example = "30305")
  32 + private Long contractId;
  33 +
  34 + @Schema(description = "审批状态", example = "1")
  35 + private Integer checkStatus;
  36 +
  37 + @Schema(description = "工作流编号", example = "16568")
  38 + private Long processInstanceId;
  39 +
  40 + @Schema(description = "回款日期")
  41 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  42 + private LocalDateTime[] returnTime;
  43 +
  44 + @Schema(description = "回款方式", example = "2")
  45 + private String returnType;
  46 +
  47 + @Schema(description = "回款金额", example = "31859")
  48 + private BigDecimal price;
  49 +
  50 + @Schema(description = "负责人", example = "22202")
  51 + private Long ownerUserId;
  52 +
  53 + @Schema(description = "批次", example = "2539")
  54 + private Long batchId;
  55 +
  56 + @Schema(description = "显示顺序")
  57 + private Integer sort;
  58 +
  59 + @Schema(description = "数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")
  60 + private Integer dataScope;
  61 +
  62 + @Schema(description = "数据范围(指定部门数组)")
  63 + private String dataScopeDeptIds;
  64 +
  65 + @Schema(description = "状态", example = "1")
  66 + private Integer status;
  67 +
  68 + @Schema(description = "备注", example = "随便")
  69 + private String remark;
  70 +
  71 + @Schema(description = "创建时间")
  72 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  73 + private LocalDateTime[] createTime;
  74 +
  75 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanBaseVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import java.math.BigDecimal;
  8 +import java.time.LocalDateTime;
  9 +
  10 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  11 +
  12 +/**
  13 + * 回款计划 Base VO,提供给添加、修改、详细的子 VO 使用
  14 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
  15 + */
  16 +@Data
  17 +public class ReceivablePlanBaseVO {
  18 +
  19 + // TODO 芋艿:这个字段,在想想命名;
  20 + @Schema(description = "期数")
  21 + private Long indexNo;
  22 +
  23 + // TODO @liuhongfeng:中英文之间,有个空格,这样更干净;
  24 + @Schema(description = "回款ID", example = "19852")
  25 + private Long receivableId;
  26 +
  27 + @Schema(description = "完成状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
  28 + //@NotNull(message = "完成状态不能为空")
  29 + private Integer status;
  30 +
  31 + // TODO @liuhongfeng:这个字段,可以写个枚举,然后 InEnum 去校验下;
  32 + // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的
  33 + @Schema(description = "审批状态", example = "1")
  34 + private String checkStatus;
  35 +
  36 + // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的,所以不适合放在 base 里面;
  37 + @Schema(description = "工作流编号", example = "8909")
  38 + private Long processInstanceId;
  39 +
  40 + // TODO @liuhongfeng:使用 Int 哈,分;
  41 + @Schema(description = "计划回款金额", example = "29675")
  42 + private BigDecimal price;
  43 +
  44 + @Schema(description = "计划回款日期")
  45 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  46 + private LocalDateTime returnTime;
  47 +
  48 + // TODO @liuhongfeng:这个字段,Integer
  49 + @Schema(description = "提前几天提醒")
  50 + private Long remindDays;
  51 +
  52 + @Schema(description = "提醒日期")
  53 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  54 + private LocalDateTime remindTime;
  55 +
  56 + @Schema(description = "客户ID", example = "18026")
  57 + private Long customerId;
  58 +
  59 + @Schema(description = "合同ID", example = "3473")
  60 + private Long contractId;
  61 +
  62 + // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的,所以不适合放在 base 里面;
  63 + @Schema(description = "负责人", example = "17828")
  64 + private Long ownerUserId;
  65 +
  66 + @Schema(description = "显示顺序")
  67 + private Integer sort;
  68 +
  69 + @Schema(description = "备注", example = "随便")
  70 + private String remark;
  71 +
  72 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import javax.validation.constraints.*;
  7 +
  8 +@Schema(description = "管理后台 - CRM 回款计划创建 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class ReceivablePlanCreateReqVO extends ReceivablePlanBaseVO {
  13 +
  14 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExcelVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import lombok.*;
  4 +
  5 +import java.math.BigDecimal;
  6 +import java.time.LocalDateTime;
  7 +
  8 +import com.alibaba.excel.annotation.ExcelProperty;
  9 +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
  10 +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
  11 +
  12 +
  13 +/**
  14 + * CRM 回款计划 Excel VO
  15 + *
  16 + * @author 芋道源码
  17 + */
  18 +@Data
  19 +public class ReceivablePlanExcelVO {
  20 +
  21 + @ExcelProperty("ID")
  22 + private Long id;
  23 +
  24 + @ExcelProperty("期数")
  25 + private Long indexNo;
  26 +
  27 + @ExcelProperty("回款ID")
  28 + private Long receivableId;
  29 +
  30 + @ExcelProperty(value = "完成状态", converter = DictConvert.class)
  31 + @DictFormat("common_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
  32 + private Integer status;
  33 +
  34 + @ExcelProperty(value = "审批状态", converter = DictConvert.class)
  35 + @DictFormat("crm_receivable_check_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
  36 + private String checkStatus;
  37 +
  38 + //@ExcelProperty("工作流编号")
  39 + //private Long processInstanceId;
  40 +
  41 + @ExcelProperty("计划回款金额")
  42 + private BigDecimal price;
  43 +
  44 + @ExcelProperty("计划回款日期")
  45 + private LocalDateTime returnTime;
  46 +
  47 + @ExcelProperty("提前几天提醒")
  48 + private Long remindDays;
  49 +
  50 + @ExcelProperty("提醒日期")
  51 + private LocalDateTime remindTime;
  52 +
  53 + @ExcelProperty("客户ID")
  54 + private Long customerId;
  55 +
  56 + @ExcelProperty("合同ID")
  57 + private Long contractId;
  58 +
  59 + @ExcelProperty("负责人")
  60 + private Long ownerUserId;
  61 +
  62 + //@ExcelProperty("显示顺序")
  63 + //private Integer sort;
  64 +
  65 + @ExcelProperty("备注")
  66 + private String remark;
  67 +
  68 + @ExcelProperty("创建时间")
  69 + private LocalDateTime createTime;
  70 +
  71 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExportReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  7 +import java.time.LocalDateTime;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +
  10 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  11 +
  12 +@Schema(description = "管理后台 - CRM 回款计划 Excel 导出 Request VO,参数和 ReceivablePlanPageReqVO 是一致的")
  13 +@Data
  14 +public class ReceivablePlanExportReqVO {
  15 +
  16 + @Schema(description = "期数")
  17 + private Long indexNo;
  18 +
  19 + @Schema(description = "完成状态", example = "2")
  20 + private Integer status;
  21 +
  22 + @Schema(description = "审批状态", example = "1")
  23 + private String checkStatus;
  24 +
  25 + @Schema(description = "计划回款日期")
  26 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  27 + private LocalDateTime[] returnTime;
  28 +
  29 + @Schema(description = "提前几天提醒")
  30 + private Long remindDays;
  31 +
  32 + @Schema(description = "提醒日期")
  33 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  34 + private LocalDateTime[] remindTime;
  35 +
  36 + @Schema(description = "客户ID", example = "18026")
  37 + private Long customerId;
  38 +
  39 + @Schema(description = "合同ID", example = "3473")
  40 + private Long contractId;
  41 +
  42 + @Schema(description = "负责人", example = "17828")
  43 + private Long ownerUserId;
  44 +
  45 + @Schema(description = "备注", example = "随便")
  46 + private String remark;
  47 +
  48 + @Schema(description = "创建时间")
  49 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  50 + private LocalDateTime[] createTime;
  51 +
  52 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanPageReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +import lombok.EqualsAndHashCode;
  7 +import lombok.ToString;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +
  10 +import java.time.LocalDateTime;
  11 +
  12 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  13 +
  14 +@Schema(description = "管理后台 - CRM 回款计划分页 Request VO")
  15 +@Data
  16 +@EqualsAndHashCode(callSuper = true)
  17 +@ToString(callSuper = true)
  18 +public class ReceivablePlanPageReqVO extends PageParam {
  19 +
  20 + // TODO 芋艿:筛选字段,需要去掉几个,在想想;
  21 +
  22 + @Schema(description = "期数")
  23 + private Long indexNo;
  24 +
  25 + @Schema(description = "完成状态", example = "2")
  26 + private Integer status;
  27 +
  28 + @Schema(description = "审批状态", example = "1")
  29 + private String checkStatus;
  30 +
  31 + @Schema(description = "计划回款日期")
  32 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  33 + private LocalDateTime[] returnTime;
  34 +
  35 + @Schema(description = "提前几天提醒")
  36 + private Long remindDays;
  37 +
  38 + @Schema(description = "提醒日期")
  39 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  40 + private LocalDateTime[] remindTime;
  41 +
  42 + @Schema(description = "客户ID", example = "18026")
  43 + private Long customerId;
  44 +
  45 + @Schema(description = "合同ID", example = "3473")
  46 + private Long contractId;
  47 +
  48 + @Schema(description = "负责人", example = "17828")
  49 + private Long ownerUserId;
  50 +
  51 + @Schema(description = "备注", example = "随便")
  52 + private String remark;
  53 +
  54 + @Schema(description = "创建时间")
  55 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  56 + private LocalDateTime[] createTime;
  57 +
  58 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.time.LocalDateTime;
  6 +
  7 +@Schema(description = "管理后台 - CRM 回款计划 Response VO")
  8 +@Data
  9 +@EqualsAndHashCode(callSuper = true)
  10 +@ToString(callSuper = true)
  11 +public class ReceivablePlanRespVO extends ReceivablePlanBaseVO {
  12 +
  13 + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153")
  14 + private Long id;
  15 +
  16 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  17 + private LocalDateTime createTime;
  18 +
  19 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.util.*;
  6 +import javax.validation.constraints.*;
  7 +
  8 +@Schema(description = "管理后台 - CRM 回款计划更新 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class ReceivablePlanUpdateReqVO extends ReceivablePlanBaseVO {
  13 +
  14 + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153")
  15 + @NotNull(message = "ID不能为空")
  16 + private Long id;
  17 +
  18 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.time.LocalDateTime;
  6 +
  7 +@Schema(description = "管理后台 - CRM 回款 Response VO")
  8 +@Data
  9 +@EqualsAndHashCode(callSuper = true)
  10 +@ToString(callSuper = true)
  11 +public class ReceivableRespVO extends ReceivableBaseVO {
  12 +
  13 + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787")
  14 + private Long id;
  15 +
  16 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  17 + private LocalDateTime createTime;
  18 +
  19 +}
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableUpdateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.util.*;
  6 +import javax.validation.constraints.*;
  7 +
  8 +@Schema(description = "管理后台 - CRM 回款更新 Request VO")
  9 +@Data
  10 +@EqualsAndHashCode(callSuper = true)
  11 +@ToString(callSuper = true)
  12 +public class ReceivableUpdateReqVO extends ReceivableBaseVO {
  13 +
  14 + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787")
  15 + @NotNull(message = "ID不能为空")
  16 + private Long id;
  17 +
  18 +}
... ...