Commit fdaa08c25880dddc12a2e8cbaf5b93365b5b3432
Merge remote-tracking branch 'origin/feature/crm'
Showing
212 changed files
with
10806 additions
and
16 deletions
pom.xml
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
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
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/CrmBusinessController.http
0 → 100644
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
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
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
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
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
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 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/app/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/business/CrmBusinessConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.business; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | |
| 6 | +import cn.iocoder.yudao.module.crm.service.permission.bo.TransferCrmPermissionBO; | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.Mapping; | |
| 9 | +import org.mapstruct.Mappings; | |
| 10 | +import org.mapstruct.factory.Mappers; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 商机 Convert | |
| 16 | + * | |
| 17 | + * @author ljlleo | |
| 18 | + */ | |
| 19 | +@Mapper | |
| 20 | +public interface CrmBusinessConvert { | |
| 21 | + | |
| 22 | + CrmBusinessConvert INSTANCE = Mappers.getMapper(CrmBusinessConvert.class); | |
| 23 | + | |
| 24 | + CrmBusinessDO convert(CrmBusinessCreateReqVO bean); | |
| 25 | + | |
| 26 | + CrmBusinessDO convert(CrmBusinessUpdateReqVO bean); | |
| 27 | + | |
| 28 | + CrmBusinessRespVO convert(CrmBusinessDO bean); | |
| 29 | + | |
| 30 | + PageResult<CrmBusinessRespVO> convertPage(PageResult<CrmBusinessDO> page); | |
| 31 | + | |
| 32 | + List<CrmBusinessExcelVO> convertList02(List<CrmBusinessDO> list); | |
| 33 | + | |
| 34 | + @Mappings({ | |
| 35 | + @Mapping(target = "userId", source = "userId"), | |
| 36 | + @Mapping(target = "crmDataId", source = "reqVO.id") | |
| 37 | + }) | |
| 38 | + TransferCrmPermissionBO convert(CrmTransferBusinessReqVO reqVO, Long userId); | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/businessstatus/CrmBusinessStatusConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.businessstatus; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | + | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.factory.Mappers; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.*; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatus.CrmBusinessStatusDO; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 商机状态 Convert | |
| 14 | + * | |
| 15 | + * @author ljlleo | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface CrmBusinessStatusConvert { | |
| 19 | + | |
| 20 | + CrmBusinessStatusConvert INSTANCE = Mappers.getMapper(CrmBusinessStatusConvert.class); | |
| 21 | + | |
| 22 | + CrmBusinessStatusDO convert(CrmBusinessStatusCreateReqVO bean); | |
| 23 | + | |
| 24 | + CrmBusinessStatusDO convert(CrmBusinessStatusUpdateReqVO bean); | |
| 25 | + | |
| 26 | + CrmBusinessStatusRespVO convert(CrmBusinessStatusDO bean); | |
| 27 | + | |
| 28 | + List<CrmBusinessStatusRespVO> convertList(List<CrmBusinessStatusDO> list); | |
| 29 | + | |
| 30 | + PageResult<CrmBusinessStatusRespVO> convertPage(PageResult<CrmBusinessStatusDO> page); | |
| 31 | + | |
| 32 | + List<CrmBusinessStatusExcelVO> convertList02(List<CrmBusinessStatusDO> list); | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/businessstatustype/CrmBusinessStatusTypeConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.businessstatustype; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | + | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.factory.Mappers; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.*; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatustype.CrmBusinessStatusTypeDO; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 商机状态类型 Convert | |
| 14 | + * | |
| 15 | + * @author ljlleo | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface CrmBusinessStatusTypeConvert { | |
| 19 | + | |
| 20 | + CrmBusinessStatusTypeConvert INSTANCE = Mappers.getMapper(CrmBusinessStatusTypeConvert.class); | |
| 21 | + | |
| 22 | + CrmBusinessStatusTypeDO convert(CrmBusinessStatusTypeCreateReqVO bean); | |
| 23 | + | |
| 24 | + CrmBusinessStatusTypeDO convert(CrmBusinessStatusTypeUpdateReqVO bean); | |
| 25 | + | |
| 26 | + CrmBusinessStatusTypeRespVO convert(CrmBusinessStatusTypeDO bean); | |
| 27 | + | |
| 28 | + List<CrmBusinessStatusTypeRespVO> convertList(List<CrmBusinessStatusTypeDO> list); | |
| 29 | + | |
| 30 | + PageResult<CrmBusinessStatusTypeRespVO> convertPage(PageResult<CrmBusinessStatusTypeDO> page); | |
| 31 | + | |
| 32 | + List<CrmBusinessStatusTypeExcelVO> convertList02(List<CrmBusinessStatusTypeDO> list); | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/clue/CrmClueConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.clue; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | + | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.factory.Mappers; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.*; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 线索 Convert | |
| 14 | + * | |
| 15 | + * @author Wanwan | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface CrmClueConvert { | |
| 19 | + | |
| 20 | + CrmClueConvert INSTANCE = Mappers.getMapper(CrmClueConvert.class); | |
| 21 | + | |
| 22 | + CrmClueDO convert(CrmClueCreateReqVO bean); | |
| 23 | + | |
| 24 | + CrmClueDO convert(CrmClueUpdateReqVO bean); | |
| 25 | + | |
| 26 | + CrmClueRespVO convert(CrmClueDO bean); | |
| 27 | + | |
| 28 | + PageResult<CrmClueRespVO> convertPage(PageResult<CrmClueDO> page); | |
| 29 | + | |
| 30 | + List<CrmClueExcelVO> convertList02(List<CrmClueDO> list); | |
| 31 | + | |
| 32 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/contact/ContactConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.contact; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contact.ContactDO; | |
| 6 | +import cn.iocoder.yudao.module.crm.service.permission.bo.TransferCrmPermissionBO; | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.Mapping; | |
| 9 | +import org.mapstruct.Mappings; | |
| 10 | +import org.mapstruct.factory.Mappers; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * crm 联系人 Convert | |
| 16 | + * | |
| 17 | + * @author 芋道源码 | |
| 18 | + */ | |
| 19 | +@Mapper | |
| 20 | +public interface ContactConvert { | |
| 21 | + | |
| 22 | + ContactConvert INSTANCE = Mappers.getMapper(ContactConvert.class); | |
| 23 | + | |
| 24 | + ContactDO convert(ContactCreateReqVO bean); | |
| 25 | + | |
| 26 | + ContactDO convert(ContactUpdateReqVO bean); | |
| 27 | + | |
| 28 | + ContactRespVO convert(ContactDO bean); | |
| 29 | + | |
| 30 | + List<ContactRespVO> convertList(List<ContactDO> list); | |
| 31 | + | |
| 32 | + PageResult<ContactRespVO> convertPage(PageResult<ContactDO> page); | |
| 33 | + | |
| 34 | + List<ContactExcelVO> convertList02(List<ContactDO> list); | |
| 35 | + | |
| 36 | + @Mappings({ | |
| 37 | + @Mapping(target = "userId", source = "userId"), | |
| 38 | + @Mapping(target = "crmDataId", source = "reqVO.id") | |
| 39 | + }) | |
| 40 | + TransferCrmPermissionBO convert(CrmTransferContactReqVO reqVO, Long userId); | |
| 41 | + | |
| 42 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/contract/ContractConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.contract; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; | |
| 6 | +import cn.iocoder.yudao.module.crm.service.permission.bo.TransferCrmPermissionBO; | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.Mapping; | |
| 9 | +import org.mapstruct.Mappings; | |
| 10 | +import org.mapstruct.factory.Mappers; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 合同 Convert | |
| 16 | + * | |
| 17 | + * @author dhb52 | |
| 18 | + */ | |
| 19 | +@Mapper | |
| 20 | +public interface ContractConvert { | |
| 21 | + | |
| 22 | + ContractConvert INSTANCE = Mappers.getMapper(ContractConvert.class); | |
| 23 | + | |
| 24 | + ContractDO convert(ContractCreateReqVO bean); | |
| 25 | + | |
| 26 | + ContractDO convert(ContractUpdateReqVO bean); | |
| 27 | + | |
| 28 | + ContractRespVO convert(ContractDO bean); | |
| 29 | + | |
| 30 | + List<ContractRespVO> convertList(List<ContractDO> list); | |
| 31 | + | |
| 32 | + PageResult<ContractRespVO> convertPage(PageResult<ContractDO> page); | |
| 33 | + | |
| 34 | + List<ContractExcelVO> convertList02(List<ContractDO> list); | |
| 35 | + | |
| 36 | + @Mappings({ | |
| 37 | + @Mapping(target = "userId", source = "userId"), | |
| 38 | + @Mapping(target = "crmDataId", source = "reqVO.id") | |
| 39 | + }) | |
| 40 | + TransferCrmPermissionBO convert(CrmTransferContractReqVO reqVO, Long userId); | |
| 41 | + | |
| 42 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/customer/CrmCustomerConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.customer; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | |
| 6 | +import cn.iocoder.yudao.module.crm.service.permission.bo.TransferCrmPermissionBO; | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.Mapping; | |
| 9 | +import org.mapstruct.Mappings; | |
| 10 | +import org.mapstruct.factory.Mappers; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 客户 Convert | |
| 16 | + * | |
| 17 | + * @author Wanwan | |
| 18 | + */ | |
| 19 | +@Mapper | |
| 20 | +public interface CrmCustomerConvert { | |
| 21 | + | |
| 22 | + CrmCustomerConvert INSTANCE = Mappers.getMapper(CrmCustomerConvert.class); | |
| 23 | + | |
| 24 | + CrmCustomerDO convert(CrmCustomerCreateReqVO bean); | |
| 25 | + | |
| 26 | + CrmCustomerDO convert(CrmCustomerUpdateReqVO bean); | |
| 27 | + | |
| 28 | + CrmCustomerRespVO convert(CrmCustomerDO bean); | |
| 29 | + | |
| 30 | + PageResult<CrmCustomerRespVO> convertPage(PageResult<CrmCustomerDO> page); | |
| 31 | + | |
| 32 | + List<CrmCustomerExcelVO> convertList02(List<CrmCustomerDO> list); | |
| 33 | + | |
| 34 | + @Mappings({ | |
| 35 | + @Mapping(target = "userId", source = "userId"), | |
| 36 | + @Mapping(target = "crmDataId", source = "reqVO.id") | |
| 37 | + }) | |
| 38 | + TransferCrmPermissionBO convert(CrmTransferCustomerReqVO reqVO, Long userId); | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/permission/CrmPermissionConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.permission; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; | |
| 4 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateBO; | |
| 5 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionUpdateBO; | |
| 6 | +import org.mapstruct.Mapper; | |
| 7 | +import org.mapstruct.factory.Mappers; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * Crm 数据权限 Convert | |
| 11 | + * | |
| 12 | + * @author Wanwan | |
| 13 | + */ | |
| 14 | +@Mapper | |
| 15 | +public interface CrmPermissionConvert { | |
| 16 | + | |
| 17 | + CrmPermissionConvert INSTANCE = Mappers.getMapper(CrmPermissionConvert.class); | |
| 18 | + | |
| 19 | + CrmPermissionDO convert(CrmPermissionCreateBO createBO); | |
| 20 | + | |
| 21 | + CrmPermissionDO convert(CrmPermissionUpdateBO updateBO); | |
| 22 | + | |
| 23 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivableConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.receivable; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | + | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.factory.Mappers; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 回款管理 Convert | |
| 14 | + * | |
| 15 | + * @author 赤焰 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface ReceivableConvert { | |
| 19 | + | |
| 20 | + ReceivableConvert INSTANCE = Mappers.getMapper(ReceivableConvert.class); | |
| 21 | + | |
| 22 | + ReceivableDO convert(ReceivableCreateReqVO bean); | |
| 23 | + | |
| 24 | + ReceivableDO convert(ReceivableUpdateReqVO bean); | |
| 25 | + | |
| 26 | + ReceivableRespVO convert(ReceivableDO bean); | |
| 27 | + | |
| 28 | + List<ReceivableRespVO> convertList(List<ReceivableDO> list); | |
| 29 | + | |
| 30 | + PageResult<ReceivableRespVO> convertPage(PageResult<ReceivableDO> page); | |
| 31 | + | |
| 32 | + List<ReceivableExcelVO> convertList02(List<ReceivableDO> list); | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivablePlanConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.convert.receivable; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | + | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.factory.Mappers; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 回款计划 Convert | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface ReceivablePlanConvert { | |
| 19 | + | |
| 20 | + ReceivablePlanConvert INSTANCE = Mappers.getMapper(ReceivablePlanConvert.class); | |
| 21 | + | |
| 22 | + ReceivablePlanDO convert(ReceivablePlanCreateReqVO bean); | |
| 23 | + | |
| 24 | + ReceivablePlanDO convert(ReceivablePlanUpdateReqVO bean); | |
| 25 | + | |
| 26 | + ReceivablePlanRespVO convert(ReceivablePlanDO bean); | |
| 27 | + | |
| 28 | + List<ReceivablePlanRespVO> convertList(List<ReceivablePlanDO> list); | |
| 29 | + | |
| 30 | + PageResult<ReceivablePlanRespVO> convertPage(PageResult<ReceivablePlanDO> page); | |
| 31 | + | |
| 32 | + List<ReceivablePlanExcelVO> convertList02(List<ReceivablePlanDO> list); | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md
0 → 100644
| 1 | +<http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao> | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/business/CrmBusinessDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.business; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatus.CrmBusinessStatusDO; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatustype.CrmBusinessStatusTypeDO; | |
| 6 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 8 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 9 | +import lombok.*; | |
| 10 | + | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 商机 DO | |
| 15 | + * | |
| 16 | + * @author ljlleo | |
| 17 | + */ | |
| 18 | +@TableName("crm_business") | |
| 19 | +@KeySequence("crm_business_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 20 | +@Data | |
| 21 | +@EqualsAndHashCode(callSuper = true) | |
| 22 | +@ToString(callSuper = true) | |
| 23 | +@Builder | |
| 24 | +@NoArgsConstructor | |
| 25 | +@AllArgsConstructor | |
| 26 | +public class CrmBusinessDO extends BaseDO { | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 主键 | |
| 30 | + */ | |
| 31 | + @TableId | |
| 32 | + private Long id; | |
| 33 | + /** | |
| 34 | + * 商机名称 | |
| 35 | + */ | |
| 36 | + private String name; | |
| 37 | + /** | |
| 38 | + * 商机状态类型编号 | |
| 39 | + * | |
| 40 | + * 关联 {@link CrmBusinessStatusTypeDO#getId()} | |
| 41 | + */ | |
| 42 | + private Long statusTypeId; | |
| 43 | + /** | |
| 44 | + * 商机状态编号 | |
| 45 | + * | |
| 46 | + * 关联 {@link CrmBusinessStatusDO#getId()} | |
| 47 | + */ | |
| 48 | + private Long statusId; | |
| 49 | + /** | |
| 50 | + * 下次联系时间 | |
| 51 | + */ | |
| 52 | + private LocalDateTime contactNextTime; | |
| 53 | + /** | |
| 54 | + * 客户编号 | |
| 55 | + * | |
| 56 | + * TODO @ljileo:这个字段,后续要写下关联的实体哈 | |
| 57 | + */ | |
| 58 | + private Long customerId; | |
| 59 | + /** | |
| 60 | + * 预计成交日期 | |
| 61 | + */ | |
| 62 | + private LocalDateTime dealTime; | |
| 63 | + /** | |
| 64 | + * 商机金额 | |
| 65 | + * | |
| 66 | + */ | |
| 67 | + private Integer price; | |
| 68 | + /** | |
| 69 | + * 整单折扣 | |
| 70 | + * | |
| 71 | + */ | |
| 72 | + private Integer discountPercent; | |
| 73 | + /** | |
| 74 | + * 产品总金额 | |
| 75 | + * | |
| 76 | + */ | |
| 77 | + private Integer productPrice; | |
| 78 | + /** | |
| 79 | + * 备注 | |
| 80 | + */ | |
| 81 | + private String remark; | |
| 82 | + /** | |
| 83 | + * 1赢单2输单3无效 | |
| 84 | + * | |
| 85 | + * TODO @lijie:搞个枚举; | |
| 86 | + */ | |
| 87 | + private Integer endStatus; | |
| 88 | + /** | |
| 89 | + * 结束时的备注 | |
| 90 | + */ | |
| 91 | + private String endRemark; | |
| 92 | + /** | |
| 93 | + * 最后跟进时间 | |
| 94 | + */ | |
| 95 | + private LocalDateTime contactLastTime; | |
| 96 | + /** | |
| 97 | + * 跟进状态 | |
| 98 | + * | |
| 99 | + * TODO @lijie:目前就是 Boolean;是否跟进 | |
| 100 | + */ | |
| 101 | + private Integer followUpStatus; | |
| 102 | + | |
| 103 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/business/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/businessstatus/CrmBusinessStatusDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.businessstatus; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 6 | +import lombok.*; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 商机状态 DO | |
| 10 | + * | |
| 11 | + * @author ljlleo | |
| 12 | + */ | |
| 13 | +@TableName("crm_business_status") | |
| 14 | +@KeySequence("crm_business_status_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 15 | +@Data | |
| 16 | +@ToString(callSuper = true) | |
| 17 | +@Builder | |
| 18 | +@NoArgsConstructor | |
| 19 | +@AllArgsConstructor | |
| 20 | +public class CrmBusinessStatusDO { | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 主键 | |
| 24 | + */ | |
| 25 | + @TableId | |
| 26 | + private Long id; | |
| 27 | + /** | |
| 28 | + * 状态类型编号 | |
| 29 | + * | |
| 30 | + * // TODO @ljlleo:要写下关联字段噢 | |
| 31 | + */ | |
| 32 | + private Long typeId; | |
| 33 | + /** | |
| 34 | + * 状态名 | |
| 35 | + */ | |
| 36 | + private String name; | |
| 37 | + /** | |
| 38 | + * 赢单率 | |
| 39 | + */ | |
| 40 | + private String percent; | |
| 41 | + /** | |
| 42 | + * 排序 | |
| 43 | + */ | |
| 44 | + private Integer sort; | |
| 45 | + | |
| 46 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/businessstatustype/CrmBusinessStatusTypeDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.businessstatustype; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 6 | +import lombok.*; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 商机状态类型 DO | |
| 10 | + * | |
| 11 | + * @author ljlleo | |
| 12 | + */ | |
| 13 | +@TableName("crm_business_status_type") | |
| 14 | +@KeySequence("crm_business_status_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 15 | +@Data | |
| 16 | +@ToString(callSuper = true) | |
| 17 | +@Builder | |
| 18 | +@NoArgsConstructor | |
| 19 | +@AllArgsConstructor | |
| 20 | +public class CrmBusinessStatusTypeDO { | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 主键 | |
| 24 | + */ | |
| 25 | + @TableId | |
| 26 | + private Long id; | |
| 27 | + /** | |
| 28 | + * 状态类型名 | |
| 29 | + */ | |
| 30 | + private String name; | |
| 31 | + // TODO @ljlleo:List 存储哈 | |
| 32 | + /** | |
| 33 | + * 使用的部门编号 | |
| 34 | + */ | |
| 35 | + private String deptIds; | |
| 36 | + /** | |
| 37 | + * 开启状态 | |
| 38 | + */ | |
| 39 | + // TODO @ljlleo:这个字段,使用 Integer,对应 CommonStatus | |
| 40 | + private Boolean status; | |
| 41 | + | |
| 42 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/clue/CrmClueDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.clue; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | |
| 5 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 8 | +import lombok.*; | |
| 9 | + | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | + | |
| 12 | +// TODO 芋艿:字段的顺序,需要整理下; | |
| 13 | +/** | |
| 14 | + * 线索 DO | |
| 15 | + * | |
| 16 | + * @author Wanwan | |
| 17 | + */ | |
| 18 | +@TableName("crm_clue") | |
| 19 | +@KeySequence("crm_clue_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 20 | +@Data | |
| 21 | +@EqualsAndHashCode(callSuper = true) | |
| 22 | +@ToString(callSuper = true) | |
| 23 | +@Builder | |
| 24 | +@NoArgsConstructor | |
| 25 | +@AllArgsConstructor | |
| 26 | +public class CrmClueDO extends BaseDO { | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 编号,主键自增 | |
| 30 | + */ | |
| 31 | + @TableId | |
| 32 | + private Long id; | |
| 33 | + /** | |
| 34 | + * 转化状态 | |
| 35 | + */ | |
| 36 | + private Boolean transformStatus; | |
| 37 | + /** | |
| 38 | + * 跟进状态 | |
| 39 | + */ | |
| 40 | + private Boolean followUpStatus; | |
| 41 | + /** | |
| 42 | + * 线索名称 | |
| 43 | + */ | |
| 44 | + private String name; | |
| 45 | + /** | |
| 46 | + * 客户 id | |
| 47 | + * | |
| 48 | + * 关联 {@link CrmCustomerDO#getId()} | |
| 49 | + */ | |
| 50 | + private Long customerId; | |
| 51 | + /** | |
| 52 | + * 下次联系时间 | |
| 53 | + */ | |
| 54 | + private LocalDateTime contactNextTime; | |
| 55 | + /** | |
| 56 | + * 电话 | |
| 57 | + */ | |
| 58 | + private String telephone; | |
| 59 | + /** | |
| 60 | + * 手机号 | |
| 61 | + */ | |
| 62 | + private String mobile; | |
| 63 | + /** | |
| 64 | + * 地址 | |
| 65 | + */ | |
| 66 | + private String address; | |
| 67 | + /** | |
| 68 | + * 最后跟进时间 TODO 添加跟进记录时更新该值 | |
| 69 | + */ | |
| 70 | + private LocalDateTime contactLastTime; | |
| 71 | + /** | |
| 72 | + * 备注 | |
| 73 | + */ | |
| 74 | + private String remark; | |
| 75 | + | |
| 76 | + // TODO 芋艿:客户级别; | |
| 77 | + // TODO 芋艿:线索来源; | |
| 78 | + // TODO 芋艿:客户行业; | |
| 79 | + | |
| 80 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/clue/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contact/ContactDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.contact; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.*; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * crm 联系人 DO | |
| 13 | + * | |
| 14 | + * @author 芋道源码 | |
| 15 | + */ | |
| 16 | +@TableName("crm_contact") | |
| 17 | +@KeySequence("crm_contact_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 18 | +@Data | |
| 19 | +@EqualsAndHashCode(callSuper = true) | |
| 20 | +@ToString(callSuper = true) | |
| 21 | +@Builder | |
| 22 | +@NoArgsConstructor | |
| 23 | +@AllArgsConstructor | |
| 24 | +public class ContactDO extends BaseDO { | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 主键 | |
| 28 | + */ | |
| 29 | + @TableId | |
| 30 | + private Long id; | |
| 31 | + /** | |
| 32 | + * 联系人名称 | |
| 33 | + */ | |
| 34 | + private String name; | |
| 35 | + /** | |
| 36 | + * 下次联系时间 | |
| 37 | + */ | |
| 38 | + private LocalDateTime nextTime; | |
| 39 | + /** | |
| 40 | + * 手机号 | |
| 41 | + */ | |
| 42 | + private String mobile; | |
| 43 | + /** | |
| 44 | + * 电话 | |
| 45 | + */ | |
| 46 | + private String telephone; | |
| 47 | + /** | |
| 48 | + * 电子邮箱 | |
| 49 | + */ | |
| 50 | + private String email; | |
| 51 | + /** | |
| 52 | + * 职务 | |
| 53 | + */ | |
| 54 | + private String post; | |
| 55 | + /** | |
| 56 | + * 客户编号 | |
| 57 | + * | |
| 58 | + * TODO @zyna:关联的字段,也要写下 | |
| 59 | + */ | |
| 60 | + private Long customerId; | |
| 61 | + /** | |
| 62 | + * 地址 | |
| 63 | + */ | |
| 64 | + private String address; | |
| 65 | + /** | |
| 66 | + * 备注 | |
| 67 | + */ | |
| 68 | + private String remark; | |
| 69 | + /** | |
| 70 | + * 最后跟进时间 | |
| 71 | + */ | |
| 72 | + private LocalDateTime lastTime; | |
| 73 | + | |
| 74 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contact/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contract/ContractDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.contract; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.*; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 合同 DO | |
| 13 | + * | |
| 14 | + * @author dhb52 | |
| 15 | + */ | |
| 16 | +@TableName("crm_contract") | |
| 17 | +@KeySequence("crm_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 18 | +@Data | |
| 19 | +@EqualsAndHashCode(callSuper = true) | |
| 20 | +@ToString(callSuper = true) | |
| 21 | +@Builder | |
| 22 | +@NoArgsConstructor | |
| 23 | +@AllArgsConstructor | |
| 24 | +public class ContractDO extends BaseDO { | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 合同编号 | |
| 28 | + */ | |
| 29 | + @TableId | |
| 30 | + private Long id; | |
| 31 | + /** | |
| 32 | + * 合同名称 | |
| 33 | + */ | |
| 34 | + private String name; | |
| 35 | + /** | |
| 36 | + * 客户编号 | |
| 37 | + */ | |
| 38 | + private Long customerId; | |
| 39 | + /** | |
| 40 | + * 商机编号 | |
| 41 | + */ | |
| 42 | + private Long businessId; | |
| 43 | + /** | |
| 44 | + * 工作流编号 | |
| 45 | + */ | |
| 46 | + private Long processInstanceId; | |
| 47 | + /** | |
| 48 | + * 下单日期 | |
| 49 | + */ | |
| 50 | + private LocalDateTime orderDate; | |
| 51 | + /** | |
| 52 | + * 合同编号 | |
| 53 | + */ | |
| 54 | + private String no; | |
| 55 | + /** | |
| 56 | + * 开始时间 | |
| 57 | + */ | |
| 58 | + private LocalDateTime startTime; | |
| 59 | + /** | |
| 60 | + * 结束时间 | |
| 61 | + */ | |
| 62 | + private LocalDateTime endTime; | |
| 63 | + /** | |
| 64 | + * 合同金额 | |
| 65 | + */ | |
| 66 | + private Integer price; | |
| 67 | + /** | |
| 68 | + * 整单折扣 | |
| 69 | + */ | |
| 70 | + private Integer discountPercent; | |
| 71 | + /** | |
| 72 | + * 产品总金额 | |
| 73 | + */ | |
| 74 | + private Integer productPrice; | |
| 75 | + /** | |
| 76 | + * 联系人编号 | |
| 77 | + */ | |
| 78 | + private Long contactId; | |
| 79 | + /** | |
| 80 | + * 公司签约人 | |
| 81 | + */ | |
| 82 | + private Long signUserId; | |
| 83 | + /** | |
| 84 | + * 最后跟进时间 | |
| 85 | + */ | |
| 86 | + private LocalDateTime contactLastTime; | |
| 87 | + /** | |
| 88 | + * 备注 | |
| 89 | + */ | |
| 90 | + private String remark; | |
| 91 | + | |
| 92 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contract/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/customer/CrmCustomerDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.customer; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.*; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +// TODO 芋艿:调整下字段 | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 客户 DO | |
| 15 | + * | |
| 16 | + * @author Wanwan | |
| 17 | + */ | |
| 18 | +@TableName(value = "crm_customer", autoResultMap = true) | |
| 19 | +@KeySequence("crm_customer_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 20 | +@Data | |
| 21 | +@EqualsAndHashCode(callSuper = true) | |
| 22 | +@ToString(callSuper = true) | |
| 23 | +@Builder | |
| 24 | +@NoArgsConstructor | |
| 25 | +@AllArgsConstructor | |
| 26 | +public class CrmCustomerDO extends BaseDO { | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 编号 | |
| 30 | + */ | |
| 31 | + @TableId | |
| 32 | + private Long id; | |
| 33 | + /** | |
| 34 | + * 客户名称 | |
| 35 | + */ | |
| 36 | + private String name; | |
| 37 | + /** | |
| 38 | + * 跟进状态 | |
| 39 | + */ | |
| 40 | + private Boolean followUpStatus; | |
| 41 | + /** | |
| 42 | + * 锁定状态 | |
| 43 | + */ | |
| 44 | + private Boolean lockStatus; | |
| 45 | + /** | |
| 46 | + * 成交状态 | |
| 47 | + */ | |
| 48 | + private Boolean dealStatus; | |
| 49 | + /** | |
| 50 | + * 所属行业 | |
| 51 | + * | |
| 52 | + * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_CUSTOMER_INDUSTRY} | |
| 53 | + */ | |
| 54 | + private Integer industryId; | |
| 55 | + /** | |
| 56 | + * 客户等级 | |
| 57 | + * | |
| 58 | + * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_CUSTOMER_LEVEL} | |
| 59 | + */ | |
| 60 | + private Integer level; | |
| 61 | + /** | |
| 62 | + * 客户来源 | |
| 63 | + * | |
| 64 | + * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_CUSTOMER_SOURCE} | |
| 65 | + */ | |
| 66 | + private Integer source; | |
| 67 | + /** | |
| 68 | + * 手机 | |
| 69 | + */ | |
| 70 | + private String mobile; | |
| 71 | + /** | |
| 72 | + * 电话 | |
| 73 | + */ | |
| 74 | + private String telephone; | |
| 75 | + /** | |
| 76 | + * 网址 | |
| 77 | + */ | |
| 78 | + private String website; | |
| 79 | + /** | |
| 80 | ||
| 81 | + */ | |
| 82 | + private String qq; | |
| 83 | + /** | |
| 84 | ||
| 85 | + */ | |
| 86 | + private String wechat; | |
| 87 | + /** | |
| 88 | ||
| 89 | + */ | |
| 90 | + private String email; | |
| 91 | + /** | |
| 92 | + * 客户描述 | |
| 93 | + */ | |
| 94 | + private String description; | |
| 95 | + /** | |
| 96 | + * 备注 | |
| 97 | + */ | |
| 98 | + private String remark; | |
| 99 | + /** | |
| 100 | + * 地区编号 | |
| 101 | + */ | |
| 102 | + private Long areaId; | |
| 103 | + /** | |
| 104 | + * 详细地址 | |
| 105 | + */ | |
| 106 | + private String detailAddress; | |
| 107 | + /** | |
| 108 | + * 最后跟进时间 | |
| 109 | + */ | |
| 110 | + private LocalDateTime contactLastTime; | |
| 111 | + /** | |
| 112 | + * 下次联系时间 | |
| 113 | + */ | |
| 114 | + private LocalDateTime contactNextTime; | |
| 115 | + | |
| 116 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/customer/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/permission/CrmPermissionDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.permission; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler; | |
| 5 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 6 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 8 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 9 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 10 | +import lombok.*; | |
| 11 | + | |
| 12 | +import java.util.Set; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * crm 数据权限 DO | |
| 16 | + * | |
| 17 | + * @author HUIHUI | |
| 18 | + */ | |
| 19 | +@TableName("crm_receivable") | |
| 20 | +@KeySequence("crm_receivable_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 21 | +@Data | |
| 22 | +@EqualsAndHashCode(callSuper = true) | |
| 23 | +@ToString(callSuper = true) | |
| 24 | +@Builder | |
| 25 | +@NoArgsConstructor | |
| 26 | +@AllArgsConstructor | |
| 27 | +public class CrmPermissionDO extends BaseDO { | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * ID | |
| 31 | + */ | |
| 32 | + @TableId | |
| 33 | + private Long id; | |
| 34 | + /** | |
| 35 | + * 数据类型 关联 {@link CrmEnum} | |
| 36 | + */ | |
| 37 | + private Integer crmType; | |
| 38 | + /** | |
| 39 | + * 数据编号 关联 {@link CrmEnum} 对应模块 DO#getId() | |
| 40 | + */ | |
| 41 | + private Long crmDataId; | |
| 42 | + /** | |
| 43 | + * 负责人的用户编号 关联 AdminUser#id | |
| 44 | + */ | |
| 45 | + private Long ownerUserId; | |
| 46 | + /** | |
| 47 | + * 只读权限的用户编号数组 | |
| 48 | + */ | |
| 49 | + @TableField(typeHandler = JsonLongSetTypeHandler.class) | |
| 50 | + private Set<Long> roUserIds; | |
| 51 | + /** | |
| 52 | + * 读写权限的用户编号数组 | |
| 53 | + */ | |
| 54 | + @TableField(typeHandler = JsonLongSetTypeHandler.class) | |
| 55 | + private Set<Long> rwUserIds; | |
| 56 | + | |
| 57 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/product/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivableDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.receivable; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.*; | |
| 8 | + | |
| 9 | +import java.math.BigDecimal; | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 回款管理 DO | |
| 14 | + * | |
| 15 | + * @author 赤焰 | |
| 16 | + */ | |
| 17 | +@TableName("crm_receivable") | |
| 18 | +@KeySequence("crm_receivable_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 19 | +@Data | |
| 20 | +@EqualsAndHashCode(callSuper = true) | |
| 21 | +@ToString(callSuper = true) | |
| 22 | +@Builder | |
| 23 | +@NoArgsConstructor | |
| 24 | +@AllArgsConstructor | |
| 25 | +public class ReceivableDO extends BaseDO { | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * ID | |
| 29 | + */ | |
| 30 | + @TableId | |
| 31 | + private Long id; | |
| 32 | + /** | |
| 33 | + * 回款编号 | |
| 34 | + */ | |
| 35 | + private String no; | |
| 36 | + /** | |
| 37 | + * 回款计划ID | |
| 38 | + * | |
| 39 | + * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 | |
| 40 | + */ | |
| 41 | + private Long planId; | |
| 42 | + /** | |
| 43 | + * 客户ID | |
| 44 | + * | |
| 45 | + * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 | |
| 46 | + */ | |
| 47 | + private Long customerId; | |
| 48 | + /** | |
| 49 | + * 合同ID | |
| 50 | + * | |
| 51 | + * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 | |
| 52 | + */ | |
| 53 | + private Long contractId; | |
| 54 | + /** | |
| 55 | + * 审批状态 | |
| 56 | + * | |
| 57 | + * 枚举 {@link TODO crm_receivable_check_status 对应的类} | |
| 58 | + */ | |
| 59 | + private Integer checkStatus; | |
| 60 | + /** | |
| 61 | + * 工作流编号 | |
| 62 | + * | |
| 63 | + * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 | |
| 64 | + */ | |
| 65 | + private Long processInstanceId; | |
| 66 | + /** | |
| 67 | + * 回款日期 | |
| 68 | + */ | |
| 69 | + private LocalDateTime returnTime; | |
| 70 | + /** | |
| 71 | + * 回款方式 | |
| 72 | + */ | |
| 73 | + private String returnType; | |
| 74 | + /** | |
| 75 | + * 回款金额 | |
| 76 | + */ | |
| 77 | + private BigDecimal price; | |
| 78 | + /** | |
| 79 | + * 负责人 | |
| 80 | + */ | |
| 81 | + private Long ownerUserId; | |
| 82 | + /** | |
| 83 | + * 批次 | |
| 84 | + */ | |
| 85 | + private Long batchId; | |
| 86 | + /** | |
| 87 | + * 显示顺序 | |
| 88 | + */ | |
| 89 | + private Integer sort; | |
| 90 | + // TODO 芋艿:dataScope、dataScopeDeptIds 在想下; | |
| 91 | + /** | |
| 92 | + * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) | |
| 93 | + */ | |
| 94 | + private Integer dataScope; | |
| 95 | + /** | |
| 96 | + * 数据范围(指定部门数组) | |
| 97 | + */ | |
| 98 | + private String dataScopeDeptIds; | |
| 99 | + /** | |
| 100 | + * 状态 | |
| 101 | + * | |
| 102 | + * 枚举 {@link TODO common_status 对应的类} | |
| 103 | + */ | |
| 104 | + private Integer status; | |
| 105 | + /** | |
| 106 | + * 备注 | |
| 107 | + */ | |
| 108 | + private String remark; | |
| 109 | + | |
| 110 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivablePlanDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.receivable; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import java.math.BigDecimal; | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | +import com.baomidou.mybatisplus.annotation.*; | |
| 11 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 回款计划 DO | |
| 15 | + * | |
| 16 | + * @author 芋道源码 | |
| 17 | + */ | |
| 18 | +@TableName("crm_receivable_plan") | |
| 19 | +@KeySequence("crm_receivable_plan_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 20 | +@Data | |
| 21 | +@EqualsAndHashCode(callSuper = true) | |
| 22 | +@ToString(callSuper = true) | |
| 23 | +@Builder | |
| 24 | +@NoArgsConstructor | |
| 25 | +@AllArgsConstructor | |
| 26 | +public class ReceivablePlanDO extends BaseDO { | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * ID | |
| 30 | + */ | |
| 31 | + @TableId | |
| 32 | + private Long id; | |
| 33 | + /** | |
| 34 | + * 期数 | |
| 35 | + */ | |
| 36 | + private Long indexNo; | |
| 37 | + /** | |
| 38 | + * 回款ID | |
| 39 | + */ | |
| 40 | + private Long receivableId; | |
| 41 | + /** | |
| 42 | + * 完成状态 | |
| 43 | + * | |
| 44 | + * 枚举 {@link TODO common_status 对应的类} | |
| 45 | + */ | |
| 46 | + private Integer status; | |
| 47 | + /** | |
| 48 | + * 审批状态 | |
| 49 | + * | |
| 50 | + * 枚举 {@link TODO crm_receivable_check_status 对应的类} | |
| 51 | + */ | |
| 52 | + private String checkStatus; | |
| 53 | + /** | |
| 54 | + * 工作流编号 | |
| 55 | + */ | |
| 56 | + private Long processInstanceId; | |
| 57 | + /** | |
| 58 | + * 计划回款金额 | |
| 59 | + */ | |
| 60 | + private BigDecimal price; | |
| 61 | + /** | |
| 62 | + * 计划回款日期 | |
| 63 | + */ | |
| 64 | + private LocalDateTime returnTime; | |
| 65 | + /** | |
| 66 | + * 提前几天提醒 | |
| 67 | + */ | |
| 68 | + private Long remindDays; | |
| 69 | + /** | |
| 70 | + * 提醒日期 | |
| 71 | + */ | |
| 72 | + private LocalDateTime remindTime; | |
| 73 | + /** | |
| 74 | + * 客户ID | |
| 75 | + */ | |
| 76 | + private Long customerId; | |
| 77 | + /** | |
| 78 | + * 合同ID | |
| 79 | + */ | |
| 80 | + private Long contractId; | |
| 81 | + /** | |
| 82 | + * 负责人 | |
| 83 | + */ | |
| 84 | + private Long ownerUserId; | |
| 85 | + /** | |
| 86 | + * 显示顺序 | |
| 87 | + */ | |
| 88 | + private Integer sort; | |
| 89 | + /** | |
| 90 | + * 备注 | |
| 91 | + */ | |
| 92 | + private String remark; | |
| 93 | + | |
| 94 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/business/CrmBusinessMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.business; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.CrmBusinessExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.CrmBusinessPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 商机 Mapper | |
| 15 | + * | |
| 16 | + * @author ljlleo | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface CrmBusinessMapper extends BaseMapperX<CrmBusinessDO> { | |
| 20 | + | |
| 21 | + default PageResult<CrmBusinessDO> selectPage(CrmBusinessPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<CrmBusinessDO>() | |
| 23 | + .likeIfPresent(CrmBusinessDO::getName, reqVO.getName()) | |
| 24 | + .orderByDesc(CrmBusinessDO::getId)); | |
| 25 | + } | |
| 26 | + | |
| 27 | + default List<CrmBusinessDO> selectList(CrmBusinessExportReqVO reqVO) { | |
| 28 | + return selectList(new LambdaQueryWrapperX<CrmBusinessDO>() | |
| 29 | + .likeIfPresent(CrmBusinessDO::getName, reqVO.getName()) | |
| 30 | + .eqIfPresent(CrmBusinessDO::getStatusTypeId, reqVO.getStatusTypeId()) | |
| 31 | + .eqIfPresent(CrmBusinessDO::getStatusId, reqVO.getStatusId()) | |
| 32 | + .betweenIfPresent(CrmBusinessDO::getContactNextTime, reqVO.getContactNextTime()) | |
| 33 | + .eqIfPresent(CrmBusinessDO::getCustomerId, reqVO.getCustomerId()) | |
| 34 | + .betweenIfPresent(CrmBusinessDO::getDealTime, reqVO.getDealTime()) | |
| 35 | + .eqIfPresent(CrmBusinessDO::getPrice, reqVO.getPrice()) | |
| 36 | + .eqIfPresent(CrmBusinessDO::getDiscountPercent, reqVO.getDiscountPercent()) | |
| 37 | + .eqIfPresent(CrmBusinessDO::getProductPrice, reqVO.getProductPrice()) | |
| 38 | + .eqIfPresent(CrmBusinessDO::getRemark, reqVO.getRemark()) | |
| 39 | + .betweenIfPresent(CrmBusinessDO::getCreateTime, reqVO.getCreateTime()) | |
| 40 | + .eqIfPresent(CrmBusinessDO::getEndStatus, reqVO.getEndStatus()) | |
| 41 | + .eqIfPresent(CrmBusinessDO::getEndRemark, reqVO.getEndRemark()) | |
| 42 | + .betweenIfPresent(CrmBusinessDO::getContactLastTime, reqVO.getContactLastTime()) | |
| 43 | + .eqIfPresent(CrmBusinessDO::getFollowUpStatus, reqVO.getFollowUpStatus()) | |
| 44 | + .orderByDesc(CrmBusinessDO::getId)); | |
| 45 | + } | |
| 46 | + | |
| 47 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/business/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/businessstatus/CrmBusinessStatusMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.businessstatus; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatus.CrmBusinessStatusDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 商机状态 Mapper | |
| 15 | + * | |
| 16 | + * @author ljlleo | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface CrmBusinessStatusMapper extends BaseMapperX<CrmBusinessStatusDO> { | |
| 20 | + | |
| 21 | + default PageResult<CrmBusinessStatusDO> selectPage(CrmBusinessStatusPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<CrmBusinessStatusDO>() | |
| 23 | + .eqIfPresent(CrmBusinessStatusDO::getTypeId, reqVO.getTypeId()) | |
| 24 | + .orderByDesc(CrmBusinessStatusDO::getId)); | |
| 25 | + } | |
| 26 | + | |
| 27 | + default List<CrmBusinessStatusDO> selectList(CrmBusinessStatusExportReqVO reqVO) { | |
| 28 | + return selectList(new LambdaQueryWrapperX<CrmBusinessStatusDO>() | |
| 29 | + .eqIfPresent(CrmBusinessStatusDO::getTypeId, reqVO.getTypeId()) | |
| 30 | + .likeIfPresent(CrmBusinessStatusDO::getName, reqVO.getName()) | |
| 31 | + .eqIfPresent(CrmBusinessStatusDO::getPercent, reqVO.getPercent()) | |
| 32 | + .eqIfPresent(CrmBusinessStatusDO::getSort, reqVO.getSort()) | |
| 33 | + .orderByDesc(CrmBusinessStatusDO::getId)); | |
| 34 | + } | |
| 35 | + | |
| 36 | + default List<CrmBusinessStatusDO> getBusinessStatusListByTypeId(Integer typeId) { | |
| 37 | + return selectList(CrmBusinessStatusDO::getTypeId, typeId); | |
| 38 | + } | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/businessstatustype/CrmBusinessStatusTypeMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.businessstatustype; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatustype.CrmBusinessStatusTypeDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 商机状态类型 Mapper | |
| 15 | + * | |
| 16 | + * @author ljlleo | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface CrmBusinessStatusTypeMapper extends BaseMapperX<CrmBusinessStatusTypeDO> { | |
| 20 | + | |
| 21 | + default PageResult<CrmBusinessStatusTypeDO> selectPage(CrmBusinessStatusTypePageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<CrmBusinessStatusTypeDO>() | |
| 23 | + .likeIfPresent(CrmBusinessStatusTypeDO::getName, reqVO.getName()) | |
| 24 | +// .eqIfPresent(CrmBusinessStatusTypeDO::getDeptIds, reqVO.getDeptIds()) TODO 报错,临时注释掉 | |
| 25 | + .eqIfPresent(CrmBusinessStatusTypeDO::getStatus, reqVO.getStatus()) | |
| 26 | + .orderByDesc(CrmBusinessStatusTypeDO::getId)); | |
| 27 | + } | |
| 28 | + | |
| 29 | + default List<CrmBusinessStatusTypeDO> selectList(CrmBusinessStatusTypeExportReqVO reqVO) { | |
| 30 | + return selectList(new LambdaQueryWrapperX<CrmBusinessStatusTypeDO>() | |
| 31 | + .likeIfPresent(CrmBusinessStatusTypeDO::getName, reqVO.getName()) | |
| 32 | + .eqIfPresent(CrmBusinessStatusTypeDO::getDeptIds, reqVO.getDeptIds()) | |
| 33 | + .eqIfPresent(CrmBusinessStatusTypeDO::getStatus, reqVO.getStatus()) | |
| 34 | + .orderByDesc(CrmBusinessStatusTypeDO::getId)); | |
| 35 | + } | |
| 36 | + | |
| 37 | + default List<CrmBusinessStatusTypeDO> getBusinessStatusTypeListByStatus(Integer status) { | |
| 38 | + return selectList(CrmBusinessStatusTypeDO::getStatus, status.byteValue()); | |
| 39 | + } | |
| 40 | + | |
| 41 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/clue/CrmClueMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.clue; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmCluePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 线索 Mapper | |
| 15 | + * | |
| 16 | + * @author Wanwan | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface CrmClueMapper extends BaseMapperX<CrmClueDO> { | |
| 20 | + | |
| 21 | + default PageResult<CrmClueDO> selectPage(CrmCluePageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<CrmClueDO>() | |
| 23 | + .likeIfPresent(CrmClueDO::getName, reqVO.getName()) | |
| 24 | + .likeIfPresent(CrmClueDO::getTelephone, reqVO.getTelephone()) | |
| 25 | + .likeIfPresent(CrmClueDO::getMobile, reqVO.getMobile()) | |
| 26 | + .orderByDesc(CrmClueDO::getId)); | |
| 27 | + } | |
| 28 | + | |
| 29 | + default List<CrmClueDO> selectList(CrmClueExportReqVO reqVO) { | |
| 30 | + return selectList(new LambdaQueryWrapperX<CrmClueDO>() | |
| 31 | + .eqIfPresent(CrmClueDO::getTransformStatus, reqVO.getTransformStatus()) | |
| 32 | + .eqIfPresent(CrmClueDO::getFollowUpStatus, reqVO.getFollowUpStatus()) | |
| 33 | + .likeIfPresent(CrmClueDO::getName, reqVO.getName()) | |
| 34 | + .eqIfPresent(CrmClueDO::getCustomerId, reqVO.getCustomerId()) | |
| 35 | + .betweenIfPresent(CrmClueDO::getContactNextTime, reqVO.getContactNextTime()) | |
| 36 | + .likeIfPresent(CrmClueDO::getTelephone, reqVO.getTelephone()) | |
| 37 | + .likeIfPresent(CrmClueDO::getMobile, reqVO.getMobile()) | |
| 38 | + .likeIfPresent(CrmClueDO::getAddress, reqVO.getAddress()) | |
| 39 | + .betweenIfPresent(CrmClueDO::getContactLastTime, reqVO.getContactLastTime()) | |
| 40 | + .betweenIfPresent(CrmClueDO::getCreateTime, reqVO.getCreateTime()) | |
| 41 | + .orderByDesc(CrmClueDO::getId)); | |
| 42 | + } | |
| 43 | + | |
| 44 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/clue/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contact/ContactMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.contact; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.ContactExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.ContactPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contact.ContactDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * crm联系人 Mapper | |
| 15 | + * | |
| 16 | + * @author 芋道源码 | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface ContactMapper extends BaseMapperX<ContactDO> { | |
| 20 | + | |
| 21 | + default PageResult<ContactDO> selectPage(ContactPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<ContactDO>() | |
| 23 | + .likeIfPresent(ContactDO::getName, reqVO.getName()) | |
| 24 | + .betweenIfPresent(ContactDO::getNextTime, reqVO.getNextTime()) | |
| 25 | + .eqIfPresent(ContactDO::getMobile, reqVO.getMobile()) | |
| 26 | + .eqIfPresent(ContactDO::getTelephone, reqVO.getTelephone()) | |
| 27 | + .eqIfPresent(ContactDO::getEmail, reqVO.getEmail()) | |
| 28 | + .eqIfPresent(ContactDO::getPost, reqVO.getPost()) | |
| 29 | + .eqIfPresent(ContactDO::getCustomerId, reqVO.getCustomerId()) | |
| 30 | + .eqIfPresent(ContactDO::getAddress, reqVO.getAddress()) | |
| 31 | + .eqIfPresent(ContactDO::getRemark, reqVO.getRemark()) | |
| 32 | + .betweenIfPresent(ContactDO::getCreateTime, reqVO.getCreateTime()) | |
| 33 | + .betweenIfPresent(ContactDO::getLastTime, reqVO.getLastTime()) | |
| 34 | + .orderByDesc(ContactDO::getId)); | |
| 35 | + } | |
| 36 | + | |
| 37 | + default List<ContactDO> selectList(ContactExportReqVO reqVO) { | |
| 38 | + return selectList(new LambdaQueryWrapperX<ContactDO>() | |
| 39 | + .likeIfPresent(ContactDO::getName, reqVO.getName()) | |
| 40 | + .betweenIfPresent(ContactDO::getNextTime, reqVO.getNextTime()) | |
| 41 | + .eqIfPresent(ContactDO::getMobile, reqVO.getMobile()) | |
| 42 | + .eqIfPresent(ContactDO::getTelephone, reqVO.getTelephone()) | |
| 43 | + .eqIfPresent(ContactDO::getEmail, reqVO.getEmail()) | |
| 44 | + .eqIfPresent(ContactDO::getPost, reqVO.getPost()) | |
| 45 | + .eqIfPresent(ContactDO::getCustomerId, reqVO.getCustomerId()) | |
| 46 | + .eqIfPresent(ContactDO::getAddress, reqVO.getAddress()) | |
| 47 | + .eqIfPresent(ContactDO::getRemark, reqVO.getRemark()) | |
| 48 | + .betweenIfPresent(ContactDO::getCreateTime, reqVO.getCreateTime()) | |
| 49 | + .betweenIfPresent(ContactDO::getLastTime, reqVO.getLastTime()) | |
| 50 | + .orderByDesc(ContactDO::getId)); | |
| 51 | + } | |
| 52 | + | |
| 53 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contact/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/ContractMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.contract; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.ContractExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.ContractPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 合同 Mapper | |
| 15 | + * | |
| 16 | + * @author dhb52 | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface ContractMapper extends BaseMapperX<ContractDO> { | |
| 20 | + | |
| 21 | + default PageResult<ContractDO> selectPage(ContractPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>() | |
| 23 | + .likeIfPresent(ContractDO::getName, reqVO.getName()) | |
| 24 | + .eqIfPresent(ContractDO::getCustomerId, reqVO.getCustomerId()) | |
| 25 | + .eqIfPresent(ContractDO::getBusinessId, reqVO.getBusinessId()) | |
| 26 | + .betweenIfPresent(ContractDO::getOrderDate, reqVO.getOrderDate()) | |
| 27 | + .eqIfPresent(ContractDO::getNo, reqVO.getNo()) | |
| 28 | + .eqIfPresent(ContractDO::getDiscountPercent, reqVO.getDiscountPercent()) | |
| 29 | + .eqIfPresent(ContractDO::getProductPrice, reqVO.getProductPrice()) | |
| 30 | + .orderByDesc(ContractDO::getId)); | |
| 31 | + } | |
| 32 | + | |
| 33 | + default List<ContractDO> selectList(ContractExportReqVO reqVO) { | |
| 34 | + return selectList(new LambdaQueryWrapperX<ContractDO>() | |
| 35 | + .likeIfPresent(ContractDO::getName, reqVO.getName()) | |
| 36 | + .eqIfPresent(ContractDO::getCustomerId, reqVO.getCustomerId()) | |
| 37 | + .eqIfPresent(ContractDO::getBusinessId, reqVO.getBusinessId()) | |
| 38 | + .betweenIfPresent(ContractDO::getOrderDate, reqVO.getOrderDate()) | |
| 39 | + .eqIfPresent(ContractDO::getNo, reqVO.getNo()) | |
| 40 | + .eqIfPresent(ContractDO::getDiscountPercent, reqVO.getDiscountPercent()) | |
| 41 | + .eqIfPresent(ContractDO::getProductPrice, reqVO.getProductPrice()) | |
| 42 | + .orderByDesc(ContractDO::getId)); | |
| 43 | + } | |
| 44 | + | |
| 45 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/customer/CrmCustomerMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.customer; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 客户 Mapper | |
| 15 | + * | |
| 16 | + * @author Wanwan | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface CrmCustomerMapper extends BaseMapperX<CrmCustomerDO> { | |
| 20 | + | |
| 21 | + default PageResult<CrmCustomerDO> selectPage(CrmCustomerPageReqVO reqVO) { | |
| 22 | + // TODO @Wanwan 填充负责人,所属部门字段;这个可以在 controller 填哈; | |
| 23 | + return selectPage(reqVO, new LambdaQueryWrapperX<CrmCustomerDO>() | |
| 24 | + .likeIfPresent(CrmCustomerDO::getName, reqVO.getName()) | |
| 25 | + .eqIfPresent(CrmCustomerDO::getMobile, reqVO.getMobile()) | |
| 26 | + .orderByDesc(CrmCustomerDO::getId)); | |
| 27 | + } | |
| 28 | + | |
| 29 | + default List<CrmCustomerDO> selectList(CrmCustomerExportReqVO reqVO) { | |
| 30 | + return selectList(new LambdaQueryWrapperX<CrmCustomerDO>() | |
| 31 | + .likeIfPresent(CrmCustomerDO::getName, reqVO.getName()) | |
| 32 | + .eqIfPresent(CrmCustomerDO::getMobile, reqVO.getMobile()) | |
| 33 | + .orderByDesc(CrmCustomerDO::getId)); | |
| 34 | + } | |
| 35 | + | |
| 36 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/customer/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/permission/CrmPermissionMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.permission; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; | |
| 6 | +import org.apache.ibatis.annotations.Mapper; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * crm 数据权限 mapper | |
| 10 | + * | |
| 11 | + * @author HUIHUI | |
| 12 | + */ | |
| 13 | +@Mapper | |
| 14 | +public interface CrmPermissionMapper extends BaseMapperX<CrmPermissionDO> { | |
| 15 | + | |
| 16 | + default CrmPermissionDO selectByCrmTypeAndCrmDataId(Integer crmType, Long crmDataId) { | |
| 17 | + return selectOne(new LambdaQueryWrapperX<CrmPermissionDO>() | |
| 18 | + .eq(CrmPermissionDO::getCrmType, crmType).eq(CrmPermissionDO::getCrmDataId, crmDataId)); | |
| 19 | + } | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/permission/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/product/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivableMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.receivable; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 回款管理 Mapper | |
| 14 | + * | |
| 15 | + * @author 赤焰 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface ReceivableMapper extends BaseMapperX<ReceivableDO> { | |
| 19 | + | |
| 20 | + default PageResult<ReceivableDO> selectPage(ReceivablePageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<ReceivableDO>() | |
| 22 | + .eqIfPresent(ReceivableDO::getNo, reqVO.getNo()) | |
| 23 | + .eqIfPresent(ReceivableDO::getPlanId, reqVO.getPlanId()) | |
| 24 | + .eqIfPresent(ReceivableDO::getCustomerId, reqVO.getCustomerId()) | |
| 25 | + .eqIfPresent(ReceivableDO::getContractId, reqVO.getContractId()) | |
| 26 | + .eqIfPresent(ReceivableDO::getCheckStatus, reqVO.getCheckStatus()) | |
| 27 | + .eqIfPresent(ReceivableDO::getProcessInstanceId, reqVO.getProcessInstanceId()) | |
| 28 | + .betweenIfPresent(ReceivableDO::getReturnTime, reqVO.getReturnTime()) | |
| 29 | + .eqIfPresent(ReceivableDO::getReturnType, reqVO.getReturnType()) | |
| 30 | + .eqIfPresent(ReceivableDO::getPrice, reqVO.getPrice()) | |
| 31 | + .eqIfPresent(ReceivableDO::getOwnerUserId, reqVO.getOwnerUserId()) | |
| 32 | + .eqIfPresent(ReceivableDO::getBatchId, reqVO.getBatchId()) | |
| 33 | + .eqIfPresent(ReceivableDO::getSort, reqVO.getSort()) | |
| 34 | + .eqIfPresent(ReceivableDO::getDataScope, reqVO.getDataScope()) | |
| 35 | + .eqIfPresent(ReceivableDO::getDataScopeDeptIds, reqVO.getDataScopeDeptIds()) | |
| 36 | + .eqIfPresent(ReceivableDO::getStatus, reqVO.getStatus()) | |
| 37 | + .eqIfPresent(ReceivableDO::getRemark, reqVO.getRemark()) | |
| 38 | + .betweenIfPresent(ReceivableDO::getCreateTime, reqVO.getCreateTime()) | |
| 39 | + .orderByDesc(ReceivableDO::getId)); | |
| 40 | + } | |
| 41 | + | |
| 42 | + default List<ReceivableDO> selectList(ReceivableExportReqVO reqVO) { | |
| 43 | + return selectList(new LambdaQueryWrapperX<ReceivableDO>() | |
| 44 | + .eqIfPresent(ReceivableDO::getNo, reqVO.getNo()) | |
| 45 | + .eqIfPresent(ReceivableDO::getPlanId, reqVO.getPlanId()) | |
| 46 | + .eqIfPresent(ReceivableDO::getCustomerId, reqVO.getCustomerId()) | |
| 47 | + .eqIfPresent(ReceivableDO::getContractId, reqVO.getContractId()) | |
| 48 | + .eqIfPresent(ReceivableDO::getCheckStatus, reqVO.getCheckStatus()) | |
| 49 | + .eqIfPresent(ReceivableDO::getProcessInstanceId, reqVO.getProcessInstanceId()) | |
| 50 | + .betweenIfPresent(ReceivableDO::getReturnTime, reqVO.getReturnTime()) | |
| 51 | + .eqIfPresent(ReceivableDO::getReturnType, reqVO.getReturnType()) | |
| 52 | + .eqIfPresent(ReceivableDO::getPrice, reqVO.getPrice()) | |
| 53 | + .eqIfPresent(ReceivableDO::getOwnerUserId, reqVO.getOwnerUserId()) | |
| 54 | + .eqIfPresent(ReceivableDO::getBatchId, reqVO.getBatchId()) | |
| 55 | + .eqIfPresent(ReceivableDO::getSort, reqVO.getSort()) | |
| 56 | + .eqIfPresent(ReceivableDO::getDataScope, reqVO.getDataScope()) | |
| 57 | + .eqIfPresent(ReceivableDO::getDataScopeDeptIds, reqVO.getDataScopeDeptIds()) | |
| 58 | + .eqIfPresent(ReceivableDO::getStatus, reqVO.getStatus()) | |
| 59 | + .eqIfPresent(ReceivableDO::getRemark, reqVO.getRemark()) | |
| 60 | + .betweenIfPresent(ReceivableDO::getCreateTime, reqVO.getCreateTime()) | |
| 61 | + .orderByDesc(ReceivableDO::getId)); | |
| 62 | + } | |
| 63 | + | |
| 64 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivablePlanMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.receivable; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 回款计划 Mapper | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface ReceivablePlanMapper extends BaseMapperX<ReceivablePlanDO> { | |
| 19 | + | |
| 20 | + default PageResult<ReceivablePlanDO> selectPage(ReceivablePlanPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<ReceivablePlanDO>() | |
| 22 | + .eqIfPresent(ReceivablePlanDO::getIndexNo, reqVO.getIndexNo()) | |
| 23 | + .eqIfPresent(ReceivablePlanDO::getStatus, reqVO.getStatus()) | |
| 24 | + .eqIfPresent(ReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus()) | |
| 25 | + .betweenIfPresent(ReceivablePlanDO::getReturnTime, reqVO.getReturnTime()) | |
| 26 | + .eqIfPresent(ReceivablePlanDO::getRemindDays, reqVO.getRemindDays()) | |
| 27 | + .betweenIfPresent(ReceivablePlanDO::getRemindTime, reqVO.getRemindTime()) | |
| 28 | + .eqIfPresent(ReceivablePlanDO::getCustomerId, reqVO.getCustomerId()) | |
| 29 | + .eqIfPresent(ReceivablePlanDO::getContractId, reqVO.getContractId()) | |
| 30 | + .eqIfPresent(ReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId()) | |
| 31 | + .eqIfPresent(ReceivablePlanDO::getRemark, reqVO.getRemark()) | |
| 32 | + .betweenIfPresent(ReceivablePlanDO::getCreateTime, reqVO.getCreateTime()) | |
| 33 | + .orderByDesc(ReceivablePlanDO::getId)); | |
| 34 | + } | |
| 35 | + | |
| 36 | + default List<ReceivablePlanDO> selectList(ReceivablePlanExportReqVO reqVO) { | |
| 37 | + return selectList(new LambdaQueryWrapperX<ReceivablePlanDO>() | |
| 38 | + .eqIfPresent(ReceivablePlanDO::getIndexNo, reqVO.getIndexNo()) | |
| 39 | + .eqIfPresent(ReceivablePlanDO::getStatus, reqVO.getStatus()) | |
| 40 | + .eqIfPresent(ReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus()) | |
| 41 | + .betweenIfPresent(ReceivablePlanDO::getReturnTime, reqVO.getReturnTime()) | |
| 42 | + .eqIfPresent(ReceivablePlanDO::getRemindDays, reqVO.getRemindDays()) | |
| 43 | + .betweenIfPresent(ReceivablePlanDO::getRemindTime, reqVO.getRemindTime()) | |
| 44 | + .eqIfPresent(ReceivablePlanDO::getCustomerId, reqVO.getCustomerId()) | |
| 45 | + .eqIfPresent(ReceivablePlanDO::getContractId, reqVO.getContractId()) | |
| 46 | + .eqIfPresent(ReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId()) | |
| 47 | + .eqIfPresent(ReceivablePlanDO::getRemark, reqVO.getRemark()) | |
| 48 | + .betweenIfPresent(ReceivablePlanDO::getCreateTime, reqVO.getCreateTime()) | |
| 49 | + .orderByDesc(ReceivablePlanDO::getId)); | |
| 50 | + } | |
| 51 | + | |
| 52 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/core/annotations/CrmPermission.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.framework.core.annotations; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 4 | +import cn.iocoder.yudao.module.crm.framework.enums.OperationTypeEnum; | |
| 5 | + | |
| 6 | +import java.lang.annotation.Documented; | |
| 7 | +import java.lang.annotation.Retention; | |
| 8 | +import java.lang.annotation.RetentionPolicy; | |
| 9 | +import java.lang.annotation.Target; | |
| 10 | + | |
| 11 | +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; | |
| 12 | +import static java.lang.annotation.ElementType.METHOD; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * Crm 数据操作权限校验 AOP 注解 | |
| 16 | + * | |
| 17 | + * @author HUIHUI | |
| 18 | + */ | |
| 19 | +@Target({METHOD, ANNOTATION_TYPE}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@Documented | |
| 22 | +public @interface CrmPermission { | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * crm 类型 | |
| 26 | + */ | |
| 27 | + CrmEnum crmType(); | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 操作类型 | |
| 31 | + */ | |
| 32 | + OperationTypeEnum operationType(); | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/core/aop/CrmPermissionAspect.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.framework.core.aop; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.util.ObjUtil; | |
| 5 | +import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; | |
| 6 | +import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; | |
| 7 | +import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; | |
| 8 | +import cn.iocoder.yudao.module.crm.framework.enums.OperationTypeEnum; | |
| 9 | +import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; | |
| 10 | +import lombok.extern.slf4j.Slf4j; | |
| 11 | +import org.aspectj.lang.JoinPoint; | |
| 12 | +import org.aspectj.lang.annotation.Aspect; | |
| 13 | +import org.aspectj.lang.annotation.Before; | |
| 14 | +import org.springframework.stereotype.Component; | |
| 15 | + | |
| 16 | +import javax.annotation.Resource; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 19 | +import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; | |
| 20 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CRM_PERMISSION_DENIED; | |
| 21 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CRM_PERMISSION_MODEL_NOT_EXISTS; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * Crm 数据权限校验 AOP 切面 | |
| 25 | + * | |
| 26 | + * @author HUIHUI | |
| 27 | + */ | |
| 28 | +@Component | |
| 29 | +@Aspect | |
| 30 | +@Slf4j | |
| 31 | +public class CrmPermissionAspect { | |
| 32 | + | |
| 33 | + @Resource | |
| 34 | + private CrmPermissionService crmPermissionService; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 获得用户编号 | |
| 38 | + * | |
| 39 | + * @return 用户编号 | |
| 40 | + */ | |
| 41 | + private static Long getUserId() { | |
| 42 | + return WebFrameworkUtils.getLoginUserId(); | |
| 43 | + } | |
| 44 | + | |
| 45 | + @Before("@annotation(crmPermission)") | |
| 46 | + public void doBefore(JoinPoint joinPoint, CrmPermission crmPermission) { | |
| 47 | + try { | |
| 48 | + Integer crmType = crmPermission.crmType().getType(); | |
| 49 | + Integer operationType = crmPermission.operationType().getType(); | |
| 50 | + // TODO @puhui999:不一定是 id 参数噢;例如说,ContactServiceImpl 的 updateContact | |
| 51 | + Long id = (Long) joinPoint.getArgs()[0];// 获取操作数据的编号 | |
| 52 | + | |
| 53 | + // 1.1 获取数据权限 | |
| 54 | + CrmPermissionDO permission = crmPermissionService.getCrmPermissionByCrmTypeAndCrmDataId(crmType, id); | |
| 55 | + if (permission == null) { | |
| 56 | + // 不存在说明数据也不存在 | |
| 57 | + throw exception(CRM_PERMISSION_MODEL_NOT_EXISTS, crmPermission.crmType().getName()); | |
| 58 | + } | |
| 59 | + // 1.2 校验是否为公海数据 | |
| 60 | + // TODO @puhui999:这个判断去掉比较合适哈。这里更多是业务逻辑,不算权限判断。例如说,公海的客户,只要没负责人,就可以领取了; | |
| 61 | + if (permission.getOwnerUserId() == null) { | |
| 62 | + return; | |
| 63 | + } | |
| 64 | + // 1.3 校验当前负责人是不是自己 | |
| 65 | + if (ObjUtil.equal(permission.getOwnerUserId(), getUserId())) { | |
| 66 | + return; | |
| 67 | + } | |
| 68 | + // 1.4 TODO 校验是否为超级管理员 | |
| 69 | + | |
| 70 | + // 2. 校验是否有读权限 | |
| 71 | + if (OperationTypeEnum.isRead(operationType)) { | |
| 72 | + // 校验该数据当前用户是否可读 | |
| 73 | + // TODO @puhui999:直接 CollUtil.contains 就好,因为就是有某个 userId 呀 | |
| 74 | + boolean isRead = CollUtil.contains(permission.getRoUserIds(), item -> ObjUtil.equal(item, getUserId())) | |
| 75 | + || CollUtil.contains(permission.getRwUserIds(), item -> ObjUtil.equal(item, getUserId())); | |
| 76 | + if (isRead) { | |
| 77 | + return; | |
| 78 | + } | |
| 79 | + } | |
| 80 | + | |
| 81 | + // 3. 校验是否有编辑权限 | |
| 82 | + if (OperationTypeEnum.isEdit(operationType)) { | |
| 83 | + // 校验该数据当前用户是否可读写 | |
| 84 | + if (CollUtil.contains(permission.getRwUserIds(), item -> ObjUtil.equal(item, getUserId()))) { | |
| 85 | + return; | |
| 86 | + } | |
| 87 | + } | |
| 88 | + | |
| 89 | + // 4. 没通过结束,报错 {}操作失败,原因:没有权限 | |
| 90 | + throw exception(CRM_PERMISSION_DENIED, crmPermission.crmType().getName()); | |
| 91 | + } catch (Exception ex) { | |
| 92 | + log.error("[doBefore][crmPermission({}) 数据校验错误]", toJsonString(crmPermission), ex); | |
| 93 | + } | |
| 94 | + } | |
| 95 | + | |
| 96 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/core/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/enums/CrmEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.framework.enums; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.ObjUtil; | |
| 4 | +import lombok.Getter; | |
| 5 | +import lombok.RequiredArgsConstructor; | |
| 6 | + | |
| 7 | +// TODO @puhui999:可以改成 CrmBizTypeEnum,CRM 业务类型枚举 | |
| 8 | +/** | |
| 9 | + * Crm 类型枚举 | |
| 10 | + * | |
| 11 | + * @author HUIHUI | |
| 12 | + */ | |
| 13 | +@RequiredArgsConstructor | |
| 14 | +@Getter | |
| 15 | +public enum CrmEnum { | |
| 16 | + | |
| 17 | + CRM_LEADS(1, "线索"), | |
| 18 | + CRM_CUSTOMER(2, "客户"), | |
| 19 | + CRM_CONTACTS(3, "联系人"), | |
| 20 | + CRM_BUSINESS(5, "商机"), | |
| 21 | + CRM_CONTRACT(6, "合同"); | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 类型 | |
| 25 | + */ | |
| 26 | + private final Integer type; | |
| 27 | + /** | |
| 28 | + * 名称 | |
| 29 | + */ | |
| 30 | + private final String name; | |
| 31 | + | |
| 32 | + public static String getNameByType(Integer type) { | |
| 33 | + for (CrmEnum crmEnum : CrmEnum.values()) { | |
| 34 | + if (ObjUtil.equal(crmEnum.type, type)) { | |
| 35 | + return crmEnum.name; | |
| 36 | + } | |
| 37 | + } | |
| 38 | + return ""; | |
| 39 | + } | |
| 40 | + | |
| 41 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/enums/OperationTypeEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.framework.enums; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.ObjUtil; | |
| 4 | +import lombok.Getter; | |
| 5 | +import lombok.RequiredArgsConstructor; | |
| 6 | + | |
| 7 | +// TODO @puhui999:是不是可以和 PermissionTypeEnum 合并,就是 CrmPermissionEnum,负责人、读取、读写;目前阶段,不用做的特别细致;类似 linux 的 acl; | |
| 8 | +/** | |
| 9 | + * Crm 数据操作类型枚举 | |
| 10 | + * | |
| 11 | + * @author HUIHUI | |
| 12 | + */ | |
| 13 | +@RequiredArgsConstructor | |
| 14 | +@Getter | |
| 15 | +public enum OperationTypeEnum { | |
| 16 | + | |
| 17 | + // TODO @puhui999:抽象上,就分三种,会更合理。一个 OWNER 负责人,一个 READ 读,一个 WRITE 写; | |
| 18 | + DELETE(1, "删除"), | |
| 19 | + UPDATE(2, "修改"), | |
| 20 | + READ(3, "查询"); | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 类型 | |
| 24 | + */ | |
| 25 | + private final Integer type; | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 名称 | |
| 29 | + */ | |
| 30 | + private final String name; | |
| 31 | + | |
| 32 | + public static boolean isRead(Integer type) { | |
| 33 | + return ObjUtil.equal(type, READ.getType()); | |
| 34 | + } | |
| 35 | + | |
| 36 | + public static boolean isEdit(Integer type) { | |
| 37 | + return ObjUtil.equal(type, UPDATE.getType()) || ObjUtil.equal(type, DELETE.getType()); | |
| 38 | + } | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/framework/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.business; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | |
| 6 | + | |
| 7 | +import javax.validation.Valid; | |
| 8 | +import java.util.Collection; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 商机 Service 接口 | |
| 13 | + * | |
| 14 | + * @author ljlleo | |
| 15 | + */ | |
| 16 | +public interface CrmBusinessService { | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 创建商机 | |
| 20 | + * | |
| 21 | + * @param createReqVO 创建信息 | |
| 22 | + * @param userId 用户编号 | |
| 23 | + * @return 编号 | |
| 24 | + */ | |
| 25 | + Long createBusiness(@Valid CrmBusinessCreateReqVO createReqVO, Long userId); | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 更新商机 | |
| 29 | + * | |
| 30 | + * @param updateReqVO 更新信息 | |
| 31 | + */ | |
| 32 | + void updateBusiness(@Valid CrmBusinessUpdateReqVO updateReqVO); | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 删除商机 | |
| 36 | + * | |
| 37 | + * @param id 编号 | |
| 38 | + */ | |
| 39 | + void deleteBusiness(Long id); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 获得商机 | |
| 43 | + * | |
| 44 | + * @param id 编号 | |
| 45 | + * @return 商机 | |
| 46 | + */ | |
| 47 | + CrmBusinessDO getBusiness(Long id); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 获得商机列表 | |
| 51 | + * | |
| 52 | + * @param ids 编号 | |
| 53 | + * @return 商机列表 | |
| 54 | + */ | |
| 55 | + List<CrmBusinessDO> getBusinessList(Collection<Long> ids); | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 获得商机分页 | |
| 59 | + * | |
| 60 | + * @param pageReqVO 分页查询 | |
| 61 | + * @return 商机分页 | |
| 62 | + */ | |
| 63 | + PageResult<CrmBusinessDO> getBusinessPage(CrmBusinessPageReqVO pageReqVO); | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 获得商机列表, 用于 Excel 导出 | |
| 67 | + * | |
| 68 | + * @param exportReqVO 查询条件 | |
| 69 | + * @return 商机列表 | |
| 70 | + */ | |
| 71 | + List<CrmBusinessDO> getBusinessList(CrmBusinessExportReqVO exportReqVO); | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 商机转移 | |
| 75 | + * | |
| 76 | + * @param reqVO 请求 | |
| 77 | + * @param userId 用户编号 | |
| 78 | + */ | |
| 79 | + void transferBusiness(CrmTransferBusinessReqVO reqVO, Long userId); | |
| 80 | + | |
| 81 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.business; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.*; | |
| 7 | +import cn.iocoder.yudao.module.crm.convert.business.CrmBusinessConvert; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.mysql.business.CrmBusinessMapper; | |
| 10 | +import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; | |
| 11 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 12 | +import cn.iocoder.yudao.module.crm.framework.enums.OperationTypeEnum; | |
| 13 | +import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; | |
| 14 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateBO; | |
| 15 | +import org.springframework.stereotype.Service; | |
| 16 | +import org.springframework.transaction.annotation.Transactional; | |
| 17 | +import org.springframework.validation.annotation.Validated; | |
| 18 | + | |
| 19 | +import javax.annotation.Resource; | |
| 20 | +import java.util.Collection; | |
| 21 | +import java.util.List; | |
| 22 | + | |
| 23 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.BUSINESS_NOT_EXISTS; | |
| 25 | + | |
| 26 | +/** | |
| 27 | + * 商机 Service 实现类 | |
| 28 | + * | |
| 29 | + * @author ljlleo | |
| 30 | + */ | |
| 31 | +@Service | |
| 32 | +@Validated | |
| 33 | +public class CrmBusinessServiceImpl implements CrmBusinessService { | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private CrmBusinessMapper businessMapper; | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private CrmPermissionService crmPermissionService; | |
| 40 | + | |
| 41 | + @Override | |
| 42 | + @Transactional(rollbackFor = Exception.class) | |
| 43 | + public Long createBusiness(CrmBusinessCreateReqVO createReqVO, Long userId) { | |
| 44 | + // 插入 | |
| 45 | + CrmBusinessDO business = CrmBusinessConvert.INSTANCE.convert(createReqVO); | |
| 46 | + businessMapper.insert(business); | |
| 47 | + | |
| 48 | + // 创建数据权限 | |
| 49 | + crmPermissionService.createCrmPermission(new CrmPermissionCreateBO().setCrmType(CrmEnum.CRM_BUSINESS.getType()) | |
| 50 | + .setCrmDataId(business.getId()).setOwnerUserId(userId)); // 设置当前操作的人为负责人 | |
| 51 | + | |
| 52 | + // 返回 | |
| 53 | + return business.getId(); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Override | |
| 57 | + @Transactional(rollbackFor = Exception.class) | |
| 58 | + @CrmPermission(crmType = CrmEnum.CRM_BUSINESS, operationType = OperationTypeEnum.UPDATE) | |
| 59 | + public void updateBusiness(CrmBusinessUpdateReqVO updateReqVO) { | |
| 60 | + // 校验存在 | |
| 61 | + validateBusinessExists(updateReqVO.getId()); | |
| 62 | + // 更新 | |
| 63 | + CrmBusinessDO updateObj = CrmBusinessConvert.INSTANCE.convert(updateReqVO); | |
| 64 | + businessMapper.updateById(updateObj); | |
| 65 | + } | |
| 66 | + | |
| 67 | + @Override | |
| 68 | + @Transactional(rollbackFor = Exception.class) | |
| 69 | + @CrmPermission(crmType = CrmEnum.CRM_BUSINESS, operationType = OperationTypeEnum.DELETE) | |
| 70 | + public void deleteBusiness(Long id) { | |
| 71 | + // 校验存在 | |
| 72 | + validateBusinessExists(id); | |
| 73 | + // 删除 | |
| 74 | + businessMapper.deleteById(id); | |
| 75 | + } | |
| 76 | + | |
| 77 | + private CrmBusinessDO validateBusinessExists(Long id) { | |
| 78 | + CrmBusinessDO crmBusiness = businessMapper.selectById(id); | |
| 79 | + if (crmBusiness == null) { | |
| 80 | + throw exception(BUSINESS_NOT_EXISTS); | |
| 81 | + } | |
| 82 | + return crmBusiness; | |
| 83 | + } | |
| 84 | + | |
| 85 | + @Override | |
| 86 | + @CrmPermission(crmType = CrmEnum.CRM_BUSINESS, operationType = OperationTypeEnum.READ) | |
| 87 | + public CrmBusinessDO getBusiness(Long id) { | |
| 88 | + return businessMapper.selectById(id); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @Override | |
| 92 | + public List<CrmBusinessDO> getBusinessList(Collection<Long> ids) { | |
| 93 | + if (CollUtil.isEmpty(ids)) { | |
| 94 | + return ListUtil.empty(); | |
| 95 | + } | |
| 96 | + return businessMapper.selectBatchIds(ids); | |
| 97 | + } | |
| 98 | + | |
| 99 | + @Override | |
| 100 | + public PageResult<CrmBusinessDO> getBusinessPage(CrmBusinessPageReqVO pageReqVO) { | |
| 101 | + return businessMapper.selectPage(pageReqVO); | |
| 102 | + } | |
| 103 | + | |
| 104 | + @Override | |
| 105 | + public List<CrmBusinessDO> getBusinessList(CrmBusinessExportReqVO exportReqVO) { | |
| 106 | + return businessMapper.selectList(exportReqVO); | |
| 107 | + } | |
| 108 | + | |
| 109 | + @Override | |
| 110 | + @Transactional(rollbackFor = Exception.class) | |
| 111 | + public void transferBusiness(CrmTransferBusinessReqVO reqVO, Long userId) { | |
| 112 | + // 1 校验商机是否存在 | |
| 113 | + validateBusinessExists(reqVO.getId()); | |
| 114 | + | |
| 115 | + // 2. 数据权限转移 | |
| 116 | + crmPermissionService.transferCrmPermission( | |
| 117 | + CrmBusinessConvert.INSTANCE.convert(reqVO, userId).setCrmType(CrmEnum.CRM_BUSINESS.getType())); | |
| 118 | + | |
| 119 | + } | |
| 120 | + | |
| 121 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/businessstatus/CrmBusinessStatusService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.businessstatus; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusExportReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusUpdateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatus.CrmBusinessStatusDO; | |
| 9 | + | |
| 10 | +import javax.validation.Valid; | |
| 11 | +import java.util.Collection; | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 商机状态 Service 接口 | |
| 16 | + * | |
| 17 | + * @author ljlleo | |
| 18 | + */ | |
| 19 | +public interface CrmBusinessStatusService { | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 创建商机状态 | |
| 23 | + * | |
| 24 | + * @param createReqVO 创建信息 | |
| 25 | + * @return 编号 | |
| 26 | + */ | |
| 27 | + Long createBusinessStatus(@Valid CrmBusinessStatusCreateReqVO createReqVO); | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 更新商机状态 | |
| 31 | + * | |
| 32 | + * @param updateReqVO 更新信息 | |
| 33 | + */ | |
| 34 | + void updateBusinessStatus(@Valid CrmBusinessStatusUpdateReqVO updateReqVO); | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 删除商机状态 | |
| 38 | + * | |
| 39 | + * @param id 编号 | |
| 40 | + */ | |
| 41 | + void deleteBusinessStatus(Long id); | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 获得商机状态 | |
| 45 | + * | |
| 46 | + * @param id 编号 | |
| 47 | + * @return 商机状态 | |
| 48 | + */ | |
| 49 | + CrmBusinessStatusDO getBusinessStatus(Long id); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 获得商机状态列表 | |
| 53 | + * | |
| 54 | + * @param ids 编号 | |
| 55 | + * @return 商机状态列表 | |
| 56 | + */ | |
| 57 | + List<CrmBusinessStatusDO> getBusinessStatusList(Collection<Long> ids); | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 获得商机状态分页 | |
| 61 | + * | |
| 62 | + * @param pageReqVO 分页查询 | |
| 63 | + * @return 商机状态分页 | |
| 64 | + */ | |
| 65 | + PageResult<CrmBusinessStatusDO> getBusinessStatusPage(CrmBusinessStatusPageReqVO pageReqVO); | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 获得商机状态列表, 用于 Excel 导出 | |
| 69 | + * | |
| 70 | + * @param exportReqVO 查询条件 | |
| 71 | + * @return 商机状态列表 | |
| 72 | + */ | |
| 73 | + List<CrmBusinessStatusDO> getBusinessStatusList(CrmBusinessStatusExportReqVO exportReqVO); | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * 根据类型 ID 获得商机状态列表 | |
| 77 | + * | |
| 78 | + * @param typeId 商机状态类型 ID | |
| 79 | + * @return 商机状态列表 | |
| 80 | + */ | |
| 81 | + List<CrmBusinessStatusDO> getBusinessStatusListByTypeId(Integer typeId); | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 获得商机状态列表 | |
| 85 | + * | |
| 86 | + * @return 商机状态列表 | |
| 87 | + */ | |
| 88 | + List<CrmBusinessStatusDO> getBusinessStatusList(); | |
| 89 | + | |
| 90 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/businessstatus/CrmBusinessStatusServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.businessstatus; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusExportReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusPageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusUpdateReqVO; | |
| 10 | +import cn.iocoder.yudao.module.crm.convert.businessstatus.CrmBusinessStatusConvert; | |
| 11 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatus.CrmBusinessStatusDO; | |
| 12 | +import cn.iocoder.yudao.module.crm.dal.mysql.businessstatus.CrmBusinessStatusMapper; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | + | |
| 16 | +import javax.annotation.Resource; | |
| 17 | +import java.util.Collection; | |
| 18 | +import java.util.List; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 21 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.BUSINESS_STATUS_NOT_EXISTS; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 商机状态 Service 实现类 | |
| 25 | + * | |
| 26 | + * @author ljlleo | |
| 27 | + */ | |
| 28 | +@Service | |
| 29 | +@Validated | |
| 30 | +public class CrmBusinessStatusServiceImpl implements CrmBusinessStatusService { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private CrmBusinessStatusMapper businessStatusMapper; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Long createBusinessStatus(CrmBusinessStatusCreateReqVO createReqVO) { | |
| 37 | + // 插入 | |
| 38 | + CrmBusinessStatusDO businessStatus = CrmBusinessStatusConvert.INSTANCE.convert(createReqVO); | |
| 39 | + businessStatusMapper.insert(businessStatus); | |
| 40 | + // 返回 | |
| 41 | + return businessStatus.getId(); | |
| 42 | + } | |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public void updateBusinessStatus(CrmBusinessStatusUpdateReqVO updateReqVO) { | |
| 46 | + // 校验存在 | |
| 47 | + validateBusinessStatusExists(updateReqVO.getId()); | |
| 48 | + // 更新 | |
| 49 | + CrmBusinessStatusDO updateObj = CrmBusinessStatusConvert.INSTANCE.convert(updateReqVO); | |
| 50 | + businessStatusMapper.updateById(updateObj); | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public void deleteBusinessStatus(Long id) { | |
| 55 | + // 校验存在 | |
| 56 | + validateBusinessStatusExists(id); | |
| 57 | + // 删除 | |
| 58 | + businessStatusMapper.deleteById(id); | |
| 59 | + } | |
| 60 | + | |
| 61 | + private void validateBusinessStatusExists(Long id) { | |
| 62 | + if (businessStatusMapper.selectById(id) == null) { | |
| 63 | + throw exception(BUSINESS_STATUS_NOT_EXISTS); | |
| 64 | + } | |
| 65 | + } | |
| 66 | + | |
| 67 | + @Override | |
| 68 | + public CrmBusinessStatusDO getBusinessStatus(Long id) { | |
| 69 | + return businessStatusMapper.selectById(id); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Override | |
| 73 | + public List<CrmBusinessStatusDO> getBusinessStatusList(Collection<Long> ids) { | |
| 74 | + if (CollUtil.isEmpty(ids)) { | |
| 75 | + return ListUtil.empty(); | |
| 76 | + } | |
| 77 | + return businessStatusMapper.selectBatchIds(ids); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public PageResult<CrmBusinessStatusDO> getBusinessStatusPage(CrmBusinessStatusPageReqVO pageReqVO) { | |
| 82 | + return businessStatusMapper.selectPage(pageReqVO); | |
| 83 | + } | |
| 84 | + | |
| 85 | + @Override | |
| 86 | + public List<CrmBusinessStatusDO> getBusinessStatusList(CrmBusinessStatusExportReqVO exportReqVO) { | |
| 87 | + return businessStatusMapper.selectList(exportReqVO); | |
| 88 | + } | |
| 89 | + | |
| 90 | + @Override | |
| 91 | + public List<CrmBusinessStatusDO> getBusinessStatusListByTypeId(Integer typeId) { | |
| 92 | + return businessStatusMapper.getBusinessStatusListByTypeId(typeId); | |
| 93 | + } | |
| 94 | + | |
| 95 | + @Override | |
| 96 | + public List<CrmBusinessStatusDO> getBusinessStatusList() { | |
| 97 | + return businessStatusMapper.selectList(); | |
| 98 | + } | |
| 99 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/businessstatustype/CrmBusinessStatusTypeService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.businessstatustype; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeExportReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypePageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeUpdateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatustype.CrmBusinessStatusTypeDO; | |
| 9 | + | |
| 10 | +import javax.validation.Valid; | |
| 11 | +import java.util.Collection; | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 商机状态类型 Service 接口 | |
| 16 | + * | |
| 17 | + * @author ljlleo | |
| 18 | + */ | |
| 19 | +public interface CrmBusinessStatusTypeService { | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 创建商机状态类型 | |
| 23 | + * | |
| 24 | + * @param createReqVO 创建信息 | |
| 25 | + * @return 编号 | |
| 26 | + */ | |
| 27 | + Long createBusinessStatusType(@Valid CrmBusinessStatusTypeCreateReqVO createReqVO); | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 更新商机状态类型 | |
| 31 | + * | |
| 32 | + * @param updateReqVO 更新信息 | |
| 33 | + */ | |
| 34 | + void updateBusinessStatusType(@Valid CrmBusinessStatusTypeUpdateReqVO updateReqVO); | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 删除商机状态类型 | |
| 38 | + * | |
| 39 | + * @param id 编号 | |
| 40 | + */ | |
| 41 | + void deleteBusinessStatusType(Long id); | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 获得商机状态类型 | |
| 45 | + * | |
| 46 | + * @param id 编号 | |
| 47 | + * @return 商机状态类型 | |
| 48 | + */ | |
| 49 | + CrmBusinessStatusTypeDO getBusinessStatusType(Long id); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 获得商机状态类型列表 | |
| 53 | + * | |
| 54 | + * @param ids 编号 | |
| 55 | + * @return 商机状态类型列表 | |
| 56 | + */ | |
| 57 | + List<CrmBusinessStatusTypeDO> getBusinessStatusTypeList(Collection<Long> ids); | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 获得商机状态类型分页 | |
| 61 | + * | |
| 62 | + * @param pageReqVO 分页查询 | |
| 63 | + * @return 商机状态类型分页 | |
| 64 | + */ | |
| 65 | + PageResult<CrmBusinessStatusTypeDO> getBusinessStatusTypePage(CrmBusinessStatusTypePageReqVO pageReqVO); | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 获得商机状态类型列表, 用于 Excel 导出 | |
| 69 | + * | |
| 70 | + * @param exportReqVO 查询条件 | |
| 71 | + * @return 商机状态类型列表 | |
| 72 | + */ | |
| 73 | + List<CrmBusinessStatusTypeDO> getBusinessStatusTypeList(CrmBusinessStatusTypeExportReqVO exportReqVO); | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * 获得商机状态类型列表 | |
| 77 | + * | |
| 78 | + * @param status 状态 | |
| 79 | + * @return 商机状态类型列表 | |
| 80 | + */ | |
| 81 | + List<CrmBusinessStatusTypeDO> getBusinessStatusTypeListByStatus(Integer status); | |
| 82 | + | |
| 83 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/businessstatustype/CrmBusinessStatusTypeServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.businessstatustype; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeExportReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypePageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeUpdateReqVO; | |
| 10 | +import cn.iocoder.yudao.module.crm.convert.businessstatustype.CrmBusinessStatusTypeConvert; | |
| 11 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatustype.CrmBusinessStatusTypeDO; | |
| 12 | +import cn.iocoder.yudao.module.crm.dal.mysql.businessstatustype.CrmBusinessStatusTypeMapper; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | + | |
| 16 | +import javax.annotation.Resource; | |
| 17 | +import java.util.Collection; | |
| 18 | +import java.util.List; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 21 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.BUSINESS_STATUS_TYPE_NOT_EXISTS; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 商机状态类型 Service 实现类 | |
| 25 | + * | |
| 26 | + * @author ljlleo | |
| 27 | + */ | |
| 28 | +@Service | |
| 29 | +@Validated | |
| 30 | +public class CrmBusinessStatusTypeServiceImpl implements CrmBusinessStatusTypeService { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private CrmBusinessStatusTypeMapper businessStatusTypeMapper; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Long createBusinessStatusType(CrmBusinessStatusTypeCreateReqVO createReqVO) { | |
| 37 | + // TODO ljlleo:name 应该需要唯一哈; | |
| 38 | + // 插入 | |
| 39 | + CrmBusinessStatusTypeDO businessStatusType = CrmBusinessStatusTypeConvert.INSTANCE.convert(createReqVO); | |
| 40 | + businessStatusTypeMapper.insert(businessStatusType); | |
| 41 | + // 返回 | |
| 42 | + return businessStatusType.getId(); | |
| 43 | + } | |
| 44 | + | |
| 45 | + @Override | |
| 46 | + public void updateBusinessStatusType(CrmBusinessStatusTypeUpdateReqVO updateReqVO) { | |
| 47 | + // TODO ljlleo:name 应该需要唯一哈; | |
| 48 | + // 校验存在 | |
| 49 | + validateBusinessStatusTypeExists(updateReqVO.getId()); | |
| 50 | + // 更新 | |
| 51 | + CrmBusinessStatusTypeDO updateObj = CrmBusinessStatusTypeConvert.INSTANCE.convert(updateReqVO); | |
| 52 | + businessStatusTypeMapper.updateById(updateObj); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Override | |
| 56 | + public void deleteBusinessStatusType(Long id) { | |
| 57 | + // 校验存在 | |
| 58 | + validateBusinessStatusTypeExists(id); | |
| 59 | + // TODO 艿艿:这里在看看,是不是要校验业务是否在使用; | |
| 60 | + // 删除 | |
| 61 | + businessStatusTypeMapper.deleteById(id); | |
| 62 | + } | |
| 63 | + | |
| 64 | + private void validateBusinessStatusTypeExists(Long id) { | |
| 65 | + if (businessStatusTypeMapper.selectById(id) == null) { | |
| 66 | + throw exception(BUSINESS_STATUS_TYPE_NOT_EXISTS); | |
| 67 | + } | |
| 68 | + } | |
| 69 | + | |
| 70 | + @Override | |
| 71 | + public CrmBusinessStatusTypeDO getBusinessStatusType(Long id) { | |
| 72 | + return businessStatusTypeMapper.selectById(id); | |
| 73 | + } | |
| 74 | + | |
| 75 | + @Override | |
| 76 | + public List<CrmBusinessStatusTypeDO> getBusinessStatusTypeList(Collection<Long> ids) { | |
| 77 | + if (CollUtil.isEmpty(ids)) { | |
| 78 | + return ListUtil.empty(); | |
| 79 | + } | |
| 80 | + return businessStatusTypeMapper.selectBatchIds(ids); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @Override | |
| 84 | + public PageResult<CrmBusinessStatusTypeDO> getBusinessStatusTypePage(CrmBusinessStatusTypePageReqVO pageReqVO) { | |
| 85 | + return businessStatusTypeMapper.selectPage(pageReqVO); | |
| 86 | + } | |
| 87 | + | |
| 88 | + @Override | |
| 89 | + public List<CrmBusinessStatusTypeDO> getBusinessStatusTypeList(CrmBusinessStatusTypeExportReqVO exportReqVO) { | |
| 90 | + return businessStatusTypeMapper.selectList(exportReqVO); | |
| 91 | + } | |
| 92 | + | |
| 93 | + @Override | |
| 94 | + public List<CrmBusinessStatusTypeDO> getBusinessStatusTypeListByStatus(Integer status) { | |
| 95 | + return businessStatusTypeMapper.getBusinessStatusTypeListByStatus(status); | |
| 96 | + } | |
| 97 | + | |
| 98 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.clue; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import javax.validation.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.*; | |
| 6 | +import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO; | |
| 7 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 线索 Service 接口 | |
| 11 | + * | |
| 12 | + * @author Wanwan | |
| 13 | + */ | |
| 14 | +public interface CrmClueService { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 创建线索 | |
| 18 | + * | |
| 19 | + * @param createReqVO 创建信息 | |
| 20 | + * @return 编号 | |
| 21 | + */ | |
| 22 | + Long createClue(@Valid CrmClueCreateReqVO createReqVO); | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 更新线索 | |
| 26 | + * | |
| 27 | + * @param updateReqVO 更新信息 | |
| 28 | + */ | |
| 29 | + void updateClue(@Valid CrmClueUpdateReqVO updateReqVO); | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 删除线索 | |
| 33 | + * | |
| 34 | + * @param id 编号 | |
| 35 | + */ | |
| 36 | + void deleteClue(Long id); | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 获得线索 | |
| 40 | + * | |
| 41 | + * @param id 编号 | |
| 42 | + * @return 线索 | |
| 43 | + */ | |
| 44 | + CrmClueDO getClue(Long id); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得线索列表 | |
| 48 | + * | |
| 49 | + * @param ids 编号 | |
| 50 | + * @return 线索列表 | |
| 51 | + */ | |
| 52 | + List<CrmClueDO> getClueList(Collection<Long> ids); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得线索分页 | |
| 56 | + * | |
| 57 | + * @param pageReqVO 分页查询 | |
| 58 | + * @return 线索分页 | |
| 59 | + */ | |
| 60 | + PageResult<CrmClueDO> getCluePage(CrmCluePageReqVO pageReqVO); | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 获得线索列表, 用于 Excel 导出 | |
| 64 | + * | |
| 65 | + * @param exportReqVO 查询条件 | |
| 66 | + * @return 线索列表 | |
| 67 | + */ | |
| 68 | + List<CrmClueDO> getClueList(CrmClueExportReqVO exportReqVO); | |
| 69 | + | |
| 70 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.clue; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueExportReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmCluePageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueUpdateReqVO; | |
| 10 | +import cn.iocoder.yudao.module.crm.convert.clue.CrmClueConvert; | |
| 11 | +import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO; | |
| 12 | +import cn.iocoder.yudao.module.crm.dal.mysql.clue.CrmClueMapper; | |
| 13 | +import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; | |
| 14 | +import org.springframework.stereotype.Service; | |
| 15 | +import org.springframework.validation.annotation.Validated; | |
| 16 | + | |
| 17 | +import javax.annotation.Resource; | |
| 18 | +import java.util.Collection; | |
| 19 | +import java.util.List; | |
| 20 | + | |
| 21 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 22 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CLUE_NOT_EXISTS; | |
| 23 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CUSTOMER_NOT_EXISTS; | |
| 24 | + | |
| 25 | +/** | |
| 26 | + * 线索 Service 实现类 | |
| 27 | + * | |
| 28 | + * @author Wanwan | |
| 29 | + */ | |
| 30 | +@Service | |
| 31 | +@Validated | |
| 32 | +public class CrmClueServiceImpl implements CrmClueService { | |
| 33 | + | |
| 34 | + @Resource | |
| 35 | + private CrmClueMapper clueMapper; | |
| 36 | + @Resource | |
| 37 | + private CrmCustomerService customerService; | |
| 38 | + | |
| 39 | + @Override | |
| 40 | + public Long createClue(CrmClueCreateReqVO createReqVO) { | |
| 41 | + // 校验客户是否存在 | |
| 42 | + customerService.validateCustomer(createReqVO.getCustomerId()); | |
| 43 | + // 插入 | |
| 44 | + CrmClueDO clue = CrmClueConvert.INSTANCE.convert(createReqVO); | |
| 45 | + clueMapper.insert(clue); | |
| 46 | + // 返回 | |
| 47 | + return clue.getId(); | |
| 48 | + } | |
| 49 | + | |
| 50 | + @Override | |
| 51 | + public void updateClue(CrmClueUpdateReqVO updateReqVO) { | |
| 52 | + // 校验存在 | |
| 53 | + validateClueExists(updateReqVO.getId()); | |
| 54 | + // 校验客户是否存在 | |
| 55 | + customerService.validateCustomer(updateReqVO.getCustomerId()); | |
| 56 | + | |
| 57 | + // 更新 | |
| 58 | + CrmClueDO updateObj = CrmClueConvert.INSTANCE.convert(updateReqVO); | |
| 59 | + clueMapper.updateById(updateObj); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public void deleteClue(Long id) { | |
| 64 | + // 校验存在 | |
| 65 | + validateClueExists(id); | |
| 66 | + // 删除 | |
| 67 | + clueMapper.deleteById(id); | |
| 68 | + } | |
| 69 | + | |
| 70 | + private void validateClueExists(Long id) { | |
| 71 | + if (clueMapper.selectById(id) == null) { | |
| 72 | + throw exception(CLUE_NOT_EXISTS); | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | + @Override | |
| 77 | + public CrmClueDO getClue(Long id) { | |
| 78 | + return clueMapper.selectById(id); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Override | |
| 82 | + public List<CrmClueDO> getClueList(Collection<Long> ids) { | |
| 83 | + if (CollUtil.isEmpty(ids)) { | |
| 84 | + return ListUtil.empty(); | |
| 85 | + } | |
| 86 | + return clueMapper.selectBatchIds(ids); | |
| 87 | + } | |
| 88 | + | |
| 89 | + @Override | |
| 90 | + public PageResult<CrmClueDO> getCluePage(CrmCluePageReqVO pageReqVO) { | |
| 91 | + return clueMapper.selectPage(pageReqVO); | |
| 92 | + } | |
| 93 | + | |
| 94 | + @Override | |
| 95 | + public List<CrmClueDO> getClueList(CrmClueExportReqVO exportReqVO) { | |
| 96 | + return clueMapper.selectList(exportReqVO); | |
| 97 | + } | |
| 98 | + | |
| 99 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/ContactService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.contact; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contact.ContactDO; | |
| 6 | + | |
| 7 | +import javax.validation.Valid; | |
| 8 | +import java.util.Collection; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * crm联系人 Service 接口 | |
| 13 | + * | |
| 14 | + * @author 芋道源码 | |
| 15 | + */ | |
| 16 | +public interface ContactService { | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 创建crm联系人 | |
| 20 | + * | |
| 21 | + * @param createReqVO 创建信息 | |
| 22 | + * @param userId 用户编号 | |
| 23 | + * @return 编号 | |
| 24 | + */ | |
| 25 | + Long createContact(@Valid ContactCreateReqVO createReqVO, Long userId); | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 更新crm联系人 | |
| 29 | + * | |
| 30 | + * @param updateReqVO 更新信息 | |
| 31 | + */ | |
| 32 | + void updateContact(@Valid ContactUpdateReqVO updateReqVO); | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 删除crm联系人 | |
| 36 | + * | |
| 37 | + * @param id 编号 | |
| 38 | + */ | |
| 39 | + void deleteContact(Long id); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 获得crm联系人 | |
| 43 | + * | |
| 44 | + * @param id 编号 | |
| 45 | + * @return crm联系人 | |
| 46 | + */ | |
| 47 | + ContactDO getContact(Long id); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 获得crm联系人列表 | |
| 51 | + * | |
| 52 | + * @param ids 编号 | |
| 53 | + * @return crm联系人列表 | |
| 54 | + */ | |
| 55 | + List<ContactDO> getContactList(Collection<Long> ids); | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 获得crm联系人分页 | |
| 59 | + * | |
| 60 | + * @param pageReqVO 分页查询 | |
| 61 | + * @return crm联系人分页 | |
| 62 | + */ | |
| 63 | + PageResult<ContactDO> getContactPage(ContactPageReqVO pageReqVO); | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 获得crm联系人列表, 用于 Excel 导出 | |
| 67 | + * | |
| 68 | + * @param exportReqVO 查询条件 | |
| 69 | + * @return crm联系人列表 | |
| 70 | + */ | |
| 71 | + List<ContactDO> getContactList(ContactExportReqVO exportReqVO); | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 联系人编号 | |
| 75 | + * | |
| 76 | + * @param reqVO 请求 | |
| 77 | + * @param userId 用户编号 | |
| 78 | + */ | |
| 79 | + void transferContact(CrmTransferContactReqVO reqVO, Long userId); | |
| 80 | + | |
| 81 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/ContactServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.contact; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.*; | |
| 7 | +import cn.iocoder.yudao.module.crm.convert.contact.ContactConvert; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contact.ContactDO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.mysql.contact.ContactMapper; | |
| 10 | +import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; | |
| 11 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 12 | +import cn.iocoder.yudao.module.crm.framework.enums.OperationTypeEnum; | |
| 13 | +import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; | |
| 14 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateBO; | |
| 15 | +import org.springframework.stereotype.Service; | |
| 16 | +import org.springframework.transaction.annotation.Transactional; | |
| 17 | +import org.springframework.validation.annotation.Validated; | |
| 18 | + | |
| 19 | +import javax.annotation.Resource; | |
| 20 | +import java.util.Collection; | |
| 21 | +import java.util.List; | |
| 22 | + | |
| 23 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CONTACT_NOT_EXISTS; | |
| 25 | + | |
| 26 | +/** | |
| 27 | + * crm联系人 Service 实现类 | |
| 28 | + * | |
| 29 | + * @author 芋道源码 | |
| 30 | + */ | |
| 31 | +@Service | |
| 32 | +@Validated | |
| 33 | +public class ContactServiceImpl implements ContactService { | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private ContactMapper contactMapper; | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private CrmPermissionService crmPermissionService; | |
| 40 | + | |
| 41 | + @Override | |
| 42 | + public Long createContact(ContactCreateReqVO createReqVO, Long userId) { | |
| 43 | + // TODO @customerId:需要校验存在 | |
| 44 | + // 插入 | |
| 45 | + ContactDO contact = ContactConvert.INSTANCE.convert(createReqVO); | |
| 46 | + contactMapper.insert(contact); | |
| 47 | + | |
| 48 | + // 创建数据权限 | |
| 49 | + crmPermissionService.createCrmPermission(new CrmPermissionCreateBO().setCrmType(CrmEnum.CRM_BUSINESS.getType()) | |
| 50 | + .setCrmDataId(contact.getId()).setOwnerUserId(userId)); // 设置当前操作的人为负责人 | |
| 51 | + | |
| 52 | + // 返回 | |
| 53 | + return contact.getId(); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Override | |
| 57 | + @Transactional(rollbackFor = Exception.class) | |
| 58 | + @CrmPermission(crmType = CrmEnum.CRM_CONTACTS, operationType = OperationTypeEnum.UPDATE) | |
| 59 | + public void updateContact(ContactUpdateReqVO updateReqVO) { | |
| 60 | + // 校验存在 | |
| 61 | + validateContactExists(updateReqVO.getId()); | |
| 62 | + // TODO @customerId:需要校验存在 | |
| 63 | + | |
| 64 | + // 更新 | |
| 65 | + ContactDO updateObj = ContactConvert.INSTANCE.convert(updateReqVO); | |
| 66 | + contactMapper.updateById(updateObj); | |
| 67 | + } | |
| 68 | + | |
| 69 | + @Override | |
| 70 | + @Transactional(rollbackFor = Exception.class) | |
| 71 | + @CrmPermission(crmType = CrmEnum.CRM_CONTACTS, operationType = OperationTypeEnum.DELETE) | |
| 72 | + public void deleteContact(Long id) { | |
| 73 | + // 校验存在 | |
| 74 | + validateContactExists(id); | |
| 75 | + // 删除 | |
| 76 | + contactMapper.deleteById(id); | |
| 77 | + } | |
| 78 | + | |
| 79 | + private ContactDO validateContactExists(Long id) { | |
| 80 | + ContactDO contact = contactMapper.selectById(id); | |
| 81 | + if (contact == null) { | |
| 82 | + throw exception(CONTACT_NOT_EXISTS); | |
| 83 | + } | |
| 84 | + return contact; | |
| 85 | + } | |
| 86 | + | |
| 87 | + @Override | |
| 88 | + @CrmPermission(crmType = CrmEnum.CRM_CONTACTS, operationType = OperationTypeEnum.READ) | |
| 89 | + public ContactDO getContact(Long id) { | |
| 90 | + return contactMapper.selectById(id); | |
| 91 | + } | |
| 92 | + | |
| 93 | + @Override | |
| 94 | + public List<ContactDO> getContactList(Collection<Long> ids) { | |
| 95 | + if (CollUtil.isEmpty(ids)) { | |
| 96 | + return ListUtil.empty(); | |
| 97 | + } | |
| 98 | + return contactMapper.selectBatchIds(ids); | |
| 99 | + } | |
| 100 | + | |
| 101 | + @Override | |
| 102 | + public PageResult<ContactDO> getContactPage(ContactPageReqVO pageReqVO) { | |
| 103 | + return contactMapper.selectPage(pageReqVO); | |
| 104 | + } | |
| 105 | + | |
| 106 | + @Override | |
| 107 | + public List<ContactDO> getContactList(ContactExportReqVO exportReqVO) { | |
| 108 | + return contactMapper.selectList(exportReqVO); | |
| 109 | + } | |
| 110 | + | |
| 111 | + @Override | |
| 112 | + public void transferContact(CrmTransferContactReqVO reqVO, Long userId) { | |
| 113 | + // 1 校验联系人是否存在 | |
| 114 | + validateContactExists(reqVO.getId()); | |
| 115 | + | |
| 116 | + // 2. 数据权限转移 | |
| 117 | + crmPermissionService.transferCrmPermission( | |
| 118 | + ContactConvert.INSTANCE.convert(reqVO, userId).setCrmType(CrmEnum.CRM_CONTACTS.getType())); | |
| 119 | + | |
| 120 | + } | |
| 121 | + | |
| 122 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contact/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/ContractService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.contract; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; | |
| 6 | + | |
| 7 | +import javax.validation.Valid; | |
| 8 | +import java.util.Collection; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 合同 Service 接口 | |
| 13 | + * | |
| 14 | + * @author dhb52 | |
| 15 | + */ | |
| 16 | +public interface ContractService { | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 创建合同 | |
| 20 | + * | |
| 21 | + * @param createReqVO 创建信息 | |
| 22 | + * @param userId 用户编号 | |
| 23 | + * @return 编号 | |
| 24 | + */ | |
| 25 | + Long createContract(@Valid ContractCreateReqVO createReqVO, Long userId); | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 更新合同 | |
| 29 | + * | |
| 30 | + * @param updateReqVO 更新信息 | |
| 31 | + */ | |
| 32 | + void updateContract(@Valid ContractUpdateReqVO updateReqVO); | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 删除合同 | |
| 36 | + * | |
| 37 | + * @param id 编号 | |
| 38 | + */ | |
| 39 | + void deleteContract(Long id); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 获得合同 | |
| 43 | + * | |
| 44 | + * @param id 编号 | |
| 45 | + * @return 合同 | |
| 46 | + */ | |
| 47 | + ContractDO getContract(Long id); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 获得合同列表 | |
| 51 | + * | |
| 52 | + * @param ids 编号 | |
| 53 | + * @return 合同列表 | |
| 54 | + */ | |
| 55 | + List<ContractDO> getContractList(Collection<Long> ids); | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 获得合同分页 | |
| 59 | + * | |
| 60 | + * @param pageReqVO 分页查询 | |
| 61 | + * @return 合同分页 | |
| 62 | + */ | |
| 63 | + PageResult<ContractDO> getContractPage(ContractPageReqVO pageReqVO); | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 获得合同列表, 用于 Excel 导出 | |
| 67 | + * | |
| 68 | + * @param exportReqVO 查询条件 | |
| 69 | + * @return 合同列表 | |
| 70 | + */ | |
| 71 | + List<ContractDO> getContractList(ContractExportReqVO exportReqVO); | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 合同转移 | |
| 75 | + * | |
| 76 | + * @param reqVO 请求 | |
| 77 | + * @param userId 用户编号 | |
| 78 | + */ | |
| 79 | + void transferContract(CrmTransferContractReqVO reqVO, Long userId); | |
| 80 | + | |
| 81 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/ContractServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.contract; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.*; | |
| 7 | +import cn.iocoder.yudao.module.crm.convert.contract.ContractConvert; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.mysql.contract.ContractMapper; | |
| 10 | +import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; | |
| 11 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 12 | +import cn.iocoder.yudao.module.crm.framework.enums.OperationTypeEnum; | |
| 13 | +import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; | |
| 14 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateBO; | |
| 15 | +import org.springframework.stereotype.Service; | |
| 16 | +import org.springframework.transaction.annotation.Transactional; | |
| 17 | +import org.springframework.validation.annotation.Validated; | |
| 18 | + | |
| 19 | +import javax.annotation.Resource; | |
| 20 | +import java.util.Collection; | |
| 21 | +import java.util.List; | |
| 22 | + | |
| 23 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CONTRACT_NOT_EXISTS; | |
| 25 | + | |
| 26 | +/** | |
| 27 | + * 合同 Service 实现类 | |
| 28 | + * | |
| 29 | + * @author dhb52 | |
| 30 | + */ | |
| 31 | +@Service | |
| 32 | +@Validated | |
| 33 | +public class ContractServiceImpl implements ContractService { | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private ContractMapper contractMapper; | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private CrmPermissionService crmPermissionService; | |
| 40 | + | |
| 41 | + @Override | |
| 42 | + public Long createContract(ContractCreateReqVO createReqVO, Long userId) { | |
| 43 | + // 插入 | |
| 44 | + ContractDO contract = ContractConvert.INSTANCE.convert(createReqVO); | |
| 45 | + contractMapper.insert(contract); | |
| 46 | + | |
| 47 | + // 创建数据权限 | |
| 48 | + crmPermissionService.createCrmPermission(new CrmPermissionCreateBO().setCrmType(CrmEnum.CRM_CONTRACT.getType()) | |
| 49 | + .setCrmDataId(contract.getId()).setOwnerUserId(userId)); // 设置当前操作的人为负责人 | |
| 50 | + | |
| 51 | + // 返回 | |
| 52 | + return contract.getId(); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Override | |
| 56 | + @Transactional(rollbackFor = Exception.class) | |
| 57 | + @CrmPermission(crmType = CrmEnum.CRM_CONTRACT, operationType = OperationTypeEnum.DELETE) | |
| 58 | + public void updateContract(ContractUpdateReqVO updateReqVO) { | |
| 59 | + // 校验存在 | |
| 60 | + validateContractExists(updateReqVO.getId()); | |
| 61 | + // 更新 | |
| 62 | + ContractDO updateObj = ContractConvert.INSTANCE.convert(updateReqVO); | |
| 63 | + contractMapper.updateById(updateObj); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @Override | |
| 67 | + @Transactional(rollbackFor = Exception.class) | |
| 68 | + @CrmPermission(crmType = CrmEnum.CRM_CONTRACT, operationType = OperationTypeEnum.DELETE) | |
| 69 | + public void deleteContract(Long id) { | |
| 70 | + // 校验存在 | |
| 71 | + validateContractExists(id); | |
| 72 | + // 删除 | |
| 73 | + contractMapper.deleteById(id); | |
| 74 | + } | |
| 75 | + | |
| 76 | + private ContractDO validateContractExists(Long id) { | |
| 77 | + ContractDO contract = contractMapper.selectById(id); | |
| 78 | + if (contract == null) { | |
| 79 | + throw exception(CONTRACT_NOT_EXISTS); | |
| 80 | + } | |
| 81 | + return contract; | |
| 82 | + } | |
| 83 | + | |
| 84 | + @Override | |
| 85 | + @CrmPermission(crmType = CrmEnum.CRM_CONTRACT, operationType = OperationTypeEnum.READ) | |
| 86 | + public ContractDO getContract(Long id) { | |
| 87 | + return contractMapper.selectById(id); | |
| 88 | + } | |
| 89 | + | |
| 90 | + @Override | |
| 91 | + public List<ContractDO> getContractList(Collection<Long> ids) { | |
| 92 | + if (CollUtil.isEmpty(ids)) { | |
| 93 | + return ListUtil.empty(); | |
| 94 | + } | |
| 95 | + return contractMapper.selectBatchIds(ids); | |
| 96 | + } | |
| 97 | + | |
| 98 | + @Override | |
| 99 | + public PageResult<ContractDO> getContractPage(ContractPageReqVO pageReqVO) { | |
| 100 | + return contractMapper.selectPage(pageReqVO); | |
| 101 | + } | |
| 102 | + | |
| 103 | + @Override | |
| 104 | + public List<ContractDO> getContractList(ContractExportReqVO exportReqVO) { | |
| 105 | + return contractMapper.selectList(exportReqVO); | |
| 106 | + } | |
| 107 | + | |
| 108 | + @Override | |
| 109 | + @Transactional(rollbackFor = Exception.class) | |
| 110 | + public void transferContract(CrmTransferContractReqVO reqVO, Long userId) { | |
| 111 | + // 1 校验合同是否存在 | |
| 112 | + validateContractExists(reqVO.getId()); | |
| 113 | + | |
| 114 | + // 2. 数据权限转移 | |
| 115 | + crmPermissionService.transferCrmPermission( | |
| 116 | + ContractConvert.INSTANCE.convert(reqVO, userId).setCrmType(CrmEnum.CRM_CONTRACT.getType())); | |
| 117 | + | |
| 118 | + } | |
| 119 | + | |
| 120 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.customer; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | |
| 6 | + | |
| 7 | +import javax.validation.Valid; | |
| 8 | +import java.util.Collection; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 客户 Service 接口 | |
| 13 | + * | |
| 14 | + * @author Wanwan | |
| 15 | + */ | |
| 16 | +public interface CrmCustomerService { | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 创建客户 | |
| 20 | + * | |
| 21 | + * @param createReqVO 创建信息 | |
| 22 | + * @param userId 用户编号 | |
| 23 | + * @return 编号 | |
| 24 | + */ | |
| 25 | + Long createCustomer(@Valid CrmCustomerCreateReqVO createReqVO, Long userId); | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 更新客户 | |
| 29 | + * | |
| 30 | + * @param updateReqVO 更新信息 | |
| 31 | + */ | |
| 32 | + void updateCustomer(@Valid CrmCustomerUpdateReqVO updateReqVO); | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 删除客户 | |
| 36 | + * | |
| 37 | + * @param id 编号 | |
| 38 | + */ | |
| 39 | + void deleteCustomer(Long id); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 获得客户 | |
| 43 | + * | |
| 44 | + * @param id 编号 | |
| 45 | + * @return 客户 | |
| 46 | + */ | |
| 47 | + CrmCustomerDO getCustomer(Long id); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 获得客户列表 | |
| 51 | + * | |
| 52 | + * @param ids 编号 | |
| 53 | + * @return 客户列表 | |
| 54 | + */ | |
| 55 | + List<CrmCustomerDO> getCustomerList(Collection<Long> ids); | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 获得客户分页 | |
| 59 | + * | |
| 60 | + * @param pageReqVO 分页查询 | |
| 61 | + * @return 客户分页 | |
| 62 | + */ | |
| 63 | + PageResult<CrmCustomerDO> getCustomerPage(CrmCustomerPageReqVO pageReqVO); | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 获得客户列表, 用于 Excel 导出 | |
| 67 | + * | |
| 68 | + * @param exportReqVO 查询条件 | |
| 69 | + * @return 客户列表 | |
| 70 | + */ | |
| 71 | + List<CrmCustomerDO> getCustomerList(CrmCustomerExportReqVO exportReqVO); | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 校验客户是否存在 | |
| 75 | + * | |
| 76 | + * @param customerId 客户 id | |
| 77 | + * @return 客户 | |
| 78 | + */ | |
| 79 | + CrmCustomerDO validateCustomer(Long customerId); | |
| 80 | + | |
| 81 | + /** | |
| 82 | + * 客户转移 | |
| 83 | + * | |
| 84 | + * @param reqVO 请求 | |
| 85 | + * @param userId 用户编号 | |
| 86 | + */ | |
| 87 | + void transferCustomer(CrmTransferCustomerReqVO reqVO, Long userId); | |
| 88 | + | |
| 89 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.customer; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.*; | |
| 7 | +import cn.iocoder.yudao.module.crm.convert.customer.CrmCustomerConvert; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.mysql.customer.CrmCustomerMapper; | |
| 10 | +import cn.iocoder.yudao.module.crm.framework.core.annotations.CrmPermission; | |
| 11 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 12 | +import cn.iocoder.yudao.module.crm.framework.enums.OperationTypeEnum; | |
| 13 | +import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService; | |
| 14 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateBO; | |
| 15 | +import cn.iocoder.yudao.module.system.api.dept.DeptApi; | |
| 16 | +import org.springframework.stereotype.Service; | |
| 17 | +import org.springframework.transaction.annotation.Transactional; | |
| 18 | +import org.springframework.validation.annotation.Validated; | |
| 19 | + | |
| 20 | +import javax.annotation.Resource; | |
| 21 | +import java.util.Collection; | |
| 22 | +import java.util.List; | |
| 23 | +import java.util.Objects; | |
| 24 | + | |
| 25 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 26 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CUSTOMER_NOT_EXISTS; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * 客户 Service 实现类 | |
| 30 | + * | |
| 31 | + * @author Wanwan | |
| 32 | + */ | |
| 33 | +@Service | |
| 34 | +@Validated | |
| 35 | +public class CrmCustomerServiceImpl implements CrmCustomerService { | |
| 36 | + | |
| 37 | + @Resource | |
| 38 | + private CrmCustomerMapper customerMapper; | |
| 39 | + @Resource | |
| 40 | + private DeptApi deptApi; // TODO @wanwan:拼接数据,可以放到 controller;所以这里的引入,可以考虑放到 controller 哈; | |
| 41 | + @Resource | |
| 42 | + private CrmPermissionService crmPermissionService; | |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public Long createCustomer(CrmCustomerCreateReqVO createReqVO, Long userId) { | |
| 46 | + // 插入 | |
| 47 | + CrmCustomerDO customer = CrmCustomerConvert.INSTANCE.convert(createReqVO); | |
| 48 | + customerMapper.insert(customer); | |
| 49 | + | |
| 50 | + // 创建数据权限 | |
| 51 | + crmPermissionService.createCrmPermission(new CrmPermissionCreateBO().setCrmType(CrmEnum.CRM_CUSTOMER.getType()) | |
| 52 | + .setCrmDataId(customer.getId()).setOwnerUserId(userId)); // 设置当前操作的人为负责人 | |
| 53 | + | |
| 54 | + // 返回 | |
| 55 | + return customer.getId(); | |
| 56 | + } | |
| 57 | + | |
| 58 | + @Override | |
| 59 | + @Transactional(rollbackFor = Exception.class) | |
| 60 | + @CrmPermission(crmType = CrmEnum.CRM_CUSTOMER, operationType = OperationTypeEnum.UPDATE) | |
| 61 | + public void updateCustomer(CrmCustomerUpdateReqVO updateReqVO) { | |
| 62 | + // 校验存在 | |
| 63 | + validateCustomerExists(updateReqVO.getId()); | |
| 64 | + // TODO 芋艿:数据权限,校验是否可以操作 | |
| 65 | + | |
| 66 | + // 更新 | |
| 67 | + CrmCustomerDO updateObj = CrmCustomerConvert.INSTANCE.convert(updateReqVO); | |
| 68 | + customerMapper.updateById(updateObj); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Override | |
| 72 | + @Transactional(rollbackFor = Exception.class) | |
| 73 | + @CrmPermission(crmType = CrmEnum.CRM_CUSTOMER, operationType = OperationTypeEnum.DELETE) | |
| 74 | + public void deleteCustomer(Long id) { | |
| 75 | + // 校验存在 | |
| 76 | + validateCustomerExists(id); | |
| 77 | + // TODO 芋艿:数据权限,校验是否可以操作 | |
| 78 | + | |
| 79 | + // 删除 | |
| 80 | + customerMapper.deleteById(id); | |
| 81 | + } | |
| 82 | + | |
| 83 | + private void validateCustomerExists(Long id) { | |
| 84 | + if (customerMapper.selectById(id) == null) { | |
| 85 | + throw exception(CUSTOMER_NOT_EXISTS); | |
| 86 | + } | |
| 87 | + } | |
| 88 | + | |
| 89 | + @Override | |
| 90 | + @CrmPermission(crmType = CrmEnum.CRM_CUSTOMER, operationType = OperationTypeEnum.READ) | |
| 91 | + public CrmCustomerDO getCustomer(Long id) { | |
| 92 | + return customerMapper.selectById(id); | |
| 93 | + } | |
| 94 | + | |
| 95 | + @Override | |
| 96 | + public List<CrmCustomerDO> getCustomerList(Collection<Long> ids) { | |
| 97 | + if (CollUtil.isEmpty(ids)) { | |
| 98 | + return ListUtil.empty(); | |
| 99 | + } | |
| 100 | + return customerMapper.selectBatchIds(ids); | |
| 101 | + } | |
| 102 | + | |
| 103 | + @Override | |
| 104 | + public PageResult<CrmCustomerDO> getCustomerPage(CrmCustomerPageReqVO pageReqVO) { | |
| 105 | + // TODO 芋艿:数据权限,是否可以查询到; | |
| 106 | + return customerMapper.selectPage(pageReqVO); | |
| 107 | + } | |
| 108 | + | |
| 109 | + @Override | |
| 110 | + public List<CrmCustomerDO> getCustomerList(CrmCustomerExportReqVO exportReqVO) { | |
| 111 | + return customerMapper.selectList(exportReqVO); | |
| 112 | + } | |
| 113 | + | |
| 114 | + // TODO wanwan:service 接口已经注释,实现类就不需要了。 | |
| 115 | + /** | |
| 116 | + * 校验客户是否存在 | |
| 117 | + * | |
| 118 | + * @param customerId 客户 id | |
| 119 | + * @return 客户 | |
| 120 | + */ | |
| 121 | + @Override | |
| 122 | + public CrmCustomerDO validateCustomer(Long customerId) { | |
| 123 | + CrmCustomerDO customer = getCustomer(customerId); | |
| 124 | + if (Objects.isNull(customer)) { | |
| 125 | + throw exception(CUSTOMER_NOT_EXISTS); | |
| 126 | + } | |
| 127 | + return customer; | |
| 128 | + } | |
| 129 | + | |
| 130 | + @Override | |
| 131 | + @Transactional(rollbackFor = Exception.class) | |
| 132 | + public void transferCustomer(CrmTransferCustomerReqVO reqVO, Long userId) { | |
| 133 | + // 1. 校验合同是否存在 | |
| 134 | + validateCustomer(reqVO.getId()); | |
| 135 | + | |
| 136 | + // 2. 数据权限转移 | |
| 137 | + crmPermissionService.transferCrmPermission( | |
| 138 | + CrmCustomerConvert.INSTANCE.convert(reqVO, userId).setCrmType(CrmEnum.CRM_CUSTOMER.getType())); | |
| 139 | + } | |
| 140 | + | |
| 141 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/permission/CrmPermissionService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.permission; | |
| 2 | + | |
| 3 | + | |
| 4 | +import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; | |
| 5 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 6 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateBO; | |
| 7 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionUpdateBO; | |
| 8 | +import cn.iocoder.yudao.module.crm.service.permission.bo.TransferCrmPermissionBO; | |
| 9 | + | |
| 10 | +import javax.validation.Valid; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * crm 数据权限 Service 接口 | |
| 14 | + * | |
| 15 | + * @author HUIHUI | |
| 16 | + */ | |
| 17 | +public interface CrmPermissionService { | |
| 18 | + | |
| 19 | + // TODO @puhui999:方法名上,不用 Crm | |
| 20 | + /** | |
| 21 | + * 创建数据权限 | |
| 22 | + * | |
| 23 | + * @param createBO 创建信息 | |
| 24 | + * @return 编号 | |
| 25 | + */ | |
| 26 | + Long createCrmPermission(@Valid CrmPermissionCreateBO createBO); | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 更新数据权限 | |
| 30 | + * | |
| 31 | + * @param updateBO 更新信息 | |
| 32 | + */ | |
| 33 | + void updateCrmPermission(@Valid CrmPermissionUpdateBO updateBO); | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 删除数据权限 | |
| 37 | + * | |
| 38 | + * @param id 编号 | |
| 39 | + */ | |
| 40 | + void deleteCrmPermission(Long id); | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 获得数据权限 | |
| 44 | + * | |
| 45 | + * @param crmType 数据类型 关联 {@link CrmEnum} | |
| 46 | + * @param crmDataId 数据编号 关联 {@link CrmEnum} 对应模块 DO#getId() | |
| 47 | + * @return 数据权限 | |
| 48 | + */ | |
| 49 | + CrmPermissionDO getCrmPermissionByCrmTypeAndCrmDataId(Integer crmType, Long crmDataId); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 数据权限转移 | |
| 53 | + * | |
| 54 | + * @param transferCrmPermissionBO 数据权限转移请求 | |
| 55 | + */ | |
| 56 | + void transferCrmPermission(@Valid TransferCrmPermissionBO transferCrmPermissionBO); | |
| 57 | + | |
| 58 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/permission/CrmPermissionServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.permission; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.util.ObjUtil; | |
| 5 | +import cn.iocoder.yudao.module.crm.convert.permission.CrmPermissionConvert; | |
| 6 | +import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; | |
| 7 | +import cn.iocoder.yudao.module.crm.dal.mysql.permission.CrmPermissionMapper; | |
| 8 | +import cn.iocoder.yudao.module.crm.enums.common.PermissionTypeEnum; | |
| 9 | +import cn.iocoder.yudao.module.crm.enums.common.TransferTypeEnum; | |
| 10 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 11 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateBO; | |
| 12 | +import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionUpdateBO; | |
| 13 | +import cn.iocoder.yudao.module.crm.service.permission.bo.TransferCrmPermissionBO; | |
| 14 | +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; | |
| 15 | +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; | |
| 16 | +import org.springframework.stereotype.Service; | |
| 17 | +import org.springframework.transaction.annotation.Transactional; | |
| 18 | +import org.springframework.validation.annotation.Validated; | |
| 19 | + | |
| 20 | +import javax.annotation.Resource; | |
| 21 | +import java.util.Set; | |
| 22 | + | |
| 23 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*; | |
| 25 | + | |
| 26 | +/** | |
| 27 | + * crm 数据权限 Service 接口实现类 | |
| 28 | + * | |
| 29 | + * @author HUIHUI | |
| 30 | + */ | |
| 31 | +@Service | |
| 32 | +@Validated | |
| 33 | +public class CrmPermissionServiceImpl implements CrmPermissionService { | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private CrmPermissionMapper crmPermissionMapper; | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private AdminUserApi adminUserApi; | |
| 40 | + | |
| 41 | + @Override | |
| 42 | + @Transactional(rollbackFor = Exception.class) | |
| 43 | + public Long createCrmPermission(CrmPermissionCreateBO createBO) { | |
| 44 | + // TODO @puhui999:createDO 改成 permission,保持统一哈; | |
| 45 | + CrmPermissionDO createDO = CrmPermissionConvert.INSTANCE.convert(createBO); | |
| 46 | + crmPermissionMapper.insert(createDO); | |
| 47 | + return createDO.getId(); | |
| 48 | + } | |
| 49 | + | |
| 50 | + @Override | |
| 51 | + @Transactional(rollbackFor = Exception.class) | |
| 52 | + public void updateCrmPermission(CrmPermissionUpdateBO updateBO) { | |
| 53 | + validateCrmPermissionExists(updateBO.getId()); | |
| 54 | + // 更新操作 | |
| 55 | + CrmPermissionDO updateDO = CrmPermissionConvert.INSTANCE.convert(updateBO); | |
| 56 | + crmPermissionMapper.updateById(updateDO); | |
| 57 | + } | |
| 58 | + | |
| 59 | + @Override | |
| 60 | + @Transactional(rollbackFor = Exception.class) | |
| 61 | + public void deleteCrmPermission(Long id) { | |
| 62 | + validateCrmPermissionExists(id); | |
| 63 | + // 删除 | |
| 64 | + crmPermissionMapper.deleteById(id); | |
| 65 | + } | |
| 66 | + | |
| 67 | + private void validateCrmPermissionExists(Long id) { | |
| 68 | + if (crmPermissionMapper.selectById(id) == null) { | |
| 69 | + throw exception(CRM_PERMISSION_NOT_EXISTS); | |
| 70 | + } | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Override | |
| 74 | + public CrmPermissionDO getCrmPermissionByCrmTypeAndCrmDataId(Integer crmType, Long crmDataId) { | |
| 75 | + return crmPermissionMapper.selectByCrmTypeAndCrmDataId(crmType, crmDataId); | |
| 76 | + } | |
| 77 | + | |
| 78 | + // TODO @puhui999:参数名,是不是 transferReqBO | |
| 79 | + @Override | |
| 80 | + public void transferCrmPermission(TransferCrmPermissionBO transferCrmPermissionBO) { | |
| 81 | + // 1.1 校验商机是否存在 | |
| 82 | + // TODO puhui999:这里直接调用 crmPermissionMapper 的 selectByCrmTypeAndCrmDataId 方法,会更简洁一点; | |
| 83 | + CrmPermissionDO permission = getCrmPermissionByCrmTypeAndCrmDataId(transferCrmPermissionBO.getCrmType(), | |
| 84 | + transferCrmPermissionBO.getCrmDataId()); | |
| 85 | + String crmName = CrmEnum.getNameByType(transferCrmPermissionBO.getCrmType()); | |
| 86 | + if (permission == null) { | |
| 87 | + throw exception(CRM_PERMISSION_MODEL_NOT_EXISTS, crmName); | |
| 88 | + } | |
| 89 | + // 1.2 校验转移对象是否已经是该负责人 | |
| 90 | + if (ObjUtil.equal(permission.getOwnerUserId(), permission.getOwnerUserId())) { | |
| 91 | + // TODO @puhui999:是不是这个错误码不太对。。。 | |
| 92 | + throw exception(CRM_PERMISSION_MODEL_TRANSFER_FAIL_OWNER_USER_NOT_EXISTS, crmName); | |
| 93 | + } | |
| 94 | + // 1.3 校验新负责人是否存在 | |
| 95 | + AdminUserRespDTO user = adminUserApi.getUser(permission.getOwnerUserId()); | |
| 96 | + if (user == null) { | |
| 97 | + throw exception(CRM_PERMISSION_MODEL_TRANSFER_FAIL_OWNER_USER_EXISTS, crmName); | |
| 98 | + } | |
| 99 | + // TODO 校验是否为超级管理员 || 1.4 | |
| 100 | + // 1.4 校验是否有写权限 | |
| 101 | + // TODO puhui999:CollUtil.contains 就够了,不用后面写个表达式; | |
| 102 | + if (!CollUtil.contains(permission.getRwUserIds(), id -> ObjUtil.equal(id, transferCrmPermissionBO.getUserId()))) { | |
| 103 | + throw exception(CRM_PERMISSION_DENIED, crmName); | |
| 104 | + } | |
| 105 | + | |
| 106 | + // 2. 权限转移 | |
| 107 | + CrmPermissionDO updateCrmPermission = new CrmPermissionDO().setId(permission.getId()) | |
| 108 | + .setOwnerUserId(transferCrmPermissionBO.getOwnerUserId()); | |
| 109 | + if (ObjUtil.equal(TransferTypeEnum.TEAM.getType(), transferCrmPermissionBO.getTransferType())) { | |
| 110 | + if (ObjUtil.equal(PermissionTypeEnum.READONLY.getType(), transferCrmPermissionBO.getPermissionType())) { | |
| 111 | + Set<Long> roUserIds = permission.getRoUserIds(); | |
| 112 | + roUserIds.add(permission.getOwnerUserId()); // 老负责人加入团队有只读权限 | |
| 113 | + updateCrmPermission.setRoUserIds(roUserIds); | |
| 114 | + } | |
| 115 | + if (ObjUtil.equal(PermissionTypeEnum.READ_AND_WRITE.getType(), transferCrmPermissionBO.getPermissionType())) { | |
| 116 | + Set<Long> rwUserIds = permission.getRwUserIds(); | |
| 117 | + rwUserIds.add(permission.getOwnerUserId()); // 老负责人加入团队有读写权限 | |
| 118 | + updateCrmPermission.setRoUserIds(rwUserIds); | |
| 119 | + } | |
| 120 | + } | |
| 121 | + crmPermissionMapper.updateById(updateCrmPermission); | |
| 122 | + | |
| 123 | + // 3. TODO 记录机转移日志 | |
| 124 | + // TODO @puhui999:是不是交给业务记录哈; | |
| 125 | + } | |
| 126 | + | |
| 127 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/permission/bo/CrmPermissionCreateBO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.permission.bo; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import javax.validation.constraints.NotNull; | |
| 7 | +import java.util.Set; | |
| 8 | + | |
| 9 | +// TODO @puhui999:,一个是 Crm 前缀,一个 Req 表示入参 | |
| 10 | +/** | |
| 11 | + * crm 数据权限 Create BO | |
| 12 | + * | |
| 13 | + * @author HUIHUI | |
| 14 | + */ | |
| 15 | +@Data | |
| 16 | +public class CrmPermissionCreateBO { | |
| 17 | + | |
| 18 | + // TODO @puhui999:如果是关联字段,换一行写它的注释;不然看着略乱哈 | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * Crm 类型 关联 {@link CrmEnum} | |
| 22 | + */ | |
| 23 | + @NotNull(message = "Crm 类型不能为空") | |
| 24 | + private Integer crmType; | |
| 25 | + /** | |
| 26 | + * 数据编号 关联 {@link CrmEnum} 对应模块 DO#getId() | |
| 27 | + */ | |
| 28 | + @NotNull(message = "Crm 数据编号不能为空") | |
| 29 | + private Long crmDataId; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 负责人的用户编号 关联 AdminUser#id, null 则为公海数据 | |
| 33 | + */ | |
| 34 | + private Long ownerUserId; | |
| 35 | + /** | |
| 36 | + * 只读权限的用户编号数组 | |
| 37 | + */ | |
| 38 | + private Set<Long> roUserIds; | |
| 39 | + /** | |
| 40 | + * 读写权限的用户编号数组 | |
| 41 | + */ | |
| 42 | + private Set<Long> rwUserIds; | |
| 43 | + | |
| 44 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/permission/bo/CrmPermissionUpdateBO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.permission.bo; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; | |
| 4 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +import javax.validation.constraints.NotNull; | |
| 8 | +import java.util.Set; | |
| 9 | + | |
| 10 | +// TODO @puhui999:,一个是 Crm 前缀,一个 Req 表示入参 | |
| 11 | +/** | |
| 12 | + * crm 数据权限 Update BO | |
| 13 | + * | |
| 14 | + * @author HUIHUI | |
| 15 | + */ | |
| 16 | +@Data | |
| 17 | +public class CrmPermissionUpdateBO { | |
| 18 | + | |
| 19 | + // TODO @puhui999:id 和 crmType + crmDataId 是不是重叠了; | |
| 20 | + /** | |
| 21 | + * 数据权限编号 {@link CrmPermissionDO#getId()} | |
| 22 | + */ | |
| 23 | + @NotNull(message = "Crm 数据权限编号不能为空") | |
| 24 | + private Long id; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * Crm 类型 关联 {@link CrmEnum} | |
| 28 | + */ | |
| 29 | + @NotNull(message = "Crm 类型不能为空") | |
| 30 | + private Integer crmType; | |
| 31 | + /** | |
| 32 | + * 数据编号 关联 {@link CrmEnum} 对应模块 DO#getId() | |
| 33 | + */ | |
| 34 | + @NotNull(message = "Crm 数据编号不能为空") | |
| 35 | + private Long crmDataId; | |
| 36 | + /** | |
| 37 | + * 负责人的用户编号 关联 AdminUser#id, null 则为公海数据 | |
| 38 | + */ | |
| 39 | + private Long ownerUserId; | |
| 40 | + /** | |
| 41 | + * 只读权限的用户编号数组 | |
| 42 | + */ | |
| 43 | + private Set<Long> roUserIds; | |
| 44 | + /** | |
| 45 | + * 读写权限的用户编号数组 | |
| 46 | + */ | |
| 47 | + private Set<Long> rwUserIds; | |
| 48 | + | |
| 49 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/permission/bo/TransferCrmPermissionBO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.permission.bo; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.crm.enums.common.PermissionTypeEnum; | |
| 4 | +import cn.iocoder.yudao.module.crm.enums.common.TransferTypeEnum; | |
| 5 | +import cn.iocoder.yudao.module.crm.framework.enums.CrmEnum; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +import javax.validation.constraints.NotNull; | |
| 9 | + | |
| 10 | +// TODO @puhui999:CrmTransferPermissionReqBO,一个是 Crm 前缀,一个 Req 表示入参 | |
| 11 | +/** | |
| 12 | + * 数据权限转移 BO | |
| 13 | + * | |
| 14 | + * @author HUIHUI | |
| 15 | + */ | |
| 16 | +@Data | |
| 17 | +public class TransferCrmPermissionBO { | |
| 18 | + | |
| 19 | + // TODO @puhui999:参数的注释 | |
| 20 | + @NotNull(message = "用户编号不能为空") | |
| 21 | + private Long userId; | |
| 22 | + | |
| 23 | + // TODO @puhui999:bizType | |
| 24 | + /** | |
| 25 | + * Crm 类型 关联 {@link CrmEnum} TODO 这种不用再写关联了,直接 @InEnum 参数校验 | |
| 26 | + */ | |
| 27 | + @NotNull(message = "Crm 类型不能为空") | |
| 28 | + private Integer crmType; | |
| 29 | + | |
| 30 | + // TODO @puhui999:bizId | |
| 31 | + /** | |
| 32 | + * 数据编号 | |
| 33 | + */ | |
| 34 | + @NotNull(message = "Crm 数据编号不能为空") | |
| 35 | + private Long crmDataId; | |
| 36 | + | |
| 37 | + // TODO @puhui999:要不这里改成 newOwnerUserId;然后,transferType 和 permissionType,合并成 oldOwnerPermission(空就是移除) | |
| 38 | + @NotNull(message = "新负责人的用户编号不能为空") | |
| 39 | + private Long ownerUserId; | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 原负责人移除方式, 关联 {@link TransferTypeEnum} TODO 这种不用再写关联了,直接 @InEnum 参数校验 | |
| 43 | + */ | |
| 44 | + @NotNull(message = "原负责人移除方式不能为空") | |
| 45 | + private Integer transferType; | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 权限类型, 关联 {@link PermissionTypeEnum} | |
| 49 | + */ | |
| 50 | + @NotNull(message = "权限类型不能为空") | |
| 51 | + private Integer permissionType; | |
| 52 | + | |
| 53 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/product/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.receivable; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import javax.validation.*; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; | |
| 6 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; | |
| 7 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 回款计划 Service 接口 | |
| 11 | + * | |
| 12 | + * @author 芋道源码 | |
| 13 | + */ | |
| 14 | +public interface ReceivablePlanService { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 创建回款计划 | |
| 18 | + * | |
| 19 | + * @param createReqVO 创建信息 | |
| 20 | + * @return 编号 | |
| 21 | + */ | |
| 22 | + Long createReceivablePlan(@Valid ReceivablePlanCreateReqVO createReqVO); | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 更新回款计划 | |
| 26 | + * | |
| 27 | + * @param updateReqVO 更新信息 | |
| 28 | + */ | |
| 29 | + void updateReceivablePlan(@Valid ReceivablePlanUpdateReqVO updateReqVO); | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 删除回款计划 | |
| 33 | + * | |
| 34 | + * @param id 编号 | |
| 35 | + */ | |
| 36 | + void deleteReceivablePlan(Long id); | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 获得回款计划 | |
| 40 | + * | |
| 41 | + * @param id 编号 | |
| 42 | + * @return 回款计划 | |
| 43 | + */ | |
| 44 | + ReceivablePlanDO getReceivablePlan(Long id); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得回款计划列表 | |
| 48 | + * | |
| 49 | + * @param ids 编号 | |
| 50 | + * @return 回款计划列表 | |
| 51 | + */ | |
| 52 | + List<ReceivablePlanDO> getReceivablePlanList(Collection<Long> ids); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得回款计划分页 | |
| 56 | + * | |
| 57 | + * @param pageReqVO 分页查询 | |
| 58 | + * @return 回款计划分页 | |
| 59 | + */ | |
| 60 | + PageResult<ReceivablePlanDO> getReceivablePlanPage(ReceivablePlanPageReqVO pageReqVO); | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 获得回款计划列表, 用于 Excel 导出 | |
| 64 | + * | |
| 65 | + * @param exportReqVO 查询条件 | |
| 66 | + * @return 回款计划列表 | |
| 67 | + */ | |
| 68 | + List<ReceivablePlanDO> getReceivablePlanList(ReceivablePlanExportReqVO exportReqVO); | |
| 69 | + | |
| 70 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.receivable; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.hutool.core.util.ObjectUtil; | |
| 6 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 7 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanCreateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanExportReqVO; | |
| 10 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanPageReqVO; | |
| 11 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanUpdateReqVO; | |
| 12 | +import cn.iocoder.yudao.module.crm.convert.receivable.ReceivablePlanConvert; | |
| 13 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; | |
| 14 | +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper; | |
| 15 | +import org.springframework.stereotype.Service; | |
| 16 | +import org.springframework.validation.annotation.Validated; | |
| 17 | + | |
| 18 | +import javax.annotation.Resource; | |
| 19 | +import java.util.Collection; | |
| 20 | +import java.util.List; | |
| 21 | + | |
| 22 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 23 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_PLAN_NOT_EXISTS; | |
| 24 | + | |
| 25 | +/** | |
| 26 | + * 回款计划 Service 实现类 | |
| 27 | + * | |
| 28 | + * @author 芋道源码 | |
| 29 | + */ | |
| 30 | +@Service | |
| 31 | +@Validated | |
| 32 | +public class ReceivablePlanServiceImpl implements ReceivablePlanService { | |
| 33 | + | |
| 34 | + @Resource | |
| 35 | + private ReceivablePlanMapper receivablePlanMapper; | |
| 36 | + | |
| 37 | + @Override | |
| 38 | + public Long createReceivablePlan(ReceivablePlanCreateReqVO createReqVO) { | |
| 39 | + // 插入 | |
| 40 | + ReceivablePlanDO receivablePlan = ReceivablePlanConvert.INSTANCE.convert(createReqVO); | |
| 41 | + // TODO @liuhongfeng:空格要注释;if (ObjectUtil.isNull(receivablePlan.getStatus())) { | |
| 42 | + if(ObjectUtil.isNull(receivablePlan.getStatus())){ | |
| 43 | + receivablePlan.setStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 44 | + } | |
| 45 | + receivablePlanMapper.insert(receivablePlan); | |
| 46 | + // 返回 | |
| 47 | + return receivablePlan.getId(); | |
| 48 | + } | |
| 49 | + | |
| 50 | + @Override | |
| 51 | + public void updateReceivablePlan(ReceivablePlanUpdateReqVO updateReqVO) { | |
| 52 | + // 校验存在 | |
| 53 | + validateReceivablePlanExists(updateReqVO.getId()); | |
| 54 | + | |
| 55 | + // 更新 | |
| 56 | + ReceivablePlanDO updateObj = ReceivablePlanConvert.INSTANCE.convert(updateReqVO); | |
| 57 | + receivablePlanMapper.updateById(updateObj); | |
| 58 | + } | |
| 59 | + | |
| 60 | + @Override | |
| 61 | + public void deleteReceivablePlan(Long id) { | |
| 62 | + // 校验存在 | |
| 63 | + validateReceivablePlanExists(id); | |
| 64 | + // 删除 | |
| 65 | + receivablePlanMapper.deleteById(id); | |
| 66 | + } | |
| 67 | + | |
| 68 | + private void validateReceivablePlanExists(Long id) { | |
| 69 | + if (receivablePlanMapper.selectById(id) == null) { | |
| 70 | + throw exception(RECEIVABLE_PLAN_NOT_EXISTS); | |
| 71 | + } | |
| 72 | + } | |
| 73 | + | |
| 74 | + @Override | |
| 75 | + public ReceivablePlanDO getReceivablePlan(Long id) { | |
| 76 | + return receivablePlanMapper.selectById(id); | |
| 77 | + } | |
| 78 | + | |
| 79 | + @Override | |
| 80 | + public List<ReceivablePlanDO> getReceivablePlanList(Collection<Long> ids) { | |
| 81 | + if (CollUtil.isEmpty(ids)) { | |
| 82 | + return ListUtil.empty(); | |
| 83 | + } | |
| 84 | + return receivablePlanMapper.selectBatchIds(ids); | |
| 85 | + } | |
| 86 | + | |
| 87 | + @Override | |
| 88 | + public PageResult<ReceivablePlanDO> getReceivablePlanPage(ReceivablePlanPageReqVO pageReqVO) { | |
| 89 | + return receivablePlanMapper.selectPage(pageReqVO); | |
| 90 | + } | |
| 91 | + | |
| 92 | + @Override | |
| 93 | + public List<ReceivablePlanDO> getReceivablePlanList(ReceivablePlanExportReqVO exportReqVO) { | |
| 94 | + return receivablePlanMapper.selectList(exportReqVO); | |
| 95 | + } | |
| 96 | + | |
| 97 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.receivable; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import javax.validation.*; | |
| 5 | + | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; | |
| 7 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; | |
| 8 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 回款管理 Service 接口 | |
| 12 | + * | |
| 13 | + * @author 赤焰 | |
| 14 | + */ | |
| 15 | +public interface ReceivableService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建回款管理 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createReceivable(@Valid ReceivableCreateReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 更新回款管理 | |
| 27 | + * | |
| 28 | + * @param updateReqVO 更新信息 | |
| 29 | + */ | |
| 30 | + void updateReceivable(@Valid ReceivableUpdateReqVO updateReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 删除回款管理 | |
| 34 | + * | |
| 35 | + * @param id 编号 | |
| 36 | + */ | |
| 37 | + void deleteReceivable(Long id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 获得回款管理 | |
| 41 | + * | |
| 42 | + * @param id 编号 | |
| 43 | + * @return 回款管理 | |
| 44 | + */ | |
| 45 | + ReceivableDO getReceivable(Long id); | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 获得回款管理列表 | |
| 49 | + * | |
| 50 | + * @param ids 编号 | |
| 51 | + * @return 回款管理列表 | |
| 52 | + */ | |
| 53 | + List<ReceivableDO> getReceivableList(Collection<Long> ids); | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 获得回款管理分页 | |
| 57 | + * | |
| 58 | + * @param pageReqVO 分页查询 | |
| 59 | + * @return 回款管理分页 | |
| 60 | + */ | |
| 61 | + PageResult<ReceivableDO> getReceivablePage(ReceivablePageReqVO pageReqVO); | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * 获得回款管理列表, 用于 Excel 导出 | |
| 65 | + * | |
| 66 | + * @param exportReqVO 查询条件 | |
| 67 | + * @return 回款管理列表 | |
| 68 | + */ | |
| 69 | + List<ReceivableDO> getReceivableList(ReceivableExportReqVO exportReqVO); | |
| 70 | + | |
| 71 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.receivable; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.ListUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableExportReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableUpdateReqVO; | |
| 10 | +import cn.iocoder.yudao.module.crm.convert.receivable.ReceivableConvert; | |
| 11 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; | |
| 12 | +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | + | |
| 16 | +import javax.annotation.Resource; | |
| 17 | +import java.util.Collection; | |
| 18 | +import java.util.List; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 21 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_NOT_EXISTS; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 回款管理 Service 实现类 | |
| 25 | + * | |
| 26 | + * @author 赤焰 | |
| 27 | + */ | |
| 28 | +@Service | |
| 29 | +@Validated | |
| 30 | +public class ReceivableServiceImpl implements ReceivableService { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private ReceivableMapper receivableMapper; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Long createReceivable(ReceivableCreateReqVO createReqVO) { | |
| 37 | + // TODO @liuhongfeng:planId 是否存在,是否合法,需要去校验; | |
| 38 | + // TODO @liuhongfeng:其它类似 customerId、contractId 也需要去校验; | |
| 39 | + // 插入 | |
| 40 | + ReceivableDO receivable = ReceivableConvert.INSTANCE.convert(createReqVO); | |
| 41 | + receivableMapper.insert(receivable); | |
| 42 | + // 返回 | |
| 43 | + return receivable.getId(); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @Override | |
| 47 | + public void updateReceivable(ReceivableUpdateReqVO updateReqVO) { | |
| 48 | + // 校验存在 | |
| 49 | + validateReceivableExists(updateReqVO.getId()); | |
| 50 | + | |
| 51 | + // 更新 | |
| 52 | + ReceivableDO updateObj = ReceivableConvert.INSTANCE.convert(updateReqVO); | |
| 53 | + receivableMapper.updateById(updateObj); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Override | |
| 57 | + public void deleteReceivable(Long id) { | |
| 58 | + // 校验存在 | |
| 59 | + validateReceivableExists(id); | |
| 60 | + // 删除 | |
| 61 | + receivableMapper.deleteById(id); | |
| 62 | + } | |
| 63 | + | |
| 64 | + private void validateReceivableExists(Long id) { | |
| 65 | + if (receivableMapper.selectById(id) == null) { | |
| 66 | + throw exception(RECEIVABLE_NOT_EXISTS); | |
| 67 | + } | |
| 68 | + } | |
| 69 | + | |
| 70 | + @Override | |
| 71 | + public ReceivableDO getReceivable(Long id) { | |
| 72 | + return receivableMapper.selectById(id); | |
| 73 | + } | |
| 74 | + | |
| 75 | + @Override | |
| 76 | + public List<ReceivableDO> getReceivableList(Collection<Long> ids) { | |
| 77 | + if (CollUtil.isEmpty(ids)) { | |
| 78 | + return ListUtil.empty(); | |
| 79 | + } | |
| 80 | + return receivableMapper.selectBatchIds(ids); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @Override | |
| 84 | + public PageResult<ReceivableDO> getReceivablePage(ReceivablePageReqVO pageReqVO) { | |
| 85 | + return receivableMapper.selectPage(pageReqVO); | |
| 86 | + } | |
| 87 | + | |
| 88 | + @Override | |
| 89 | + public List<ReceivableDO> getReceivableList(ReceivableExportReqVO exportReqVO) { | |
| 90 | + return receivableMapper.selectList(exportReqVO); | |
| 91 | + } | |
| 92 | + | |
| 93 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/package-info.java
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/business/CrmBusinessMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.business.CrmBusinessMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/businessstatustype/CrmBusinessStatusTypeMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.businessstatustype.CrmBusinessStatusTypeMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/clue/CrmClueMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.clue.CrmClueMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/contact/ContactMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.contact.ContactMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/customer/CrmCustomerMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.customer.CrmCustomerMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivableMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivablePlanMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.business; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.CrmBusinessCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.CrmBusinessExportReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.business.vo.CrmBusinessUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.mysql.business.CrmBusinessMapper; | |
| 9 | +import org.junit.jupiter.api.Disabled; | |
| 10 | +import org.junit.jupiter.api.Test; | |
| 11 | +import org.springframework.context.annotation.Import; | |
| 12 | + | |
| 13 | +import javax.annotation.Resource; | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 17 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 18 | +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | |
| 19 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 20 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 23 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.BUSINESS_NOT_EXISTS; | |
| 24 | +import static org.junit.jupiter.api.Assertions.*; | |
| 25 | + | |
| 26 | +/** | |
| 27 | + * {@link CrmBusinessServiceImpl} 的单元测试类 | |
| 28 | + * | |
| 29 | + * @author ljlleo | |
| 30 | + */ | |
| 31 | +@Import(CrmBusinessServiceImpl.class) | |
| 32 | +public class CrmBusinessServiceImplTest extends BaseDbUnitTest { | |
| 33 | + | |
| 34 | + @Resource | |
| 35 | + private CrmBusinessServiceImpl businessService; | |
| 36 | + | |
| 37 | + @Resource | |
| 38 | + private CrmBusinessMapper businessMapper; | |
| 39 | + | |
| 40 | + @Test | |
| 41 | + public void testCreateBusiness_success() { | |
| 42 | + // 准备参数 | |
| 43 | + CrmBusinessCreateReqVO reqVO = randomPojo(CrmBusinessCreateReqVO.class); | |
| 44 | + | |
| 45 | + // 调用 | |
| 46 | + Long businessId = businessService.createBusiness(reqVO, getLoginUserId()); | |
| 47 | + // 断言 | |
| 48 | + assertNotNull(businessId); | |
| 49 | + // 校验记录的属性是否正确 | |
| 50 | + CrmBusinessDO business = businessMapper.selectById(businessId); | |
| 51 | + assertPojoEquals(reqVO, business); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Test | |
| 55 | + public void testUpdateBusiness_success() { | |
| 56 | + // mock 数据 | |
| 57 | + CrmBusinessDO dbBusiness = randomPojo(CrmBusinessDO.class); | |
| 58 | + businessMapper.insert(dbBusiness);// @Sql: 先插入出一条存在的数据 | |
| 59 | + // 准备参数 | |
| 60 | + CrmBusinessUpdateReqVO reqVO = randomPojo(CrmBusinessUpdateReqVO.class, o -> { | |
| 61 | + o.setId(dbBusiness.getId()); // 设置更新的 ID | |
| 62 | + }); | |
| 63 | + | |
| 64 | + // 调用 | |
| 65 | + businessService.updateBusiness(reqVO); | |
| 66 | + // 校验是否更新正确 | |
| 67 | + CrmBusinessDO business = businessMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 68 | + assertPojoEquals(reqVO, business); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Test | |
| 72 | + public void testUpdateBusiness_notExists() { | |
| 73 | + // 准备参数 | |
| 74 | + CrmBusinessUpdateReqVO reqVO = randomPojo(CrmBusinessUpdateReqVO.class); | |
| 75 | + | |
| 76 | + // 调用, 并断言异常 | |
| 77 | + assertServiceException(() -> businessService.updateBusiness(reqVO), BUSINESS_NOT_EXISTS); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Test | |
| 81 | + public void testDeleteBusiness_success() { | |
| 82 | + // mock 数据 | |
| 83 | + CrmBusinessDO dbBusiness = randomPojo(CrmBusinessDO.class); | |
| 84 | + businessMapper.insert(dbBusiness);// @Sql: 先插入出一条存在的数据 | |
| 85 | + // 准备参数 | |
| 86 | + Long id = dbBusiness.getId(); | |
| 87 | + | |
| 88 | + // 调用 | |
| 89 | + businessService.deleteBusiness(id); | |
| 90 | + // 校验数据不存在了 | |
| 91 | + assertNull(businessMapper.selectById(id)); | |
| 92 | + } | |
| 93 | + | |
| 94 | + @Test | |
| 95 | + public void testDeleteBusiness_notExists() { | |
| 96 | + // 准备参数 | |
| 97 | + Long id = randomLongId(); | |
| 98 | + | |
| 99 | + // 调用, 并断言异常 | |
| 100 | + assertServiceException(() -> businessService.deleteBusiness(id), BUSINESS_NOT_EXISTS); | |
| 101 | + } | |
| 102 | + | |
| 103 | + @Test | |
| 104 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 105 | + public void testGetBusinessPage() { | |
| 106 | + // mock 数据 | |
| 107 | + CrmBusinessDO dbBusiness = randomPojo(CrmBusinessDO.class, o -> { // 等会查询到 | |
| 108 | + o.setName(null); | |
| 109 | + o.setStatusTypeId(null); | |
| 110 | + o.setStatusId(null); | |
| 111 | + o.setContactNextTime(null); | |
| 112 | + o.setCustomerId(null); | |
| 113 | + o.setDealTime(null); | |
| 114 | + o.setPrice(null); | |
| 115 | + o.setDiscountPercent(null); | |
| 116 | + o.setProductPrice(null); | |
| 117 | + o.setRemark(null); | |
| 118 | + o.setCreateTime(null); | |
| 119 | + o.setEndStatus(null); | |
| 120 | + o.setEndRemark(null); | |
| 121 | + o.setContactLastTime(null); | |
| 122 | + o.setFollowUpStatus(null); | |
| 123 | + }); | |
| 124 | + businessMapper.insert(dbBusiness); | |
| 125 | + // 测试 name 不匹配 | |
| 126 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setName(null))); | |
| 127 | + // 测试 statusTypeId 不匹配 | |
| 128 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setStatusTypeId(null))); | |
| 129 | + // 测试 statusId 不匹配 | |
| 130 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setStatusId(null))); | |
| 131 | + // 测试 contactNextTime 不匹配 | |
| 132 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setContactNextTime(null))); | |
| 133 | + // 测试 customerId 不匹配 | |
| 134 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setCustomerId(null))); | |
| 135 | + // 测试 dealTime 不匹配 | |
| 136 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setDealTime(null))); | |
| 137 | + // 测试 price 不匹配 | |
| 138 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setPrice(null))); | |
| 139 | + // 测试 discountPercent 不匹配 | |
| 140 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setDiscountPercent(null))); | |
| 141 | + // 测试 productPrice 不匹配 | |
| 142 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setProductPrice(null))); | |
| 143 | + // 测试 remark 不匹配 | |
| 144 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setRemark(null))); | |
| 145 | + // 测试 createTime 不匹配 | |
| 146 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setCreateTime(null))); | |
| 147 | + // 测试 endStatus 不匹配 | |
| 148 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setEndStatus(null))); | |
| 149 | + // 测试 endRemark 不匹配 | |
| 150 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setEndRemark(null))); | |
| 151 | + // 测试 contactLastTime 不匹配 | |
| 152 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setContactLastTime(null))); | |
| 153 | + // 测试 followUpStatus 不匹配 | |
| 154 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setFollowUpStatus(null))); | |
| 155 | + //// 准备参数 | |
| 156 | + //CrmBusinessPageReqVO reqVO = new CrmBusinessPageReqVO(); | |
| 157 | + //reqVO.setName(null); | |
| 158 | + //reqVO.setStatusTypeId(null); | |
| 159 | + //reqVO.setStatusId(null); | |
| 160 | + //reqVO.setContactNextTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 161 | + //reqVO.setCustomerId(null); | |
| 162 | + //reqVO.setDealTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 163 | + //reqVO.setPrice(null); | |
| 164 | + //reqVO.setDiscountPercent(null); | |
| 165 | + //reqVO.setProductPrice(null); | |
| 166 | + //reqVO.setRemark(null); | |
| 167 | + //reqVO.setOwnerUserId(null); | |
| 168 | + //reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 169 | + //reqVO.setRoUserIds(null); | |
| 170 | + //reqVO.setRwUserIds(null); | |
| 171 | + //reqVO.setEndStatus(null); | |
| 172 | + //reqVO.setEndRemark(null); | |
| 173 | + //reqVO.setContactLastTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 174 | + //reqVO.setFollowUpStatus(null); | |
| 175 | + // | |
| 176 | + //// 调用 | |
| 177 | + //PageResult<CrmBusinessDO> pageResult = businessService.getBusinessPage(reqVO); | |
| 178 | + //// 断言 | |
| 179 | + //assertEquals(1, pageResult.getTotal()); | |
| 180 | + //assertEquals(1, pageResult.getList().size()); | |
| 181 | + //assertPojoEquals(dbBusiness, pageResult.getList().get(0)); | |
| 182 | + } | |
| 183 | + | |
| 184 | + @Test | |
| 185 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 186 | + public void testGetBusinessList() { | |
| 187 | + // mock 数据 | |
| 188 | + CrmBusinessDO dbBusiness = randomPojo(CrmBusinessDO.class, o -> { // 等会查询到 | |
| 189 | + o.setName(null); | |
| 190 | + o.setStatusTypeId(null); | |
| 191 | + o.setStatusId(null); | |
| 192 | + o.setContactNextTime(null); | |
| 193 | + o.setCustomerId(null); | |
| 194 | + o.setDealTime(null); | |
| 195 | + o.setPrice(null); | |
| 196 | + o.setDiscountPercent(null); | |
| 197 | + o.setProductPrice(null); | |
| 198 | + o.setRemark(null); | |
| 199 | + o.setCreateTime(null); | |
| 200 | + o.setEndStatus(null); | |
| 201 | + o.setEndRemark(null); | |
| 202 | + o.setContactLastTime(null); | |
| 203 | + o.setFollowUpStatus(null); | |
| 204 | + }); | |
| 205 | + businessMapper.insert(dbBusiness); | |
| 206 | + // 测试 name 不匹配 | |
| 207 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setName(null))); | |
| 208 | + // 测试 statusTypeId 不匹配 | |
| 209 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setStatusTypeId(null))); | |
| 210 | + // 测试 statusId 不匹配 | |
| 211 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setStatusId(null))); | |
| 212 | + // 测试 contactNextTime 不匹配 | |
| 213 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setContactNextTime(null))); | |
| 214 | + // 测试 customerId 不匹配 | |
| 215 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setCustomerId(null))); | |
| 216 | + // 测试 dealTime 不匹配 | |
| 217 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setDealTime(null))); | |
| 218 | + // 测试 price 不匹配 | |
| 219 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setPrice(null))); | |
| 220 | + // 测试 discountPercent 不匹配 | |
| 221 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setDiscountPercent(null))); | |
| 222 | + // 测试 productPrice 不匹配 | |
| 223 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setProductPrice(null))); | |
| 224 | + // 测试 remark 不匹配 | |
| 225 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setRemark(null))); | |
| 226 | + // 测试 createTime 不匹配 | |
| 227 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setCreateTime(null))); | |
| 228 | + // 测试 endStatus 不匹配 | |
| 229 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setEndStatus(null))); | |
| 230 | + // 测试 endRemark 不匹配 | |
| 231 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setEndRemark(null))); | |
| 232 | + // 测试 contactLastTime 不匹配 | |
| 233 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setContactLastTime(null))); | |
| 234 | + // 测试 followUpStatus 不匹配 | |
| 235 | + businessMapper.insert(cloneIgnoreId(dbBusiness, o -> o.setFollowUpStatus(null))); | |
| 236 | + // 准备参数 | |
| 237 | + CrmBusinessExportReqVO reqVO = new CrmBusinessExportReqVO(); | |
| 238 | + reqVO.setName(null); | |
| 239 | + reqVO.setStatusTypeId(null); | |
| 240 | + reqVO.setStatusId(null); | |
| 241 | + reqVO.setContactNextTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 242 | + reqVO.setCustomerId(null); | |
| 243 | + reqVO.setDealTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 244 | + reqVO.setPrice(null); | |
| 245 | + reqVO.setDiscountPercent(null); | |
| 246 | + reqVO.setProductPrice(null); | |
| 247 | + reqVO.setRemark(null); | |
| 248 | + reqVO.setOwnerUserId(null); | |
| 249 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 250 | + reqVO.setRoUserIds(null); | |
| 251 | + reqVO.setRwUserIds(null); | |
| 252 | + reqVO.setEndStatus(null); | |
| 253 | + reqVO.setEndRemark(null); | |
| 254 | + reqVO.setContactLastTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 255 | + reqVO.setFollowUpStatus(null); | |
| 256 | + | |
| 257 | + // 调用 | |
| 258 | + List<CrmBusinessDO> list = businessService.getBusinessList(reqVO); | |
| 259 | + // 断言 | |
| 260 | + assertEquals(1, list.size()); | |
| 261 | + assertPojoEquals(dbBusiness, list.get(0)); | |
| 262 | + } | |
| 263 | + | |
| 264 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/businessstatus/CrmBusinessStatusServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.businessstatus; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusExportReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo.CrmBusinessStatusUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatus.CrmBusinessStatusDO; | |
| 8 | +import cn.iocoder.yudao.module.crm.dal.mysql.businessstatus.CrmBusinessStatusMapper; | |
| 9 | +import org.junit.jupiter.api.Disabled; | |
| 10 | +import org.junit.jupiter.api.Test; | |
| 11 | +import org.springframework.context.annotation.Import; | |
| 12 | + | |
| 13 | +import javax.annotation.Resource; | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 17 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 18 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 19 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 20 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 21 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.BUSINESS_STATUS_NOT_EXISTS; | |
| 22 | +import static org.junit.jupiter.api.Assertions.*; | |
| 23 | + | |
| 24 | +/** | |
| 25 | + * {@link CrmBusinessStatusServiceImpl} 的单元测试类 | |
| 26 | + * | |
| 27 | + * @author ljlleo | |
| 28 | + */ | |
| 29 | +@Import(CrmBusinessStatusServiceImpl.class) | |
| 30 | +public class CrmBusinessStatusServiceImplTest extends BaseDbUnitTest { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private CrmBusinessStatusServiceImpl businessStatusService; | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private CrmBusinessStatusMapper businessStatusMapper; | |
| 37 | + | |
| 38 | + @Test | |
| 39 | + public void testCreateBusinessStatus_success() { | |
| 40 | + // 准备参数 | |
| 41 | + CrmBusinessStatusCreateReqVO reqVO = randomPojo(CrmBusinessStatusCreateReqVO.class); | |
| 42 | + | |
| 43 | + // 调用 | |
| 44 | + Long businessStatusId = businessStatusService.createBusinessStatus(reqVO); | |
| 45 | + // 断言 | |
| 46 | + assertNotNull(businessStatusId); | |
| 47 | + // 校验记录的属性是否正确 | |
| 48 | + CrmBusinessStatusDO businessStatus = businessStatusMapper.selectById(businessStatusId); | |
| 49 | + assertPojoEquals(reqVO, businessStatus); | |
| 50 | + } | |
| 51 | + | |
| 52 | + @Test | |
| 53 | + public void testUpdateBusinessStatus_success() { | |
| 54 | + // mock 数据 | |
| 55 | + CrmBusinessStatusDO dbBusinessStatus = randomPojo(CrmBusinessStatusDO.class); | |
| 56 | + businessStatusMapper.insert(dbBusinessStatus);// @Sql: 先插入出一条存在的数据 | |
| 57 | + // 准备参数 | |
| 58 | + CrmBusinessStatusUpdateReqVO reqVO = randomPojo(CrmBusinessStatusUpdateReqVO.class, o -> { | |
| 59 | + o.setId(dbBusinessStatus.getId()); // 设置更新的 ID | |
| 60 | + }); | |
| 61 | + | |
| 62 | + // 调用 | |
| 63 | + businessStatusService.updateBusinessStatus(reqVO); | |
| 64 | + // 校验是否更新正确 | |
| 65 | + CrmBusinessStatusDO businessStatus = businessStatusMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 66 | + assertPojoEquals(reqVO, businessStatus); | |
| 67 | + } | |
| 68 | + | |
| 69 | + @Test | |
| 70 | + public void testUpdateBusinessStatus_notExists() { | |
| 71 | + // 准备参数 | |
| 72 | + CrmBusinessStatusUpdateReqVO reqVO = randomPojo(CrmBusinessStatusUpdateReqVO.class); | |
| 73 | + | |
| 74 | + // 调用, 并断言异常 | |
| 75 | + assertServiceException(() -> businessStatusService.updateBusinessStatus(reqVO), BUSINESS_STATUS_NOT_EXISTS); | |
| 76 | + } | |
| 77 | + | |
| 78 | + @Test | |
| 79 | + public void testDeleteBusinessStatus_success() { | |
| 80 | + // mock 数据 | |
| 81 | + CrmBusinessStatusDO dbBusinessStatus = randomPojo(CrmBusinessStatusDO.class); | |
| 82 | + businessStatusMapper.insert(dbBusinessStatus);// @Sql: 先插入出一条存在的数据 | |
| 83 | + // 准备参数 | |
| 84 | + Long id = dbBusinessStatus.getId(); | |
| 85 | + | |
| 86 | + // 调用 | |
| 87 | + businessStatusService.deleteBusinessStatus(id); | |
| 88 | + // 校验数据不存在了 | |
| 89 | + assertNull(businessStatusMapper.selectById(id)); | |
| 90 | + } | |
| 91 | + | |
| 92 | + @Test | |
| 93 | + public void testDeleteBusinessStatus_notExists() { | |
| 94 | + // 准备参数 | |
| 95 | + Long id = randomLongId(); | |
| 96 | + | |
| 97 | + // 调用, 并断言异常 | |
| 98 | + assertServiceException(() -> businessStatusService.deleteBusinessStatus(id), BUSINESS_STATUS_NOT_EXISTS); | |
| 99 | + } | |
| 100 | + | |
| 101 | + @Test | |
| 102 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 103 | + public void testGetBusinessStatusPage() { | |
| 104 | + // mock 数据 | |
| 105 | + CrmBusinessStatusDO dbBusinessStatus = randomPojo(CrmBusinessStatusDO.class, o -> { // 等会查询到 | |
| 106 | + o.setTypeId(null); | |
| 107 | + o.setName(null); | |
| 108 | + o.setPercent(null); | |
| 109 | + o.setSort(null); | |
| 110 | + }); | |
| 111 | + businessStatusMapper.insert(dbBusinessStatus); | |
| 112 | + // 测试 typeId 不匹配 | |
| 113 | + businessStatusMapper.insert(cloneIgnoreId(dbBusinessStatus, o -> o.setTypeId(null))); | |
| 114 | + // 测试 name 不匹配 | |
| 115 | + businessStatusMapper.insert(cloneIgnoreId(dbBusinessStatus, o -> o.setName(null))); | |
| 116 | + // 测试 percent 不匹配 | |
| 117 | + businessStatusMapper.insert(cloneIgnoreId(dbBusinessStatus, o -> o.setPercent(null))); | |
| 118 | + // 测试 sort 不匹配 | |
| 119 | + businessStatusMapper.insert(cloneIgnoreId(dbBusinessStatus, o -> o.setSort(null))); | |
| 120 | + // 准备参数 | |
| 121 | + //CrmBusinessStatusPageReqVO reqVO = new CrmBusinessStatusPageReqVO(); | |
| 122 | + //reqVO.setTypeId(null); | |
| 123 | + //reqVO.setName(null); | |
| 124 | + //reqVO.setPercent(null); | |
| 125 | + //reqVO.setSort(null); | |
| 126 | + // | |
| 127 | + //// 调用 | |
| 128 | + //PageResult<CrmBusinessStatusDO> pageResult = businessStatusService.getBusinessStatusPage(reqVO); | |
| 129 | + //// 断言 | |
| 130 | + //assertEquals(1, pageResult.getTotal()); | |
| 131 | + //assertEquals(1, pageResult.getList().size()); | |
| 132 | + //assertPojoEquals(dbBusinessStatus, pageResult.getList().get(0)); | |
| 133 | + } | |
| 134 | + | |
| 135 | + @Test | |
| 136 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 137 | + public void testGetBusinessStatusList() { | |
| 138 | + // mock 数据 | |
| 139 | + CrmBusinessStatusDO dbBusinessStatus = randomPojo(CrmBusinessStatusDO.class, o -> { // 等会查询到 | |
| 140 | + o.setTypeId(null); | |
| 141 | + o.setName(null); | |
| 142 | + o.setPercent(null); | |
| 143 | + o.setSort(null); | |
| 144 | + }); | |
| 145 | + businessStatusMapper.insert(dbBusinessStatus); | |
| 146 | + // 测试 typeId 不匹配 | |
| 147 | + businessStatusMapper.insert(cloneIgnoreId(dbBusinessStatus, o -> o.setTypeId(null))); | |
| 148 | + // 测试 name 不匹配 | |
| 149 | + businessStatusMapper.insert(cloneIgnoreId(dbBusinessStatus, o -> o.setName(null))); | |
| 150 | + // 测试 percent 不匹配 | |
| 151 | + businessStatusMapper.insert(cloneIgnoreId(dbBusinessStatus, o -> o.setPercent(null))); | |
| 152 | + // 测试 sort 不匹配 | |
| 153 | + businessStatusMapper.insert(cloneIgnoreId(dbBusinessStatus, o -> o.setSort(null))); | |
| 154 | + // 准备参数 | |
| 155 | + CrmBusinessStatusExportReqVO reqVO = new CrmBusinessStatusExportReqVO(); | |
| 156 | + reqVO.setTypeId(null); | |
| 157 | + reqVO.setName(null); | |
| 158 | + reqVO.setPercent(null); | |
| 159 | + reqVO.setSort(null); | |
| 160 | + | |
| 161 | + // 调用 | |
| 162 | + List<CrmBusinessStatusDO> list = businessStatusService.getBusinessStatusList(reqVO); | |
| 163 | + // 断言 | |
| 164 | + assertEquals(1, list.size()); | |
| 165 | + assertPojoEquals(dbBusinessStatus, list.get(0)); | |
| 166 | + } | |
| 167 | + | |
| 168 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/businessstatustype/CrmBusinessStatusTypeServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.businessstatustype; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo.CrmBusinessStatusTypeUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.dataobject.businessstatustype.CrmBusinessStatusTypeDO; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.mysql.businessstatustype.CrmBusinessStatusTypeMapper; | |
| 11 | +import org.junit.jupiter.api.Disabled; | |
| 12 | +import org.junit.jupiter.api.Test; | |
| 13 | +import org.springframework.context.annotation.Import; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 19 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 20 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.BUSINESS_STATUS_TYPE_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * {@link CrmBusinessStatusTypeServiceImpl} 的单元测试类 | |
| 29 | + * | |
| 30 | + * @author ljlleo | |
| 31 | + */ | |
| 32 | +@Import(CrmBusinessStatusTypeServiceImpl.class) | |
| 33 | +public class CrmBusinessStatusTypeServiceImplTest extends BaseDbUnitTest { | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private CrmBusinessStatusTypeServiceImpl businessStatusTypeService; | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private CrmBusinessStatusTypeMapper businessStatusTypeMapper; | |
| 40 | + | |
| 41 | + @Test | |
| 42 | + public void testCreateBusinessStatusType_success() { | |
| 43 | + // 准备参数 | |
| 44 | + CrmBusinessStatusTypeCreateReqVO reqVO = randomPojo(CrmBusinessStatusTypeCreateReqVO.class); | |
| 45 | + | |
| 46 | + // 调用 | |
| 47 | + Long businessStatusTypeId = businessStatusTypeService.createBusinessStatusType(reqVO); | |
| 48 | + // 断言 | |
| 49 | + assertNotNull(businessStatusTypeId); | |
| 50 | + // 校验记录的属性是否正确 | |
| 51 | + CrmBusinessStatusTypeDO businessStatusType = businessStatusTypeMapper.selectById(businessStatusTypeId); | |
| 52 | + assertPojoEquals(reqVO, businessStatusType); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Test | |
| 56 | + public void testUpdateBusinessStatusType_success() { | |
| 57 | + // mock 数据 | |
| 58 | + CrmBusinessStatusTypeDO dbBusinessStatusType = randomPojo(CrmBusinessStatusTypeDO.class); | |
| 59 | + businessStatusTypeMapper.insert(dbBusinessStatusType);// @Sql: 先插入出一条存在的数据 | |
| 60 | + // 准备参数 | |
| 61 | + CrmBusinessStatusTypeUpdateReqVO reqVO = randomPojo(CrmBusinessStatusTypeUpdateReqVO.class, o -> { | |
| 62 | + o.setId(dbBusinessStatusType.getId()); // 设置更新的 ID | |
| 63 | + }); | |
| 64 | + | |
| 65 | + // 调用 | |
| 66 | + businessStatusTypeService.updateBusinessStatusType(reqVO); | |
| 67 | + // 校验是否更新正确 | |
| 68 | + CrmBusinessStatusTypeDO businessStatusType = businessStatusTypeMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 69 | + assertPojoEquals(reqVO, businessStatusType); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Test | |
| 73 | + public void testUpdateBusinessStatusType_notExists() { | |
| 74 | + // 准备参数 | |
| 75 | + CrmBusinessStatusTypeUpdateReqVO reqVO = randomPojo(CrmBusinessStatusTypeUpdateReqVO.class); | |
| 76 | + | |
| 77 | + // 调用, 并断言异常 | |
| 78 | + assertServiceException(() -> businessStatusTypeService.updateBusinessStatusType(reqVO), BUSINESS_STATUS_TYPE_NOT_EXISTS); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Test | |
| 82 | + public void testDeleteBusinessStatusType_success() { | |
| 83 | + // mock 数据 | |
| 84 | + CrmBusinessStatusTypeDO dbBusinessStatusType = randomPojo(CrmBusinessStatusTypeDO.class); | |
| 85 | + businessStatusTypeMapper.insert(dbBusinessStatusType);// @Sql: 先插入出一条存在的数据 | |
| 86 | + // 准备参数 | |
| 87 | + Long id = dbBusinessStatusType.getId(); | |
| 88 | + | |
| 89 | + // 调用 | |
| 90 | + businessStatusTypeService.deleteBusinessStatusType(id); | |
| 91 | + // 校验数据不存在了 | |
| 92 | + assertNull(businessStatusTypeMapper.selectById(id)); | |
| 93 | + } | |
| 94 | + | |
| 95 | + @Test | |
| 96 | + public void testDeleteBusinessStatusType_notExists() { | |
| 97 | + // 准备参数 | |
| 98 | + Long id = randomLongId(); | |
| 99 | + | |
| 100 | + // 调用, 并断言异常 | |
| 101 | + assertServiceException(() -> businessStatusTypeService.deleteBusinessStatusType(id), BUSINESS_STATUS_TYPE_NOT_EXISTS); | |
| 102 | + } | |
| 103 | + | |
| 104 | + @Test | |
| 105 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 106 | + public void testGetBusinessStatusTypePage() { | |
| 107 | + // mock 数据 | |
| 108 | + CrmBusinessStatusTypeDO dbBusinessStatusType = randomPojo(CrmBusinessStatusTypeDO.class, o -> { // 等会查询到 | |
| 109 | + o.setName(null); | |
| 110 | + o.setDeptIds(null); | |
| 111 | + o.setStatus(null); | |
| 112 | + //o.setCreateTime(null); | |
| 113 | + }); | |
| 114 | + businessStatusTypeMapper.insert(dbBusinessStatusType); | |
| 115 | + // 测试 name 不匹配 | |
| 116 | + businessStatusTypeMapper.insert(cloneIgnoreId(dbBusinessStatusType, o -> o.setName(null))); | |
| 117 | + // 测试 deptIds 不匹配 | |
| 118 | + businessStatusTypeMapper.insert(cloneIgnoreId(dbBusinessStatusType, o -> o.setDeptIds(null))); | |
| 119 | + // 测试 status 不匹配 | |
| 120 | + businessStatusTypeMapper.insert(cloneIgnoreId(dbBusinessStatusType, o -> o.setStatus(null))); | |
| 121 | + // 测试 createTime 不匹配 | |
| 122 | + //businessStatusTypeMapper.insert(cloneIgnoreId(dbBusinessStatusType, o -> o.setCreateTime(null))); | |
| 123 | + // 准备参数 | |
| 124 | + CrmBusinessStatusTypePageReqVO reqVO = new CrmBusinessStatusTypePageReqVO(); | |
| 125 | + reqVO.setName(null); | |
| 126 | + //reqVO.setDeptIds(null); | |
| 127 | + reqVO.setStatus(null); | |
| 128 | + //reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 129 | + | |
| 130 | + // 调用 | |
| 131 | + PageResult<CrmBusinessStatusTypeDO> pageResult = businessStatusTypeService.getBusinessStatusTypePage(reqVO); | |
| 132 | + // 断言 | |
| 133 | + assertEquals(1, pageResult.getTotal()); | |
| 134 | + assertEquals(1, pageResult.getList().size()); | |
| 135 | + assertPojoEquals(dbBusinessStatusType, pageResult.getList().get(0)); | |
| 136 | + } | |
| 137 | + | |
| 138 | + @Test | |
| 139 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 140 | + public void testGetBusinessStatusTypeList() { | |
| 141 | + // mock 数据 | |
| 142 | + CrmBusinessStatusTypeDO dbBusinessStatusType = randomPojo(CrmBusinessStatusTypeDO.class, o -> { // 等会查询到 | |
| 143 | + o.setName(null); | |
| 144 | + o.setDeptIds(null); | |
| 145 | + o.setStatus(null); | |
| 146 | + //o.setCreateTime(null); | |
| 147 | + }); | |
| 148 | + businessStatusTypeMapper.insert(dbBusinessStatusType); | |
| 149 | + // 测试 name 不匹配 | |
| 150 | + businessStatusTypeMapper.insert(cloneIgnoreId(dbBusinessStatusType, o -> o.setName(null))); | |
| 151 | + // 测试 deptIds 不匹配 | |
| 152 | + businessStatusTypeMapper.insert(cloneIgnoreId(dbBusinessStatusType, o -> o.setDeptIds(null))); | |
| 153 | + // 测试 status 不匹配 | |
| 154 | + businessStatusTypeMapper.insert(cloneIgnoreId(dbBusinessStatusType, o -> o.setStatus(null))); | |
| 155 | + // 测试 createTime 不匹配 | |
| 156 | + //businessStatusTypeMapper.insert(cloneIgnoreId(dbBusinessStatusType, o -> o.setCreateTime(null))); | |
| 157 | + // 准备参数 | |
| 158 | + CrmBusinessStatusTypeExportReqVO reqVO = new CrmBusinessStatusTypeExportReqVO(); | |
| 159 | + reqVO.setName(null); | |
| 160 | + reqVO.setDeptIds(null); | |
| 161 | + reqVO.setStatus(null); | |
| 162 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 163 | + | |
| 164 | + // 调用 | |
| 165 | + List<CrmBusinessStatusTypeDO> list = businessStatusTypeService.getBusinessStatusTypeList(reqVO); | |
| 166 | + // 断言 | |
| 167 | + assertEquals(1, list.size()); | |
| 168 | + assertPojoEquals(dbBusinessStatusType, list.get(0)); | |
| 169 | + } | |
| 170 | + | |
| 171 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.clue; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmCluePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.mysql.clue.CrmClueMapper; | |
| 11 | +import org.junit.jupiter.api.Disabled; | |
| 12 | +import org.junit.jupiter.api.Test; | |
| 13 | +import org.springframework.context.annotation.Import; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 19 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 20 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CLUE_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | + | |
| 27 | +// TODO 芋艿:单测后续补; | |
| 28 | +/** | |
| 29 | + * {@link CrmClueServiceImpl} 的单元测试类 | |
| 30 | + * | |
| 31 | + * @author Wanwan | |
| 32 | + */ | |
| 33 | +@Import(CrmClueServiceImpl.class) | |
| 34 | +public class CrmClueServiceImplTest extends BaseDbUnitTest { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private CrmClueServiceImpl clueService; | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private CrmClueMapper clueMapper; | |
| 41 | + | |
| 42 | + @Test | |
| 43 | + public void testCreateClue_success() { | |
| 44 | + // 准备参数 | |
| 45 | + CrmClueCreateReqVO reqVO = randomPojo(CrmClueCreateReqVO.class); | |
| 46 | + | |
| 47 | + // 调用 | |
| 48 | + Long clueId = clueService.createClue(reqVO); | |
| 49 | + // 断言 | |
| 50 | + assertNotNull(clueId); | |
| 51 | + // 校验记录的属性是否正确 | |
| 52 | + CrmClueDO clue = clueMapper.selectById(clueId); | |
| 53 | + assertPojoEquals(reqVO, clue); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Test | |
| 57 | + public void testUpdateClue_success() { | |
| 58 | + // mock 数据 | |
| 59 | + CrmClueDO dbClue = randomPojo(CrmClueDO.class); | |
| 60 | + clueMapper.insert(dbClue);// @Sql: 先插入出一条存在的数据 | |
| 61 | + // 准备参数 | |
| 62 | + CrmClueUpdateReqVO reqVO = randomPojo(CrmClueUpdateReqVO.class, o -> { | |
| 63 | + o.setId(dbClue.getId()); // 设置更新的 ID | |
| 64 | + }); | |
| 65 | + | |
| 66 | + // 调用 | |
| 67 | + clueService.updateClue(reqVO); | |
| 68 | + // 校验是否更新正确 | |
| 69 | + CrmClueDO clue = clueMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 70 | + assertPojoEquals(reqVO, clue); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Test | |
| 74 | + public void testUpdateClue_notExists() { | |
| 75 | + // 准备参数 | |
| 76 | + CrmClueUpdateReqVO reqVO = randomPojo(CrmClueUpdateReqVO.class); | |
| 77 | + | |
| 78 | + // 调用, 并断言异常 | |
| 79 | + assertServiceException(() -> clueService.updateClue(reqVO), CLUE_NOT_EXISTS); | |
| 80 | + } | |
| 81 | + | |
| 82 | + @Test | |
| 83 | + public void testDeleteClue_success() { | |
| 84 | + // mock 数据 | |
| 85 | + CrmClueDO dbClue = randomPojo(CrmClueDO.class); | |
| 86 | + clueMapper.insert(dbClue);// @Sql: 先插入出一条存在的数据 | |
| 87 | + // 准备参数 | |
| 88 | + Long id = dbClue.getId(); | |
| 89 | + | |
| 90 | + // 调用 | |
| 91 | + clueService.deleteClue(id); | |
| 92 | + // 校验数据不存在了 | |
| 93 | + assertNull(clueMapper.selectById(id)); | |
| 94 | + } | |
| 95 | + | |
| 96 | + @Test | |
| 97 | + public void testDeleteClue_notExists() { | |
| 98 | + // 准备参数 | |
| 99 | + Long id = randomLongId(); | |
| 100 | + | |
| 101 | + // 调用, 并断言异常 | |
| 102 | + assertServiceException(() -> clueService.deleteClue(id), CLUE_NOT_EXISTS); | |
| 103 | + } | |
| 104 | + | |
| 105 | + @Test | |
| 106 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 107 | + public void testGetCluePage() { | |
| 108 | + // mock 数据 | |
| 109 | + CrmClueDO dbClue = randomPojo(CrmClueDO.class, o -> { // 等会查询到 | |
| 110 | + o.setTransformStatus(null); | |
| 111 | + o.setFollowUpStatus(null); | |
| 112 | + o.setName(null); | |
| 113 | + o.setCustomerId(null); | |
| 114 | + o.setContactNextTime(null); | |
| 115 | + o.setTelephone(null); | |
| 116 | + o.setMobile(null); | |
| 117 | + o.setAddress(null); | |
| 118 | + o.setContactLastTime(null); | |
| 119 | + o.setCreateTime(null); | |
| 120 | + }); | |
| 121 | + clueMapper.insert(dbClue); | |
| 122 | + // 测试 transformStatus 不匹配 | |
| 123 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setTransformStatus(null))); | |
| 124 | + // 测试 followUpStatus 不匹配 | |
| 125 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setFollowUpStatus(null))); | |
| 126 | + // 测试 name 不匹配 | |
| 127 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setName(null))); | |
| 128 | + // 测试 customerId 不匹配 | |
| 129 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setCustomerId(null))); | |
| 130 | + // 测试 contactNextTime 不匹配 | |
| 131 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setContactNextTime(null))); | |
| 132 | + // 测试 telephone 不匹配 | |
| 133 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setTelephone(null))); | |
| 134 | + // 测试 mobile 不匹配 | |
| 135 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setMobile(null))); | |
| 136 | + // 测试 address 不匹配 | |
| 137 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setAddress(null))); | |
| 138 | + // 测试 contactLastTime 不匹配 | |
| 139 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setContactLastTime(null))); | |
| 140 | + // 测试 createTime 不匹配 | |
| 141 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setCreateTime(null))); | |
| 142 | + // 准备参数 | |
| 143 | + CrmCluePageReqVO reqVO = new CrmCluePageReqVO(); | |
| 144 | + reqVO.setName(null); | |
| 145 | + reqVO.setTelephone(null); | |
| 146 | + reqVO.setMobile(null); | |
| 147 | + | |
| 148 | + // 调用 | |
| 149 | + PageResult<CrmClueDO> pageResult = clueService.getCluePage(reqVO); | |
| 150 | + // 断言 | |
| 151 | + assertEquals(1, pageResult.getTotal()); | |
| 152 | + assertEquals(1, pageResult.getList().size()); | |
| 153 | + assertPojoEquals(dbClue, pageResult.getList().get(0)); | |
| 154 | + } | |
| 155 | + | |
| 156 | + @Test | |
| 157 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 158 | + public void testGetClueList() { | |
| 159 | + // mock 数据 | |
| 160 | + CrmClueDO dbClue = randomPojo(CrmClueDO.class, o -> { // 等会查询到 | |
| 161 | + o.setTransformStatus(null); | |
| 162 | + o.setFollowUpStatus(null); | |
| 163 | + o.setName(null); | |
| 164 | + o.setCustomerId(null); | |
| 165 | + o.setContactNextTime(null); | |
| 166 | + o.setTelephone(null); | |
| 167 | + o.setMobile(null); | |
| 168 | + o.setAddress(null); | |
| 169 | + o.setContactLastTime(null); | |
| 170 | + o.setCreateTime(null); | |
| 171 | + }); | |
| 172 | + clueMapper.insert(dbClue); | |
| 173 | + // 测试 transformStatus 不匹配 | |
| 174 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setTransformStatus(null))); | |
| 175 | + // 测试 followUpStatus 不匹配 | |
| 176 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setFollowUpStatus(null))); | |
| 177 | + // 测试 name 不匹配 | |
| 178 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setName(null))); | |
| 179 | + // 测试 customerId 不匹配 | |
| 180 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setCustomerId(null))); | |
| 181 | + // 测试 contactNextTime 不匹配 | |
| 182 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setContactNextTime(null))); | |
| 183 | + // 测试 telephone 不匹配 | |
| 184 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setTelephone(null))); | |
| 185 | + // 测试 mobile 不匹配 | |
| 186 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setMobile(null))); | |
| 187 | + // 测试 address 不匹配 | |
| 188 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setAddress(null))); | |
| 189 | + // 测试 contactLastTime 不匹配 | |
| 190 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setContactLastTime(null))); | |
| 191 | + // 测试 createTime 不匹配 | |
| 192 | + clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setCreateTime(null))); | |
| 193 | + // 准备参数 | |
| 194 | + CrmClueExportReqVO reqVO = new CrmClueExportReqVO(); | |
| 195 | + reqVO.setTransformStatus(null); | |
| 196 | + reqVO.setFollowUpStatus(null); | |
| 197 | + reqVO.setName(null); | |
| 198 | + reqVO.setCustomerId(null); | |
| 199 | + reqVO.setContactNextTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 200 | + reqVO.setTelephone(null); | |
| 201 | + reqVO.setMobile(null); | |
| 202 | + reqVO.setAddress(null); | |
| 203 | + reqVO.setOwnerUserId(null); | |
| 204 | + reqVO.setContactLastTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 205 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 206 | + | |
| 207 | + // 调用 | |
| 208 | + List<CrmClueDO> list = clueService.getClueList(reqVO); | |
| 209 | + // 断言 | |
| 210 | + assertEquals(1, list.size()); | |
| 211 | + assertPojoEquals(dbClue, list.get(0)); | |
| 212 | + } | |
| 213 | + | |
| 214 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/contract/ContractServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.contract; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.ContractCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.ContractExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.ContractPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.ContractUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.mysql.contract.ContractMapper; | |
| 11 | +import org.junit.jupiter.api.Disabled; | |
| 12 | +import org.junit.jupiter.api.Test; | |
| 13 | +import org.springframework.context.annotation.Import; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 19 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 20 | +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 24 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 25 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CONTRACT_NOT_EXISTS; | |
| 26 | +import static org.junit.jupiter.api.Assertions.*; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * {@link ContractServiceImpl} 的单元测试类 | |
| 30 | + * | |
| 31 | + * @author dhb52 | |
| 32 | + */ | |
| 33 | +@Import(ContractServiceImpl.class) | |
| 34 | +public class ContractServiceImplTest extends BaseDbUnitTest { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private ContractServiceImpl contractService; | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private ContractMapper contractMapper; | |
| 41 | + | |
| 42 | + @Test | |
| 43 | + public void testCreateContract_success() { | |
| 44 | + // 准备参数 | |
| 45 | + ContractCreateReqVO reqVO = randomPojo(ContractCreateReqVO.class); | |
| 46 | + | |
| 47 | + // 调用 | |
| 48 | + Long contractId = contractService.createContract(reqVO, getLoginUserId()); | |
| 49 | + // 断言 | |
| 50 | + assertNotNull(contractId); | |
| 51 | + // 校验记录的属性是否正确 | |
| 52 | + ContractDO contract = contractMapper.selectById(contractId); | |
| 53 | + assertPojoEquals(reqVO, contract); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Test | |
| 57 | + public void testUpdateContract_success() { | |
| 58 | + // mock 数据 | |
| 59 | + ContractDO dbContract = randomPojo(ContractDO.class); | |
| 60 | + contractMapper.insert(dbContract);// @Sql: 先插入出一条存在的数据 | |
| 61 | + // 准备参数 | |
| 62 | + ContractUpdateReqVO reqVO = randomPojo(ContractUpdateReqVO.class, o -> { | |
| 63 | + o.setId(dbContract.getId()); // 设置更新的 ID | |
| 64 | + }); | |
| 65 | + | |
| 66 | + // 调用 | |
| 67 | + contractService.updateContract(reqVO); | |
| 68 | + // 校验是否更新正确 | |
| 69 | + ContractDO contract = contractMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 70 | + assertPojoEquals(reqVO, contract); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Test | |
| 74 | + public void testUpdateContract_notExists() { | |
| 75 | + // 准备参数 | |
| 76 | + ContractUpdateReqVO reqVO = randomPojo(ContractUpdateReqVO.class); | |
| 77 | + | |
| 78 | + // 调用, 并断言异常 | |
| 79 | + assertServiceException(() -> contractService.updateContract(reqVO), CONTRACT_NOT_EXISTS); | |
| 80 | + } | |
| 81 | + | |
| 82 | + @Test | |
| 83 | + public void testDeleteContract_success() { | |
| 84 | + // mock 数据 | |
| 85 | + ContractDO dbContract = randomPojo(ContractDO.class); | |
| 86 | + contractMapper.insert(dbContract);// @Sql: 先插入出一条存在的数据 | |
| 87 | + // 准备参数 | |
| 88 | + Long id = dbContract.getId(); | |
| 89 | + | |
| 90 | + // 调用 | |
| 91 | + contractService.deleteContract(id); | |
| 92 | + // 校验数据不存在了 | |
| 93 | + assertNull(contractMapper.selectById(id)); | |
| 94 | + } | |
| 95 | + | |
| 96 | + @Test | |
| 97 | + public void testDeleteContract_notExists() { | |
| 98 | + // 准备参数 | |
| 99 | + Long id = randomLongId(); | |
| 100 | + | |
| 101 | + // 调用, 并断言异常 | |
| 102 | + assertServiceException(() -> contractService.deleteContract(id), CONTRACT_NOT_EXISTS); | |
| 103 | + } | |
| 104 | + | |
| 105 | + @Test | |
| 106 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 107 | + public void testGetContractPage() { | |
| 108 | + // mock 数据 | |
| 109 | + ContractDO dbContract = randomPojo(ContractDO.class, o -> { // 等会查询到 | |
| 110 | + o.setName(null); | |
| 111 | + o.setCustomerId(null); | |
| 112 | + o.setBusinessId(null); | |
| 113 | + o.setOrderDate(null); | |
| 114 | + o.setNo(null); | |
| 115 | + o.setDiscountPercent(null); | |
| 116 | + o.setProductPrice(null); | |
| 117 | + }); | |
| 118 | + contractMapper.insert(dbContract); | |
| 119 | + // 测试 name 不匹配 | |
| 120 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setName(null))); | |
| 121 | + // 测试 customerId 不匹配 | |
| 122 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setCustomerId(null))); | |
| 123 | + // 测试 businessId 不匹配 | |
| 124 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setBusinessId(null))); | |
| 125 | + // 测试 orderDate 不匹配 | |
| 126 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setOrderDate(null))); | |
| 127 | + // 测试 no 不匹配 | |
| 128 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setNo(null))); | |
| 129 | + // 测试 discountPercent 不匹配 | |
| 130 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setDiscountPercent(null))); | |
| 131 | + // 测试 productPrice 不匹配 | |
| 132 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setProductPrice(null))); | |
| 133 | + // 准备参数 | |
| 134 | + ContractPageReqVO reqVO = new ContractPageReqVO(); | |
| 135 | + reqVO.setName(null); | |
| 136 | + reqVO.setCustomerId(null); | |
| 137 | + reqVO.setBusinessId(null); | |
| 138 | + reqVO.setOrderDate(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 139 | + reqVO.setNo(null); | |
| 140 | + reqVO.setDiscountPercent(null); | |
| 141 | + reqVO.setProductPrice(null); | |
| 142 | + | |
| 143 | + // 调用 | |
| 144 | + PageResult<ContractDO> pageResult = contractService.getContractPage(reqVO); | |
| 145 | + // 断言 | |
| 146 | + assertEquals(1, pageResult.getTotal()); | |
| 147 | + assertEquals(1, pageResult.getList().size()); | |
| 148 | + assertPojoEquals(dbContract, pageResult.getList().get(0)); | |
| 149 | + } | |
| 150 | + | |
| 151 | + @Test | |
| 152 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 153 | + public void testGetContractList() { | |
| 154 | + // mock 数据 | |
| 155 | + ContractDO dbContract = randomPojo(ContractDO.class, o -> { // 等会查询到 | |
| 156 | + o.setName("合同名称"); | |
| 157 | + o.setCustomerId(null); | |
| 158 | + o.setBusinessId(null); | |
| 159 | + o.setOrderDate(null); | |
| 160 | + o.setNo(null); | |
| 161 | + o.setDiscountPercent(null); | |
| 162 | + o.setProductPrice(null); | |
| 163 | + }); | |
| 164 | + contractMapper.insert(dbContract); | |
| 165 | + // 测试 name 不匹配 | |
| 166 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setName(null))); | |
| 167 | + // 测试 customerId 不匹配 | |
| 168 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setCustomerId(null))); | |
| 169 | + // 测试 businessId 不匹配 | |
| 170 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setBusinessId(null))); | |
| 171 | + // 测试 orderDate 不匹配 | |
| 172 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setOrderDate(null))); | |
| 173 | + // 测试 no 不匹配 | |
| 174 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setNo(null))); | |
| 175 | + // 测试 discountPercent 不匹配 | |
| 176 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setDiscountPercent(null))); | |
| 177 | + // 测试 productPrice 不匹配 | |
| 178 | + contractMapper.insert(cloneIgnoreId(dbContract, o -> o.setProductPrice(null))); | |
| 179 | + // 准备参数 | |
| 180 | + ContractExportReqVO reqVO = new ContractExportReqVO(); | |
| 181 | + reqVO.setName(null); | |
| 182 | + reqVO.setCustomerId(null); | |
| 183 | + reqVO.setBusinessId(null); | |
| 184 | + reqVO.setOrderDate(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 185 | + reqVO.setNo(null); | |
| 186 | + reqVO.setDiscountPercent(null); | |
| 187 | + reqVO.setProductPrice(null); | |
| 188 | + | |
| 189 | + // 调用 | |
| 190 | + List<ContractDO> list = contractService.getContractList(reqVO); | |
| 191 | + // 断言 | |
| 192 | + assertEquals(1, list.size()); | |
| 193 | + assertPojoEquals(dbContract, list.get(0)); | |
| 194 | + } | |
| 195 | + | |
| 196 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.customer; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.mysql.customer.CrmCustomerMapper; | |
| 11 | +import org.junit.jupiter.api.Disabled; | |
| 12 | +import org.junit.jupiter.api.Test; | |
| 13 | +import org.springframework.context.annotation.Import; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 19 | +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | |
| 20 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CUSTOMER_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | + | |
| 27 | +// TODO 芋艿:单测后续补 | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * {@link CrmCustomerServiceImpl} 的单元测试类 | |
| 31 | + * | |
| 32 | + * @author Wanwan | |
| 33 | + */ | |
| 34 | +@Import(CrmCustomerServiceImpl.class) | |
| 35 | +public class CrmCustomerServiceImplTest extends BaseDbUnitTest { | |
| 36 | + | |
| 37 | + @Resource | |
| 38 | + private CrmCustomerServiceImpl customerService; | |
| 39 | + | |
| 40 | + @Resource | |
| 41 | + private CrmCustomerMapper customerMapper; | |
| 42 | + | |
| 43 | + @Test | |
| 44 | + public void testCreateCustomer_success() { | |
| 45 | + // 准备参数 | |
| 46 | + CrmCustomerCreateReqVO reqVO = randomPojo(CrmCustomerCreateReqVO.class); | |
| 47 | + | |
| 48 | + // 调用 | |
| 49 | + Long customerId = customerService.createCustomer(reqVO, getLoginUserId()); | |
| 50 | + // 断言 | |
| 51 | + assertNotNull(customerId); | |
| 52 | + // 校验记录的属性是否正确 | |
| 53 | + CrmCustomerDO customer = customerMapper.selectById(customerId); | |
| 54 | + assertPojoEquals(reqVO, customer); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Test | |
| 58 | + public void testUpdateCustomer_success() { | |
| 59 | + // mock 数据 | |
| 60 | + CrmCustomerDO dbCustomer = randomPojo(CrmCustomerDO.class); | |
| 61 | + customerMapper.insert(dbCustomer);// @Sql: 先插入出一条存在的数据 | |
| 62 | + // 准备参数 | |
| 63 | + CrmCustomerUpdateReqVO reqVO = randomPojo(CrmCustomerUpdateReqVO.class, o -> { | |
| 64 | + o.setId(dbCustomer.getId()); // 设置更新的 ID | |
| 65 | + }); | |
| 66 | + | |
| 67 | + // 调用 | |
| 68 | + customerService.updateCustomer(reqVO); | |
| 69 | + // 校验是否更新正确 | |
| 70 | + CrmCustomerDO customer = customerMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 71 | + assertPojoEquals(reqVO, customer); | |
| 72 | + } | |
| 73 | + | |
| 74 | + @Test | |
| 75 | + public void testUpdateCustomer_notExists() { | |
| 76 | + // 准备参数 | |
| 77 | + CrmCustomerUpdateReqVO reqVO = randomPojo(CrmCustomerUpdateReqVO.class); | |
| 78 | + | |
| 79 | + // 调用, 并断言异常 | |
| 80 | + assertServiceException(() -> customerService.updateCustomer(reqVO), CUSTOMER_NOT_EXISTS); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @Test | |
| 84 | + public void testDeleteCustomer_success() { | |
| 85 | + // mock 数据 | |
| 86 | + CrmCustomerDO dbCustomer = randomPojo(CrmCustomerDO.class); | |
| 87 | + customerMapper.insert(dbCustomer);// @Sql: 先插入出一条存在的数据 | |
| 88 | + // 准备参数 | |
| 89 | + Long id = dbCustomer.getId(); | |
| 90 | + | |
| 91 | + // 调用 | |
| 92 | + customerService.deleteCustomer(id); | |
| 93 | + // 校验数据不存在了 | |
| 94 | + assertNull(customerMapper.selectById(id)); | |
| 95 | + } | |
| 96 | + | |
| 97 | + @Test | |
| 98 | + public void testDeleteCustomer_notExists() { | |
| 99 | + // 准备参数 | |
| 100 | + Long id = randomLongId(); | |
| 101 | + | |
| 102 | + // 调用, 并断言异常 | |
| 103 | + assertServiceException(() -> customerService.deleteCustomer(id), CUSTOMER_NOT_EXISTS); | |
| 104 | + } | |
| 105 | + | |
| 106 | + @Test | |
| 107 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 108 | + public void testGetCustomerPage() { | |
| 109 | + // mock 数据 | |
| 110 | + CrmCustomerDO dbCustomer = randomPojo(CrmCustomerDO.class, o -> { // 等会查询到 | |
| 111 | + o.setName(null); | |
| 112 | + o.setMobile(null); | |
| 113 | + o.setTelephone(null); | |
| 114 | + o.setWebsite(null); | |
| 115 | + }); | |
| 116 | + customerMapper.insert(dbCustomer); | |
| 117 | + // 测试 name 不匹配 | |
| 118 | + customerMapper.insert(cloneIgnoreId(dbCustomer, o -> o.setName(null))); | |
| 119 | + // 测试 mobile 不匹配 | |
| 120 | + customerMapper.insert(cloneIgnoreId(dbCustomer, o -> o.setMobile(null))); | |
| 121 | + // 测试 telephone 不匹配 | |
| 122 | + customerMapper.insert(cloneIgnoreId(dbCustomer, o -> o.setTelephone(null))); | |
| 123 | + // 测试 website 不匹配 | |
| 124 | + customerMapper.insert(cloneIgnoreId(dbCustomer, o -> o.setWebsite(null))); | |
| 125 | + // 准备参数 | |
| 126 | + CrmCustomerPageReqVO reqVO = new CrmCustomerPageReqVO(); | |
| 127 | + reqVO.setName(null); | |
| 128 | + reqVO.setMobile(null); | |
| 129 | + //reqVO.setTelephone(null); | |
| 130 | + //reqVO.setWebsite(null); | |
| 131 | + | |
| 132 | + // 调用 | |
| 133 | + PageResult<CrmCustomerDO> pageResult = customerService.getCustomerPage(reqVO); | |
| 134 | + // 断言 | |
| 135 | + assertEquals(1, pageResult.getTotal()); | |
| 136 | + assertEquals(1, pageResult.getList().size()); | |
| 137 | + assertPojoEquals(dbCustomer, pageResult.getList().get(0)); | |
| 138 | + } | |
| 139 | + | |
| 140 | + @Test | |
| 141 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 142 | + public void testGetCustomerList() { | |
| 143 | + // mock 数据 | |
| 144 | + CrmCustomerDO dbCustomer = randomPojo(CrmCustomerDO.class, o -> { // 等会查询到 | |
| 145 | + o.setName(null); | |
| 146 | + o.setMobile(null); | |
| 147 | + o.setTelephone(null); | |
| 148 | + o.setWebsite(null); | |
| 149 | + }); | |
| 150 | + customerMapper.insert(dbCustomer); | |
| 151 | + // 测试 name 不匹配 | |
| 152 | + customerMapper.insert(cloneIgnoreId(dbCustomer, o -> o.setName(null))); | |
| 153 | + // 测试 mobile 不匹配 | |
| 154 | + customerMapper.insert(cloneIgnoreId(dbCustomer, o -> o.setMobile(null))); | |
| 155 | + // 测试 telephone 不匹配 | |
| 156 | + customerMapper.insert(cloneIgnoreId(dbCustomer, o -> o.setTelephone(null))); | |
| 157 | + // 测试 website 不匹配 | |
| 158 | + customerMapper.insert(cloneIgnoreId(dbCustomer, o -> o.setWebsite(null))); | |
| 159 | + // 准备参数 | |
| 160 | + CrmCustomerExportReqVO reqVO = new CrmCustomerExportReqVO(); | |
| 161 | + reqVO.setName(null); | |
| 162 | + reqVO.setMobile(null); | |
| 163 | + //reqVO.setTelephone(null); | |
| 164 | + //reqVO.setWebsite(null); | |
| 165 | + | |
| 166 | + // 调用 | |
| 167 | + List<CrmCustomerDO> list = customerService.getCustomerList(reqVO); | |
| 168 | + // 断言 | |
| 169 | + assertEquals(1, list.size()); | |
| 170 | + assertPojoEquals(dbCustomer, list.get(0)); | |
| 171 | + } | |
| 172 | + | |
| 173 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.receivable; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper; | |
| 11 | +import org.junit.jupiter.api.Disabled; | |
| 12 | +import org.junit.jupiter.api.Test; | |
| 13 | +import org.springframework.context.annotation.Import; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 19 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 20 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_PLAN_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | + | |
| 27 | +// TODO 芋艿:后续,需要补充测试用例 | |
| 28 | +/** | |
| 29 | + * {@link ReceivablePlanServiceImpl} 的单元测试类 | |
| 30 | + * | |
| 31 | + * @author 芋道源码 | |
| 32 | + */ | |
| 33 | +@Import(ReceivablePlanServiceImpl.class) | |
| 34 | +public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private ReceivablePlanServiceImpl receivablePlanService; | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private ReceivablePlanMapper receivablePlanMapper; | |
| 41 | + | |
| 42 | + @Test | |
| 43 | + public void testCreateReceivablePlan_success() { | |
| 44 | + // 准备参数 | |
| 45 | + ReceivablePlanCreateReqVO reqVO = randomPojo(ReceivablePlanCreateReqVO.class); | |
| 46 | + | |
| 47 | + // 调用 | |
| 48 | + Long receivablePlanId = receivablePlanService.createReceivablePlan(reqVO); | |
| 49 | + // 断言 | |
| 50 | + assertNotNull(receivablePlanId); | |
| 51 | + // 校验记录的属性是否正确 | |
| 52 | + ReceivablePlanDO receivablePlan = receivablePlanMapper.selectById(receivablePlanId); | |
| 53 | + assertPojoEquals(reqVO, receivablePlan); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Test | |
| 57 | + public void testUpdateReceivablePlan_success() { | |
| 58 | + // mock 数据 | |
| 59 | + ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class); | |
| 60 | + receivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据 | |
| 61 | + // 准备参数 | |
| 62 | + ReceivablePlanUpdateReqVO reqVO = randomPojo(ReceivablePlanUpdateReqVO.class, o -> { | |
| 63 | + o.setId(dbReceivablePlan.getId()); // 设置更新的 ID | |
| 64 | + }); | |
| 65 | + | |
| 66 | + // 调用 | |
| 67 | + receivablePlanService.updateReceivablePlan(reqVO); | |
| 68 | + // 校验是否更新正确 | |
| 69 | + ReceivablePlanDO receivablePlan = receivablePlanMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 70 | + assertPojoEquals(reqVO, receivablePlan); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Test | |
| 74 | + public void testUpdateReceivablePlan_notExists() { | |
| 75 | + // 准备参数 | |
| 76 | + ReceivablePlanUpdateReqVO reqVO = randomPojo(ReceivablePlanUpdateReqVO.class); | |
| 77 | + | |
| 78 | + // 调用, 并断言异常 | |
| 79 | + assertServiceException(() -> receivablePlanService.updateReceivablePlan(reqVO), RECEIVABLE_PLAN_NOT_EXISTS); | |
| 80 | + } | |
| 81 | + | |
| 82 | + @Test | |
| 83 | + public void testDeleteReceivablePlan_success() { | |
| 84 | + // mock 数据 | |
| 85 | + ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class); | |
| 86 | + receivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据 | |
| 87 | + // 准备参数 | |
| 88 | + Long id = dbReceivablePlan.getId(); | |
| 89 | + | |
| 90 | + // 调用 | |
| 91 | + receivablePlanService.deleteReceivablePlan(id); | |
| 92 | + // 校验数据不存在了 | |
| 93 | + assertNull(receivablePlanMapper.selectById(id)); | |
| 94 | + } | |
| 95 | + | |
| 96 | + @Test | |
| 97 | + public void testDeleteReceivablePlan_notExists() { | |
| 98 | + // 准备参数 | |
| 99 | + Long id = randomLongId(); | |
| 100 | + | |
| 101 | + // 调用, 并断言异常 | |
| 102 | + assertServiceException(() -> receivablePlanService.deleteReceivablePlan(id), RECEIVABLE_PLAN_NOT_EXISTS); | |
| 103 | + } | |
| 104 | + | |
| 105 | + @Test | |
| 106 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 107 | + public void testGetReceivablePlanPage() { | |
| 108 | + // mock 数据 | |
| 109 | + ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class, o -> { // 等会查询到 | |
| 110 | + o.setIndexNo(null); | |
| 111 | + o.setStatus(null); | |
| 112 | + o.setCheckStatus(null); | |
| 113 | + o.setReturnTime(null); | |
| 114 | + o.setRemindDays(null); | |
| 115 | + o.setRemindTime(null); | |
| 116 | + o.setCustomerId(null); | |
| 117 | + o.setContractId(null); | |
| 118 | + o.setOwnerUserId(null); | |
| 119 | + o.setRemark(null); | |
| 120 | + o.setCreateTime(null); | |
| 121 | + }); | |
| 122 | + receivablePlanMapper.insert(dbReceivablePlan); | |
| 123 | + // 测试 indexNo 不匹配 | |
| 124 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setIndexNo(null))); | |
| 125 | + // 测试 status 不匹配 | |
| 126 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null))); | |
| 127 | + // 测试 checkStatus 不匹配 | |
| 128 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null))); | |
| 129 | + // 测试 returnTime 不匹配 | |
| 130 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null))); | |
| 131 | + // 测试 remindDays 不匹配 | |
| 132 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null))); | |
| 133 | + // 测试 remindTime 不匹配 | |
| 134 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null))); | |
| 135 | + // 测试 customerId 不匹配 | |
| 136 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null))); | |
| 137 | + // 测试 contractId 不匹配 | |
| 138 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null))); | |
| 139 | + // 测试 ownerUserId 不匹配 | |
| 140 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null))); | |
| 141 | + // 测试 remark 不匹配 | |
| 142 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null))); | |
| 143 | + // 测试 createTime 不匹配 | |
| 144 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null))); | |
| 145 | + // 准备参数 | |
| 146 | + ReceivablePlanPageReqVO reqVO = new ReceivablePlanPageReqVO(); | |
| 147 | + reqVO.setIndexNo(null); | |
| 148 | + reqVO.setStatus(null); | |
| 149 | + reqVO.setCheckStatus(null); | |
| 150 | + reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 151 | + reqVO.setRemindDays(null); | |
| 152 | + reqVO.setRemindTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 153 | + reqVO.setCustomerId(null); | |
| 154 | + reqVO.setContractId(null); | |
| 155 | + reqVO.setOwnerUserId(null); | |
| 156 | + reqVO.setRemark(null); | |
| 157 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 158 | + | |
| 159 | + // 调用 | |
| 160 | + PageResult<ReceivablePlanDO> pageResult = receivablePlanService.getReceivablePlanPage(reqVO); | |
| 161 | + // 断言 | |
| 162 | + assertEquals(1, pageResult.getTotal()); | |
| 163 | + assertEquals(1, pageResult.getList().size()); | |
| 164 | + assertPojoEquals(dbReceivablePlan, pageResult.getList().get(0)); | |
| 165 | + } | |
| 166 | + | |
| 167 | + @Test | |
| 168 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 169 | + public void testGetReceivablePlanList() { | |
| 170 | + // mock 数据 | |
| 171 | + ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class, o -> { // 等会查询到 | |
| 172 | + o.setIndexNo(null); | |
| 173 | + o.setStatus(null); | |
| 174 | + o.setCheckStatus(null); | |
| 175 | + o.setReturnTime(null); | |
| 176 | + o.setRemindDays(null); | |
| 177 | + o.setRemindTime(null); | |
| 178 | + o.setCustomerId(null); | |
| 179 | + o.setContractId(null); | |
| 180 | + o.setOwnerUserId(null); | |
| 181 | + o.setRemark(null); | |
| 182 | + o.setCreateTime(null); | |
| 183 | + }); | |
| 184 | + receivablePlanMapper.insert(dbReceivablePlan); | |
| 185 | + // 测试 indexNo 不匹配 | |
| 186 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setIndexNo(null))); | |
| 187 | + // 测试 status 不匹配 | |
| 188 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null))); | |
| 189 | + // 测试 checkStatus 不匹配 | |
| 190 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null))); | |
| 191 | + // 测试 returnTime 不匹配 | |
| 192 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null))); | |
| 193 | + // 测试 remindDays 不匹配 | |
| 194 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null))); | |
| 195 | + // 测试 remindTime 不匹配 | |
| 196 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null))); | |
| 197 | + // 测试 customerId 不匹配 | |
| 198 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null))); | |
| 199 | + // 测试 contractId 不匹配 | |
| 200 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null))); | |
| 201 | + // 测试 ownerUserId 不匹配 | |
| 202 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null))); | |
| 203 | + // 测试 remark 不匹配 | |
| 204 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null))); | |
| 205 | + // 测试 createTime 不匹配 | |
| 206 | + receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null))); | |
| 207 | + // 准备参数 | |
| 208 | + ReceivablePlanExportReqVO reqVO = new ReceivablePlanExportReqVO(); | |
| 209 | + reqVO.setIndexNo(null); | |
| 210 | + reqVO.setStatus(null); | |
| 211 | + reqVO.setCheckStatus(null); | |
| 212 | + reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 213 | + reqVO.setRemindDays(null); | |
| 214 | + reqVO.setRemindTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 215 | + reqVO.setCustomerId(null); | |
| 216 | + reqVO.setContractId(null); | |
| 217 | + reqVO.setOwnerUserId(null); | |
| 218 | + reqVO.setRemark(null); | |
| 219 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 220 | + | |
| 221 | + // 调用 | |
| 222 | + List<ReceivablePlanDO> list = receivablePlanService.getReceivablePlanList(reqVO); | |
| 223 | + // 断言 | |
| 224 | + assertEquals(1, list.size()); | |
| 225 | + assertPojoEquals(dbReceivablePlan, list.get(0)); | |
| 226 | + } | |
| 227 | + | |
| 228 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.receivable; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; | |
| 10 | +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper; | |
| 11 | +import org.junit.jupiter.api.Disabled; | |
| 12 | +import org.junit.jupiter.api.Test; | |
| 13 | +import org.springframework.context.annotation.Import; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 19 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 20 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 24 | +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | + | |
| 27 | +// TODO 芋艿:等实现完,在校验下; | |
| 28 | +/** | |
| 29 | + * {@link ReceivableServiceImpl} 的单元测试类 | |
| 30 | + * | |
| 31 | + * @author 赤焰 | |
| 32 | + */ | |
| 33 | +@Import(ReceivableServiceImpl.class) | |
| 34 | +public class ReceivableServiceImplTest extends BaseDbUnitTest { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private ReceivableServiceImpl receivableService; | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private ReceivableMapper receivableMapper; | |
| 41 | + | |
| 42 | + @Test | |
| 43 | + public void testCreateReceivable_success() { | |
| 44 | + // 准备参数 | |
| 45 | + ReceivableCreateReqVO reqVO = randomPojo(ReceivableCreateReqVO.class); | |
| 46 | + | |
| 47 | + // 调用 | |
| 48 | + Long receivableId = receivableService.createReceivable(reqVO); | |
| 49 | + // 断言 | |
| 50 | + assertNotNull(receivableId); | |
| 51 | + // 校验记录的属性是否正确 | |
| 52 | + ReceivableDO receivable = receivableMapper.selectById(receivableId); | |
| 53 | + assertPojoEquals(reqVO, receivable); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Test | |
| 57 | + public void testUpdateReceivable_success() { | |
| 58 | + // mock 数据 | |
| 59 | + ReceivableDO dbReceivable = randomPojo(ReceivableDO.class); | |
| 60 | + receivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据 | |
| 61 | + // 准备参数 | |
| 62 | + ReceivableUpdateReqVO reqVO = randomPojo(ReceivableUpdateReqVO.class, o -> { | |
| 63 | + o.setId(dbReceivable.getId()); // 设置更新的 ID | |
| 64 | + }); | |
| 65 | + | |
| 66 | + // 调用 | |
| 67 | + receivableService.updateReceivable(reqVO); | |
| 68 | + // 校验是否更新正确 | |
| 69 | + ReceivableDO receivable = receivableMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 70 | + assertPojoEquals(reqVO, receivable); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Test | |
| 74 | + public void testUpdateReceivable_notExists() { | |
| 75 | + // 准备参数 | |
| 76 | + ReceivableUpdateReqVO reqVO = randomPojo(ReceivableUpdateReqVO.class); | |
| 77 | + | |
| 78 | + // 调用, 并断言异常 | |
| 79 | + assertServiceException(() -> receivableService.updateReceivable(reqVO), RECEIVABLE_NOT_EXISTS); | |
| 80 | + } | |
| 81 | + | |
| 82 | + @Test | |
| 83 | + public void testDeleteReceivable_success() { | |
| 84 | + // mock 数据 | |
| 85 | + ReceivableDO dbReceivable = randomPojo(ReceivableDO.class); | |
| 86 | + receivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据 | |
| 87 | + // 准备参数 | |
| 88 | + Long id = dbReceivable.getId(); | |
| 89 | + | |
| 90 | + // 调用 | |
| 91 | + receivableService.deleteReceivable(id); | |
| 92 | + // 校验数据不存在了 | |
| 93 | + assertNull(receivableMapper.selectById(id)); | |
| 94 | + } | |
| 95 | + | |
| 96 | + @Test | |
| 97 | + public void testDeleteReceivable_notExists() { | |
| 98 | + // 准备参数 | |
| 99 | + Long id = randomLongId(); | |
| 100 | + | |
| 101 | + // 调用, 并断言异常 | |
| 102 | + assertServiceException(() -> receivableService.deleteReceivable(id), RECEIVABLE_NOT_EXISTS); | |
| 103 | + } | |
| 104 | + | |
| 105 | + @Test | |
| 106 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 107 | + public void testGetReceivablePage() { | |
| 108 | + // mock 数据 | |
| 109 | + ReceivableDO dbReceivable = randomPojo(ReceivableDO.class, o -> { // 等会查询到 | |
| 110 | + o.setNo(null); | |
| 111 | + o.setPlanId(null); | |
| 112 | + o.setCustomerId(null); | |
| 113 | + o.setContractId(null); | |
| 114 | + o.setCheckStatus(null); | |
| 115 | + o.setProcessInstanceId(null); | |
| 116 | + o.setReturnTime(null); | |
| 117 | + o.setReturnType(null); | |
| 118 | + o.setPrice(null); | |
| 119 | + o.setOwnerUserId(null); | |
| 120 | + o.setBatchId(null); | |
| 121 | + o.setSort(null); | |
| 122 | + o.setDataScope(null); | |
| 123 | + o.setDataScopeDeptIds(null); | |
| 124 | + o.setStatus(null); | |
| 125 | + o.setRemark(null); | |
| 126 | + o.setCreateTime(null); | |
| 127 | + }); | |
| 128 | + receivableMapper.insert(dbReceivable); | |
| 129 | + // 测试 no 不匹配 | |
| 130 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null))); | |
| 131 | + // 测试 planId 不匹配 | |
| 132 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null))); | |
| 133 | + // 测试 customerId 不匹配 | |
| 134 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null))); | |
| 135 | + // 测试 contractId 不匹配 | |
| 136 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null))); | |
| 137 | + // 测试 checkStatus 不匹配 | |
| 138 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null))); | |
| 139 | + // 测试 processInstanceId 不匹配 | |
| 140 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null))); | |
| 141 | + // 测试 returnTime 不匹配 | |
| 142 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null))); | |
| 143 | + // 测试 returnType 不匹配 | |
| 144 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null))); | |
| 145 | + // 测试 price 不匹配 | |
| 146 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null))); | |
| 147 | + // 测试 ownerUserId 不匹配 | |
| 148 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null))); | |
| 149 | + // 测试 batchId 不匹配 | |
| 150 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null))); | |
| 151 | + // 测试 sort 不匹配 | |
| 152 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null))); | |
| 153 | + // 测试 dataScope 不匹配 | |
| 154 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null))); | |
| 155 | + // 测试 dataScopeDeptIds 不匹配 | |
| 156 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null))); | |
| 157 | + // 测试 status 不匹配 | |
| 158 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null))); | |
| 159 | + // 测试 remark 不匹配 | |
| 160 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null))); | |
| 161 | + // 测试 createTime 不匹配 | |
| 162 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null))); | |
| 163 | + // 准备参数 | |
| 164 | + ReceivablePageReqVO reqVO = new ReceivablePageReqVO(); | |
| 165 | + reqVO.setNo(null); | |
| 166 | + reqVO.setPlanId(null); | |
| 167 | + reqVO.setCustomerId(null); | |
| 168 | + reqVO.setContractId(null); | |
| 169 | + reqVO.setCheckStatus(null); | |
| 170 | + reqVO.setProcessInstanceId(null); | |
| 171 | + reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 172 | + reqVO.setReturnType(null); | |
| 173 | + reqVO.setPrice(null); | |
| 174 | + reqVO.setOwnerUserId(null); | |
| 175 | + reqVO.setBatchId(null); | |
| 176 | + reqVO.setSort(null); | |
| 177 | + reqVO.setDataScope(null); | |
| 178 | + reqVO.setDataScopeDeptIds(null); | |
| 179 | + reqVO.setStatus(null); | |
| 180 | + reqVO.setRemark(null); | |
| 181 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 182 | + | |
| 183 | + // 调用 | |
| 184 | + PageResult<ReceivableDO> pageResult = receivableService.getReceivablePage(reqVO); | |
| 185 | + // 断言 | |
| 186 | + assertEquals(1, pageResult.getTotal()); | |
| 187 | + assertEquals(1, pageResult.getList().size()); | |
| 188 | + assertPojoEquals(dbReceivable, pageResult.getList().get(0)); | |
| 189 | + } | |
| 190 | + | |
| 191 | + @Test | |
| 192 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 193 | + public void testGetReceivableList() { | |
| 194 | + // mock 数据 | |
| 195 | + ReceivableDO dbReceivable = randomPojo(ReceivableDO.class, o -> { // 等会查询到 | |
| 196 | + o.setNo(null); | |
| 197 | + o.setPlanId(null); | |
| 198 | + o.setCustomerId(null); | |
| 199 | + o.setContractId(null); | |
| 200 | + o.setCheckStatus(null); | |
| 201 | + o.setProcessInstanceId(null); | |
| 202 | + o.setReturnTime(null); | |
| 203 | + o.setReturnType(null); | |
| 204 | + o.setPrice(null); | |
| 205 | + o.setOwnerUserId(null); | |
| 206 | + o.setBatchId(null); | |
| 207 | + o.setSort(null); | |
| 208 | + o.setDataScope(null); | |
| 209 | + o.setDataScopeDeptIds(null); | |
| 210 | + o.setStatus(null); | |
| 211 | + o.setRemark(null); | |
| 212 | + o.setCreateTime(null); | |
| 213 | + }); | |
| 214 | + receivableMapper.insert(dbReceivable); | |
| 215 | + // 测试 no 不匹配 | |
| 216 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null))); | |
| 217 | + // 测试 planId 不匹配 | |
| 218 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null))); | |
| 219 | + // 测试 customerId 不匹配 | |
| 220 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null))); | |
| 221 | + // 测试 contractId 不匹配 | |
| 222 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null))); | |
| 223 | + // 测试 checkStatus 不匹配 | |
| 224 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null))); | |
| 225 | + // 测试 processInstanceId 不匹配 | |
| 226 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null))); | |
| 227 | + // 测试 returnTime 不匹配 | |
| 228 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null))); | |
| 229 | + // 测试 returnType 不匹配 | |
| 230 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null))); | |
| 231 | + // 测试 price 不匹配 | |
| 232 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null))); | |
| 233 | + // 测试 ownerUserId 不匹配 | |
| 234 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null))); | |
| 235 | + // 测试 batchId 不匹配 | |
| 236 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null))); | |
| 237 | + // 测试 sort 不匹配 | |
| 238 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null))); | |
| 239 | + // 测试 dataScope 不匹配 | |
| 240 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null))); | |
| 241 | + // 测试 dataScopeDeptIds 不匹配 | |
| 242 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null))); | |
| 243 | + // 测试 status 不匹配 | |
| 244 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null))); | |
| 245 | + // 测试 remark 不匹配 | |
| 246 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null))); | |
| 247 | + // 测试 createTime 不匹配 | |
| 248 | + receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null))); | |
| 249 | + // 准备参数 | |
| 250 | + ReceivableExportReqVO reqVO = new ReceivableExportReqVO(); | |
| 251 | + reqVO.setNo(null); | |
| 252 | + reqVO.setPlanId(null); | |
| 253 | + reqVO.setCustomerId(null); | |
| 254 | + reqVO.setContractId(null); | |
| 255 | + reqVO.setCheckStatus(null); | |
| 256 | + reqVO.setProcessInstanceId(null); | |
| 257 | + reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 258 | + reqVO.setReturnType(null); | |
| 259 | + reqVO.setPrice(null); | |
| 260 | + reqVO.setOwnerUserId(null); | |
| 261 | + reqVO.setBatchId(null); | |
| 262 | + reqVO.setSort(null); | |
| 263 | + reqVO.setDataScope(null); | |
| 264 | + reqVO.setDataScopeDeptIds(null); | |
| 265 | + reqVO.setStatus(null); | |
| 266 | + reqVO.setRemark(null); | |
| 267 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 268 | + | |
| 269 | + // 调用 | |
| 270 | + List<ReceivableDO> list = receivableService.getReceivableList(reqVO); | |
| 271 | + // 断言 | |
| 272 | + assertEquals(1, list.size()); | |
| 273 | + assertPojoEquals(dbReceivable, list.get(0)); | |
| 274 | + } | |
| 275 | + | |
| 276 | +} | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/resources/application-unit-test.yaml
0 → 100644
| 1 | +spring: | |
| 2 | + main: | |
| 3 | + lazy-initialization: true # 开启懒加载,加快速度 | |
| 4 | + banner-mode: off # 单元测试,禁用 Banner | |
| 5 | + | |
| 6 | +--- #################### 数据库相关配置 #################### | |
| 7 | + | |
| 8 | +spring: | |
| 9 | + # 数据源配置项 | |
| 10 | + datasource: | |
| 11 | + name: ruoyi-vue-pro | |
| 12 | + url: jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;NON_KEYWORDS=value; # MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写 | |
| 13 | + driver-class-name: org.h2.Driver | |
| 14 | + username: sa | |
| 15 | + password: | |
| 16 | + druid: | |
| 17 | + async-init: true # 单元测试,异步初始化 Druid 连接池,提升启动速度 | |
| 18 | + initial-size: 1 # 单元测试,配置为 1,提升启动速度 | |
| 19 | + sql: | |
| 20 | + init: | |
| 21 | + schema-locations: classpath:/sql/create_tables.sql | |
| 22 | + | |
| 23 | + # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 | |
| 24 | + redis: | |
| 25 | + host: 127.0.0.1 # 地址 | |
| 26 | + port: 16379 # 端口(单元测试,使用 16379 端口) | |
| 27 | + database: 0 # 数据库索引 | |
| 28 | + | |
| 29 | +mybatis-plus: | |
| 30 | + lazy-initialization: true # 单元测试,设置 MyBatis Mapper 延迟加载,加速每个单元测试 | |
| 31 | + type-aliases-package: ${yudao.info.base-package}.module.*.dal.dataobject | |
| 32 | + | |
| 33 | +--- #################### 定时任务相关配置 #################### | |
| 34 | + | |
| 35 | +--- #################### 配置中心相关配置 #################### | |
| 36 | + | |
| 37 | +--- #################### 服务保障相关配置 #################### | |
| 38 | + | |
| 39 | +# Lock4j 配置项(单元测试,禁用 Lock4j) | |
| 40 | + | |
| 41 | +# Resilience4j 配置项 | |
| 42 | + | |
| 43 | +--- #################### 监控相关配置 #################### | |
| 44 | + | |
| 45 | +--- #################### 芋道相关配置 #################### | |
| 46 | + | |
| 47 | +# 芋道配置项,设置当前项目所有自定义的配置 | |
| 48 | +yudao: | |
| 49 | + info: | |
| 50 | + base-package: cn.iocoder.yudao | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/test/resources/logback.xml
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/test/resources/sql/clean.sql
0 → 100644
yudao-module-crm/yudao-module-crm-biz/src/test/resources/sql/create_tables.sql
0 → 100644
| 1 | +CREATE TABLE IF NOT EXISTS "crm_contract" ( | |
| 2 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 3 | + "name" varchar NOT NULL, | |
| 4 | + "customer_id" bigint, | |
| 5 | + "business_id" bigint, | |
| 6 | + "process_instance_id" bigint, | |
| 7 | + "order_date" varchar, | |
| 8 | + "owner_user_id" bigint, | |
| 9 | + "no" varchar, | |
| 10 | + "start_time" varchar, | |
| 11 | + "end_time" varchar, | |
| 12 | + "price" int, | |
| 13 | + "discount_percent" int, | |
| 14 | + "product_price" int, | |
| 15 | + "ro_user_ids" varchar, | |
| 16 | + "rw_user_ids" varchar, | |
| 17 | + "contact_id" bigint, | |
| 18 | + "sign_user_id" bigint, | |
| 19 | + "contact_last_time" varchar, | |
| 20 | + "remark" varchar, | |
| 21 | + "creator" varchar DEFAULT '', | |
| 22 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 23 | + "updater" varchar DEFAULT '', | |
| 24 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 25 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 26 | + PRIMARY KEY ("id") | |
| 27 | +) COMMENT '合同表'; | |
| 28 | + | |
| 29 | +CREATE TABLE IF NOT EXISTS "crm_clue" ( | |
| 30 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 31 | + "transform_status" bit NOT NULL, | |
| 32 | + "follow_up_status" bit NOT NULL, | |
| 33 | + "name" varchar NOT NULL, | |
| 34 | + "customer_id" bigint NOT NULL, | |
| 35 | + "contact_next_time" varchar, | |
| 36 | + "telephone" varchar, | |
| 37 | + "mobile" varchar, | |
| 38 | + "address" varchar, | |
| 39 | + "owner_user_id" bigint, | |
| 40 | + "contact_last_time" varchar, | |
| 41 | + "remark" varchar, | |
| 42 | + "creator" varchar DEFAULT '', | |
| 43 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 44 | + "updater" varchar DEFAULT '', | |
| 45 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 46 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 47 | + "tenant_id" bigint NOT NULL, | |
| 48 | + PRIMARY KEY ("id") | |
| 49 | +) COMMENT '线索表'; | |
| 50 | + | |
| 51 | +CREATE TABLE IF NOT EXISTS "crm_receivable" ( | |
| 52 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 53 | + "no" varchar, | |
| 54 | + "plan_id" bigint, | |
| 55 | + "customer_id" bigint, | |
| 56 | + "contract_id" bigint, | |
| 57 | + "check_status" int, | |
| 58 | + "process_instance_id" bigint, | |
| 59 | + "return_time" varchar, | |
| 60 | + "return_type" varchar, | |
| 61 | + "price" varchar, | |
| 62 | + "owner_user_id" bigint, | |
| 63 | + "batch_id" bigint, | |
| 64 | + "sort" int, | |
| 65 | + "data_scope" int, | |
| 66 | + "data_scope_dept_ids" varchar, | |
| 67 | + "status" int NOT NULL, | |
| 68 | + "remark" varchar, | |
| 69 | + "creator" varchar DEFAULT '', | |
| 70 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 71 | + "updater" varchar DEFAULT '', | |
| 72 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 73 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 74 | + PRIMARY KEY ("id") | |
| 75 | +) COMMENT '回款管理'; | |
| 76 | + | |
| 77 | +CREATE TABLE IF NOT EXISTS "crm_receivable_plan" ( | |
| 78 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 79 | + "index_no" bigint, | |
| 80 | + "receivable_id" bigint, | |
| 81 | + "status" int NOT NULL, | |
| 82 | + "check_status" varchar, | |
| 83 | + "process_instance_id" bigint, | |
| 84 | + "price" varchar, | |
| 85 | + "return_time" varchar, | |
| 86 | + "remind_days" bigint, | |
| 87 | + "remind_time" varchar, | |
| 88 | + "customer_id" bigint, | |
| 89 | + "contract_id" bigint, | |
| 90 | + "owner_user_id" bigint, | |
| 91 | + "sort" int, | |
| 92 | + "remark" varchar, | |
| 93 | + "creator" varchar DEFAULT '', | |
| 94 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 95 | + "updater" varchar DEFAULT '', | |
| 96 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 97 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 98 | + PRIMARY KEY ("id") | |
| 99 | +) COMMENT '回款计划'; | |
| 100 | + | |
| 101 | +CREATE TABLE IF NOT EXISTS "crm_customer" ( | |
| 102 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 103 | + "name" varchar, | |
| 104 | + "follow_up_status" bit NOT NULL, | |
| 105 | + "lock_status" bit NOT NULL, | |
| 106 | + "deal_status" bit NOT NULL, | |
| 107 | + "mobile" varchar, | |
| 108 | + "telephone" varchar, | |
| 109 | + "website" varchar, | |
| 110 | + "remark" varchar, | |
| 111 | + "owner_user_id" bigint, | |
| 112 | + "ro_user_ids" varchar, | |
| 113 | + "rw_user_ids" varchar, | |
| 114 | + "area_id" bigint, | |
| 115 | + "detail_address" varchar, | |
| 116 | + "contact_last_time" varchar, | |
| 117 | + "contact_next_time" varchar, | |
| 118 | + "creator" varchar DEFAULT '', | |
| 119 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 120 | + "updater" varchar DEFAULT '', | |
| 121 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 122 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 123 | + "tenant_id" bigint NOT NULL, | |
| 124 | + PRIMARY KEY ("id") | |
| 125 | +) COMMENT '客户表'; | |
| 0 | 126 | \ No newline at end of file | ... | ... |
yudao-server/pom.xml
| ... | ... | @@ -91,6 +91,13 @@ |
| 91 | 91 | <!-- <version>${revision}</version>--> |
| 92 | 92 | <!-- </dependency>--> |
| 93 | 93 | |
| 94 | + <!-- CRM 相关模块。默认注释,保证编译速度 --> | |
| 95 | + <dependency> | |
| 96 | + <groupId>cn.iocoder.boot</groupId> | |
| 97 | + <artifactId>yudao-module-crm-biz</artifactId> | |
| 98 | + <version>${revision}</version> | |
| 99 | + </dependency> | |
| 100 | + | |
| 94 | 101 | <!-- spring boot 配置所需依赖 --> |
| 95 | 102 | <dependency> |
| 96 | 103 | <groupId>org.springframework.boot</groupId> | ... | ... |
yudao-ui-admin/src/api/crm/business.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 创建商机 | |
| 4 | +export function createBusiness(data) { | |
| 5 | + return request({ | |
| 6 | + url: '/crm/business/create', | |
| 7 | + method: 'post', | |
| 8 | + data: data | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 更新商机 | |
| 13 | +export function updateBusiness(data) { | |
| 14 | + return request({ | |
| 15 | + url: '/crm/business/update', | |
| 16 | + method: 'put', | |
| 17 | + data: data | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 删除商机 | |
| 22 | +export function deleteBusiness(id) { | |
| 23 | + return request({ | |
| 24 | + url: '/crm/business/delete?id=' + id, | |
| 25 | + method: 'delete' | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 获得商机 | |
| 30 | +export function getBusiness(id) { | |
| 31 | + return request({ | |
| 32 | + url: '/crm/business/get?id=' + id, | |
| 33 | + method: 'get' | |
| 34 | + }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 获得商机分页 | |
| 38 | +export function getBusinessPage(query) { | |
| 39 | + return request({ | |
| 40 | + url: '/crm/business/page', | |
| 41 | + method: 'get', | |
| 42 | + params: query | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出商机 Excel | |
| 47 | +export function exportBusinessExcel(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/crm/business/export-excel', | |
| 50 | + method: 'get', | |
| 51 | + params: query, | |
| 52 | + responseType: 'blob' | |
| 53 | + }) | |
| 54 | +} | ... | ... |
yudao-ui-admin/src/api/crm/businessStatus.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 创建商机状态 | |
| 4 | +export function createBusinessStatus(data) { | |
| 5 | + return request({ | |
| 6 | + url: '/crm/business-status/create', | |
| 7 | + method: 'post', | |
| 8 | + data: data | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 更新商机状态 | |
| 13 | +export function updateBusinessStatus(data) { | |
| 14 | + return request({ | |
| 15 | + url: '/crm/business-status/update', | |
| 16 | + method: 'put', | |
| 17 | + data: data | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 删除商机状态 | |
| 22 | +export function deleteBusinessStatus(id) { | |
| 23 | + return request({ | |
| 24 | + url: '/crm/business-status/delete?id=' + id, | |
| 25 | + method: 'delete' | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 获得商机状态 | |
| 30 | +export function getBusinessStatus(id) { | |
| 31 | + return request({ | |
| 32 | + url: '/crm/business-status/get?id=' + id, | |
| 33 | + method: 'get' | |
| 34 | + }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 获得商机状态分页 | |
| 38 | +export function getBusinessStatusPage(query) { | |
| 39 | + return request({ | |
| 40 | + url: '/crm/business-status/page', | |
| 41 | + method: 'get', | |
| 42 | + params: query | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出商机状态 Excel | |
| 47 | +export function exportBusinessStatusExcel(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/crm/business-status/export-excel', | |
| 50 | + method: 'get', | |
| 51 | + params: query, | |
| 52 | + responseType: 'blob' | |
| 53 | + }) | |
| 54 | +} | |
| 55 | + | |
| 56 | +// 根据类型ID获取商机状态信息列表 | |
| 57 | +export function getBusinessStatusListByTypeId(typeId) { | |
| 58 | + return request({ | |
| 59 | + url: '/crm/business-status/get-simple-list?typeId=' + typeId, | |
| 60 | + method: 'get' | |
| 61 | + }) | |
| 62 | +} | |
| 63 | + | |
| 64 | +// 获取商机状态信息列表 | |
| 65 | +export function getBusinessStatusList() { | |
| 66 | + return request({ | |
| 67 | + url: '/crm/business-status/get-all-list', | |
| 68 | + method: 'get' | |
| 69 | + }) | |
| 70 | +} | ... | ... |
yudao-ui-admin/src/api/crm/businessStatusType.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 创建商机状态类型 | |
| 4 | +export function createBusinessStatusType(data) { | |
| 5 | + return request({ | |
| 6 | + url: '/crm/business-status-type/create', | |
| 7 | + method: 'post', | |
| 8 | + data: data | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 更新商机状态类型 | |
| 13 | +export function updateBusinessStatusType(data) { | |
| 14 | + return request({ | |
| 15 | + url: '/crm/business-status-type/update', | |
| 16 | + method: 'put', | |
| 17 | + data: data | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 删除商机状态类型 | |
| 22 | +export function deleteBusinessStatusType(id) { | |
| 23 | + return request({ | |
| 24 | + url: '/crm/business-status-type/delete?id=' + id, | |
| 25 | + method: 'delete' | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 获得商机状态类型 | |
| 30 | +export function getBusinessStatusType(id) { | |
| 31 | + return request({ | |
| 32 | + url: '/crm/business-status-type/get?id=' + id, | |
| 33 | + method: 'get' | |
| 34 | + }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 获得商机状态类型分页 | |
| 38 | +export function getBusinessStatusTypePage(query) { | |
| 39 | + return request({ | |
| 40 | + url: '/crm/business-status-type/page', | |
| 41 | + method: 'get', | |
| 42 | + params: query | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出商机状态类型 Excel | |
| 47 | +export function exportBusinessStatusTypeExcel(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/crm/business-status-type/export-excel', | |
| 50 | + method: 'get', | |
| 51 | + params: query, | |
| 52 | + responseType: 'blob' | |
| 53 | + }) | |
| 54 | +} | |
| 55 | + | |
| 56 | +// 获取商机状态类型信息列表 | |
| 57 | +export function getBusinessStatusTypeList() { | |
| 58 | + return request({ | |
| 59 | + url: '/crm/business-status-type/get-simple-list', | |
| 60 | + method: 'get' | |
| 61 | + }) | |
| 62 | +} | ... | ... |
yudao-ui-admin/src/api/crm/contact/contact.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 创建crm联系人 | |
| 4 | +export function createContact(data) { | |
| 5 | + return request({ | |
| 6 | + url: '/crm/contact/create', | |
| 7 | + method: 'post', | |
| 8 | + data: data | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 更新crm联系人 | |
| 13 | +export function updateContact(data) { | |
| 14 | + return request({ | |
| 15 | + url: '/crm/contact/update', | |
| 16 | + method: 'put', | |
| 17 | + data: data | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 删除crm联系人 | |
| 22 | +export function deleteContact(id) { | |
| 23 | + return request({ | |
| 24 | + url: '/crm/contact/delete?id=' + id, | |
| 25 | + method: 'delete' | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 获得crm联系人 | |
| 30 | +export function getContact(id) { | |
| 31 | + return request({ | |
| 32 | + url: '/crm/contact/get?id=' + id, | |
| 33 | + method: 'get' | |
| 34 | + }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 获得crm联系人分页 | |
| 38 | +export function getContactPage(query) { | |
| 39 | + return request({ | |
| 40 | + url: '/crm/contact/page', | |
| 41 | + method: 'get', | |
| 42 | + params: query | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出crm联系人 Excel | |
| 47 | +export function exportContactExcel(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/crm/contact/export-excel', | |
| 50 | + method: 'get', | |
| 51 | + params: query, | |
| 52 | + responseType: 'blob' | |
| 53 | + }) | |
| 54 | +} | ... | ... |
yudao-ui-admin/src/views/crm/business/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + | |
| 4 | + <!-- 搜索工作栏 --> | |
| 5 | + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |
| 6 | + <el-form-item label="商机名称" prop="name"> | |
| 7 | + <el-input v-model="queryParams.name" placeholder="请输入商机名称" clearable @keyup.enter.native="handleQuery"/> | |
| 8 | + </el-form-item> | |
| 9 | + <el-form-item> | |
| 10 | + <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 11 | + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 12 | + </el-form-item> | |
| 13 | + </el-form> | |
| 14 | + | |
| 15 | + <!-- 操作工具栏 --> | |
| 16 | + <el-row :gutter="10" class="mb8"> | |
| 17 | + <el-col :span="1.5"> | |
| 18 | + <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | |
| 19 | + v-hasPermi="['crm:business:create']">新增</el-button> | |
| 20 | + </el-col> | |
| 21 | + <el-col :span="1.5"> | |
| 22 | + <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" | |
| 23 | + v-hasPermi="['crm:business:export']">导出</el-button> | |
| 24 | + </el-col> | |
| 25 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 26 | + </el-row> | |
| 27 | + | |
| 28 | + <!-- 列表 --> | |
| 29 | + <el-table v-loading="loading" :data="list"> | |
| 30 | + <el-table-column label="商机名称" align="center" prop="name" /> | |
| 31 | + <el-table-column label="客户名称" align="center" prop="customerId" /> | |
| 32 | + <el-table-column label="商机金额" align="center" prop="price" /> | |
| 33 | + <el-table-column label="预计成交日期" align="center" prop="dealTime" width="180"> | |
| 34 | + <template v-slot="scope"> | |
| 35 | + <span>{{ parseTime(scope.row.dealTime) }}</span> | |
| 36 | + </template> | |
| 37 | + </el-table-column> | |
| 38 | + <el-table-column label="备注" align="center" prop="remark" /> | |
| 39 | + <el-table-column label="商机状态类型" align="center" prop="statusTypeId" width="120"> | |
| 40 | + <template v-slot="scope"> | |
| 41 | + <el-tag> {{getBusinessStatusTypeName(scope.row.statusTypeId)}} </el-tag> | |
| 42 | + </template> | |
| 43 | + </el-table-column> | |
| 44 | + <el-table-column label="商机状态" align="center" prop="statusId" width="100"> | |
| 45 | + <template v-slot="scope"> | |
| 46 | + <el-tag> {{getBusinessStatusName(scope.row.statusId)}} </el-tag> | |
| 47 | + </template> | |
| 48 | + </el-table-column> | |
| 49 | + <el-table-column label="更新时间" align="center" prop="updateTime" width="180"> | |
| 50 | + <template v-slot="scope"> | |
| 51 | + <span>{{ parseTime(scope.row.updateTime) }}</span> | |
| 52 | + </template> | |
| 53 | + </el-table-column> | |
| 54 | + <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | |
| 55 | + <template v-slot="scope"> | |
| 56 | + <span>{{ parseTime(scope.row.createTime) }}</span> | |
| 57 | + </template> | |
| 58 | + </el-table-column> | |
| 59 | + <el-table-column label="负责人" align="center" prop="ownerUserId" /> | |
| 60 | + <el-table-column label="创建人" align="center" prop="creator" /> | |
| 61 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 62 | + <template v-slot="scope"> | |
| 63 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | |
| 64 | + v-hasPermi="['crm:business:update']">修改</el-button> | |
| 65 | + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | |
| 66 | + v-hasPermi="['crm:business:delete']">删除</el-button> | |
| 67 | + </template> | |
| 68 | + </el-table-column> | |
| 69 | + </el-table> | |
| 70 | + <!-- 分页组件 --> | |
| 71 | + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 72 | + @pagination="getList"/> | |
| 73 | + | |
| 74 | + <!-- 对话框(添加 / 修改) --> | |
| 75 | + <el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body> | |
| 76 | + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | |
| 77 | + <el-form-item label="商机名称" prop="name"> | |
| 78 | + <el-input v-model="form.name" placeholder="请输入商机名称" /> | |
| 79 | + </el-form-item> | |
| 80 | + <el-form-item label="客户编号" prop="customerId"> | |
| 81 | + <el-input v-model="form.customerId" placeholder="请输入客户编号" /> | |
| 82 | + </el-form-item> | |
| 83 | + <el-form-item label="商机状态类型" prop="statusTypeId"> | |
| 84 | + <el-select v-model="form.statusTypeId" placeholder="请选择商机状态类型" clearable size="small" @change="changeBusinessStatusType"> | |
| 85 | + <el-option v-for="item in businessStatusTypeList" :key="item.id" :label="item.name" :value="item.id"/> | |
| 86 | + </el-select> | |
| 87 | + </el-form-item> | |
| 88 | + <el-form-item label="商机状态" prop="statusId"> | |
| 89 | + <el-select v-model="form.statusId" placeholder="请选择商机状态" clearable size="small"> | |
| 90 | + <el-option v-for="item in businessStatusList" :key="item.id" :label="item.name" :value="item.id"/> | |
| 91 | + </el-select> | |
| 92 | + </el-form-item> | |
| 93 | + <el-form-item label="预计成交日期" prop="dealTime"> | |
| 94 | + <el-date-picker clearable v-model="form.dealTime" type="date" value-format="timestamp" placeholder="选择预计成交日期" /> | |
| 95 | + </el-form-item> | |
| 96 | + <el-form-item label="商机金额" prop="price"> | |
| 97 | + <el-input v-model="form.price" placeholder="请输入商机金额" /> | |
| 98 | + </el-form-item> | |
| 99 | + <el-form-item label="整单折扣(%)" prop="discountPercent"> | |
| 100 | + <el-input v-model="form.discountPercent" placeholder="请输入整单折扣" /> | |
| 101 | + </el-form-item> | |
| 102 | + <el-form-item label="产品总金额" prop="productPrice"> | |
| 103 | + <el-input v-model="form.productPrice" placeholder="请输入产品总金额" /> | |
| 104 | + </el-form-item> | |
| 105 | + <el-form-item label="备注" prop="remark"> | |
| 106 | + <el-input v-model="form.remark" placeholder="请输入备注" /> | |
| 107 | + </el-form-item> | |
| 108 | + </el-form> | |
| 109 | + <div slot="footer" class="dialog-footer"> | |
| 110 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 111 | + <el-button @click="cancel">取 消</el-button> | |
| 112 | + </div> | |
| 113 | + </el-dialog> | |
| 114 | + </div> | |
| 115 | +</template> | |
| 116 | + | |
| 117 | +<script> | |
| 118 | +import { createBusiness, updateBusiness, deleteBusiness, getBusiness, getBusinessPage, exportBusinessExcel } from "@/api/crm/business"; | |
| 119 | +import { getBusinessStatusListByTypeId, getBusinessStatusList } from "@/api/crm/businessStatus"; | |
| 120 | +import { getBusinessStatusTypeList } from "@/api/crm/businessStatusType"; | |
| 121 | + | |
| 122 | +export default { | |
| 123 | + name: "Business", | |
| 124 | + components: { | |
| 125 | + }, | |
| 126 | + data() { | |
| 127 | + return { | |
| 128 | + // 遮罩层 | |
| 129 | + loading: true, | |
| 130 | + // 导出遮罩层 | |
| 131 | + exportLoading: false, | |
| 132 | + // 显示搜索条件 | |
| 133 | + showSearch: true, | |
| 134 | + // 总条数 | |
| 135 | + total: 0, | |
| 136 | + // 商机列表 | |
| 137 | + list: [], | |
| 138 | + // 根据类型ID获取的商机状态列表 | |
| 139 | + businessStatusList: [], | |
| 140 | + // 所有商机状态列表 | |
| 141 | + businessStatusAllList: [], | |
| 142 | + // 商机状态类型列表 | |
| 143 | + businessStatusTypeList: [], | |
| 144 | + // 弹出层标题 | |
| 145 | + title: "", | |
| 146 | + // 是否显示弹出层 | |
| 147 | + open: false, | |
| 148 | + // 查询参数 | |
| 149 | + queryParams: { | |
| 150 | + pageNo: 1, | |
| 151 | + pageSize: 10, | |
| 152 | + name: null, | |
| 153 | + statusTypeId: null, | |
| 154 | + statusId: null, | |
| 155 | + contactNextTime: [], | |
| 156 | + customerId: null, | |
| 157 | + dealTime: [], | |
| 158 | + price: null, | |
| 159 | + discountPercent: null, | |
| 160 | + productPrice: null, | |
| 161 | + remark: null, | |
| 162 | + ownerUserId: null, | |
| 163 | + createTime: [], | |
| 164 | + roUserIds: null, | |
| 165 | + rwUserIds: null, | |
| 166 | + endStatus: null, | |
| 167 | + endRemark: null, | |
| 168 | + contactLastTime: [], | |
| 169 | + followUpStatus: null, | |
| 170 | + }, | |
| 171 | + // 表单参数 | |
| 172 | + form: {}, | |
| 173 | + // 表单校验 | |
| 174 | + rules: { | |
| 175 | + name: [{ required: true, message: "商机名称不能为空", trigger: "blur" }], | |
| 176 | + customerId: [{ required: true, message: "客户编号不能为空", trigger: "blur" }], | |
| 177 | + roUserIds: [{ required: true, message: "只读权限的用户编号数组不能为空", trigger: "blur" }], | |
| 178 | + rwUserIds: [{ required: true, message: "读写权限的用户编号数组不能为空", trigger: "blur" }], | |
| 179 | + endStatus: [{ required: true, message: "1赢单2输单3无效不能为空", trigger: "blur" }], | |
| 180 | + } | |
| 181 | + }; | |
| 182 | + }, | |
| 183 | + created() { | |
| 184 | + this.getList(); | |
| 185 | + }, | |
| 186 | + methods: { | |
| 187 | + /** 查询列表 */ | |
| 188 | + getList() { | |
| 189 | + this.loading = true; | |
| 190 | + // 执行查询 | |
| 191 | + getBusinessPage(this.queryParams).then(response => { | |
| 192 | + this.list = response.data.list; | |
| 193 | + this.total = response.data.total; | |
| 194 | + this.loading = false; | |
| 195 | + }); | |
| 196 | + //查询商机状态类型集合 | |
| 197 | + getBusinessStatusTypeList().then(response => { | |
| 198 | + this.businessStatusTypeList = response.data; | |
| 199 | + }); | |
| 200 | + //查询商机状态类型集合 | |
| 201 | + getBusinessStatusList().then(response => { | |
| 202 | + this.businessStatusAllList = response.data; | |
| 203 | + }); | |
| 204 | + | |
| 205 | + }, | |
| 206 | + /** 取消按钮 */ | |
| 207 | + cancel() { | |
| 208 | + this.open = false; | |
| 209 | + this.reset(); | |
| 210 | + }, | |
| 211 | + /** 表单重置 */ | |
| 212 | + reset() { | |
| 213 | + this.form = { | |
| 214 | + id: undefined, | |
| 215 | + name: undefined, | |
| 216 | + statusTypeId: undefined, | |
| 217 | + statusId: undefined, | |
| 218 | + contactNextTime: undefined, | |
| 219 | + customerId: undefined, | |
| 220 | + dealTime: undefined, | |
| 221 | + price: undefined, | |
| 222 | + discountPercent: undefined, | |
| 223 | + productPrice: undefined, | |
| 224 | + remark: undefined, | |
| 225 | + ownerUserId: undefined, | |
| 226 | + roUserIds: undefined, | |
| 227 | + rwUserIds: undefined, | |
| 228 | + endStatus: undefined, | |
| 229 | + endRemark: undefined, | |
| 230 | + contactLastTime: undefined, | |
| 231 | + followUpStatus: undefined, | |
| 232 | + }; | |
| 233 | + this.resetForm("form"); | |
| 234 | + }, | |
| 235 | + /** 搜索按钮操作 */ | |
| 236 | + handleQuery() { | |
| 237 | + this.queryParams.pageNo = 1; | |
| 238 | + this.getList(); | |
| 239 | + }, | |
| 240 | + /** 重置按钮操作 */ | |
| 241 | + resetQuery() { | |
| 242 | + this.resetForm("queryForm"); | |
| 243 | + this.handleQuery(); | |
| 244 | + }, | |
| 245 | + /** 新增按钮操作 */ | |
| 246 | + handleAdd() { | |
| 247 | + this.reset(); | |
| 248 | + this.open = true; | |
| 249 | + this.title = "添加商机"; | |
| 250 | + }, | |
| 251 | + /** 修改按钮操作 */ | |
| 252 | + handleUpdate(row) { | |
| 253 | + this.reset(); | |
| 254 | + const id = row.id; | |
| 255 | + getBusiness(id).then(response => { | |
| 256 | + this.form = response.data; | |
| 257 | + this.open = true; | |
| 258 | + this.title = "修改商机"; | |
| 259 | + }); | |
| 260 | + }, | |
| 261 | + /** 提交按钮 */ | |
| 262 | + submitForm() { | |
| 263 | + this.$refs["form"].validate(valid => { | |
| 264 | + if (!valid) { | |
| 265 | + return; | |
| 266 | + } | |
| 267 | + // 修改的提交 | |
| 268 | + if (this.form.id != null) { | |
| 269 | + updateBusiness(this.form).then(response => { | |
| 270 | + this.$modal.msgSuccess("修改成功"); | |
| 271 | + this.open = false; | |
| 272 | + this.getList(); | |
| 273 | + }); | |
| 274 | + return; | |
| 275 | + } | |
| 276 | + // 添加的提交 | |
| 277 | + createBusiness(this.form).then(response => { | |
| 278 | + this.$modal.msgSuccess("新增成功"); | |
| 279 | + this.open = false; | |
| 280 | + this.getList(); | |
| 281 | + }); | |
| 282 | + }); | |
| 283 | + }, | |
| 284 | + /** 删除按钮操作 */ | |
| 285 | + handleDelete(row) { | |
| 286 | + const id = row.id; | |
| 287 | + this.$modal.confirm('是否确认删除商机编号为"' + id + '"的数据项?').then(function() { | |
| 288 | + return deleteBusiness(id); | |
| 289 | + }).then(() => { | |
| 290 | + this.getList(); | |
| 291 | + this.$modal.msgSuccess("删除成功"); | |
| 292 | + }).catch(() => {}); | |
| 293 | + }, | |
| 294 | + /** 导出按钮操作 */ | |
| 295 | + handleExport() { | |
| 296 | + // 处理查询参数 | |
| 297 | + let params = {...this.queryParams}; | |
| 298 | + params.pageNo = undefined; | |
| 299 | + params.pageSize = undefined; | |
| 300 | + this.$modal.confirm('是否确认导出所有商机数据项?').then(() => { | |
| 301 | + this.exportLoading = true; | |
| 302 | + return exportBusinessExcel(params); | |
| 303 | + }).then(response => { | |
| 304 | + this.$download.excel(response, '商机.xls'); | |
| 305 | + this.exportLoading = false; | |
| 306 | + }).catch(() => {}); | |
| 307 | + }, | |
| 308 | + /** 选择商机状态类型事件 */ | |
| 309 | + changeBusinessStatusType (id) { | |
| 310 | + //查询商机状态集合 | |
| 311 | + getBusinessStatusListByTypeId(id).then(response => { | |
| 312 | + this.businessStatusList = response.data; | |
| 313 | + }); | |
| 314 | + }, | |
| 315 | + /** 商机状态类型名格式化 */ | |
| 316 | + getBusinessStatusTypeName(typeId) { | |
| 317 | + for (const item of this.businessStatusTypeList) { | |
| 318 | + if (item.id === typeId) { | |
| 319 | + return item.name; | |
| 320 | + } | |
| 321 | + } | |
| 322 | + return '未知'; | |
| 323 | + }, | |
| 324 | + /** 商机状态名格式化 */ | |
| 325 | + getBusinessStatusName(id) { | |
| 326 | + for (const item of this.businessStatusAllList) { | |
| 327 | + if (item.id === id) { | |
| 328 | + return item.name; | |
| 329 | + } | |
| 330 | + } | |
| 331 | + return '未知'; | |
| 332 | + } | |
| 333 | + } | |
| 334 | +}; | |
| 335 | +</script> | ... | ... |
yudao-ui-admin/src/views/crm/contact/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + | |
| 4 | + <!-- 搜索工作栏 --> | |
| 5 | + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px"> | |
| 6 | + <el-form-item label="姓名" prop="name"> | |
| 7 | + <el-input v-model="queryParams.name" placeholder="请输入联系人名称" clearable @keyup.enter.native="handleQuery"/> | |
| 8 | + </el-form-item> | |
| 9 | + <el-form-item label="下次联系时间" prop="nextTime"> | |
| 10 | + <el-date-picker v-model="queryParams.nextTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" | |
| 11 | + range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item label="手机号" prop="mobile"> | |
| 14 | + <el-input v-model="queryParams.mobile" placeholder="请输入手机号" clearable @keyup.enter.native="handleQuery"/> | |
| 15 | + </el-form-item> | |
| 16 | +<!-- <el-form-item label="电话" prop="telephone">--> | |
| 17 | +<!-- <el-input v-model="queryParams.telephone" placeholder="请输入电话" clearable @keyup.enter.native="handleQuery"/>--> | |
| 18 | +<!-- </el-form-item>--> | |
| 19 | +<!-- <el-form-item label="电子邮箱" prop="email">--> | |
| 20 | +<!-- <el-input v-model="queryParams.email" placeholder="请输入电子邮箱" clearable @keyup.enter.native="handleQuery"/>--> | |
| 21 | +<!-- </el-form-item>--> | |
| 22 | +<!-- <el-form-item label="职务" prop="post">--> | |
| 23 | +<!-- <el-input v-model="queryParams.post" placeholder="请输入职务" clearable @keyup.enter.native="handleQuery"/>--> | |
| 24 | +<!-- </el-form-item>--> | |
| 25 | + <el-form-item label="客户编号" prop="customerId"> | |
| 26 | + <el-input v-model="queryParams.customerId" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery"/> | |
| 27 | + </el-form-item> | |
| 28 | +<!-- <el-form-item label="地址" prop="address">--> | |
| 29 | +<!-- <el-input v-model="queryParams.address" placeholder="请输入地址" clearable @keyup.enter.native="handleQuery"/>--> | |
| 30 | +<!-- </el-form-item>--> | |
| 31 | +<!-- <el-form-item label="备注" prop="remark">--> | |
| 32 | +<!-- <el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>--> | |
| 33 | +<!-- </el-form-item>--> | |
| 34 | + <el-form-item label="负责人用户编号" prop="ownerUserId"> | |
| 35 | + <el-input v-model="queryParams.ownerUserId" placeholder="请输入负责人用户编号" clearable @keyup.enter.native="handleQuery"/> | |
| 36 | + </el-form-item> | |
| 37 | +<!-- <el-form-item label="创建时间" prop="createTime">--> | |
| 38 | +<!-- <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"--> | |
| 39 | +<!-- range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />--> | |
| 40 | +<!-- </el-form-item>--> | |
| 41 | +<!-- <el-form-item label="最后跟进时间" prop="lastTime">--> | |
| 42 | +<!-- <el-date-picker v-model="queryParams.lastTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"--> | |
| 43 | +<!-- range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />--> | |
| 44 | +<!-- </el-form-item>--> | |
| 45 | +<!-- <el-form-item label="更新人" prop="updator">--> | |
| 46 | +<!-- <el-input v-model="queryParams.updator" placeholder="请输入更新人" clearable @keyup.enter.native="handleQuery"/>--> | |
| 47 | +<!-- </el-form-item>--> | |
| 48 | + <el-form-item> | |
| 49 | + <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 50 | + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 51 | + </el-form-item> | |
| 52 | + </el-form> | |
| 53 | + | |
| 54 | + <!-- 操作工具栏 --> | |
| 55 | + <el-row :gutter="10" class="mb8"> | |
| 56 | + <el-col :span="1.5"> | |
| 57 | + <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | |
| 58 | + v-hasPermi="['crm:contact:create']">新增</el-button> | |
| 59 | + </el-col> | |
| 60 | + <el-col :span="1.5"> | |
| 61 | + <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" | |
| 62 | + v-hasPermi="['crm:contact:export']">导出</el-button> | |
| 63 | + </el-col> | |
| 64 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 65 | + </el-row> | |
| 66 | + | |
| 67 | + <!-- 列表 --> | |
| 68 | + <el-table v-loading="loading" :data="list"> | |
| 69 | + <el-table-column label="姓名" align="center" prop="name" /> | |
| 70 | + <el-table-column label="下次联系时间" align="center" prop="nextTime" > | |
| 71 | + <template v-slot="scope"> | |
| 72 | + <span>{{ parseTime(scope.row.nextTime) }}</span> | |
| 73 | + </template> | |
| 74 | + </el-table-column> | |
| 75 | + <el-table-column label="手机号" align="center" prop="mobile" /> | |
| 76 | + <el-table-column label="电话" align="center" prop="telephone" /> | |
| 77 | + <el-table-column label="电子邮箱" align="center" prop="email" /> | |
| 78 | + <el-table-column label="职务" align="center" prop="post" /> | |
| 79 | + <el-table-column label="客户编号" align="center" prop="customerId" /> | |
| 80 | + <el-table-column label="地址" align="center" prop="address" /> | |
| 81 | + <el-table-column label="备注" align="center" prop="remark" /> | |
| 82 | + <el-table-column label="负责人用户编号" align="center" prop="ownerUserId" /> | |
| 83 | + <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | |
| 84 | + <template v-slot="scope"> | |
| 85 | + <span>{{ parseTime(scope.row.createTime) }}</span> | |
| 86 | + </template> | |
| 87 | + </el-table-column> | |
| 88 | + <el-table-column label="最后跟进时间" align="center" prop="lastTime" width="180"> | |
| 89 | + <template v-slot="scope"> | |
| 90 | + <span>{{ parseTime(scope.row.lastTime) }}</span> | |
| 91 | + </template> | |
| 92 | + </el-table-column> | |
| 93 | + <el-table-column label="更新人" align="center" prop="updator" /> | |
| 94 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 95 | + <template v-slot="scope"> | |
| 96 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | |
| 97 | + v-hasPermi="['crm:contact:update']">修改</el-button> | |
| 98 | + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | |
| 99 | + v-hasPermi="['crm:contact:delete']">删除</el-button> | |
| 100 | + </template> | |
| 101 | + </el-table-column> | |
| 102 | + </el-table> | |
| 103 | + <!-- 分页组件 --> | |
| 104 | + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 105 | + @pagination="getList"/> | |
| 106 | + | |
| 107 | + <!-- 对话框(添加 / 修改) --> | |
| 108 | + <el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body> | |
| 109 | + <el-form ref="form" :model="form" :rules="rules" label-width="110px"> | |
| 110 | + <el-form-item label="姓名" prop="name"> | |
| 111 | + <el-input v-model="form.name" placeholder="请输入联系人名称" /> | |
| 112 | + </el-form-item> | |
| 113 | + <el-form-item label="下次联系时间" prop="nextTime"> | |
| 114 | + <el-date-picker clearable v-model="form.nextTime" type="date" value-format="timestamp" placeholder="选择下次联系时间" /> | |
| 115 | + </el-form-item> | |
| 116 | + <el-form-item label="手机号" prop="mobile"> | |
| 117 | + <el-input v-model="form.mobile" placeholder="请输入手机号" /> | |
| 118 | + </el-form-item> | |
| 119 | + <el-form-item label="电话" prop="telephone"> | |
| 120 | + <el-input v-model="form.telephone" placeholder="请输入电话" /> | |
| 121 | + </el-form-item> | |
| 122 | + <el-form-item label="电子邮箱" prop="email"> | |
| 123 | + <el-input v-model="form.email" placeholder="请输入电子邮箱" /> | |
| 124 | + </el-form-item> | |
| 125 | + <el-form-item label="职务" prop="post"> | |
| 126 | + <el-input v-model="form.post" placeholder="请输入职务" /> | |
| 127 | + </el-form-item> | |
| 128 | + <el-form-item label="客户编号" prop="customerId"> | |
| 129 | + <el-input v-model="form.customerId" placeholder="请输入客户编号" /> | |
| 130 | + </el-form-item> | |
| 131 | + <el-form-item label="地址" prop="address"> | |
| 132 | + <el-input v-model="form.address" placeholder="请输入地址" /> | |
| 133 | + </el-form-item> | |
| 134 | + <el-form-item label="备注" prop="remark"> | |
| 135 | + <el-input v-model="form.remark" placeholder="请输入备注" /> | |
| 136 | + </el-form-item> | |
| 137 | + <el-form-item label="负责人用户编号" prop="ownerUserId"> | |
| 138 | + <el-input v-model="form.ownerUserId" placeholder="请输入负责人用户编号" /> | |
| 139 | + </el-form-item> | |
| 140 | + <el-form-item label="最后跟进时间" prop="lastTime"> | |
| 141 | + <el-date-picker clearable v-model="form.lastTime" type="date" value-format="timestamp" placeholder="选择最后跟进时间" /> | |
| 142 | + </el-form-item> | |
| 143 | + <el-form-item label="更新人" prop="updator"> | |
| 144 | + <el-input v-model="form.updator" placeholder="请输入更新人" /> | |
| 145 | + </el-form-item> | |
| 146 | + </el-form> | |
| 147 | + <div slot="footer" class="dialog-footer"> | |
| 148 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 149 | + <el-button @click="cancel">取 消</el-button> | |
| 150 | + </div> | |
| 151 | + </el-dialog> | |
| 152 | + </div> | |
| 153 | +</template> | |
| 154 | + | |
| 155 | +<script> | |
| 156 | +import { createContact, updateContact, deleteContact, getContact, getContactPage, exportContactExcel } from "@/api/crm/contact/contact"; | |
| 157 | + | |
| 158 | +export default { | |
| 159 | + name: "Contact", | |
| 160 | + components: { | |
| 161 | + }, | |
| 162 | + data() { | |
| 163 | + return { | |
| 164 | + // 遮罩层 | |
| 165 | + loading: true, | |
| 166 | + // 导出遮罩层 | |
| 167 | + exportLoading: false, | |
| 168 | + // 显示搜索条件 | |
| 169 | + showSearch: true, | |
| 170 | + // 总条数 | |
| 171 | + total: 0, | |
| 172 | + // crm联系人列表 | |
| 173 | + list: [], | |
| 174 | + // 弹出层标题 | |
| 175 | + title: "", | |
| 176 | + // 是否显示弹出层 | |
| 177 | + open: false, | |
| 178 | + // 查询参数 | |
| 179 | + queryParams: { | |
| 180 | + pageNo: 1, | |
| 181 | + pageSize: 10, | |
| 182 | + name: null, | |
| 183 | + nextTime: [], | |
| 184 | + mobile: null, | |
| 185 | + telephone: null, | |
| 186 | + email: null, | |
| 187 | + post: null, | |
| 188 | + customerId: null, | |
| 189 | + address: null, | |
| 190 | + remark: null, | |
| 191 | + ownerUserId: null, | |
| 192 | + createTime: [], | |
| 193 | + lastTime: [], | |
| 194 | + updator: null, | |
| 195 | + }, | |
| 196 | + // 表单参数 | |
| 197 | + form: {}, | |
| 198 | + // 表单校验 | |
| 199 | + rules: { | |
| 200 | + } | |
| 201 | + }; | |
| 202 | + }, | |
| 203 | + created() { | |
| 204 | + this.getList(); | |
| 205 | + }, | |
| 206 | + methods: { | |
| 207 | + /** 查询列表 */ | |
| 208 | + getList() { | |
| 209 | + this.loading = true; | |
| 210 | + // 执行查询 | |
| 211 | + getContactPage(this.queryParams).then(response => { | |
| 212 | + this.list = response.data.list; | |
| 213 | + this.total = response.data.total; | |
| 214 | + this.loading = false; | |
| 215 | + }); | |
| 216 | + }, | |
| 217 | + /** 取消按钮 */ | |
| 218 | + cancel() { | |
| 219 | + this.open = false; | |
| 220 | + this.reset(); | |
| 221 | + }, | |
| 222 | + /** 表单重置 */ | |
| 223 | + reset() { | |
| 224 | + this.form = { | |
| 225 | + id: undefined, | |
| 226 | + name: undefined, | |
| 227 | + nextTime: undefined, | |
| 228 | + mobile: undefined, | |
| 229 | + telephone: undefined, | |
| 230 | + email: undefined, | |
| 231 | + post: undefined, | |
| 232 | + customerId: undefined, | |
| 233 | + address: undefined, | |
| 234 | + remark: undefined, | |
| 235 | + ownerUserId: undefined, | |
| 236 | + lastTime: undefined, | |
| 237 | + updator: undefined, | |
| 238 | + }; | |
| 239 | + this.resetForm("form"); | |
| 240 | + }, | |
| 241 | + /** 搜索按钮操作 */ | |
| 242 | + handleQuery() { | |
| 243 | + this.queryParams.pageNo = 1; | |
| 244 | + this.getList(); | |
| 245 | + }, | |
| 246 | + /** 重置按钮操作 */ | |
| 247 | + resetQuery() { | |
| 248 | + this.resetForm("queryForm"); | |
| 249 | + this.handleQuery(); | |
| 250 | + }, | |
| 251 | + /** 新增按钮操作 */ | |
| 252 | + handleAdd() { | |
| 253 | + this.reset(); | |
| 254 | + this.open = true; | |
| 255 | + this.title = "添加联系人"; | |
| 256 | + }, | |
| 257 | + /** 修改按钮操作 */ | |
| 258 | + handleUpdate(row) { | |
| 259 | + this.reset(); | |
| 260 | + const id = row.id; | |
| 261 | + getContact(id).then(response => { | |
| 262 | + this.form = response.data; | |
| 263 | + this.open = true; | |
| 264 | + this.title = "修改联系人"; | |
| 265 | + }); | |
| 266 | + }, | |
| 267 | + /** 提交按钮 */ | |
| 268 | + submitForm() { | |
| 269 | + this.$refs["form"].validate(valid => { | |
| 270 | + if (!valid) { | |
| 271 | + return; | |
| 272 | + } | |
| 273 | + // 修改的提交 | |
| 274 | + if (this.form.id != null) { | |
| 275 | + updateContact(this.form).then(response => { | |
| 276 | + this.$modal.msgSuccess("修改成功"); | |
| 277 | + this.open = false; | |
| 278 | + this.getList(); | |
| 279 | + }); | |
| 280 | + return; | |
| 281 | + } | |
| 282 | + // 添加的提交 | |
| 283 | + createContact(this.form).then(response => { | |
| 284 | + this.$modal.msgSuccess("新增成功"); | |
| 285 | + this.open = false; | |
| 286 | + this.getList(); | |
| 287 | + }); | |
| 288 | + }); | |
| 289 | + }, | |
| 290 | + /** 删除按钮操作 */ | |
| 291 | + handleDelete(row) { | |
| 292 | + const id = row.id; | |
| 293 | + this.$modal.confirm('是否确认删除联系人编号为"' + id + '"的数据项?').then(function() { | |
| 294 | + return deleteContact(id); | |
| 295 | + }).then(() => { | |
| 296 | + this.getList(); | |
| 297 | + this.$modal.msgSuccess("删除成功"); | |
| 298 | + }).catch(() => {}); | |
| 299 | + }, | |
| 300 | + /** 导出按钮操作 */ | |
| 301 | + handleExport() { | |
| 302 | + // 处理查询参数 | |
| 303 | + let params = {...this.queryParams}; | |
| 304 | + params.pageNo = undefined; | |
| 305 | + params.pageSize = undefined; | |
| 306 | + this.$modal.confirm('是否确认导出所有联系人数据项?').then(() => { | |
| 307 | + this.exportLoading = true; | |
| 308 | + return exportContactExcel(params); | |
| 309 | + }).then(response => { | |
| 310 | + this.$download.excel(response, '联系人.xls'); | |
| 311 | + this.exportLoading = false; | |
| 312 | + }).catch(() => {}); | |
| 313 | + } | |
| 314 | + } | |
| 315 | +}; | |
| 316 | +</script> | ... | ... |