Commit df70402484a670b7d311502d18ead30eb8f9d51e
Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product
Showing
95 changed files
with
2389 additions
and
201 deletions
sql/mysql/pay_wallet.sql
| ... | ... | @@ -125,3 +125,58 @@ CREATE TABLE `pay_wallet_recharge` ( |
| 125 | 125 | `tenant_id` bigint(0) NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 126 | 126 | PRIMARY KEY (`id`) USING BTREE |
| 127 | 127 | ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员钱包充值' ROW_FORMAT = Dynamic; |
| 128 | + | |
| 129 | +-- 钱包充值套餐菜单脚本 | |
| 130 | + | |
| 131 | +INSERT INTO system_menu( | |
| 132 | + name, permission, type, sort, parent_id, | |
| 133 | + path, icon, component, status, component_name | |
| 134 | +) | |
| 135 | +VALUES ( | |
| 136 | + '钱包管理', '', 1, 5, 1117, | |
| 137 | + 'wallet', 'ep:caret-right', '', 0, '' | |
| 138 | + ); | |
| 139 | +SELECT @parentId := LAST_INSERT_ID(); | |
| 140 | +INSERT INTO system_menu( | |
| 141 | + name, permission, type, sort, parent_id, | |
| 142 | + path, icon, component, status, component_name | |
| 143 | +) | |
| 144 | +VALUES ( | |
| 145 | + '充值套餐', '', 2, 2, @parentId, | |
| 146 | + 'wallet-recharge-package', 'fa:leaf', 'pay/wallet/rechargePackage/index', 0, 'WalletRechargePackage' | |
| 147 | + ); | |
| 148 | +SELECT @parentId := LAST_INSERT_ID(); | |
| 149 | + | |
| 150 | +-- 按钮 SQL | |
| 151 | +INSERT INTO system_menu( | |
| 152 | + name, permission, type, sort, parent_id, | |
| 153 | + path, icon, component, status | |
| 154 | +) | |
| 155 | +VALUES ( | |
| 156 | + '钱包充值套餐查询', 'pay:wallet-recharge-package:query', 3, 1, @parentId, | |
| 157 | + '', '', '', 0 | |
| 158 | + ); | |
| 159 | +INSERT INTO system_menu( | |
| 160 | + name, permission, type, sort, parent_id, | |
| 161 | + path, icon, component, status | |
| 162 | +) | |
| 163 | +VALUES ( | |
| 164 | + '钱包充值套餐创建', 'pay:wallet-recharge-package:create', 3, 2, @parentId, | |
| 165 | + '', '', '', 0 | |
| 166 | + ); | |
| 167 | +INSERT INTO system_menu( | |
| 168 | + name, permission, type, sort, parent_id, | |
| 169 | + path, icon, component, status | |
| 170 | +) | |
| 171 | +VALUES ( | |
| 172 | + '钱包充值套餐更新', 'pay:wallet-recharge-package:update', 3, 3, @parentId, | |
| 173 | + '', '', '', 0 | |
| 174 | + ); | |
| 175 | +INSERT INTO system_menu( | |
| 176 | + name, permission, type, sort, parent_id, | |
| 177 | + path, icon, component, status | |
| 178 | +) | |
| 179 | +VALUES ( | |
| 180 | + '钱包充值套餐删除', 'pay:wallet-recharge-package:delete', 3, 4, @parentId, | |
| 181 | + '', '', '', 0 | |
| 182 | + ); | ... | ... |
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: 05/10/2023 12:42:16 | |
| 14 | + Date: 14/10/2023 20:04:17 | |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | SET NAMES utf8mb4; |
| ... | ... | @@ -384,7 +384,7 @@ CREATE TABLE `infra_api_error_log` ( |
| 384 | 384 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 385 | 385 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 386 | 386 | PRIMARY KEY (`id`) USING BTREE |
| 387 | -) ENGINE = InnoDB AUTO_INCREMENT = 1662 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志'; | |
| 387 | +) ENGINE = InnoDB AUTO_INCREMENT = 1734 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志'; | |
| 388 | 388 | |
| 389 | 389 | -- ---------------------------- |
| 390 | 390 | -- Records of infra_api_error_log |
| ... | ... | @@ -422,7 +422,7 @@ CREATE TABLE `infra_codegen_column` ( |
| 422 | 422 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 423 | 423 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 424 | 424 | PRIMARY KEY (`id`) USING BTREE |
| 425 | -) ENGINE = InnoDB AUTO_INCREMENT = 1778 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义'; | |
| 425 | +) ENGINE = InnoDB AUTO_INCREMENT = 1805 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义'; | |
| 426 | 426 | |
| 427 | 427 | -- ---------------------------- |
| 428 | 428 | -- Records of infra_codegen_column |
| ... | ... | @@ -455,7 +455,7 @@ CREATE TABLE `infra_codegen_table` ( |
| 455 | 455 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 456 | 456 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 457 | 457 | PRIMARY KEY (`id`) USING BTREE |
| 458 | -) ENGINE = InnoDB AUTO_INCREMENT = 135 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表定义'; | |
| 458 | +) ENGINE = InnoDB AUTO_INCREMENT = 137 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表定义'; | |
| 459 | 459 | |
| 460 | 460 | -- ---------------------------- |
| 461 | 461 | -- Records of infra_codegen_table |
| ... | ... | @@ -709,7 +709,7 @@ CREATE TABLE `member_address` ( |
| 709 | 709 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 710 | 710 | PRIMARY KEY (`id`) USING BTREE, |
| 711 | 711 | INDEX `idx_userId`(`user_id` ASC) USING BTREE |
| 712 | -) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '用户收件地址'; | |
| 712 | +) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '用户收件地址'; | |
| 713 | 713 | |
| 714 | 714 | -- ---------------------------- |
| 715 | 715 | -- Records of member_address |
| ... | ... | @@ -717,6 +717,33 @@ CREATE TABLE `member_address` ( |
| 717 | 717 | BEGIN; |
| 718 | 718 | INSERT INTO `member_address` (`id`, `user_id`, `name`, `mobile`, `area_id`, `detail_address`, `default_status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (21, 247, 'yunai', '15601691300', 140302, '芋道源码 233 号 666 室', b'1', '1', '2022-08-01 22:46:35', '247', '2023-06-26 19:47:46', b'0', 1); |
| 719 | 719 | INSERT INTO `member_address` (`id`, `user_id`, `name`, `mobile`, `area_id`, `detail_address`, `default_status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (23, 247, '测试', '15601691300', 120103, '13232312', b'0', '247', '2023-06-26 19:47:40', '247', '2023-06-26 19:47:46', b'0', 1); |
| 720 | +INSERT INTO `member_address` (`id`, `user_id`, `name`, `mobile`, `area_id`, `detail_address`, `default_status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (24, 248, '芋头', '15601691234', 110101, '灌灌灌灌灌', b'1', '248', '2023-10-06 10:08:24', '248', '2023-10-06 10:08:24', b'0', 1); | |
| 721 | +COMMIT; | |
| 722 | + | |
| 723 | +-- ---------------------------- | |
| 724 | +-- Table structure for member_config | |
| 725 | +-- ---------------------------- | |
| 726 | +DROP TABLE IF EXISTS `member_config`; | |
| 727 | +CREATE TABLE `member_config` ( | |
| 728 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键', | |
| 729 | + `point_trade_deduct_enable` bit(1) NOT NULL COMMENT '是否开启积分抵扣', | |
| 730 | + `point_trade_deduct_unit_price` int NOT NULL COMMENT '积分抵扣(单位:分)', | |
| 731 | + `point_trade_deduct_max_price` int NULL DEFAULT NULL COMMENT '积分抵扣最大值', | |
| 732 | + `point_trade_give_point` bigint NULL DEFAULT NULL COMMENT '1 元赠送多少分', | |
| 733 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | |
| 734 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 735 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | |
| 736 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 737 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 738 | + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', | |
| 739 | + PRIMARY KEY (`id`) USING BTREE | |
| 740 | +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员配置表'; | |
| 741 | + | |
| 742 | +-- ---------------------------- | |
| 743 | +-- Records of member_config | |
| 744 | +-- ---------------------------- | |
| 745 | +BEGIN; | |
| 746 | +INSERT INTO `member_config` (`id`, `point_trade_deduct_enable`, `point_trade_deduct_unit_price`, `point_trade_deduct_max_price`, `point_trade_give_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (5, b'1', 100, 2, 3, '1', '2023-08-20 09:54:42', '1', '2023-10-01 23:44:01', b'0', 1); | |
| 720 | 747 | COMMIT; |
| 721 | 748 | |
| 722 | 749 | -- ---------------------------- |
| ... | ... | @@ -741,7 +768,7 @@ CREATE TABLE `member_experience_record` ( |
| 741 | 768 | PRIMARY KEY (`id`) USING BTREE, |
| 742 | 769 | INDEX `idx_user_id`(`user_id` ASC) USING BTREE COMMENT '会员经验记录-用户编号', |
| 743 | 770 | INDEX `idx_user_biz_type`(`user_id` ASC, `biz_type` ASC) USING BTREE COMMENT '会员经验记录-用户业务类型' |
| 744 | -) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员经验记录'; | |
| 771 | +) ENGINE = InnoDB AUTO_INCREMENT = 41 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员经验记录'; | |
| 745 | 772 | |
| 746 | 773 | -- ---------------------------- |
| 747 | 774 | -- Records of member_experience_record |
| ... | ... | @@ -759,6 +786,27 @@ INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, ` |
| 759 | 786 | INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (10, 247, '97', 2, '下单奖励', '下单获得 384945 经验', 384945, 5529343, NULL, '2023-10-02 10:21:12', NULL, '2023-10-02 10:21:12', b'0', 1); |
| 760 | 787 | INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (11, 247, '11', 3, '退单扣除', '退单获得 -699900 经验', -699900, 4829443, NULL, '2023-10-02 15:19:37', NULL, '2023-10-02 15:19:37', b'0', 1); |
| 761 | 788 | INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (12, 247, '98', 2, '下单奖励', '下单获得 384945 经验', 384945, 5214388, NULL, '2023-10-02 15:38:39', NULL, '2023-10-02 15:38:39', b'0', 1); |
| 789 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (13, 247, '102', 2, '下单奖励', '下单获得 201 经验', 201, 5214589, NULL, '2023-10-05 23:05:29', NULL, '2023-10-05 23:05:29', b'0', 1); | |
| 790 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (14, 247, '107', 2, '下单奖励', '下单获得 201 经验', 201, 5214790, NULL, '2023-10-05 23:23:00', NULL, '2023-10-05 23:23:00', b'0', 1); | |
| 791 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (15, 248, '108', 2, '下单奖励', '下单获得 275 经验', 275, 275, NULL, '2023-10-06 10:13:44', NULL, '2023-10-06 10:13:44', b'0', 1); | |
| 792 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (16, 248, '118', 2, '下单奖励', '下单获得 203 经验', 203, 478, NULL, '2023-10-07 06:58:52', NULL, '2023-10-07 06:58:52', b'0', 1); | |
| 793 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (17, 248, '119', 2, '下单奖励', '下单获得 700100 经验', 700100, 700578, NULL, '2023-10-10 23:02:36', NULL, '2023-10-10 23:02:36', b'0', 1); | |
| 794 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (21, 248, '15', 3, '退单扣除', '退单获得 -700100 经验', -700100, 478, '1', '2023-10-10 23:11:19', '1', '2023-10-10 23:11:19', b'0', 1); | |
| 795 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (22, 248, '119', 3, '退单扣除', '退单获得 -700100 经验', -700100, 0, '1', '2023-10-10 23:11:23', '1', '2023-10-10 23:11:23', b'0', 1); | |
| 796 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (23, 248, '120', 2, '下单奖励', '下单获得 700100 经验', 700100, 700100, NULL, '2023-10-10 23:16:09', NULL, '2023-10-10 23:16:09', b'0', 1); | |
| 797 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (24, 248, '16', 3, '退单扣除', '退单获得 -700100 经验', -700100, 0, '1', '2023-10-10 23:20:10', '1', '2023-10-10 23:20:10', b'0', 1); | |
| 798 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (25, 248, '120', 3, '退单扣除', '退单获得 -700100 经验', -700100, 0, '1', '2023-10-10 23:20:16', '1', '2023-10-10 23:20:16', b'0', 1); | |
| 799 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (26, 248, '121', 2, '下单奖励', '下单获得 700100 经验', 700100, 700100, NULL, '2023-10-10 23:23:30', NULL, '2023-10-10 23:23:30', b'0', 1); | |
| 800 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (27, 248, '17', 3, '退单扣除', '退单获得 -700100 经验', -700100, 0, '1', '2023-10-10 23:23:50', '1', '2023-10-10 23:23:50', b'0', 1); | |
| 801 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (28, 248, '121', 3, '退单扣除', '退单获得 -700100 经验', -700100, 0, '1', '2023-10-10 23:23:55', '1', '2023-10-10 23:23:55', b'0', 1); | |
| 802 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (29, 248, '122', 2, '下单奖励', '下单获得 700100 经验', 700100, 700100, NULL, '2023-10-10 23:28:07', NULL, '2023-10-10 23:28:07', b'0', 1); | |
| 803 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (30, 248, '18', 3, '退单扣除', '退单获得 -700100 经验', -700100, 0, '1', '2023-10-10 23:29:55', '1', '2023-10-10 23:29:55', b'0', 1); | |
| 804 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (31, 248, '123', 2, '下单奖励', '下单获得 300 经验', 300, 300, NULL, '2023-10-10 23:44:45', NULL, '2023-10-10 23:44:45', b'0', 1); | |
| 805 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (32, 248, '124', 2, '下单奖励', '下单获得 560120 经验', 560120, 560420, NULL, '2023-10-11 07:03:46', NULL, '2023-10-11 07:03:46', b'0', 1); | |
| 806 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (33, 248, '19', 3, '退单扣除', '退单获得 -300 经验', -300, 560120, '1', '2023-10-11 07:04:28', '1', '2023-10-11 07:04:28', b'0', 1); | |
| 807 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (34, 248, '125', 11, '下单奖励', '下单获得 700100 经验', 700100, 700100, NULL, '2023-10-11 07:33:29', NULL, '2023-10-11 07:33:29', b'0', 1); | |
| 808 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (37, 248, '127', 11, '下单奖励', '下单获得 385145 经验', 385145, 385145, NULL, '2023-10-11 07:36:44', NULL, '2023-10-11 07:36:44', b'0', 1); | |
| 809 | +INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `experience`, `total_experience`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (40, 248, '120', 13, '下单奖励(单个取消)', '退款订单获得 -385145 经验', -385145, 0, '1', '2023-10-11 07:39:26', '1', '2023-10-11 07:39:26', b'0', 1); | |
| 762 | 810 | COMMIT; |
| 763 | 811 | |
| 764 | 812 | -- ---------------------------- |
| ... | ... | @@ -835,7 +883,7 @@ CREATE TABLE `member_level_record` ( |
| 835 | 883 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 836 | 884 | PRIMARY KEY (`id`) USING BTREE, |
| 837 | 885 | INDEX `idx_user_id`(`user_id` ASC) USING BTREE COMMENT '会员等级记录-用户编号' |
| 838 | -) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员等级记录'; | |
| 886 | +) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员等级记录'; | |
| 839 | 887 | |
| 840 | 888 | -- ---------------------------- |
| 841 | 889 | -- Records of member_level_record |
| ... | ... | @@ -865,7 +913,7 @@ CREATE TABLE `member_point_record` ( |
| 865 | 913 | PRIMARY KEY (`id`) USING BTREE, |
| 866 | 914 | INDEX `index_userId`(`user_id` ASC) USING BTREE, |
| 867 | 915 | INDEX `index_title`(`title` ASC) USING BTREE |
| 868 | -) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户积分记录'; | |
| 916 | +) ENGINE = InnoDB AUTO_INCREMENT = 60 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户积分记录'; | |
| 869 | 917 | |
| 870 | 918 | -- ---------------------------- |
| 871 | 919 | -- Records of member_point_record |
| ... | ... | @@ -902,6 +950,27 @@ INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title |
| 902 | 950 | INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (29, 247, '96', 10, '订单奖励', '下单获得 20997 积分', 20997, 10547883, NULL, '2023-10-02 09:40:20', NULL, '2023-10-02 09:40:20', b'0', 1); |
| 903 | 951 | INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (30, 247, '97', 10, '订单奖励', '下单获得 11548 积分', 11548, 10559431, NULL, '2023-10-02 10:21:12', NULL, '2023-10-02 10:21:12', b'0', 1); |
| 904 | 952 | INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (31, 247, '98', 10, '订单奖励', '下单获得 11548 积分', 11548, 10570979, NULL, '2023-10-02 15:38:39', NULL, '2023-10-02 15:38:39', b'0', 1); |
| 953 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (32, 247, '102', 10, '订单奖励', '下单获得 6 积分', 6, 10570985, NULL, '2023-10-05 23:05:29', NULL, '2023-10-05 23:05:29', b'0', 1); | |
| 954 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (33, 247, '107', 10, '订单奖励', '下单获得 6 积分', 6, 10570991, NULL, '2023-10-05 23:23:00', NULL, '2023-10-05 23:23:00', b'0', 1); | |
| 955 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (34, 248, '108', 10, '订单奖励', '下单获得 8 积分', 8, 8, NULL, '2023-10-06 10:13:44', NULL, '2023-10-06 10:13:44', b'0', 1); | |
| 956 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (35, 248, '118', 10, '订单奖励', '下单获得 6 积分', 6, 14, NULL, '2023-10-07 06:58:51', NULL, '2023-10-07 06:58:51', b'0', 1); | |
| 957 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (36, 248, '119', 10, '订单奖励', '下单获得 21003 积分', 21003, 21017, NULL, '2023-10-10 23:02:35', NULL, '2023-10-10 23:02:35', b'0', 1); | |
| 958 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (40, 248, '15', 14, '订单退款', '订单退款,扣除赠送的 -21003 积分', -21003, 2080697, '1', '2023-10-10 23:11:19', '1', '2023-10-10 23:11:19', b'0', 1); | |
| 959 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (41, 248, '119', 11, '订单取消', '订单取消,退还 -21003 积分', -21003, 2059694, '1', '2023-10-10 23:11:23', '1', '2023-10-10 23:11:23', b'0', 1); | |
| 960 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (42, 248, '120', 10, '订单奖励', '下单获得 21003 积分', 21003, 2080697, NULL, '2023-10-10 23:16:09', NULL, '2023-10-10 23:16:09', b'0', 1); | |
| 961 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (43, 248, '16', 14, '订单退款', '订单退款,扣除赠送的 -21003 积分', -21003, 2059694, '1', '2023-10-10 23:20:10', '1', '2023-10-10 23:20:10', b'0', 1); | |
| 962 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (44, 248, '120', 11, '订单取消', '订单取消,退还 -21003 积分', -21003, 2038691, '1', '2023-10-10 23:20:16', '1', '2023-10-10 23:20:16', b'0', 1); | |
| 963 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (45, 248, '121', 10, '订单奖励', '下单获得 21003 积分', 21003, 2059694, NULL, '2023-10-10 23:23:30', NULL, '2023-10-10 23:23:30', b'0', 1); | |
| 964 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (46, 248, '17', 14, '订单退款', '订单退款,扣除赠送的 -21003 积分', -21003, 2038691, '1', '2023-10-10 23:23:50', '1', '2023-10-10 23:23:50', b'0', 1); | |
| 965 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (47, 248, '121', 11, '订单取消', '订单取消,退还 -21003 积分', -21003, 2017688, '1', '2023-10-10 23:23:55', '1', '2023-10-10 23:23:55', b'0', 1); | |
| 966 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (48, 248, '122', 10, '订单奖励', '下单获得 21003 积分', 21003, 2038691, NULL, '2023-10-10 23:28:07', NULL, '2023-10-10 23:28:07', b'0', 1); | |
| 967 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (49, 248, '18', 14, '订单退款', '订单退款,扣除赠送的 -21003 积分', -21003, 2017688, '1', '2023-10-10 23:29:55', '1', '2023-10-10 23:29:55', b'0', 1); | |
| 968 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (50, 248, '123', 10, '订单奖励', '下单获得 9 积分', 9, 2017697, NULL, '2023-10-10 23:44:45', NULL, '2023-10-10 23:44:45', b'0', 1); | |
| 969 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (51, 248, '124', 10, '订单奖励', '下单获得 16803 积分', 16803, 2034500, NULL, '2023-10-11 07:03:46', NULL, '2023-10-11 07:03:46', b'0', 1); | |
| 970 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (52, 248, '19', 14, '订单退款', '订单退款,扣除赠送的 -9 积分', -9, 2034491, '1', '2023-10-11 07:04:28', '1', '2023-10-11 07:04:28', b'0', 1); | |
| 971 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (53, 248, '125', 21, '订单积分奖励', '下单获得 21003 积分', 21003, 21003, NULL, '2023-10-11 07:33:29', NULL, '2023-10-11 07:33:29', b'0', 1); | |
| 972 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (56, 248, '127', 21, '订单积分奖励', '下单获得 11554 积分', 11554, 11554, NULL, '2023-10-11 07:36:44', NULL, '2023-10-11 07:36:44', b'0', 1); | |
| 973 | +INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title`, `description`, `point`, `total_point`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (59, 248, '120', 23, '订单积分奖励(单个退款)', '订单退款,扣除赠送的 -11554 积分', -11554, 0, '1', '2023-10-11 07:39:26', '1', '2023-10-11 07:39:26', b'0', 1); | |
| 905 | 974 | COMMIT; |
| 906 | 975 | |
| 907 | 976 | -- ---------------------------- |
| ... | ... | @@ -1092,7 +1161,7 @@ CREATE TABLE `system_dict_data` ( |
| 1092 | 1161 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 1093 | 1162 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1094 | 1163 | PRIMARY KEY (`id`) USING BTREE |
| 1095 | -) ENGINE = InnoDB AUTO_INCREMENT = 1386 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; | |
| 1164 | +) ENGINE = InnoDB AUTO_INCREMENT = 1398 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; | |
| 1096 | 1165 | |
| 1097 | 1166 | -- ---------------------------- |
| 1098 | 1167 | -- Records of system_dict_data |
| ... | ... | @@ -1298,7 +1367,7 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st |
| 1298 | 1367 | 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 (1244, 0, '按件', '1', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:46:40', '1', '2023-05-21 22:46:40', b'0'); |
| 1299 | 1368 | 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 (1245, 1, '按重量', '2', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:46:58', '1', '2023-05-21 22:46:58', b'0'); |
| 1300 | 1369 | 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 (1246, 2, '按体积', '3', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:47:18', '1', '2023-05-21 22:47:18', b'0'); |
| 1301 | -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 (1335, 11, '订单消费', '11', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:27', '1', '2023-08-20 11:59:47', b'0'); | |
| 1370 | +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 (1335, 11, '订单积分抵扣', '11', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:27', '1', '2023-10-11 07:41:43', b'0'); | |
| 1302 | 1371 | 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 (1336, 1, '签到', '1', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:48', '1', '2023-08-20 11:59:53', b'0'); |
| 1303 | 1372 | 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 (1341, 20, '已退款', '20', 'pay_order_status', 0, 'danger', '', '已退款', '1', '2023-07-19 18:05:37', '1', '2023-07-19 18:05:37', b'0'); |
| 1304 | 1373 | 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 (1342, 21, '请求成功,但是结果失败', '21', 'pay_notify_status', 0, 'warning', '', '请求成功,但是结果失败', '1', '2023-07-19 18:10:47', '1', '2023-07-19 18:11:38', b'0'); |
| ... | ... | @@ -1308,11 +1377,11 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st |
| 1308 | 1377 | 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 (1346, 1, '支付单', '1', 'pay_notify_type', 0, 'primary', '', '支付单', '1', '2023-07-20 12:23:17', '1', '2023-07-20 12:23:17', b'0'); |
| 1309 | 1378 | 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 (1347, 2, '退款单', '2', 'pay_notify_type', 0, 'danger', '', NULL, '1', '2023-07-20 12:23:26', '1', '2023-07-20 12:23:26', b'0'); |
| 1310 | 1379 | 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 (1348, 20, '模拟支付', 'mock', 'pay_channel_code', 0, 'default', '', '模拟支付', '1', '2023-07-29 11:10:51', '1', '2023-07-29 03:14:10', b'0'); |
| 1311 | -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 (1349, 12, '订单取消', '12', 'member_point_biz_type', 0, '', '', '', '1', '2023-08-20 12:00:03', '1', '2023-08-20 12:00:03', b'0'); | |
| 1380 | +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 (1349, 12, '订单积分抵扣(整单取消)', '12', 'member_point_biz_type', 0, '', '', '', '1', '2023-08-20 12:00:03', '1', '2023-10-11 07:42:01', b'0'); | |
| 1312 | 1381 | 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 (1350, 0, '管理员调整', '0', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); |
| 1313 | 1382 | 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 (1351, 1, '邀新奖励', '1', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); |
| 1314 | -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 (1352, 2, '下单奖励', '2', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); | |
| 1315 | -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 (1353, 3, '退单扣除', '3', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); | |
| 1383 | +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 (1352, 11, '下单奖励', '11', 'member_experience_biz_type', 0, 'success', '', NULL, '', '2023-08-22 12:41:01', '1', '2023-10-11 07:45:09', b'0'); | |
| 1384 | +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 (1353, 12, '下单奖励(整单取消)', '12', 'member_experience_biz_type', 0, 'warning', '', NULL, '', '2023-08-22 12:41:01', '1', '2023-10-11 07:45:01', b'0'); | |
| 1316 | 1385 | 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 (1354, 4, '签到奖励', '4', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); |
| 1317 | 1386 | 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 (1355, 5, '抽奖奖励', '5', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); |
| 1318 | 1387 | 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 (1356, 1, '快递发货', '1', 'trade_delivery_type', 0, '', '', '', '1', '2023-08-23 00:04:55', '1', '2023-08-23 00:04:55', b'0'); |
| ... | ... | @@ -1348,6 +1417,15 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st |
| 1348 | 1417 | 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 (1386, 1, '砍价中', '1', 'promotion_bargain_record_status', 0, 'default', '', '', '1', '2023-10-05 10:41:26', '1', '2023-10-05 10:41:26', b'0'); |
| 1349 | 1418 | 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 (1387, 2, '砍价成功', '2', 'promotion_bargain_record_status', 0, 'success', '', '', '1', '2023-10-05 10:41:39', '1', '2023-10-05 10:41:39', b'0'); |
| 1350 | 1419 | 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 (1388, 3, '砍价失败', '3', 'promotion_bargain_record_status', 0, 'warning', '', '', '1', '2023-10-05 10:41:57', '1', '2023-10-05 10:41:57', b'0'); |
| 1420 | +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, 1, '拼团中', '1', 'promotion_combination_record_status', 0, '', '', '', '1', '2023-10-08 07:24:44', '1', '2023-10-08 07:24:44', b'0'); | |
| 1421 | +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, 2, '拼团成功', '2', 'promotion_combination_record_status', 0, 'success', '', '', '1', '2023-10-08 07:24:56', '1', '2023-10-08 07:24:56', b'0'); | |
| 1422 | +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, 3, '拼团失败', '3', 'promotion_combination_record_status', 0, 'warning', '', '', '1', '2023-10-08 07:25:11', '1', '2023-10-08 07:25:11', b'0'); | |
| 1423 | +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, 2, '管理员修改', '2', 'member_point_biz_type', 0, 'default', '', '', '1', '2023-10-11 07:41:34', '1', '2023-10-11 07:41:34', b'0'); | |
| 1424 | +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, 13, '订单积分抵扣(单个退款)', '13', 'member_point_biz_type', 0, '', '', '', '1', '2023-10-11 07:42:29', '1', '2023-10-11 07:42:29', b'0'); | |
| 1425 | +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, 21, '订单积分奖励', '21', 'member_point_biz_type', 0, 'default', '', '', '1', '2023-10-11 07:42:44', '1', '2023-10-11 07:42:44', b'0'); | |
| 1426 | +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'); | |
| 1427 | +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'); | |
| 1428 | +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'); | |
| 1351 | 1429 | COMMIT; |
| 1352 | 1430 | |
| 1353 | 1431 | -- ---------------------------- |
| ... | ... | @@ -1368,7 +1446,7 @@ CREATE TABLE `system_dict_type` ( |
| 1368 | 1446 | `deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间', |
| 1369 | 1447 | PRIMARY KEY (`id`) USING BTREE, |
| 1370 | 1448 | UNIQUE INDEX `dict_type`(`type` ASC) USING BTREE |
| 1371 | -) ENGINE = InnoDB AUTO_INCREMENT = 183 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; | |
| 1449 | +) ENGINE = InnoDB AUTO_INCREMENT = 185 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; | |
| 1372 | 1450 | |
| 1373 | 1451 | -- ---------------------------- |
| 1374 | 1452 | -- Records of system_dict_type |
| ... | ... | @@ -1441,6 +1519,7 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat |
| 1441 | 1519 | INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (181, '佣金提现状态', 'brokerage_withdraw_status', 0, NULL, '', '2023-09-28 02:46:05', '', '2023-09-28 02:46:05', b'0', NULL); |
| 1442 | 1520 | 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); |
| 1443 | 1521 | 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'); |
| 1522 | +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'); | |
| 1444 | 1523 | COMMIT; |
| 1445 | 1524 | |
| 1446 | 1525 | -- ---------------------------- |
| ... | ... | @@ -1489,7 +1568,7 @@ CREATE TABLE `system_login_log` ( |
| 1489 | 1568 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1490 | 1569 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 1491 | 1570 | PRIMARY KEY (`id`) USING BTREE |
| 1492 | -) ENGINE = InnoDB AUTO_INCREMENT = 2516 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; | |
| 1571 | +) ENGINE = InnoDB AUTO_INCREMENT = 2561 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; | |
| 1493 | 1572 | |
| 1494 | 1573 | -- ---------------------------- |
| 1495 | 1574 | -- Records of system_login_log |
| ... | ... | @@ -1619,7 +1698,7 @@ CREATE TABLE `system_menu` ( |
| 1619 | 1698 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 1620 | 1699 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1621 | 1700 | PRIMARY KEY (`id`) USING BTREE |
| 1622 | -) ENGINE = InnoDB AUTO_INCREMENT = 2366 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表'; | |
| 1701 | +) ENGINE = InnoDB AUTO_INCREMENT = 2377 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表'; | |
| 1623 | 1702 | |
| 1624 | 1703 | -- ---------------------------- |
| 1625 | 1704 | -- Records of system_menu |
| ... | ... | @@ -2037,7 +2116,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 2037 | 2116 | 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 (2306, '拼团活动创建', 'promotion:combination-activity:create', 3, 2, 2304, '', '', '', '', 0, b'1', b'1', b'1', '1', '2023-08-12 17:54:49', '1', '2023-08-12 17:54:49', b'0'); |
| 2038 | 2117 | 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 (2307, '拼团活动更新', 'promotion:combination-activity:update', 3, 3, 2304, '', '', '', '', 0, b'1', b'1', b'1', '1', '2023-08-12 17:55:04', '1', '2023-08-12 17:55:04', b'0'); |
| 2039 | 2118 | 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 (2308, '拼团活动删除', 'promotion:combination-activity:delete', 3, 4, 2304, '', '', '', '', 0, b'1', b'1', b'1', '1', '2023-08-12 17:55:23', '1', '2023-08-12 17:55:23', b'0'); |
| 2040 | -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 (2309, '秒杀活动关闭', 'promotion:combination-activity:close ', 3, 5, 2304, '', '', '', '', 0, b'1', b'1', b'1', '1', '2023-08-12 17:55:37', '1', '2023-08-12 17:55:37', b'0'); | |
| 2119 | +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 (2309, '拼团活动关闭', 'promotion:combination-activity:close', 3, 5, 2304, '', '', '', '', 0, b'1', b'1', b'1', '1', '2023-08-12 17:55:37', '1', '2023-10-06 10:51:57', b'0'); | |
| 2041 | 2120 | 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 (2310, '砍价活动', '', 2, 4, 2030, 'bargain', 'ep:box', '', '', 0, b'1', b'1', b'1', '1', '2023-08-13 00:27:25', '1', '2023-08-13 00:27:25', b'0'); |
| 2042 | 2121 | 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 (2311, '砍价商品', '', 2, 1, 2310, 'activity', 'ep:burger', 'mall/promotion/bargain/activity/index', 'PromotionBargainActivity', 0, b'1', b'1', b'1', '1', '2023-08-13 00:28:49', '1', '2023-10-05 01:16:23', b'0'); |
| 2043 | 2122 | 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 (2312, '砍价活动查询', 'promotion:bargain-activity:query', 3, 1, 2311, '', '', '', '', 0, b'1', b'1', b'1', '1', '2023-08-13 00:32:30', '1', '2023-08-13 00:32:30', b'0'); |
| ... | ... | @@ -2097,6 +2176,10 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 2097 | 2176 | 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 (2366, '砍价记录', '', 2, 2, 2310, 'record', 'ep:list', 'mall/promotion/bargain/record/index', 'PromotionBargainRecord', 0, b'1', b'1', b'1', '', '2023-10-05 02:49:06', '1', '2023-10-05 10:50:38', b'0'); |
| 2098 | 2177 | 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 (2367, '砍价记录查询', 'promotion:bargain-record:query', 3, 1, 2366, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-05 02:49:06', '', '2023-10-05 02:49:06', b'0'); |
| 2099 | 2178 | 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 (2368, '助力记录查询', 'promotion:bargain-help:query', 3, 2, 2366, '', '', '', '', 0, b'1', b'1', b'1', '1', '2023-10-05 12:27:49', '1', '2023-10-05 12:27:49', b'0'); |
| 2179 | +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 (2369, '拼团记录', 'promotion:combination-record:query', 2, 2, 2303, 'record', 'ep:avatar', 'mall/promotion/combination/record/index.vue', 'PromotionCombinationRecord', 0, b'1', b'1', b'1', '1', '2023-10-08 07:10:22', '1', '2023-10-08 07:34:11', b'0'); | |
| 2180 | +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 (2374, '会员统计', '', 2, 2, 2358, 'member', 'ep:avatar', 'statistics/member/index', 'MemberStatistics', 0, b'1', b'1', b'1', '', '2023-10-11 04:39:24', '1', '2023-10-11 12:50:22', b'0'); | |
| 2181 | +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 (2375, '会员统计查询', 'statistics:member:query', 3, 1, 2374, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-11 04:39:24', '', '2023-10-11 04:39:24', b'0'); | |
| 2182 | +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 (2376, '订单核销', 'trade:order:pick-up', 3, 10, 2076, '', '', '', '', 0, b'1', b'1', b'1', '1', '2023-10-14 17:11:58', '1', '2023-10-14 17:11:58', b'0'); | |
| 2100 | 2183 | COMMIT; |
| 2101 | 2184 | |
| 2102 | 2185 | -- ---------------------------- |
| ... | ... | @@ -2215,7 +2298,7 @@ CREATE TABLE `system_oauth2_access_token` ( |
| 2215 | 2298 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2216 | 2299 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2217 | 2300 | PRIMARY KEY (`id`) USING BTREE |
| 2218 | -) ENGINE = InnoDB AUTO_INCREMENT = 2880 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; | |
| 2301 | +) ENGINE = InnoDB AUTO_INCREMENT = 3022 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; | |
| 2219 | 2302 | |
| 2220 | 2303 | -- ---------------------------- |
| 2221 | 2304 | -- Records of system_oauth2_access_token |
| ... | ... | @@ -2337,7 +2420,7 @@ CREATE TABLE `system_oauth2_refresh_token` ( |
| 2337 | 2420 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2338 | 2421 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2339 | 2422 | PRIMARY KEY (`id`) USING BTREE |
| 2340 | -) ENGINE = InnoDB AUTO_INCREMENT = 1014 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌'; | |
| 2423 | +) ENGINE = InnoDB AUTO_INCREMENT = 1049 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌'; | |
| 2341 | 2424 | |
| 2342 | 2425 | -- ---------------------------- |
| 2343 | 2426 | -- Records of system_oauth2_refresh_token |
| ... | ... | @@ -2377,7 +2460,7 @@ CREATE TABLE `system_operate_log` ( |
| 2377 | 2460 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2378 | 2461 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2379 | 2462 | PRIMARY KEY (`id`) USING BTREE |
| 2380 | -) ENGINE = InnoDB AUTO_INCREMENT = 8643 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; | |
| 2463 | +) ENGINE = InnoDB AUTO_INCREMENT = 8718 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; | |
| 2381 | 2464 | |
| 2382 | 2465 | -- ---------------------------- |
| 2383 | 2466 | -- Records of system_operate_log |
| ... | ... | @@ -3385,7 +3468,7 @@ CREATE TABLE `system_sms_code` ( |
| 3385 | 3468 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 3386 | 3469 | PRIMARY KEY (`id`) USING BTREE, |
| 3387 | 3470 | INDEX `idx_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号' |
| 3388 | -) ENGINE = InnoDB AUTO_INCREMENT = 515 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码'; | |
| 3471 | +) ENGINE = InnoDB AUTO_INCREMENT = 531 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码'; | |
| 3389 | 3472 | |
| 3390 | 3473 | -- ---------------------------- |
| 3391 | 3474 | -- Records of system_sms_code |
| ... | ... | @@ -3428,7 +3511,7 @@ CREATE TABLE `system_sms_log` ( |
| 3428 | 3511 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 3429 | 3512 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 3430 | 3513 | PRIMARY KEY (`id`) USING BTREE |
| 3431 | -) ENGINE = InnoDB AUTO_INCREMENT = 426 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志'; | |
| 3514 | +) ENGINE = InnoDB AUTO_INCREMENT = 442 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志'; | |
| 3432 | 3515 | |
| 3433 | 3516 | -- ---------------------------- |
| 3434 | 3517 | -- Records of system_sms_log |
| ... | ... | @@ -3701,7 +3784,7 @@ CREATE TABLE `system_users` ( |
| 3701 | 3784 | -- Records of system_users |
| 3702 | 3785 | -- ---------------------------- |
| 3703 | 3786 | BEGIN; |
| 3704 | -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://test.yudao.iocoder.cn/e1fdd7271685ec143a0900681606406621717a666ad0b2798b096df41422b32f.png', 0, '0:0:0:0:0:0:0:1', '2023-10-05 12:34:11', 'admin', '2021-01-05 17:03:47', NULL, '2023-10-05 12:34:11', b'0', 1); | |
| 3787 | +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://test.yudao.iocoder.cn/e1fdd7271685ec143a0900681606406621717a666ad0b2798b096df41422b32f.png', 0, '0:0:0:0:0:0:0:1', '2023-10-14 17:12:19', 'admin', '2021-01-05 17:03:47', NULL, '2023-10-14 17:12:19', b'0', 1); | |
| 3705 | 3788 | 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); |
| 3706 | 3789 | 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); |
| 3707 | 3790 | 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-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; |
| 8 | 8 | import cn.iocoder.yudao.module.product.convert.spu.ProductSpuConvert; |
| 9 | 9 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; |
| 10 | 10 | import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; |
| 11 | +import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum; | |
| 11 | 12 | import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; |
| 12 | 13 | import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; |
| 13 | 14 | import io.swagger.v3.oas.annotations.Operation; |
| ... | ... | @@ -22,6 +23,7 @@ import javax.servlet.http.HttpServletResponse; |
| 22 | 23 | import javax.validation.Valid; |
| 23 | 24 | import java.io.IOException; |
| 24 | 25 | import java.util.Collection; |
| 26 | +import java.util.Comparator; | |
| 25 | 27 | import java.util.List; |
| 26 | 28 | import java.util.Map; |
| 27 | 29 | |
| ... | ... | @@ -88,11 +90,13 @@ public class ProductSpuController { |
| 88 | 90 | return success(ProductSpuConvert.INSTANCE.convertForSpuDetailRespVO(spu, skus)); |
| 89 | 91 | } |
| 90 | 92 | |
| 91 | - @GetMapping("/get-simple-list") | |
| 93 | + @GetMapping("/list-all-simple") | |
| 92 | 94 | @Operation(summary = "获得商品 SPU 精简列表") |
| 93 | 95 | @PreAuthorize("@ss.hasPermission('product:spu:query')") |
| 94 | 96 | public CommonResult<List<ProductSpuSimpleRespVO>> getSpuSimpleList() { |
| 95 | - List<ProductSpuDO> list = productSpuService.getSpuList(); | |
| 97 | + List<ProductSpuDO> list = productSpuService.getSpuListByStatus(ProductSpuStatusEnum.ENABLE.getStatus()); | |
| 98 | + // 降序排序后,返回给前端 | |
| 99 | + list.sort(Comparator.comparing(ProductSpuDO::getSort).reversed()); | |
| 96 | 100 | return success(ProductSpuConvert.INSTANCE.convertList02(list)); |
| 97 | 101 | } |
| 98 | 102 | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuService.java
| ... | ... | @@ -68,11 +68,12 @@ public interface ProductSpuService { |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * 获得所有商品 SPU 列表 | |
| 71 | + * 获得指定状态的商品 SPU 列表 | |
| 72 | 72 | * |
| 73 | + * @param status 状态 | |
| 73 | 74 | * @return 商品 SPU 列表 |
| 74 | 75 | */ |
| 75 | - List<ProductSpuDO> getSpuList(); | |
| 76 | + List<ProductSpuDO> getSpuListByStatus(Integer status); | |
| 76 | 77 | |
| 77 | 78 | /** |
| 78 | 79 | * 获得所有商品 SPU 列表 |
| ... | ... | @@ -146,4 +147,5 @@ public interface ProductSpuService { |
| 146 | 147 | * @return 商品 SPU 列表 |
| 147 | 148 | */ |
| 148 | 149 | List<ProductSpuDO> validateSpuList(Collection<Long> ids); |
| 150 | + | |
| 149 | 151 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java
| ... | ... | @@ -196,8 +196,8 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | @Override |
| 199 | - public List<ProductSpuDO> getSpuList() { | |
| 200 | - return productSpuMapper.selectList(); | |
| 199 | + public List<ProductSpuDO> getSpuListByStatus(Integer status) { | |
| 200 | + return productSpuMapper.selectList(ProductSpuDO::getStatus, status); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | @Override | ... | ... |
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApi.java
| 1 | 1 | package cn.iocoder.yudao.module.promotion.api.combination; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.common.core.KeyValue; | |
| 4 | 3 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO; |
| 4 | +import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateRespDTO; | |
| 5 | 5 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO; |
| 6 | 6 | |
| 7 | 7 | import javax.validation.Valid; |
| ... | ... | @@ -28,9 +28,9 @@ public interface CombinationRecordApi { |
| 28 | 28 | * 创建开团记录 |
| 29 | 29 | * |
| 30 | 30 | * @param reqDTO 请求 DTO |
| 31 | - * @return key 开团记录编号、value 团长编号 | |
| 31 | + * @return 拼团信息 | |
| 32 | 32 | */ |
| 33 | - KeyValue<Long, Long> createCombinationRecord(@Valid CombinationRecordCreateReqDTO reqDTO); | |
| 33 | + CombinationRecordCreateRespDTO createCombinationRecord(@Valid CombinationRecordCreateReqDTO reqDTO); | |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * 查询拼团记录是否成功 | ... | ... |
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/dto/CombinationRecordCreateRespDTO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.api.combination.dto; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * 拼团记录的创建 Response DTO | |
| 7 | + * | |
| 8 | + * @author HUIHUI | |
| 9 | + */ | |
| 10 | +@Data | |
| 11 | +public class CombinationRecordCreateRespDTO { | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * 拼团活动编号 | |
| 15 | + * | |
| 16 | + * 关联 CombinationActivityDO 的 id 字段 | |
| 17 | + */ | |
| 18 | + private Long combinationActivityId; | |
| 19 | + /** | |
| 20 | + * 拼团团长编号 | |
| 21 | + * | |
| 22 | + * 关联 CombinationRecordDO 的 headId 字段 | |
| 23 | + */ | |
| 24 | + private Long combinationHeadId; | |
| 25 | + /** | |
| 26 | + * 拼团记录编号 | |
| 27 | + * | |
| 28 | + * 关联 CombinationRecordDO 的 id 字段 | |
| 29 | + */ | |
| 30 | + private Long combinationRecordId; | |
| 31 | + | |
| 32 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/DictTypeConstants.java
0 → 100644
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java
| ... | ... | @@ -110,4 +110,10 @@ public interface ErrorCodeConstants { |
| 110 | 110 | ErrorCode BARGAIN_HELP_CREATE_FAIL_CONFLICT = new ErrorCode(1_013_014_003, "助力失败,请重试"); |
| 111 | 111 | ErrorCode BARGAIN_HELP_CREATE_FAIL_HELP_EXISTS = new ErrorCode(1_013_014_004, "助力失败,您已经助力过了"); |
| 112 | 112 | |
| 113 | + // ========== 文章分类 1-013-015-000 ========== | |
| 114 | + ErrorCode ARTICLE_CATEGORY_NOT_EXISTS = new ErrorCode(1_013_015_000, "分类不存在"); | |
| 115 | + | |
| 116 | + // ========== 文章管理 1-013-016-000 ========== | |
| 117 | + ErrorCode ARTICLE_NOT_EXISTS = new ErrorCode(1_013_016_000, "文章管理不存在"); | |
| 118 | + | |
| 113 | 119 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApiImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.promotion.api.combination; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.common.core.KeyValue; | |
| 4 | 3 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO; |
| 4 | +import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateRespDTO; | |
| 5 | 5 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO; |
| 6 | +import cn.iocoder.yudao.module.promotion.convert.combination.CombinationActivityConvert; | |
| 6 | 7 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationRecordDO; |
| 7 | 8 | import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum; |
| 8 | 9 | import cn.iocoder.yudao.module.promotion.service.combination.CombinationRecordService; |
| ... | ... | @@ -29,10 +30,9 @@ public class CombinationRecordApiImpl implements CombinationRecordApi { |
| 29 | 30 | recordService.validateCombinationRecord(userId, activityId, headId, skuId, count); |
| 30 | 31 | } |
| 31 | 32 | |
| 32 | - // TODO @puhui999:搞个创建的 RespDTO 哈; | |
| 33 | 33 | @Override |
| 34 | - public KeyValue<Long, Long> createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) { | |
| 35 | - return recordService.createCombinationRecord(reqDTO); | |
| 34 | + public CombinationRecordCreateRespDTO createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) { | |
| 35 | + return CombinationActivityConvert.INSTANCE.convert4(recordService.createCombinationRecord(reqDTO)); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | @Override | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/ArticleCategoryController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article; | |
| 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.promotion.controller.admin.article.vo.category.*; | |
| 9 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleCategoryConvert; | |
| 10 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 11 | +import cn.iocoder.yudao.module.promotion.service.article.ArticleCategoryService; | |
| 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.Comparator; | |
| 25 | +import java.util.List; | |
| 26 | + | |
| 27 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 28 | +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | |
| 29 | + | |
| 30 | +@Tag(name = "管理后台 - 文章分类") | |
| 31 | +@RestController | |
| 32 | +@RequestMapping("/promotion/article-category") | |
| 33 | +@Validated | |
| 34 | +public class ArticleCategoryController { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private ArticleCategoryService articleCategoryService; | |
| 38 | + | |
| 39 | + @PostMapping("/create") | |
| 40 | + @Operation(summary = "创建文章分类") | |
| 41 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:create')") | |
| 42 | + public CommonResult<Long> createArticleCategory(@Valid @RequestBody ArticleCategoryCreateReqVO createReqVO) { | |
| 43 | + return success(articleCategoryService.createArticleCategory(createReqVO)); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @PutMapping("/update") | |
| 47 | + @Operation(summary = "更新文章分类") | |
| 48 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:update')") | |
| 49 | + public CommonResult<Boolean> updateArticleCategory(@Valid @RequestBody ArticleCategoryUpdateReqVO updateReqVO) { | |
| 50 | + articleCategoryService.updateArticleCategory(updateReqVO); | |
| 51 | + return success(true); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @DeleteMapping("/delete") | |
| 55 | + @Operation(summary = "删除文章分类") | |
| 56 | + @Parameter(name = "id", description = "编号", required = true) | |
| 57 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:delete')") | |
| 58 | + public CommonResult<Boolean> deleteArticleCategory(@RequestParam("id") Long id) { | |
| 59 | + articleCategoryService.deleteArticleCategory(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('promotion:article-category:query')") | |
| 67 | + public CommonResult<ArticleCategoryRespVO> getArticleCategory(@RequestParam("id") Long id) { | |
| 68 | + ArticleCategoryDO articleCategory = articleCategoryService.getArticleCategory(id); | |
| 69 | + return success(ArticleCategoryConvert.INSTANCE.convert(articleCategory)); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @GetMapping("/list") | |
| 73 | + @Operation(summary = "获得文章分类列表") | |
| 74 | + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") | |
| 75 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:query')") | |
| 76 | + public CommonResult<List<ArticleCategoryRespVO>> getArticleCategoryList(@RequestParam("ids") Collection<Long> ids) { | |
| 77 | + List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryList(ids); | |
| 78 | + return success(ArticleCategoryConvert.INSTANCE.convertList(list)); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @GetMapping("/list-all-simple") | |
| 82 | + @Operation(summary = "获取文章分类精简信息列表", description = "只包含被开启的文章分类,主要用于前端的下拉选项") | |
| 83 | + public CommonResult<List<ArticleCategorySimpleRespVO>> getSimpleDeptList() { | |
| 84 | + // 获得部门列表,只要开启状态的 | |
| 85 | + List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryListByStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 86 | + // 降序排序后,返回给前端 | |
| 87 | + list.sort(Comparator.comparing(ArticleCategoryDO::getSort).reversed()); | |
| 88 | + return success(ArticleCategoryConvert.INSTANCE.convertList03(list)); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @GetMapping("/page") | |
| 92 | + @Operation(summary = "获得文章分类分页") | |
| 93 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:query')") | |
| 94 | + public CommonResult<PageResult<ArticleCategoryRespVO>> getArticleCategoryPage(@Valid ArticleCategoryPageReqVO pageVO) { | |
| 95 | + PageResult<ArticleCategoryDO> pageResult = articleCategoryService.getArticleCategoryPage(pageVO); | |
| 96 | + return success(ArticleCategoryConvert.INSTANCE.convertPage(pageResult)); | |
| 97 | + } | |
| 98 | + | |
| 99 | + @GetMapping("/export-excel") | |
| 100 | + @Operation(summary = "导出文章分类 Excel") | |
| 101 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:export')") | |
| 102 | + @OperateLog(type = EXPORT) | |
| 103 | + public void exportArticleCategoryExcel(@Valid ArticleCategoryExportReqVO exportReqVO, | |
| 104 | + HttpServletResponse response) throws IOException { | |
| 105 | + List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryList(exportReqVO); | |
| 106 | + // 导出 Excel | |
| 107 | + List<ArticleCategoryExcelVO> datas = ArticleCategoryConvert.INSTANCE.convertList02(list); | |
| 108 | + ExcelUtils.write(response, "文章分类.xls", "数据", ArticleCategoryExcelVO.class, datas); | |
| 109 | + } | |
| 110 | + | |
| 111 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/ArticleController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article; | |
| 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.promotion.controller.admin.article.vo.*; | |
| 8 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleConvert; | |
| 9 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 10 | +import cn.iocoder.yudao.module.promotion.service.article.ArticleService; | |
| 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 | +@Tag(name = "管理后台 - 文章管理") | |
| 29 | +@RestController | |
| 30 | +@RequestMapping("/promotion/article") | |
| 31 | +@Validated | |
| 32 | +public class ArticleController { | |
| 33 | + | |
| 34 | + @Resource | |
| 35 | + private ArticleService articleService; | |
| 36 | + | |
| 37 | + @PostMapping("/create") | |
| 38 | + @Operation(summary = "创建文章管理") | |
| 39 | + @PreAuthorize("@ss.hasPermission('promotion:article:create')") | |
| 40 | + public CommonResult<Long> createArticle(@Valid @RequestBody ArticleCreateReqVO createReqVO) { | |
| 41 | + return success(articleService.createArticle(createReqVO)); | |
| 42 | + } | |
| 43 | + | |
| 44 | + @PutMapping("/update") | |
| 45 | + @Operation(summary = "更新文章管理") | |
| 46 | + @PreAuthorize("@ss.hasPermission('promotion:article:update')") | |
| 47 | + public CommonResult<Boolean> updateArticle(@Valid @RequestBody ArticleUpdateReqVO updateReqVO) { | |
| 48 | + articleService.updateArticle(updateReqVO); | |
| 49 | + return success(true); | |
| 50 | + } | |
| 51 | + | |
| 52 | + @DeleteMapping("/delete") | |
| 53 | + @Operation(summary = "删除文章管理") | |
| 54 | + @Parameter(name = "id", description = "编号", required = true) | |
| 55 | + @PreAuthorize("@ss.hasPermission('promotion:article:delete')") | |
| 56 | + public CommonResult<Boolean> deleteArticle(@RequestParam("id") Long id) { | |
| 57 | + articleService.deleteArticle(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('promotion:article:query')") | |
| 65 | + public CommonResult<ArticleRespVO> getArticle(@RequestParam("id") Long id) { | |
| 66 | + ArticleDO article = articleService.getArticle(id); | |
| 67 | + return success(ArticleConvert.INSTANCE.convert(article)); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @GetMapping("/list") | |
| 71 | + @Operation(summary = "获得文章管理列表") | |
| 72 | + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") | |
| 73 | + @PreAuthorize("@ss.hasPermission('promotion:article:query')") | |
| 74 | + public CommonResult<List<ArticleRespVO>> getArticleList(@RequestParam("ids") Collection<Long> ids) { | |
| 75 | + List<ArticleDO> list = articleService.getArticleList(ids); | |
| 76 | + return success(ArticleConvert.INSTANCE.convertList(list)); | |
| 77 | + } | |
| 78 | + | |
| 79 | + @GetMapping("/page") | |
| 80 | + @Operation(summary = "获得文章管理分页") | |
| 81 | + @PreAuthorize("@ss.hasPermission('promotion:article:query')") | |
| 82 | + public CommonResult<PageResult<ArticleRespVO>> getArticlePage(@Valid ArticlePageReqVO pageVO) { | |
| 83 | + PageResult<ArticleDO> pageResult = articleService.getArticlePage(pageVO); | |
| 84 | + return success(ArticleConvert.INSTANCE.convertPage(pageResult)); | |
| 85 | + } | |
| 86 | + | |
| 87 | + @GetMapping("/export-excel") | |
| 88 | + @Operation(summary = "导出文章管理 Excel") | |
| 89 | + @PreAuthorize("@ss.hasPermission('promotion:article:export')") | |
| 90 | + @OperateLog(type = EXPORT) | |
| 91 | + public void exportArticleExcel(@Valid ArticleExportReqVO exportReqVO, | |
| 92 | + HttpServletResponse response) throws IOException { | |
| 93 | + List<ArticleDO> list = articleService.getArticleList(exportReqVO); | |
| 94 | + // 导出 Excel | |
| 95 | + List<ArticleExcelVO> datas = ArticleConvert.INSTANCE.convertList02(list); | |
| 96 | + ExcelUtils.write(response, "文章管理.xls", "数据", ArticleExcelVO.class, datas); | |
| 97 | + } | |
| 98 | + | |
| 99 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/ArticleBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.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 ArticleBaseVO { | |
| 14 | + | |
| 15 | + @Schema(description = "文章分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15458") | |
| 16 | + @NotNull(message = "文章分类编号不能为空") | |
| 17 | + private Long categoryId; | |
| 18 | + | |
| 19 | + @Schema(description = "关联商品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22378") | |
| 20 | + @NotNull(message = "关联商品不能为空") | |
| 21 | + private Long spuId; | |
| 22 | + | |
| 23 | + @Schema(description = "文章标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是一个标题") | |
| 24 | + @NotNull(message = "文章标题不能为空") | |
| 25 | + private String title; | |
| 26 | + | |
| 27 | + @Schema(description = "文章作者", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") | |
| 28 | + private String author; | |
| 29 | + | |
| 30 | + @Schema(description = "文章封面图片地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn") | |
| 31 | + @NotNull(message = "文章封面图片地址不能为空") | |
| 32 | + private String picUrl; | |
| 33 | + | |
| 34 | + @Schema(description = "文章简介", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是一个简介") | |
| 35 | + private String introduction; | |
| 36 | + | |
| 37 | + @Schema(description = "浏览次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "111") | |
| 38 | + private String browseCount; | |
| 39 | + | |
| 40 | + @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 41 | + @NotNull(message = "排序不能为空") | |
| 42 | + private Integer sort; | |
| 43 | + | |
| 44 | + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 45 | + @NotNull(message = "状态不能为空") | |
| 46 | + private Integer status; | |
| 47 | + | |
| 48 | + @Schema(description = "是否热门(小程序)", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | |
| 49 | + @NotNull(message = "是否热门(小程序)不能为空") | |
| 50 | + private Boolean recommendHot; | |
| 51 | + | |
| 52 | + @Schema(description = "是否轮播图(小程序)", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | |
| 53 | + @NotNull(message = "是否轮播图(小程序)不能为空") | |
| 54 | + private Boolean recommendBanner; | |
| 55 | + | |
| 56 | + @Schema(description = "文章内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是文章内容") | |
| 57 | + @NotNull(message = "文章内容不能为空") | |
| 58 | + private String content; | |
| 59 | + | |
| 60 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/ArticleCreateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.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 ArticleCreateReqVO extends ArticleBaseVO { | |
| 13 | + | |
| 14 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/ArticleExcelVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.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.system.enums.DictTypeConstants; | |
| 6 | +import com.alibaba.excel.annotation.ExcelProperty; | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 文章管理 Excel VO | |
| 14 | + * | |
| 15 | + * @author HUIHUI | |
| 16 | + */ | |
| 17 | +@Data | |
| 18 | +public class ArticleExcelVO { | |
| 19 | + | |
| 20 | + @ExcelProperty("文章编号") | |
| 21 | + private Long id; | |
| 22 | + | |
| 23 | + @ExcelProperty("文章分类编号") | |
| 24 | + private Long categoryId; | |
| 25 | + | |
| 26 | + @ExcelProperty("关联商品编号") | |
| 27 | + private Long spuId; | |
| 28 | + | |
| 29 | + @ExcelProperty("文章标题") | |
| 30 | + private String title; | |
| 31 | + | |
| 32 | + @ExcelProperty("文章作者") | |
| 33 | + private String author; | |
| 34 | + | |
| 35 | + @ExcelProperty("文章封面图片地址") | |
| 36 | + private String picUrl; | |
| 37 | + | |
| 38 | + @ExcelProperty("文章简介") | |
| 39 | + private String introduction; | |
| 40 | + | |
| 41 | + @ExcelProperty("浏览次数") | |
| 42 | + private String browseCount; | |
| 43 | + | |
| 44 | + @ExcelProperty("排序") | |
| 45 | + private Integer sort; | |
| 46 | + | |
| 47 | + @ExcelProperty(value = "状态", converter = DictConvert.class) | |
| 48 | + @DictFormat(DictTypeConstants.COMMON_STATUS) | |
| 49 | + private Integer status; | |
| 50 | + | |
| 51 | + @ExcelProperty("是否热门(小程序)") | |
| 52 | + private Boolean recommendHot; | |
| 53 | + | |
| 54 | + @ExcelProperty("是否轮播图(小程序)") | |
| 55 | + private Boolean recommendBanner; | |
| 56 | + | |
| 57 | + @ExcelProperty("文章内容") | |
| 58 | + private String content; | |
| 59 | + | |
| 60 | + @ExcelProperty("创建时间") | |
| 61 | + private LocalDateTime createTime; | |
| 62 | + | |
| 63 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/ArticleExportReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.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 = "管理后台 - 文章管理 Excel 导出 Request VO,参数和 ArticlePageReqVO 是一致的") | |
| 12 | +@Data | |
| 13 | +public class ArticleExportReqVO { | |
| 14 | + | |
| 15 | + @Schema(description = "文章分类编号", example = "15458") | |
| 16 | + private Long categoryId; | |
| 17 | + | |
| 18 | + @Schema(description = "关联商品编号", example = "22378") | |
| 19 | + private Long spuId; | |
| 20 | + | |
| 21 | + @Schema(description = "文章标题") | |
| 22 | + private String title; | |
| 23 | + | |
| 24 | + @Schema(description = "文章作者") | |
| 25 | + private String author; | |
| 26 | + | |
| 27 | + @Schema(description = "状态", example = "2") | |
| 28 | + private Integer status; | |
| 29 | + | |
| 30 | + @Schema(description = "是否热门(小程序)") | |
| 31 | + private Boolean recommendHot; | |
| 32 | + | |
| 33 | + @Schema(description = "是否轮播图(小程序)") | |
| 34 | + private Boolean recommendBanner; | |
| 35 | + | |
| 36 | + @Schema(description = "创建时间") | |
| 37 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 38 | + private LocalDateTime[] createTime; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/ArticlePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.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 = "管理后台 - 文章管理分页 Request VO") | |
| 15 | +@Data | |
| 16 | +@EqualsAndHashCode(callSuper = true) | |
| 17 | +@ToString(callSuper = true) | |
| 18 | +public class ArticlePageReqVO extends PageParam { | |
| 19 | + | |
| 20 | + @Schema(description = "文章分类编号", example = "15458") | |
| 21 | + private Long categoryId; | |
| 22 | + | |
| 23 | + @Schema(description = "关联商品编号", example = "22378") | |
| 24 | + private Long spuId; | |
| 25 | + | |
| 26 | + @Schema(description = "文章标题") | |
| 27 | + private String title; | |
| 28 | + | |
| 29 | + @Schema(description = "文章作者") | |
| 30 | + private String author; | |
| 31 | + | |
| 32 | + @Schema(description = "状态", example = "2") | |
| 33 | + private Integer status; | |
| 34 | + | |
| 35 | + @Schema(description = "是否热门(小程序)") | |
| 36 | + private Boolean recommendHot; | |
| 37 | + | |
| 38 | + @Schema(description = "是否轮播图(小程序)") | |
| 39 | + private Boolean recommendBanner; | |
| 40 | + | |
| 41 | + @Schema(description = "创建时间") | |
| 42 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 43 | + private LocalDateTime[] createTime; | |
| 44 | + | |
| 45 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/ArticleRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.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 = "管理后台 - 文章管理 Response VO") | |
| 11 | +@Data | |
| 12 | +@EqualsAndHashCode(callSuper = true) | |
| 13 | +@ToString(callSuper = true) | |
| 14 | +public class ArticleRespVO extends ArticleBaseVO { | |
| 15 | + | |
| 16 | + @Schema(description = "文章编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8606") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 20 | + private LocalDateTime createTime; | |
| 21 | + | |
| 22 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/ArticleUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.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 ArticleUpdateReqVO extends ArticleBaseVO { | |
| 15 | + | |
| 16 | + @Schema(description = "文章编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8606") | |
| 17 | + @NotNull(message = "文章编号不能为空") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/category/ArticleCategoryBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category; | |
| 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 ArticleCategoryBaseVO { | |
| 14 | + | |
| 15 | + @Schema(description = "文章分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "秒杀") | |
| 16 | + @NotNull(message = "文章分类名称不能为空") | |
| 17 | + private String name; | |
| 18 | + | |
| 19 | + @Schema(description = "图标地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn") | |
| 20 | + private String picUrl; | |
| 21 | + | |
| 22 | + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 23 | + @NotNull(message = "状态不能为空") | |
| 24 | + private Integer status; | |
| 25 | + | |
| 26 | + @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 27 | + @NotNull(message = "排序不能为空") | |
| 28 | + private Integer sort; | |
| 29 | + | |
| 30 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/category/ArticleCategoryCreateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category; | |
| 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 ArticleCategoryCreateReqVO extends ArticleCategoryBaseVO { | |
| 13 | + | |
| 14 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/category/ArticleCategoryExcelVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category; | |
| 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.system.enums.DictTypeConstants; | |
| 6 | +import com.alibaba.excel.annotation.ExcelProperty; | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 文章分类 Excel VO | |
| 14 | + * | |
| 15 | + * @author HUIHUI | |
| 16 | + */ | |
| 17 | +@Data | |
| 18 | +public class ArticleCategoryExcelVO { | |
| 19 | + | |
| 20 | + @ExcelProperty("文章分类编号") | |
| 21 | + private Long id; | |
| 22 | + | |
| 23 | + @ExcelProperty("文章分类名称") | |
| 24 | + private String name; | |
| 25 | + | |
| 26 | + @ExcelProperty("图标地址") | |
| 27 | + private String picUrl; | |
| 28 | + | |
| 29 | + @ExcelProperty(value = "状态", converter = DictConvert.class) | |
| 30 | + @DictFormat(DictTypeConstants.COMMON_STATUS) | |
| 31 | + private Integer status; | |
| 32 | + | |
| 33 | + @ExcelProperty("排序") | |
| 34 | + private Integer sort; | |
| 35 | + | |
| 36 | + @ExcelProperty("创建时间") | |
| 37 | + private LocalDateTime createTime; | |
| 38 | + | |
| 39 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/category/ArticleCategoryExportReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category; | |
| 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 = "管理后台 - 文章分类 Excel 导出 Request VO,参数和 ArticleCategoryPageReqVO 是一致的") | |
| 12 | +@Data | |
| 13 | +public class ArticleCategoryExportReqVO { | |
| 14 | + | |
| 15 | + @Schema(description = "文章分类名称", example = "秒杀") | |
| 16 | + private String name; | |
| 17 | + | |
| 18 | + @Schema(description = "状态", example = "1") | |
| 19 | + private Integer status; | |
| 20 | + | |
| 21 | + @Schema(description = "创建时间") | |
| 22 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 23 | + private LocalDateTime[] createTime; | |
| 24 | + | |
| 25 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/category/ArticleCategoryPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category; | |
| 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 = "管理后台 - 文章分类分页 Request VO") | |
| 15 | +@Data | |
| 16 | +@EqualsAndHashCode(callSuper = true) | |
| 17 | +@ToString(callSuper = true) | |
| 18 | +public class ArticleCategoryPageReqVO extends PageParam { | |
| 19 | + | |
| 20 | + @Schema(description = "文章分类名称", example = "秒杀") | |
| 21 | + private String name; | |
| 22 | + | |
| 23 | + @Schema(description = "状态", example = "1") | |
| 24 | + private Integer status; | |
| 25 | + | |
| 26 | + @Schema(description = "创建时间") | |
| 27 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 28 | + private LocalDateTime[] createTime; | |
| 29 | + | |
| 30 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/category/ArticleCategoryRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category; | |
| 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 = "管理后台 - 文章分类 Response VO") | |
| 11 | +@Data | |
| 12 | +@EqualsAndHashCode(callSuper = true) | |
| 13 | +@ToString(callSuper = true) | |
| 14 | +public class ArticleCategoryRespVO extends ArticleCategoryBaseVO { | |
| 15 | + | |
| 16 | + @Schema(description = "文章分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19490") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 20 | + private LocalDateTime createTime; | |
| 21 | + | |
| 22 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/category/ArticleCategorySimpleRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +@Schema(description = "管理后台 - 文章分类精简信息 Response VO") | |
| 7 | +@Data | |
| 8 | +public class ArticleCategorySimpleRespVO { | |
| 9 | + | |
| 10 | + @Schema(description = "文章分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19490") | |
| 11 | + private Long id; | |
| 12 | + | |
| 13 | + @Schema(description = "文章分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "秒杀") | |
| 14 | + private String name; | |
| 15 | + | |
| 16 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/category/ArticleCategoryUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category; | |
| 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 ArticleCategoryUpdateReqVO extends ArticleCategoryBaseVO { | |
| 15 | + | |
| 16 | + @Schema(description = "文章分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19490") | |
| 17 | + @NotNull(message = "文章分类编号不能为空") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/CombinationRecordController.java
| ... | ... | @@ -3,11 +3,11 @@ package cn.iocoder.yudao.module.promotion.controller.admin.combination; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 5 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordPageItemRespVO; |
| 6 | -import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPage2VO; | |
| 7 | 6 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPageVO; |
| 8 | 7 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordSummaryVO; |
| 9 | 8 | import cn.iocoder.yudao.module.promotion.convert.combination.CombinationActivityConvert; |
| 10 | 9 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationActivityDO; |
| 10 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationProductDO; | |
| 11 | 11 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationRecordDO; |
| 12 | 12 | import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum; |
| 13 | 13 | import cn.iocoder.yudao.module.promotion.service.combination.CombinationActivityService; |
| ... | ... | @@ -40,29 +40,17 @@ public class CombinationRecordController { |
| 40 | 40 | @Lazy |
| 41 | 41 | private CombinationRecordService combinationRecordService; |
| 42 | 42 | |
| 43 | - // TODO @puhui999:getBargainRecordPage 和 getBargainRecordPage 是不是可以合并;然后 CombinationRecordReqPageVO 加一个 headId; | |
| 44 | - // 然后如果 headId 非空,并且第一页,单独多查询一条 head ;放到第 0 个位置;相当于说,第一页特殊一点; | |
| 45 | - | |
| 46 | 43 | @GetMapping("/page") |
| 47 | 44 | @Operation(summary = "获得拼团记录分页") |
| 48 | 45 | @PreAuthorize("@ss.hasPermission('promotion:combination-record:query')") |
| 49 | 46 | public CommonResult<PageResult<CombinationRecordPageItemRespVO>> getBargainRecordPage(@Valid CombinationRecordReqPageVO pageVO) { |
| 50 | 47 | PageResult<CombinationRecordDO> recordPage = combinationRecordService.getCombinationRecordPage(pageVO); |
| 48 | + // 拼接数据 | |
| 51 | 49 | List<CombinationActivityDO> activities = combinationActivityService.getCombinationActivityListByIds( |
| 52 | 50 | convertSet(recordPage.getList(), CombinationRecordDO::getActivityId)); |
| 53 | - // TODO @puhui999:商品没读取 | |
| 54 | - return success(CombinationActivityConvert.INSTANCE.convert(recordPage, activities)); | |
| 55 | - } | |
| 56 | - | |
| 57 | - @GetMapping("/page-by-headId") | |
| 58 | - @Operation(summary = "获得拼团记录分页") | |
| 59 | - @PreAuthorize("@ss.hasPermission('promotion:combination-record:query')") | |
| 60 | - public CommonResult<PageResult<CombinationRecordPageItemRespVO>> getBargainRecordPage(@Valid CombinationRecordReqPage2VO pageVO) { | |
| 61 | - // 包含团长和团员的分页记录 | |
| 62 | - PageResult<CombinationRecordDO> recordPage = combinationRecordService.getCombinationRecordPage2(pageVO); | |
| 63 | - List<CombinationActivityDO> activities = combinationActivityService.getCombinationActivityListByIds( | |
| 51 | + List<CombinationProductDO> products = combinationActivityService.getCombinationProductListByActivityIds( | |
| 64 | 52 | convertSet(recordPage.getList(), CombinationRecordDO::getActivityId)); |
| 65 | - return success(CombinationActivityConvert.INSTANCE.convert(recordPage, activities)); | |
| 53 | + return success(CombinationActivityConvert.INSTANCE.convert(recordPage, activities, products)); | |
| 66 | 54 | } |
| 67 | 55 | |
| 68 | 56 | @GetMapping("/get-summary") |
| ... | ... | @@ -70,7 +58,7 @@ public class CombinationRecordController { |
| 70 | 58 | @PreAuthorize("@ss.hasPermission('promotion:combination-record:query')") |
| 71 | 59 | public CommonResult<CombinationRecordSummaryVO> getCombinationRecordSummary() { |
| 72 | 60 | CombinationRecordSummaryVO summaryVO = new CombinationRecordSummaryVO(); |
| 73 | - summaryVO.setUserCount(combinationRecordService.getCombinationRecordCount(null, null, null)); // 获取拼团用户参与数量 | |
| 61 | + summaryVO.setUserCount(combinationRecordService.getCombinationUserCount()); // 获取拼团用户参与数量 | |
| 74 | 62 | summaryVO.setSuccessCount(combinationRecordService.getCombinationRecordCount( // 获取成团记录 |
| 75 | 63 | CombinationRecordStatusEnum.SUCCESS.getStatus(), null, CombinationRecordDO.HEAD_ID_GROUP)); |
| 76 | 64 | summaryVO.setVirtualGroupCount(combinationRecordService.getCombinationRecordCount(// 获取虚拟成团记录 | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/vo/recrod/CombinationRecordReqPageVO.java
| ... | ... | @@ -23,6 +23,9 @@ public class CombinationRecordReqPageVO extends PageParam { |
| 23 | 23 | @InEnum(BargainRecordStatusEnum.class) |
| 24 | 24 | private Integer status; |
| 25 | 25 | |
| 26 | + @Schema(description = "团长编号", example = "1024") | |
| 27 | + private Long headId; | |
| 28 | + | |
| 26 | 29 | @Schema(description = "创建时间") |
| 27 | 30 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 28 | 31 | private LocalDateTime[] createTime; | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
| ... | ... | @@ -47,13 +47,13 @@ public class AppCombinationRecordController { |
| 47 | 47 | public CommonResult<AppCombinationRecordSummaryRespVO> getCombinationRecordSummary() { |
| 48 | 48 | AppCombinationRecordSummaryRespVO summary = new AppCombinationRecordSummaryRespVO(); |
| 49 | 49 | // 1. 获得拼团参与用户数量 |
| 50 | - Long count = combinationRecordService.getCombinationRecordCount(null, null, null); | |
| 51 | - if (count == 0) { | |
| 50 | + Long userCount = combinationRecordService.getCombinationUserCount(); | |
| 51 | + if (userCount == 0) { | |
| 52 | 52 | summary.setAvatars(Collections.emptyList()); |
| 53 | - summary.setUserCount(count); | |
| 53 | + summary.setUserCount(userCount); | |
| 54 | 54 | return success(summary); |
| 55 | 55 | } |
| 56 | - summary.setUserCount(count); | |
| 56 | + summary.setUserCount(userCount); | |
| 57 | 57 | |
| 58 | 58 | // 2. 获得拼团记录头像 |
| 59 | 59 | List<CombinationRecordDO> records = combinationRecordService.getLatestCombinationRecordList( | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/article/ArticleCategoryConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.convert.article; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.*; | |
| 5 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 6 | +import org.mapstruct.Mapper; | |
| 7 | +import org.mapstruct.factory.Mappers; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 文章分类 Convert | |
| 13 | + * | |
| 14 | + * @author HUIHUI | |
| 15 | + */ | |
| 16 | +@Mapper | |
| 17 | +public interface ArticleCategoryConvert { | |
| 18 | + | |
| 19 | + ArticleCategoryConvert INSTANCE = Mappers.getMapper(ArticleCategoryConvert.class); | |
| 20 | + | |
| 21 | + ArticleCategoryDO convert(ArticleCategoryCreateReqVO bean); | |
| 22 | + | |
| 23 | + ArticleCategoryDO convert(ArticleCategoryUpdateReqVO bean); | |
| 24 | + | |
| 25 | + ArticleCategoryRespVO convert(ArticleCategoryDO bean); | |
| 26 | + | |
| 27 | + List<ArticleCategoryRespVO> convertList(List<ArticleCategoryDO> list); | |
| 28 | + | |
| 29 | + PageResult<ArticleCategoryRespVO> convertPage(PageResult<ArticleCategoryDO> page); | |
| 30 | + | |
| 31 | + List<ArticleCategoryExcelVO> convertList02(List<ArticleCategoryDO> list); | |
| 32 | + | |
| 33 | + List<ArticleCategorySimpleRespVO> convertList03(List<ArticleCategoryDO> list); | |
| 34 | + | |
| 35 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/article/ArticleConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.convert.article; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleExcelVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleRespVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleUpdateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 9 | +import org.mapstruct.Mapper; | |
| 10 | +import org.mapstruct.factory.Mappers; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 文章管理 Convert | |
| 16 | + * | |
| 17 | + * @author HUIHUI | |
| 18 | + */ | |
| 19 | +@Mapper | |
| 20 | +public interface ArticleConvert { | |
| 21 | + | |
| 22 | + ArticleConvert INSTANCE = Mappers.getMapper(ArticleConvert.class); | |
| 23 | + | |
| 24 | + ArticleDO convert(ArticleCreateReqVO bean); | |
| 25 | + | |
| 26 | + ArticleDO convert(ArticleUpdateReqVO bean); | |
| 27 | + | |
| 28 | + ArticleRespVO convert(ArticleDO bean); | |
| 29 | + | |
| 30 | + List<ArticleRespVO> convertList(List<ArticleDO> list); | |
| 31 | + | |
| 32 | + PageResult<ArticleRespVO> convertPage(PageResult<ArticleDO> page); | |
| 33 | + | |
| 34 | + List<ArticleExcelVO> convertList02(List<ArticleDO> list); | |
| 35 | + | |
| 36 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; |
| 8 | 8 | import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO; |
| 9 | 9 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 10 | 10 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO; |
| 11 | +import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateRespDTO; | |
| 11 | 12 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.activity.CombinationActivityCreateReqVO; |
| 12 | 13 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.activity.CombinationActivityPageItemRespVO; |
| 13 | 14 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.activity.CombinationActivityRespVO; |
| ... | ... | @@ -109,6 +110,11 @@ public interface CombinationActivityConvert { |
| 109 | 110 | |
| 110 | 111 | CombinationRecordDO convert(CombinationRecordCreateReqDTO reqDTO); |
| 111 | 112 | |
| 113 | + default CombinationRecordCreateRespDTO convert4(CombinationRecordDO combinationRecord) { | |
| 114 | + return new CombinationRecordCreateRespDTO().setCombinationActivityId(combinationRecord.getActivityId()) | |
| 115 | + .setCombinationRecordId(combinationRecord.getId()).setCombinationHeadId(combinationRecord.getHeadId()); | |
| 116 | + } | |
| 117 | + | |
| 112 | 118 | default CombinationRecordDO convert(CombinationRecordCreateReqDTO reqDTO, |
| 113 | 119 | CombinationActivityDO activity, MemberUserRespDTO user, |
| 114 | 120 | ProductSpuRespDTO spu, ProductSkuRespDTO sku) { |
| ... | ... | @@ -172,19 +178,20 @@ public interface CombinationActivityConvert { |
| 172 | 178 | |
| 173 | 179 | PageResult<CombinationRecordPageItemRespVO> convert(PageResult<CombinationRecordDO> result); |
| 174 | 180 | |
| 175 | - default PageResult<CombinationRecordPageItemRespVO> convert(PageResult<CombinationRecordDO> recordPage, List<CombinationActivityDO> activities) { | |
| 181 | + default PageResult<CombinationRecordPageItemRespVO> convert(PageResult<CombinationRecordDO> recordPage, List<CombinationActivityDO> activities, List<CombinationProductDO> products) { | |
| 176 | 182 | PageResult<CombinationRecordPageItemRespVO> result = convert(recordPage); |
| 183 | + // 拼接关联属性 | |
| 177 | 184 | Map<Long, CombinationActivityDO> activityMap = convertMap(activities, CombinationActivityDO::getId); |
| 185 | + Map<Long, List<CombinationProductDO>> productsMap = convertMultiMap(products, CombinationProductDO::getActivityId); | |
| 178 | 186 | result.setList(CollectionUtils.convertList(result.getList(), item -> { |
| 179 | 187 | findAndThen(activityMap, item.getActivityId(), activity -> { |
| 180 | - item.setActivity(convert(activity)); | |
| 188 | + item.setActivity(convert(activity).setProducts(convertList2(productsMap.get(item.getActivityId())))); | |
| 181 | 189 | }); |
| 182 | 190 | return item; |
| 183 | 191 | })); |
| 184 | 192 | return result; |
| 185 | 193 | } |
| 186 | 194 | |
| 187 | - | |
| 188 | 195 | default AppCombinationRecordDetailRespVO convert(Long userId, CombinationRecordDO headRecord, List<CombinationRecordDO> memberRecords) { |
| 189 | 196 | AppCombinationRecordDetailRespVO respVO = new AppCombinationRecordDetailRespVO() |
| 190 | 197 | .setHeadRecord(convert(headRecord)).setMemberRecords(convertList3(memberRecords)); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/article/ArticleCategoryDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.dal.dataobject.article; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 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 | +/** | |
| 11 | + * 文章分类 DO | |
| 12 | + * | |
| 13 | + * @author HUIHUI | |
| 14 | + */ | |
| 15 | +@TableName("promotion_article_category") | |
| 16 | +@KeySequence("promotion_article_category_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 17 | +@Data | |
| 18 | +@EqualsAndHashCode(callSuper = true) | |
| 19 | +@ToString(callSuper = true) | |
| 20 | +@Builder | |
| 21 | +@NoArgsConstructor | |
| 22 | +@AllArgsConstructor | |
| 23 | +public class ArticleCategoryDO extends BaseDO { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 文章分类编号 | |
| 27 | + */ | |
| 28 | + @TableId | |
| 29 | + private Long id; | |
| 30 | + /** | |
| 31 | + * 文章分类名称 | |
| 32 | + */ | |
| 33 | + private String name; | |
| 34 | + /** | |
| 35 | + * 图标地址 | |
| 36 | + */ | |
| 37 | + private String picUrl; | |
| 38 | + /** | |
| 39 | + * 状态 | |
| 40 | + * | |
| 41 | + * 枚举 {@link CommonStatusEnum} | |
| 42 | + */ | |
| 43 | + private Integer status; | |
| 44 | + /** | |
| 45 | + * 排序 | |
| 46 | + */ | |
| 47 | + private Integer sort; | |
| 48 | + | |
| 49 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/article/ArticleDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.dal.dataobject.article; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 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 | +/** | |
| 11 | + * 文章管理 DO | |
| 12 | + * | |
| 13 | + * @author HUIHUI | |
| 14 | + */ | |
| 15 | +@TableName("promotion_article") | |
| 16 | +@KeySequence("promotion_article_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 17 | +@Data | |
| 18 | +@EqualsAndHashCode(callSuper = true) | |
| 19 | +@ToString(callSuper = true) | |
| 20 | +@Builder | |
| 21 | +@NoArgsConstructor | |
| 22 | +@AllArgsConstructor | |
| 23 | +public class ArticleDO extends BaseDO { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 文章管理编号 | |
| 27 | + */ | |
| 28 | + @TableId | |
| 29 | + private Long id; | |
| 30 | + /** | |
| 31 | + * 分类编号 ArticleCategoryDO#id | |
| 32 | + */ | |
| 33 | + private Long categoryId; | |
| 34 | + /** | |
| 35 | + * 关联商品编号 ProductSpuDO#id | |
| 36 | + */ | |
| 37 | + private Long spuId; | |
| 38 | + /** | |
| 39 | + * 文章标题 | |
| 40 | + */ | |
| 41 | + private String title; | |
| 42 | + /** | |
| 43 | + * 文章作者 | |
| 44 | + */ | |
| 45 | + private String author; | |
| 46 | + /** | |
| 47 | + * 文章封面图片地址 | |
| 48 | + */ | |
| 49 | + private String picUrl; | |
| 50 | + /** | |
| 51 | + * 文章简介 | |
| 52 | + */ | |
| 53 | + private String introduction; | |
| 54 | + /** | |
| 55 | + * 浏览次数 | |
| 56 | + */ | |
| 57 | + private String browseCount; | |
| 58 | + /** | |
| 59 | + * 排序 | |
| 60 | + */ | |
| 61 | + private Integer sort; | |
| 62 | + /** | |
| 63 | + * 状态 | |
| 64 | + * | |
| 65 | + * 枚举 {@link CommonStatusEnum} | |
| 66 | + */ | |
| 67 | + private Integer status; | |
| 68 | + /** | |
| 69 | + * 是否热门(小程序) | |
| 70 | + */ | |
| 71 | + private Boolean recommendHot; | |
| 72 | + /** | |
| 73 | + * 是否轮播图(小程序) | |
| 74 | + */ | |
| 75 | + private Boolean recommendBanner; | |
| 76 | + /** | |
| 77 | + * 文章内容 | |
| 78 | + */ | |
| 79 | + private String content; | |
| 80 | + | |
| 81 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/discount/DiscountActivityDO.java
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/discount/DiscountProductDO.java
| ... | ... | @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableName; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | import lombok.EqualsAndHashCode; |
| 10 | 10 | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | + | |
| 11 | 13 | /** |
| 12 | 14 | * 限时折扣商品 DO |
| 13 | 15 | * |
| ... | ... | @@ -25,7 +27,6 @@ public class DiscountProductDO extends BaseDO { |
| 25 | 27 | @TableId |
| 26 | 28 | private Long id; |
| 27 | 29 | |
| 28 | - // TODO 芋艿:把 activity 所有的字段冗余过来 | |
| 29 | 30 | /** |
| 30 | 31 | * 限时折扣活动的编号 |
| 31 | 32 | * |
| ... | ... | @@ -33,6 +34,7 @@ public class DiscountProductDO extends BaseDO { |
| 33 | 34 | */ |
| 34 | 35 | private Long activityId; |
| 35 | 36 | |
| 37 | + | |
| 36 | 38 | /** |
| 37 | 39 | * 商品 SPU 编号 |
| 38 | 40 | * |
| ... | ... | @@ -65,4 +67,24 @@ public class DiscountProductDO extends BaseDO { |
| 65 | 67 | */ |
| 66 | 68 | private Integer discountPrice; |
| 67 | 69 | |
| 70 | + // TODO 芋艿:这几个字段,要新增下; | |
| 71 | + /** | |
| 72 | + * 活动状态 | |
| 73 | + * | |
| 74 | + * 关联 {@link DiscountActivityDO#getStatus()} | |
| 75 | + */ | |
| 76 | + private Integer activityStatus; | |
| 77 | + /** | |
| 78 | + * 活动开始时间点 | |
| 79 | + * | |
| 80 | + * 冗余 {@link DiscountActivityDO#getStartTime()} | |
| 81 | + */ | |
| 82 | + private LocalDateTime activityStartTime; | |
| 83 | + /** | |
| 84 | + * 活动结束时间点 | |
| 85 | + * | |
| 86 | + * 冗余 {@link DiscountActivityDO#getEndTime()} | |
| 87 | + */ | |
| 88 | + private LocalDateTime activityEndTime; | |
| 89 | + | |
| 68 | 90 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/reward/RewardActivityDO.java
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/article/ArticleCategoryMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.dal.mysql.article; | |
| 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.promotion.controller.admin.article.vo.category.ArticleCategoryExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 文章分类 Mapper | |
| 15 | + * | |
| 16 | + * @author HUIHUI | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface ArticleCategoryMapper extends BaseMapperX<ArticleCategoryDO> { | |
| 20 | + | |
| 21 | + default PageResult<ArticleCategoryDO> selectPage(ArticleCategoryPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<ArticleCategoryDO>() | |
| 23 | + .likeIfPresent(ArticleCategoryDO::getName, reqVO.getName()) | |
| 24 | + .eqIfPresent(ArticleCategoryDO::getStatus, reqVO.getStatus()) | |
| 25 | + .betweenIfPresent(ArticleCategoryDO::getCreateTime, reqVO.getCreateTime()) | |
| 26 | + .orderByDesc(ArticleCategoryDO::getSort)); | |
| 27 | + } | |
| 28 | + | |
| 29 | + default List<ArticleCategoryDO> selectList(ArticleCategoryExportReqVO reqVO) { | |
| 30 | + return selectList(new LambdaQueryWrapperX<ArticleCategoryDO>() | |
| 31 | + .likeIfPresent(ArticleCategoryDO::getName, reqVO.getName()) | |
| 32 | + .eqIfPresent(ArticleCategoryDO::getStatus, reqVO.getStatus()) | |
| 33 | + .betweenIfPresent(ArticleCategoryDO::getCreateTime, reqVO.getCreateTime()) | |
| 34 | + .orderByDesc(ArticleCategoryDO::getSort)); | |
| 35 | + } | |
| 36 | + | |
| 37 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/article/ArticleMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.dal.mysql.article; | |
| 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.promotion.controller.admin.article.vo.ArticleExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticlePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 文章管理 Mapper | |
| 15 | + * | |
| 16 | + * @author HUIHUI | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface ArticleMapper extends BaseMapperX<ArticleDO> { | |
| 20 | + | |
| 21 | + default PageResult<ArticleDO> selectPage(ArticlePageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<ArticleDO>() | |
| 23 | + .eqIfPresent(ArticleDO::getCategoryId, reqVO.getCategoryId()) | |
| 24 | + .eqIfPresent(ArticleDO::getTitle, reqVO.getTitle()) | |
| 25 | + .eqIfPresent(ArticleDO::getAuthor, reqVO.getAuthor()) | |
| 26 | + .eqIfPresent(ArticleDO::getStatus, reqVO.getStatus()) | |
| 27 | + .eqIfPresent(ArticleDO::getSpuId, reqVO.getSpuId()) | |
| 28 | + .eqIfPresent(ArticleDO::getRecommendHot, reqVO.getRecommendHot()) | |
| 29 | + .eqIfPresent(ArticleDO::getRecommendBanner, reqVO.getRecommendBanner()) | |
| 30 | + .betweenIfPresent(ArticleDO::getCreateTime, reqVO.getCreateTime()) | |
| 31 | + .orderByDesc(ArticleDO::getId)); | |
| 32 | + } | |
| 33 | + | |
| 34 | + default List<ArticleDO> selectList(ArticleExportReqVO reqVO) { | |
| 35 | + return selectList(new LambdaQueryWrapperX<ArticleDO>() | |
| 36 | + .eqIfPresent(ArticleDO::getCategoryId, reqVO.getCategoryId()) | |
| 37 | + .eqIfPresent(ArticleDO::getTitle, reqVO.getTitle()) | |
| 38 | + .eqIfPresent(ArticleDO::getAuthor, reqVO.getAuthor()) | |
| 39 | + .eqIfPresent(ArticleDO::getStatus, reqVO.getStatus()) | |
| 40 | + .eqIfPresent(ArticleDO::getSpuId, reqVO.getSpuId()) | |
| 41 | + .eqIfPresent(ArticleDO::getRecommendHot, reqVO.getRecommendHot()) | |
| 42 | + .eqIfPresent(ArticleDO::getRecommendBanner, reqVO.getRecommendBanner()) | |
| 43 | + .betweenIfPresent(ArticleDO::getCreateTime, reqVO.getCreateTime()) | |
| 44 | + .orderByDesc(ArticleDO::getId)); | |
| 45 | + } | |
| 46 | + | |
| 47 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/bargain/BargainActivityMapper.java
| ... | ... | @@ -86,7 +86,7 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { |
| 86 | 86 | .last("LIMIT " + count)); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - // TODO @puhui999:是不是返回 BargainActivityDO 更干净哈? | |
| 89 | + // TODO @puhui999:是不是返回 BargainActivityDO 更干净哈?分组后返回 DO 的话需要联表查询 | |
| 90 | 90 | /** |
| 91 | 91 | * 查询出指定 spuId 的 spu 参加的活动最接近现在的一条记录。多个的话,一个 spuId 对应一个最近的活动编号 |
| 92 | 92 | * | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationRecordMapper.java
| ... | ... | @@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 7 | 7 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | 8 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 9 | -import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPage2VO; | |
| 10 | 9 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPageVO; |
| 11 | 10 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationRecordDO; |
| 12 | 11 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| ... | ... | @@ -97,21 +96,19 @@ public interface CombinationRecordMapper extends BaseMapperX<CombinationRecordDO |
| 97 | 96 | } |
| 98 | 97 | |
| 99 | 98 | default PageResult<CombinationRecordDO> selectPage(CombinationRecordReqPageVO pageVO) { |
| 100 | - return selectPage(pageVO, new LambdaQueryWrapperX<CombinationRecordDO>() | |
| 99 | + LambdaQueryWrapperX<CombinationRecordDO> queryWrapper = new LambdaQueryWrapperX<CombinationRecordDO>() | |
| 101 | 100 | .eqIfPresent(CombinationRecordDO::getStatus, pageVO.getStatus()) |
| 102 | - .betweenIfPresent(CombinationRecordDO::getCreateTime, pageVO.getCreateTime())); | |
| 103 | - } | |
| 104 | - | |
| 105 | - default PageResult<CombinationRecordDO> selectPage(CombinationRecordReqPage2VO pageVO) { | |
| 106 | - return selectPage(pageVO, new LambdaQueryWrapperX<CombinationRecordDO>() | |
| 107 | - .eq(CombinationRecordDO::getId, pageVO.getHeadId()) | |
| 108 | - .or() | |
| 109 | - .eq(CombinationRecordDO::getHeadId, pageVO.getHeadId())); | |
| 101 | + .betweenIfPresent(CombinationRecordDO::getCreateTime, pageVO.getCreateTime()); | |
| 102 | + // 如果 headId 非空,说明查询指定团的团长 + 团员的拼团记录 | |
| 103 | + if (pageVO.getHeadId() != null) { | |
| 104 | + queryWrapper.eq(CombinationRecordDO::getId, pageVO.getHeadId()) // 团长 | |
| 105 | + .or().eq(CombinationRecordDO::getHeadId, pageVO.getHeadId()); // 团员 | |
| 106 | + } | |
| 107 | + return selectPage(pageVO, queryWrapper); | |
| 110 | 108 | } |
| 111 | 109 | |
| 112 | 110 | /** |
| 113 | 111 | * 查询指定条件的记录数 |
| 114 | - * 如果参数都为 null 时则查询用户拼团记录(DISTINCT 去重),也就是说查询会员表中的用户有多少人参与过拼团活动每个人只统计一次 | |
| 115 | 112 | * |
| 116 | 113 | * @param status 状态,可为 null |
| 117 | 114 | * @param virtualGroup 是否虚拟成团,可为 null |
| ... | ... | @@ -119,12 +116,21 @@ public interface CombinationRecordMapper extends BaseMapperX<CombinationRecordDO |
| 119 | 116 | * @return 记录数 |
| 120 | 117 | */ |
| 121 | 118 | default Long selectCountByHeadAndStatusAndVirtualGroup(Integer status, Boolean virtualGroup, Long headId) { |
| 119 | + return selectCount(new LambdaQueryWrapperX<CombinationRecordDO>() | |
| 120 | + .eqIfPresent(CombinationRecordDO::getStatus, status) | |
| 121 | + .eqIfPresent(CombinationRecordDO::getVirtualGroup, virtualGroup) | |
| 122 | + .eqIfPresent(CombinationRecordDO::getHeadId, headId)); | |
| 123 | + } | |
| 124 | + | |
| 125 | + /** | |
| 126 | + * 查询用户拼团记录(DISTINCT 去重),也就是说查询会员表中的用户有多少人参与过拼团活动每个人只统计一次 | |
| 127 | + * | |
| 128 | + * @return 参加过拼团的用户数 | |
| 129 | + */ | |
| 130 | + // TODO @puhui999:1)方法名,直接 selectUserCount;2)COUNT(DISTINCT(user_id)) 就可以啦,不用 group by 哈 | |
| 131 | + default Long selectUserDistinctCount() { | |
| 122 | 132 | return selectCount(new QueryWrapper<CombinationRecordDO>() |
| 123 | - // TODO @puhui999:这种偏逻辑性的,不要给 mapper 哈;可以考虑拆成 2 个 mapper,上层也是 2 个 service; | |
| 124 | - .select(status == null && virtualGroup == null && headId == null, "DISTINCT (user_id)") | |
| 125 | - .eq(status != null, "status", status) | |
| 126 | - .eq(virtualGroup != null, "virtual_group", virtualGroup) | |
| 127 | - .eq(headId != null, "head_id", headId) | |
| 133 | + .select("DISTINCT (user_id)") | |
| 128 | 134 | .groupBy("user_id")); |
| 129 | 135 | } |
| 130 | 136 | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/article/ArticleCategoryService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.service.article; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryExportReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryUpdateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 9 | + | |
| 10 | +import javax.validation.Valid; | |
| 11 | +import java.util.Collection; | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 文章分类 Service 接口 | |
| 16 | + * | |
| 17 | + * @author HUIHUI | |
| 18 | + */ | |
| 19 | +public interface ArticleCategoryService { | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 创建文章分类 | |
| 23 | + * | |
| 24 | + * @param createReqVO 创建信息 | |
| 25 | + * @return 编号 | |
| 26 | + */ | |
| 27 | + Long createArticleCategory(@Valid ArticleCategoryCreateReqVO createReqVO); | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 更新文章分类 | |
| 31 | + * | |
| 32 | + * @param updateReqVO 更新信息 | |
| 33 | + */ | |
| 34 | + void updateArticleCategory(@Valid ArticleCategoryUpdateReqVO updateReqVO); | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 删除文章分类 | |
| 38 | + * | |
| 39 | + * @param id 编号 | |
| 40 | + */ | |
| 41 | + void deleteArticleCategory(Long id); | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 获得文章分类 | |
| 45 | + * | |
| 46 | + * @param id 编号 | |
| 47 | + * @return 文章分类 | |
| 48 | + */ | |
| 49 | + ArticleCategoryDO getArticleCategory(Long id); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 获得文章分类列表 | |
| 53 | + * | |
| 54 | + * @param ids 编号 | |
| 55 | + * @return 文章分类列表 | |
| 56 | + */ | |
| 57 | + List<ArticleCategoryDO> getArticleCategoryList(Collection<Long> ids); | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 获得文章分类分页 | |
| 61 | + * | |
| 62 | + * @param pageReqVO 分页查询 | |
| 63 | + * @return 文章分类分页 | |
| 64 | + */ | |
| 65 | + PageResult<ArticleCategoryDO> getArticleCategoryPage(ArticleCategoryPageReqVO pageReqVO); | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 获得文章分类列表, 用于 Excel 导出 | |
| 69 | + * | |
| 70 | + * @param exportReqVO 查询条件 | |
| 71 | + * @return 文章分类列表 | |
| 72 | + */ | |
| 73 | + List<ArticleCategoryDO> getArticleCategoryList(ArticleCategoryExportReqVO exportReqVO); | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * 获得指定状态的文章分类列表 | |
| 77 | + * | |
| 78 | + * @param status 状态 | |
| 79 | + * @return 文章分类列表 | |
| 80 | + */ | |
| 81 | + List<ArticleCategoryDO> getArticleCategoryListByStatus(Integer status); | |
| 82 | + | |
| 83 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/article/ArticleCategoryServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.service.article; | |
| 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.promotion.controller.admin.article.vo.category.ArticleCategoryCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryExportReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryPageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryUpdateReqVO; | |
| 10 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleCategoryConvert; | |
| 11 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 12 | +import cn.iocoder.yudao.module.promotion.dal.mysql.article.ArticleCategoryMapper; | |
| 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.promotion.enums.ErrorCodeConstants.ARTICLE_CATEGORY_NOT_EXISTS; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 文章分类 Service 实现类 | |
| 25 | + * | |
| 26 | + * @author HUIHUI | |
| 27 | + */ | |
| 28 | +@Service | |
| 29 | +@Validated | |
| 30 | +public class ArticleCategoryServiceImpl implements ArticleCategoryService { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private ArticleCategoryMapper articleCategoryMapper; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Long createArticleCategory(ArticleCategoryCreateReqVO createReqVO) { | |
| 37 | + // 插入 | |
| 38 | + ArticleCategoryDO articleCategory = ArticleCategoryConvert.INSTANCE.convert(createReqVO); | |
| 39 | + articleCategoryMapper.insert(articleCategory); | |
| 40 | + // 返回 | |
| 41 | + return articleCategory.getId(); | |
| 42 | + } | |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public void updateArticleCategory(ArticleCategoryUpdateReqVO updateReqVO) { | |
| 46 | + // 校验存在 | |
| 47 | + validateArticleCategoryExists(updateReqVO.getId()); | |
| 48 | + // 更新 | |
| 49 | + ArticleCategoryDO updateObj = ArticleCategoryConvert.INSTANCE.convert(updateReqVO); | |
| 50 | + articleCategoryMapper.updateById(updateObj); | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public void deleteArticleCategory(Long id) { | |
| 55 | + // 校验存在 | |
| 56 | + validateArticleCategoryExists(id); | |
| 57 | + // 删除 | |
| 58 | + articleCategoryMapper.deleteById(id); | |
| 59 | + } | |
| 60 | + | |
| 61 | + private void validateArticleCategoryExists(Long id) { | |
| 62 | + if (articleCategoryMapper.selectById(id) == null) { | |
| 63 | + throw exception(ARTICLE_CATEGORY_NOT_EXISTS); | |
| 64 | + } | |
| 65 | + } | |
| 66 | + | |
| 67 | + @Override | |
| 68 | + public ArticleCategoryDO getArticleCategory(Long id) { | |
| 69 | + return articleCategoryMapper.selectById(id); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Override | |
| 73 | + public List<ArticleCategoryDO> getArticleCategoryList(Collection<Long> ids) { | |
| 74 | + if (CollUtil.isEmpty(ids)) { | |
| 75 | + return ListUtil.empty(); | |
| 76 | + } | |
| 77 | + return articleCategoryMapper.selectBatchIds(ids); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public PageResult<ArticleCategoryDO> getArticleCategoryPage(ArticleCategoryPageReqVO pageReqVO) { | |
| 82 | + return articleCategoryMapper.selectPage(pageReqVO); | |
| 83 | + } | |
| 84 | + | |
| 85 | + @Override | |
| 86 | + public List<ArticleCategoryDO> getArticleCategoryList(ArticleCategoryExportReqVO exportReqVO) { | |
| 87 | + return articleCategoryMapper.selectList(exportReqVO); | |
| 88 | + } | |
| 89 | + | |
| 90 | + @Override | |
| 91 | + public List<ArticleCategoryDO> getArticleCategoryListByStatus(Integer status) { | |
| 92 | + return articleCategoryMapper.selectList(ArticleCategoryDO::getStatus, status); | |
| 93 | + } | |
| 94 | + | |
| 95 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/article/ArticleService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.service.article; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleExportReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticlePageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleUpdateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 9 | + | |
| 10 | +import javax.validation.Valid; | |
| 11 | +import java.util.Collection; | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 文章管理 Service 接口 | |
| 16 | + * | |
| 17 | + * @author HUIHUI | |
| 18 | + */ | |
| 19 | +public interface ArticleService { | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 创建文章管理 | |
| 23 | + * | |
| 24 | + * @param createReqVO 创建信息 | |
| 25 | + * @return 编号 | |
| 26 | + */ | |
| 27 | + Long createArticle(@Valid ArticleCreateReqVO createReqVO); | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 更新文章管理 | |
| 31 | + * | |
| 32 | + * @param updateReqVO 更新信息 | |
| 33 | + */ | |
| 34 | + void updateArticle(@Valid ArticleUpdateReqVO updateReqVO); | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 删除文章管理 | |
| 38 | + * | |
| 39 | + * @param id 编号 | |
| 40 | + */ | |
| 41 | + void deleteArticle(Long id); | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 获得文章管理 | |
| 45 | + * | |
| 46 | + * @param id 编号 | |
| 47 | + * @return 文章管理 | |
| 48 | + */ | |
| 49 | + ArticleDO getArticle(Long id); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 获得文章管理列表 | |
| 53 | + * | |
| 54 | + * @param ids 编号 | |
| 55 | + * @return 文章管理列表 | |
| 56 | + */ | |
| 57 | + List<ArticleDO> getArticleList(Collection<Long> ids); | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 获得文章管理分页 | |
| 61 | + * | |
| 62 | + * @param pageReqVO 分页查询 | |
| 63 | + * @return 文章管理分页 | |
| 64 | + */ | |
| 65 | + PageResult<ArticleDO> getArticlePage(ArticlePageReqVO pageReqVO); | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 获得文章管理列表, 用于 Excel 导出 | |
| 69 | + * | |
| 70 | + * @param exportReqVO 查询条件 | |
| 71 | + * @return 文章管理列表 | |
| 72 | + */ | |
| 73 | + List<ArticleDO> getArticleList(ArticleExportReqVO exportReqVO); | |
| 74 | + | |
| 75 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/article/ArticleServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.service.article; | |
| 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.promotion.controller.admin.article.vo.ArticleCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleExportReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticlePageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleUpdateReqVO; | |
| 10 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleConvert; | |
| 11 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 12 | +import cn.iocoder.yudao.module.promotion.dal.mysql.article.ArticleMapper; | |
| 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.promotion.enums.ErrorCodeConstants.ARTICLE_NOT_EXISTS; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 文章管理 Service 实现类 | |
| 25 | + * | |
| 26 | + * @author HUIHUI | |
| 27 | + */ | |
| 28 | +@Service | |
| 29 | +@Validated | |
| 30 | +public class ArticleServiceImpl implements ArticleService { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private ArticleMapper articleMapper; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Long createArticle(ArticleCreateReqVO createReqVO) { | |
| 37 | + // 插入 | |
| 38 | + ArticleDO article = ArticleConvert.INSTANCE.convert(createReqVO); | |
| 39 | + articleMapper.insert(article); | |
| 40 | + // 返回 | |
| 41 | + return article.getId(); | |
| 42 | + } | |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public void updateArticle(ArticleUpdateReqVO updateReqVO) { | |
| 46 | + // 校验存在 | |
| 47 | + validateArticleExists(updateReqVO.getId()); | |
| 48 | + // 更新 | |
| 49 | + ArticleDO updateObj = ArticleConvert.INSTANCE.convert(updateReqVO); | |
| 50 | + articleMapper.updateById(updateObj); | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public void deleteArticle(Long id) { | |
| 55 | + // 校验存在 | |
| 56 | + validateArticleExists(id); | |
| 57 | + // 删除 | |
| 58 | + articleMapper.deleteById(id); | |
| 59 | + } | |
| 60 | + | |
| 61 | + private void validateArticleExists(Long id) { | |
| 62 | + if (articleMapper.selectById(id) == null) { | |
| 63 | + throw exception(ARTICLE_NOT_EXISTS); | |
| 64 | + } | |
| 65 | + } | |
| 66 | + | |
| 67 | + @Override | |
| 68 | + public ArticleDO getArticle(Long id) { | |
| 69 | + return articleMapper.selectById(id); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Override | |
| 73 | + public List<ArticleDO> getArticleList(Collection<Long> ids) { | |
| 74 | + if (CollUtil.isEmpty(ids)) { | |
| 75 | + return ListUtil.empty(); | |
| 76 | + } | |
| 77 | + return articleMapper.selectBatchIds(ids); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public PageResult<ArticleDO> getArticlePage(ArticlePageReqVO pageReqVO) { | |
| 82 | + return articleMapper.selectPage(pageReqVO); | |
| 83 | + } | |
| 84 | + | |
| 85 | + @Override | |
| 86 | + public List<ArticleDO> getArticleList(ArticleExportReqVO exportReqVO) { | |
| 87 | + return articleMapper.selectList(exportReqVO); | |
| 88 | + } | |
| 89 | + | |
| 90 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordService.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.core.KeyValue; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 5 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO; |
| 6 | 6 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO; |
| 7 | -import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPage2VO; | |
| 8 | 7 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPageVO; |
| 9 | 8 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationActivityDO; |
| 10 | 9 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationProductDO; |
| ... | ... | @@ -50,9 +49,9 @@ public interface CombinationRecordService { |
| 50 | 49 | * 创建拼团记录 |
| 51 | 50 | * |
| 52 | 51 | * @param reqDTO 创建信息 |
| 53 | - * @return key 开团记录编号 value 团长编号 | |
| 52 | + * @return 团信息 | |
| 54 | 53 | */ |
| 55 | - KeyValue<Long, Long> createCombinationRecord(CombinationRecordCreateReqDTO reqDTO); | |
| 54 | + CombinationRecordDO createCombinationRecord(CombinationRecordCreateReqDTO reqDTO); | |
| 56 | 55 | |
| 57 | 56 | /** |
| 58 | 57 | * 获得拼团记录 |
| ... | ... | @@ -94,7 +93,14 @@ public interface CombinationRecordService { |
| 94 | 93 | * @param headId 团长编号,允许空。目的 headId 设置为 {@link CombinationRecordDO#HEAD_ID_GROUP} 时,可以设置 |
| 95 | 94 | * @return 记录数 |
| 96 | 95 | */ |
| 97 | - Long getCombinationRecordCount(@Nullable Integer status, @Nullable Boolean virtualGroup, @Nullable Long headId); | |
| 96 | + Long getCombinationRecordCount(@Nullable Integer status, @Nullable Boolean virtualGroup, Long headId); | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * 查询用户拼团记录(DISTINCT 去重),也就是说查询会员表中的用户有多少人参与过拼团活动每个人只统计一次 | |
| 100 | + * | |
| 101 | + * @return 参加过拼团的用户数 | |
| 102 | + */ | |
| 103 | + Long getCombinationUserCount(); | |
| 98 | 104 | |
| 99 | 105 | /** |
| 100 | 106 | * 获取最近的 count 条拼团记录 |
| ... | ... | @@ -139,14 +145,6 @@ public interface CombinationRecordService { |
| 139 | 145 | PageResult<CombinationRecordDO> getCombinationRecordPage(CombinationRecordReqPageVO pageVO); |
| 140 | 146 | |
| 141 | 147 | /** |
| 142 | - * 获取拼团记录分页数据(通过团长查询) | |
| 143 | - * | |
| 144 | - * @param pageVO 分页请求 | |
| 145 | - * @return 拼团记录分页数据(包括团长的) | |
| 146 | - */ | |
| 147 | - PageResult<CombinationRecordDO> getCombinationRecordPage2(CombinationRecordReqPage2VO pageVO); | |
| 148 | - | |
| 149 | - /** | |
| 150 | 148 | * 【拼团活动】获得拼团记录数量 Map |
| 151 | 149 | * |
| 152 | 150 | * @param activityIds 活动记录编号数组 | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java
| ... | ... | @@ -14,7 +14,6 @@ import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi; |
| 14 | 14 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 15 | 15 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO; |
| 16 | 16 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO; |
| 17 | -import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPage2VO; | |
| 18 | 17 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPageVO; |
| 19 | 18 | import cn.iocoder.yudao.module.promotion.convert.combination.CombinationActivityConvert; |
| 20 | 19 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationActivityDO; |
| ... | ... | @@ -23,7 +22,6 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationR |
| 23 | 22 | import cn.iocoder.yudao.module.promotion.dal.mysql.combination.CombinationRecordMapper; |
| 24 | 23 | import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum; |
| 25 | 24 | import cn.iocoder.yudao.module.trade.api.order.TradeOrderApi; |
| 26 | -import org.springframework.scheduling.annotation.Async; | |
| 27 | 25 | import org.springframework.stereotype.Service; |
| 28 | 26 | import org.springframework.transaction.annotation.Transactional; |
| 29 | 27 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -72,9 +70,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 72 | 70 | CombinationRecordDO record = validateCombinationRecord(userId, orderId); |
| 73 | 71 | |
| 74 | 72 | // 更新状态 |
| 75 | - // TODO @puhui999:不要整个更新,new 一个出来;why?例如说,两个线程都去更新,这样存在相互覆盖的问题 | |
| 76 | - record.setStatus(status); | |
| 77 | - combinationRecordMapper.updateById(record); | |
| 73 | + combinationRecordMapper.updateById(new CombinationRecordDO().setId(record.getId()).setStatus(status)); | |
| 78 | 74 | } |
| 79 | 75 | |
| 80 | 76 | private CombinationRecordDO validateCombinationRecord(Long userId, Long orderId) { |
| ... | ... | @@ -164,7 +160,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 164 | 160 | |
| 165 | 161 | @Override |
| 166 | 162 | @Transactional(rollbackFor = Exception.class) |
| 167 | - public KeyValue<Long, Long> createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) { | |
| 163 | + public CombinationRecordDO createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) { | |
| 168 | 164 | // 1. 校验拼团活动 |
| 169 | 165 | KeyValue<CombinationActivityDO, CombinationProductDO> keyValue = validateCombinationRecord(reqDTO.getUserId(), |
| 170 | 166 | reqDTO.getActivityId(), reqDTO.getHeadId(), reqDTO.getSkuId(), reqDTO.getCount()); |
| ... | ... | @@ -191,7 +187,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 191 | 187 | if (ObjUtil.notEqual(CombinationRecordDO.HEAD_ID_GROUP, record.getHeadId())) { |
| 192 | 188 | updateCombinationRecordWhenCreate(reqDTO.getHeadId(), keyValue.getKey()); |
| 193 | 189 | } |
| 194 | - return new KeyValue<>(record.getId(), record.getHeadId()); | |
| 190 | + return record; | |
| 195 | 191 | } |
| 196 | 192 | |
| 197 | 193 | /** |
| ... | ... | @@ -250,6 +246,11 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 250 | 246 | } |
| 251 | 247 | |
| 252 | 248 | @Override |
| 249 | + public Long getCombinationUserCount() { | |
| 250 | + return combinationRecordMapper.selectUserDistinctCount(); | |
| 251 | + } | |
| 252 | + | |
| 253 | + @Override | |
| 253 | 254 | public List<CombinationRecordDO> getLatestCombinationRecordList(int count) { |
| 254 | 255 | return combinationRecordMapper.selectLatestList(count); |
| 255 | 256 | } |
| ... | ... | @@ -276,11 +277,6 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 276 | 277 | } |
| 277 | 278 | |
| 278 | 279 | @Override |
| 279 | - public PageResult<CombinationRecordDO> getCombinationRecordPage2(CombinationRecordReqPage2VO pageVO) { | |
| 280 | - return combinationRecordMapper.selectPage(pageVO); | |
| 281 | - } | |
| 282 | - | |
| 283 | - @Override | |
| 284 | 280 | public Map<Long, Integer> getCombinationRecordCountMapByActivity(Collection<Long> activityIds, |
| 285 | 281 | @Nullable Integer status, @Nullable Long headId) { |
| 286 | 282 | return combinationRecordMapper.selectCombinationRecordCountMapByActivityIdAndStatusAndHeadId(activityIds, status, headId); |
| ... | ... | @@ -343,8 +339,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 343 | 339 | |
| 344 | 340 | @Override |
| 345 | 341 | public KeyValue<Integer, Integer> expireCombinationRecord() { |
| 346 | - // TODO @puhui999:数字一般是 1. 2. 这种格式哈 | |
| 347 | - // 1。获取所有正在进行中的过期的父拼团 | |
| 342 | + // 1. 获取所有正在进行中的过期的父拼团 | |
| 348 | 343 | List<CombinationRecordDO> headExpireRecords = combinationRecordMapper.selectListByHeadIdAndStatusAndExpireTimeLt( |
| 349 | 344 | CombinationRecordDO.HEAD_ID_GROUP, CombinationRecordStatusEnum.IN_PROGRESS.getStatus(), LocalDateTime.now()); |
| 350 | 345 | if (CollUtil.isEmpty(headExpireRecords)) { |
| ... | ... | @@ -352,23 +347,21 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 352 | 347 | } |
| 353 | 348 | |
| 354 | 349 | // 2. 获取拼团活动 |
| 355 | - // TODO @puhui999:在自己模块里,变量可以简略点;例如说 activityList | |
| 356 | - List<CombinationActivityDO> combinationActivities = combinationActivityService.getCombinationActivityListByIds( | |
| 350 | + List<CombinationActivityDO> activities = combinationActivityService.getCombinationActivityListByIds( | |
| 357 | 351 | convertSet(headExpireRecords, CombinationRecordDO::getActivityId)); |
| 358 | - Map<Long, CombinationActivityDO> activityMap = convertMap(combinationActivities, CombinationActivityDO::getId); | |
| 352 | + Map<Long, CombinationActivityDO> activityMap = convertMap(activities, CombinationActivityDO::getId); | |
| 359 | 353 | |
| 360 | - // TODO @puhui999:job 一般不建议异步跑;因为可能下次跑,结果上次还没跑完; | |
| 361 | - // TODO 这里,我们可以每个 record 处理下;然后按照是否需要虚拟拼团,各搞一个方法逻辑 + 事务;这样,保证 job 里面尽量不要大事务,而是 n 个独立小事务的处理。 | |
| 354 | + // TODO @puhui999:这里可以改成“每个团”,处理一次哈;这样 handleExpireRecord、handleVirtualGroupRecord 都改成按团处理,每个是一个小事务; | |
| 362 | 355 | // 3. 校验是否虚拟成团 |
| 363 | 356 | List<CombinationRecordDO> virtualGroupHeadRecords = new ArrayList<>(); // 虚拟成团 |
| 364 | 357 | for (Iterator<CombinationRecordDO> iterator = headExpireRecords.iterator(); iterator.hasNext(); ) { |
| 365 | 358 | CombinationRecordDO record = iterator.next(); |
| 366 | - // 3.1 不匹配,则直接跳过 | |
| 359 | + // 3.1.不匹配,则直接跳过 | |
| 367 | 360 | CombinationActivityDO activity = activityMap.get(record.getActivityId()); |
| 368 | 361 | if (activity == null || !activity.getVirtualGroup()) { // 取不到活动的或者不是虚拟拼团的 |
| 369 | 362 | continue; |
| 370 | 363 | } |
| 371 | - // 3.2 匹配,则移除,添加到虚拟成团中,并结束寻找 | |
| 364 | + // 3.2.匹配,则移除,添加到虚拟成团中,并结束寻找 | |
| 372 | 365 | virtualGroupHeadRecords.add(record); |
| 373 | 366 | iterator.remove(); |
| 374 | 367 | break; |
| ... | ... | @@ -381,8 +374,13 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 381 | 374 | return new KeyValue<>(headExpireRecords.size(), virtualGroupHeadRecords.size()); |
| 382 | 375 | } |
| 383 | 376 | |
| 384 | - @Async | |
| 385 | - protected void handleExpireRecord(List<CombinationRecordDO> headExpireRecords) { | |
| 377 | + /** | |
| 378 | + * 处理过期拼团 | |
| 379 | + * | |
| 380 | + * @param headExpireRecords 过期拼团团长记录列表 | |
| 381 | + */ | |
| 382 | + @Transactional(rollbackFor = Exception.class) | |
| 383 | + public void handleExpireRecord(List<CombinationRecordDO> headExpireRecords) { | |
| 386 | 384 | if (CollUtil.isEmpty(headExpireRecords)) { |
| 387 | 385 | return; |
| 388 | 386 | } |
| ... | ... | @@ -400,8 +398,13 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 400 | 398 | }); |
| 401 | 399 | } |
| 402 | 400 | |
| 403 | - @Async | |
| 404 | - protected void handleVirtualGroupRecord(List<CombinationRecordDO> virtualGroupHeadRecords) { | |
| 401 | + /** | |
| 402 | + * 处理虚拟拼团 | |
| 403 | + * | |
| 404 | + * @param virtualGroupHeadRecords 虚拟成团团长记录列表 | |
| 405 | + */ | |
| 406 | + @Transactional(rollbackFor = Exception.class) | |
| 407 | + public void handleVirtualGroupRecord(List<CombinationRecordDO> virtualGroupHeadRecords) { | |
| 405 | 408 | if (CollUtil.isEmpty(virtualGroupHeadRecords)) { |
| 406 | 409 | return; |
| 407 | 410 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/test/java/cn/iocoder/yudao/module/promotion/service/article/ArticleCategoryServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.service.article; | |
| 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.promotion.controller.admin.article.vo.category.ArticleCategoryCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 10 | +import cn.iocoder.yudao.module.promotion.dal.mysql.article.ArticleCategoryMapper; | |
| 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.promotion.enums.ErrorCodeConstants.ARTICLE_CATEGORY_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * {@link ArticleCategoryServiceImpl} 的单元测试类 | |
| 29 | + * | |
| 30 | + * @author HUIHUI | |
| 31 | + */ | |
| 32 | +@Import(ArticleCategoryServiceImpl.class) | |
| 33 | +public class ArticleCategoryServiceImplTest extends BaseDbUnitTest { | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private ArticleCategoryServiceImpl articleCategoryService; | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private ArticleCategoryMapper articleCategoryMapper; | |
| 40 | + | |
| 41 | + @Test | |
| 42 | + public void testCreateArticleCategory_success() { | |
| 43 | + // 准备参数 | |
| 44 | + ArticleCategoryCreateReqVO reqVO = randomPojo(ArticleCategoryCreateReqVO.class); | |
| 45 | + | |
| 46 | + // 调用 | |
| 47 | + Long articleCategoryId = articleCategoryService.createArticleCategory(reqVO); | |
| 48 | + // 断言 | |
| 49 | + assertNotNull(articleCategoryId); | |
| 50 | + // 校验记录的属性是否正确 | |
| 51 | + ArticleCategoryDO articleCategory = articleCategoryMapper.selectById(articleCategoryId); | |
| 52 | + assertPojoEquals(reqVO, articleCategory); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Test | |
| 56 | + public void testUpdateArticleCategory_success() { | |
| 57 | + // mock 数据 | |
| 58 | + ArticleCategoryDO dbArticleCategory = randomPojo(ArticleCategoryDO.class); | |
| 59 | + articleCategoryMapper.insert(dbArticleCategory);// @Sql: 先插入出一条存在的数据 | |
| 60 | + // 准备参数 | |
| 61 | + ArticleCategoryUpdateReqVO reqVO = randomPojo(ArticleCategoryUpdateReqVO.class, o -> { | |
| 62 | + o.setId(dbArticleCategory.getId()); // 设置更新的 ID | |
| 63 | + }); | |
| 64 | + | |
| 65 | + // 调用 | |
| 66 | + articleCategoryService.updateArticleCategory(reqVO); | |
| 67 | + // 校验是否更新正确 | |
| 68 | + ArticleCategoryDO articleCategory = articleCategoryMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 69 | + assertPojoEquals(reqVO, articleCategory); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Test | |
| 73 | + public void testUpdateArticleCategory_notExists() { | |
| 74 | + // 准备参数 | |
| 75 | + ArticleCategoryUpdateReqVO reqVO = randomPojo(ArticleCategoryUpdateReqVO.class); | |
| 76 | + | |
| 77 | + // 调用, 并断言异常 | |
| 78 | + assertServiceException(() -> articleCategoryService.updateArticleCategory(reqVO), ARTICLE_CATEGORY_NOT_EXISTS); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Test | |
| 82 | + public void testDeleteArticleCategory_success() { | |
| 83 | + // mock 数据 | |
| 84 | + ArticleCategoryDO dbArticleCategory = randomPojo(ArticleCategoryDO.class); | |
| 85 | + articleCategoryMapper.insert(dbArticleCategory);// @Sql: 先插入出一条存在的数据 | |
| 86 | + // 准备参数 | |
| 87 | + Long id = dbArticleCategory.getId(); | |
| 88 | + | |
| 89 | + // 调用 | |
| 90 | + articleCategoryService.deleteArticleCategory(id); | |
| 91 | + // 校验数据不存在了 | |
| 92 | + assertNull(articleCategoryMapper.selectById(id)); | |
| 93 | + } | |
| 94 | + | |
| 95 | + @Test | |
| 96 | + public void testDeleteArticleCategory_notExists() { | |
| 97 | + // 准备参数 | |
| 98 | + Long id = randomLongId(); | |
| 99 | + | |
| 100 | + // 调用, 并断言异常 | |
| 101 | + assertServiceException(() -> articleCategoryService.deleteArticleCategory(id), ARTICLE_CATEGORY_NOT_EXISTS); | |
| 102 | + } | |
| 103 | + | |
| 104 | + @Test | |
| 105 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 106 | + public void testGetArticleCategoryPage() { | |
| 107 | + // mock 数据 | |
| 108 | + ArticleCategoryDO dbArticleCategory = randomPojo(ArticleCategoryDO.class, o -> { // 等会查询到 | |
| 109 | + o.setName(null); | |
| 110 | + o.setPicUrl(null); | |
| 111 | + o.setStatus(null); | |
| 112 | + o.setSort(null); | |
| 113 | + o.setCreateTime(null); | |
| 114 | + }); | |
| 115 | + articleCategoryMapper.insert(dbArticleCategory); | |
| 116 | + // 测试 name 不匹配 | |
| 117 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setName(null))); | |
| 118 | + // 测试 picUrl 不匹配 | |
| 119 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setPicUrl(null))); | |
| 120 | + // 测试 status 不匹配 | |
| 121 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setStatus(null))); | |
| 122 | + // 测试 sort 不匹配 | |
| 123 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setSort(null))); | |
| 124 | + // 测试 createTime 不匹配 | |
| 125 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setCreateTime(null))); | |
| 126 | + // 准备参数 | |
| 127 | + ArticleCategoryPageReqVO reqVO = new ArticleCategoryPageReqVO(); | |
| 128 | + reqVO.setName(null); | |
| 129 | + reqVO.setStatus(null); | |
| 130 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 131 | + | |
| 132 | + // 调用 | |
| 133 | + PageResult<ArticleCategoryDO> pageResult = articleCategoryService.getArticleCategoryPage(reqVO); | |
| 134 | + // 断言 | |
| 135 | + assertEquals(1, pageResult.getTotal()); | |
| 136 | + assertEquals(1, pageResult.getList().size()); | |
| 137 | + assertPojoEquals(dbArticleCategory, pageResult.getList().get(0)); | |
| 138 | + } | |
| 139 | + | |
| 140 | + @Test | |
| 141 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 142 | + public void testGetArticleCategoryList() { | |
| 143 | + // mock 数据 | |
| 144 | + ArticleCategoryDO dbArticleCategory = randomPojo(ArticleCategoryDO.class, o -> { // 等会查询到 | |
| 145 | + o.setName(null); | |
| 146 | + o.setPicUrl(null); | |
| 147 | + o.setStatus(null); | |
| 148 | + o.setSort(null); | |
| 149 | + o.setCreateTime(null); | |
| 150 | + }); | |
| 151 | + articleCategoryMapper.insert(dbArticleCategory); | |
| 152 | + // 测试 name 不匹配 | |
| 153 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setName(null))); | |
| 154 | + // 测试 picUrl 不匹配 | |
| 155 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setPicUrl(null))); | |
| 156 | + // 测试 status 不匹配 | |
| 157 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setStatus(null))); | |
| 158 | + // 测试 sort 不匹配 | |
| 159 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setSort(null))); | |
| 160 | + // 测试 createTime 不匹配 | |
| 161 | + articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setCreateTime(null))); | |
| 162 | + // 准备参数 | |
| 163 | + ArticleCategoryExportReqVO reqVO = new ArticleCategoryExportReqVO(); | |
| 164 | + reqVO.setName(null); | |
| 165 | + reqVO.setStatus(null); | |
| 166 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 167 | + | |
| 168 | + // 调用 | |
| 169 | + List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryList(reqVO); | |
| 170 | + // 断言 | |
| 171 | + assertEquals(1, list.size()); | |
| 172 | + assertPojoEquals(dbArticleCategory, list.get(0)); | |
| 173 | + } | |
| 174 | + | |
| 175 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/test/java/cn/iocoder/yudao/module/promotion/service/article/ArticleServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.service.article; | |
| 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.promotion.controller.admin.article.vo.ArticleCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleExportReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticlePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 10 | +import cn.iocoder.yudao.module.promotion.dal.mysql.article.ArticleMapper; | |
| 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.promotion.enums.ErrorCodeConstants.ARTICLE_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * {@link ArticleServiceImpl} 的单元测试类 | |
| 29 | + * | |
| 30 | + * @author HUIHUI | |
| 31 | + */ | |
| 32 | +@Import(ArticleServiceImpl.class) | |
| 33 | +public class ArticleServiceImplTest extends BaseDbUnitTest { | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private ArticleServiceImpl articleService; | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private ArticleMapper articleMapper; | |
| 40 | + | |
| 41 | + @Test | |
| 42 | + public void testCreateArticle_success() { | |
| 43 | + // 准备参数 | |
| 44 | + ArticleCreateReqVO reqVO = randomPojo(ArticleCreateReqVO.class); | |
| 45 | + | |
| 46 | + // 调用 | |
| 47 | + Long articleId = articleService.createArticle(reqVO); | |
| 48 | + // 断言 | |
| 49 | + assertNotNull(articleId); | |
| 50 | + // 校验记录的属性是否正确 | |
| 51 | + ArticleDO article = articleMapper.selectById(articleId); | |
| 52 | + assertPojoEquals(reqVO, article); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Test | |
| 56 | + public void testUpdateArticle_success() { | |
| 57 | + // mock 数据 | |
| 58 | + ArticleDO dbArticle = randomPojo(ArticleDO.class); | |
| 59 | + articleMapper.insert(dbArticle);// @Sql: 先插入出一条存在的数据 | |
| 60 | + // 准备参数 | |
| 61 | + ArticleUpdateReqVO reqVO = randomPojo(ArticleUpdateReqVO.class, o -> { | |
| 62 | + o.setId(dbArticle.getId()); // 设置更新的 ID | |
| 63 | + }); | |
| 64 | + | |
| 65 | + // 调用 | |
| 66 | + articleService.updateArticle(reqVO); | |
| 67 | + // 校验是否更新正确 | |
| 68 | + ArticleDO article = articleMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 69 | + assertPojoEquals(reqVO, article); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Test | |
| 73 | + public void testUpdateArticle_notExists() { | |
| 74 | + // 准备参数 | |
| 75 | + ArticleUpdateReqVO reqVO = randomPojo(ArticleUpdateReqVO.class); | |
| 76 | + | |
| 77 | + // 调用, 并断言异常 | |
| 78 | + assertServiceException(() -> articleService.updateArticle(reqVO), ARTICLE_NOT_EXISTS); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Test | |
| 82 | + public void testDeleteArticle_success() { | |
| 83 | + // mock 数据 | |
| 84 | + ArticleDO dbArticle = randomPojo(ArticleDO.class); | |
| 85 | + articleMapper.insert(dbArticle);// @Sql: 先插入出一条存在的数据 | |
| 86 | + // 准备参数 | |
| 87 | + Long id = dbArticle.getId(); | |
| 88 | + | |
| 89 | + // 调用 | |
| 90 | + articleService.deleteArticle(id); | |
| 91 | + // 校验数据不存在了 | |
| 92 | + assertNull(articleMapper.selectById(id)); | |
| 93 | + } | |
| 94 | + | |
| 95 | + @Test | |
| 96 | + public void testDeleteArticle_notExists() { | |
| 97 | + // 准备参数 | |
| 98 | + Long id = randomLongId(); | |
| 99 | + | |
| 100 | + // 调用, 并断言异常 | |
| 101 | + assertServiceException(() -> articleService.deleteArticle(id), ARTICLE_NOT_EXISTS); | |
| 102 | + } | |
| 103 | + | |
| 104 | + @Test | |
| 105 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 106 | + public void testGetArticlePage() { | |
| 107 | + // mock 数据 | |
| 108 | + ArticleDO dbArticle = randomPojo(ArticleDO.class, o -> { // 等会查询到 | |
| 109 | + o.setCategoryId(null); | |
| 110 | + o.setTitle(null); | |
| 111 | + o.setAuthor(null); | |
| 112 | + o.setPicUrl(null); | |
| 113 | + o.setIntroduction(null); | |
| 114 | + o.setBrowseCount(null); | |
| 115 | + o.setSort(null); | |
| 116 | + o.setStatus(null); | |
| 117 | + o.setSpuId(null); | |
| 118 | + o.setRecommendHot(null); | |
| 119 | + o.setRecommendBanner(null); | |
| 120 | + o.setContent(null); | |
| 121 | + o.setCreateTime(null); | |
| 122 | + }); | |
| 123 | + articleMapper.insert(dbArticle); | |
| 124 | + // 测试 categoryId 不匹配 | |
| 125 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setCategoryId(null))); | |
| 126 | + // 测试 title 不匹配 | |
| 127 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setTitle(null))); | |
| 128 | + // 测试 author 不匹配 | |
| 129 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setAuthor(null))); | |
| 130 | + // 测试 picUrl 不匹配 | |
| 131 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setPicUrl(null))); | |
| 132 | + // 测试 introduction 不匹配 | |
| 133 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setIntroduction(null))); | |
| 134 | + // 测试 browseCount 不匹配 | |
| 135 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setBrowseCount(null))); | |
| 136 | + // 测试 sort 不匹配 | |
| 137 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setSort(null))); | |
| 138 | + // 测试 status 不匹配 | |
| 139 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setStatus(null))); | |
| 140 | + // 测试 spuId 不匹配 | |
| 141 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setSpuId(null))); | |
| 142 | + // 测试 recommendHot 不匹配 | |
| 143 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setRecommendHot(null))); | |
| 144 | + // 测试 recommendBanner 不匹配 | |
| 145 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setRecommendBanner(null))); | |
| 146 | + // 测试 content 不匹配 | |
| 147 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setContent(null))); | |
| 148 | + // 测试 createTime 不匹配 | |
| 149 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setCreateTime(null))); | |
| 150 | + // 准备参数 | |
| 151 | + ArticlePageReqVO reqVO = new ArticlePageReqVO(); | |
| 152 | + reqVO.setCategoryId(null); | |
| 153 | + reqVO.setTitle(null); | |
| 154 | + reqVO.setAuthor(null); | |
| 155 | + reqVO.setStatus(null); | |
| 156 | + reqVO.setSpuId(null); | |
| 157 | + reqVO.setRecommendHot(null); | |
| 158 | + reqVO.setRecommendBanner(null); | |
| 159 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 160 | + | |
| 161 | + // 调用 | |
| 162 | + PageResult<ArticleDO> pageResult = articleService.getArticlePage(reqVO); | |
| 163 | + // 断言 | |
| 164 | + assertEquals(1, pageResult.getTotal()); | |
| 165 | + assertEquals(1, pageResult.getList().size()); | |
| 166 | + assertPojoEquals(dbArticle, pageResult.getList().get(0)); | |
| 167 | + } | |
| 168 | + | |
| 169 | + @Test | |
| 170 | + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 171 | + public void testGetArticleList() { | |
| 172 | + // mock 数据 | |
| 173 | + ArticleDO dbArticle = randomPojo(ArticleDO.class, o -> { // 等会查询到 | |
| 174 | + o.setCategoryId(null); | |
| 175 | + o.setTitle(null); | |
| 176 | + o.setAuthor(null); | |
| 177 | + o.setPicUrl(null); | |
| 178 | + o.setIntroduction(null); | |
| 179 | + o.setBrowseCount(null); | |
| 180 | + o.setSort(null); | |
| 181 | + o.setStatus(null); | |
| 182 | + o.setSpuId(null); | |
| 183 | + o.setRecommendHot(null); | |
| 184 | + o.setRecommendBanner(null); | |
| 185 | + o.setContent(null); | |
| 186 | + o.setCreateTime(null); | |
| 187 | + }); | |
| 188 | + articleMapper.insert(dbArticle); | |
| 189 | + // 测试 categoryId 不匹配 | |
| 190 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setCategoryId(null))); | |
| 191 | + // 测试 title 不匹配 | |
| 192 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setTitle(null))); | |
| 193 | + // 测试 author 不匹配 | |
| 194 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setAuthor(null))); | |
| 195 | + // 测试 picUrl 不匹配 | |
| 196 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setPicUrl(null))); | |
| 197 | + // 测试 introduction 不匹配 | |
| 198 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setIntroduction(null))); | |
| 199 | + // 测试 browseCount 不匹配 | |
| 200 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setBrowseCount(null))); | |
| 201 | + // 测试 sort 不匹配 | |
| 202 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setSort(null))); | |
| 203 | + // 测试 status 不匹配 | |
| 204 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setStatus(null))); | |
| 205 | + // 测试 spuId 不匹配 | |
| 206 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setSpuId(null))); | |
| 207 | + // 测试 recommendHot 不匹配 | |
| 208 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setRecommendHot(null))); | |
| 209 | + // 测试 recommendBanner 不匹配 | |
| 210 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setRecommendBanner(null))); | |
| 211 | + // 测试 content 不匹配 | |
| 212 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setContent(null))); | |
| 213 | + // 测试 createTime 不匹配 | |
| 214 | + articleMapper.insert(cloneIgnoreId(dbArticle, o -> o.setCreateTime(null))); | |
| 215 | + // 准备参数 | |
| 216 | + ArticleExportReqVO reqVO = new ArticleExportReqVO(); | |
| 217 | + reqVO.setCategoryId(null); | |
| 218 | + reqVO.setTitle(null); | |
| 219 | + reqVO.setAuthor(null); | |
| 220 | + reqVO.setStatus(null); | |
| 221 | + reqVO.setSpuId(null); | |
| 222 | + reqVO.setRecommendHot(null); | |
| 223 | + reqVO.setRecommendBanner(null); | |
| 224 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 225 | + | |
| 226 | + // 调用 | |
| 227 | + List<ArticleDO> list = articleService.getArticleList(reqVO); | |
| 228 | + // 断言 | |
| 229 | + assertEquals(1, list.size()); | |
| 230 | + assertPojoEquals(dbArticle, list.get(0)); | |
| 231 | + } | |
| 232 | + | |
| 233 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/test/resources/sql/clean.sql
| ... | ... | @@ -6,3 +6,7 @@ DELETE FROM "promotion_discount_activity"; |
| 6 | 6 | DELETE FROM "promotion_discount_product"; |
| 7 | 7 | DELETE FROM "promotion_seckill_config"; |
| 8 | 8 | DELETE FROM "promotion_combination_activity"; |
| 9 | +DELETE | |
| 10 | +FROM "promotion_article_category"; | |
| 11 | +DELETE | |
| 12 | +FROM "promotion_article"; | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/test/resources/sql/create_tables.sql
| ... | ... | @@ -180,4 +180,44 @@ CREATE TABLE IF NOT EXISTS "promotion_combination_activity" |
| 180 | 180 | "deleted" bit NOT NULL DEFAULT FALSE, |
| 181 | 181 | "tenant_id" bigint NOT NULL, |
| 182 | 182 | PRIMARY KEY ("id") |
| 183 | -) COMMENT '拼团活动'; | |
| 184 | 183 | \ No newline at end of file |
| 184 | +) COMMENT '拼团活动'; | |
| 185 | + | |
| 186 | +CREATE TABLE IF NOT EXISTS "promotion_article_category" | |
| 187 | +( | |
| 188 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 189 | + "name" varchar NOT NULL, | |
| 190 | + "pic_url" varchar, | |
| 191 | + "status" int NOT NULL, | |
| 192 | + "sort" int NOT NULL, | |
| 193 | + "creator" varchar DEFAULT '', | |
| 194 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 195 | + "updater" varchar DEFAULT '', | |
| 196 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 197 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 198 | + "tenant_id" bigint NOT NULL, | |
| 199 | + PRIMARY KEY ("id") | |
| 200 | +) COMMENT '文章分类表'; | |
| 201 | + | |
| 202 | +CREATE TABLE IF NOT EXISTS "promotion_article" | |
| 203 | +( | |
| 204 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 205 | + "category_id" bigint NOT NULL, | |
| 206 | + "title" varchar NOT NULL, | |
| 207 | + "author" varchar, | |
| 208 | + "pic_url" varchar NOT NULL, | |
| 209 | + "introduction" varchar, | |
| 210 | + "browse_count" varchar, | |
| 211 | + "sort" int NOT NULL, | |
| 212 | + "status" int NOT NULL, | |
| 213 | + "spu_id" bigint NOT NULL, | |
| 214 | + "recommend_hot" bit NOT NULL, | |
| 215 | + "recommend_banner" bit NOT NULL, | |
| 216 | + "content" varchar NOT NULL, | |
| 217 | + "creator" varchar DEFAULT '', | |
| 218 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 219 | + "updater" varchar DEFAULT '', | |
| 220 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 221 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 222 | + "tenant_id" bigint NOT NULL, | |
| 223 | + PRIMARY KEY ("id") | |
| 224 | +) COMMENT '文章管理表'; | |
| 185 | 225 | \ No newline at end of file | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/TradeStatisticsController.java
| ... | ... | @@ -48,9 +48,11 @@ public class TradeStatisticsController { |
| 48 | 48 | @Operation(summary = "获得交易统计") |
| 49 | 49 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") |
| 50 | 50 | public CommonResult<TradeStatisticsComparisonRespVO<TradeSummaryRespVO>> getTradeSummaryComparison() { |
| 51 | + // TODO @疯狂:这个要不要 tradeStatisticsService 调用里面的多个方法,组合出最终的 TradeSummaryRespVO; | |
| 51 | 52 | return success(tradeStatisticsService.getTradeSummaryComparison()); |
| 52 | 53 | } |
| 53 | 54 | |
| 55 | + // TODO @疯狂:【晚点再改和讨论;等首页的接口出来】这个要不还是叫 analyse,对比选中的时间段,和上一个时间段;类似 MemberStatisticsController 的 getMemberAnalyse | |
| 54 | 56 | @GetMapping("/trend/summary") |
| 55 | 57 | @Operation(summary = "获得交易状况统计") |
| 56 | 58 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") |
| ... | ... | @@ -60,6 +62,8 @@ public class TradeStatisticsController { |
| 60 | 62 | ArrayUtil.get(reqVO.getTimes(), 1))); |
| 61 | 63 | } |
| 62 | 64 | |
| 65 | + // TODO 芋艿:已经 review | |
| 66 | + // TODO @疯狂:这个要不直接叫 list;它即使就是把每条统计拿出来 | |
| 63 | 67 | @GetMapping("/trend/list") |
| 64 | 68 | @Operation(summary = "获得交易状况明细") |
| 65 | 69 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") |
| ... | ... | @@ -69,6 +73,7 @@ public class TradeStatisticsController { |
| 69 | 73 | ArrayUtil.get(reqVO.getTimes(), 1))); |
| 70 | 74 | } |
| 71 | 75 | |
| 76 | + // TODO @疯狂:这个要不直接叫 export;它即使就是把每条统计导出 | |
| 72 | 77 | @GetMapping("/trend/export-excel") |
| 73 | 78 | @Operation(summary = "导出获得交易状况明细 Excel") |
| 74 | 79 | @PreAuthorize("@ss.hasPermission('statistics:trade:export')") | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryRespVO.java
| ... | ... | @@ -16,25 +16,26 @@ public class TradeTrendSummaryRespVO { |
| 16 | 16 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY) |
| 17 | 17 | private LocalDate date; |
| 18 | 18 | |
| 19 | + // TODO @疯狂,要不加个 turnoverPrice? | |
| 19 | 20 | @Schema(description = "营业额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 20 | - private Integer turnover; | |
| 21 | + private Integer turnover; // 营业额 = 商品支付金额 + 充值金额 | |
| 21 | 22 | |
| 22 | - @Schema(description = "商品支付金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 23 | + @Schema(description = "订单支付金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 23 | 24 | private Integer orderPayPrice; |
| 24 | 25 | |
| 26 | + @Schema(description = "订单退款金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 27 | + private Integer orderRefundPrice; | |
| 28 | + | |
| 29 | + @Schema(description = "支付佣金金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 30 | + private Integer brokerageSettlementPrice; | |
| 31 | + | |
| 25 | 32 | @Schema(description = "充值金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 26 | 33 | private Integer rechargePrice; |
| 27 | 34 | |
| 28 | 35 | @Schema(description = "支出金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 29 | - private Integer expensePrice; | |
| 36 | + private Integer expensePrice; // 余额支付金额 + 支付佣金金额 + 商品退款金额 | |
| 30 | 37 | |
| 31 | 38 | @Schema(description = "余额支付金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 32 | - private Integer balancePrice; | |
| 33 | - | |
| 34 | - @Schema(description = "支付佣金金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 35 | - private Integer brokerageSettlementPrice; | |
| 36 | - | |
| 37 | - @Schema(description = "商品退款金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 38 | - private Integer orderRefundPrice; | |
| 39 | + private Integer balancePrice; // TODO @疯狂:这个字段要不改成:walletPayPrice | |
| 39 | 40 | |
| 40 | 41 | } | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/infra/ApiAccessLogStatisticsMapper.java
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/pay/PayWalletStatisticsMapper.java
| ... | ... | @@ -17,14 +17,17 @@ import java.time.LocalDateTime; |
| 17 | 17 | @SuppressWarnings("rawtypes") |
| 18 | 18 | public interface PayWalletStatisticsMapper extends BaseMapperX { |
| 19 | 19 | |
| 20 | + // TODO 芋艿:已经 review; | |
| 20 | 21 | WalletSummaryRespBO selectRechargeSummaryByPayTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 21 | 22 | @Param("endTime") LocalDateTime endTime, |
| 22 | 23 | @Param("payStatus") Boolean payStatus); |
| 23 | 24 | |
| 25 | + // TODO 芋艿:已经 review; | |
| 24 | 26 | WalletSummaryRespBO selectRechargeSummaryByRefundTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 25 | 27 | @Param("endTime") LocalDateTime endTime, |
| 26 | 28 | @Param("refundStatus") Integer refundStatus); |
| 27 | 29 | |
| 30 | + // TODO 芋艿:已经 review; | |
| 28 | 31 | Integer selectPriceSummaryByBizTypeAndCreateTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 29 | 32 | @Param("endTime") LocalDateTime endTime, |
| 30 | 33 | @Param("bizType") Integer bizType); | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/AfterSaleStatisticsMapper.java
| ... | ... | @@ -16,6 +16,7 @@ import java.time.LocalDateTime; |
| 16 | 16 | @Mapper |
| 17 | 17 | public interface AfterSaleStatisticsMapper extends BaseMapperX<TradeStatisticsDO> { |
| 18 | 18 | |
| 19 | + // TODO 芋艿:已 review | |
| 19 | 20 | AfterSaleSummaryRespBO selectSummaryByRefundTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 20 | 21 | @Param("endTime") LocalDateTime endTime); |
| 21 | 22 | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeOrderStatisticsMapper.java
| ... | ... | @@ -22,9 +22,11 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX<TradeStatisticsD |
| 22 | 22 | // TODO 芋艿:已经 review |
| 23 | 23 | List<MemberAreaStatisticsRespVO> selectSummaryListByAreaId(); |
| 24 | 24 | |
| 25 | + // TODO 芋艿:已经 review | |
| 25 | 26 | Integer selectCountByCreateTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 26 | 27 | @Param("endTime") LocalDateTime endTime); |
| 27 | 28 | |
| 29 | + // TODO 芋艿:已经 review | |
| 28 | 30 | Integer selectCountByPayTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 29 | 31 | @Param("endTime") LocalDateTime endTime); |
| 30 | 32 | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeStatisticsMapper.java
| ... | ... | @@ -24,6 +24,7 @@ public interface TradeStatisticsMapper extends BaseMapperX<TradeStatisticsDO> { |
| 24 | 24 | TradeTrendSummaryRespVO selectByTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 25 | 25 | @Param("endTime") LocalDateTime endTime); |
| 26 | 26 | |
| 27 | + // TODO @芋艿:已经 review | |
| 27 | 28 | List<TradeTrendSummaryRespVO> selectListByTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 28 | 29 | @Param("endTime") LocalDateTime endTime); |
| 29 | 30 | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsService.java
| ... | ... | @@ -12,6 +12,7 @@ import java.time.LocalDateTime; |
| 12 | 12 | */ |
| 13 | 13 | public interface PayWalletStatisticsService { |
| 14 | 14 | |
| 15 | + // TODO 芋艿:已经 review | |
| 15 | 16 | /** |
| 16 | 17 | * 获取钱包统计 |
| 17 | 18 | * |
| ... | ... | @@ -21,6 +22,7 @@ public interface PayWalletStatisticsService { |
| 21 | 22 | */ |
| 22 | 23 | WalletSummaryRespBO getWalletSummary(LocalDateTime beginTime, LocalDateTime endTime); |
| 23 | 24 | |
| 25 | + // TODO 芋艿:已经 review | |
| 24 | 26 | /** |
| 25 | 27 | * 获取钱包充值统计 |
| 26 | 28 | * | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/AfterSaleStatisticsService.java
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/BrokerageStatisticsService.java
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsService.java
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsServiceImpl.java
| ... | ... | @@ -57,6 +57,30 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { |
| 57 | 57 | return TradeStatisticsConvert.INSTANCE.convert(yesterdayData, beforeYesterdayData, monthData, lastMonthData); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | + /** | |
| 61 | + * 统计指定日期的交易数据 | |
| 62 | + * | |
| 63 | + * @param days 增加的天数 | |
| 64 | + * @return 交易数据 | |
| 65 | + */ | |
| 66 | + private TradeSummaryRespBO getTradeSummaryByDays(int days) { | |
| 67 | + LocalDateTime date = LocalDateTime.now().plusDays(days); | |
| 68 | + return tradeStatisticsMapper.selectOrderCreateCountSumAndOrderPayPriceSumByTimeBetween( | |
| 69 | + LocalDateTimeUtil.beginOfDay(date), LocalDateTimeUtil.endOfDay(date)); | |
| 70 | + } | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 统计指定月份的交易数据 | |
| 74 | + * | |
| 75 | + * @param months 增加的月数 | |
| 76 | + * @return 交易数据 | |
| 77 | + */ | |
| 78 | + private TradeSummaryRespBO getTradeSummaryByMonths(int months) { | |
| 79 | + LocalDateTime monthDate = LocalDateTime.now().plusMonths(months); | |
| 80 | + return tradeStatisticsMapper.selectOrderCreateCountSumAndOrderPayPriceSumByTimeBetween( | |
| 81 | + LocalDateTimeUtils.beginOfMonth(monthDate), LocalDateTimeUtils.endOfMonth(monthDate)); | |
| 82 | + } | |
| 83 | + | |
| 60 | 84 | @Override |
| 61 | 85 | public TradeStatisticsComparisonRespVO<TradeTrendSummaryRespVO> getTradeTrendSummaryComparison(LocalDateTime beginTime, |
| 62 | 86 | LocalDateTime endTime) { |
| ... | ... | @@ -73,6 +97,7 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { |
| 73 | 97 | return tradeStatisticsMapper.selectExpensePriceByTimeBetween(beginTime, endTime); |
| 74 | 98 | } |
| 75 | 99 | |
| 100 | + // TODO @疯狂:是不是直接返回 TradeStatisticsDO;上层在去聚合? | |
| 76 | 101 | @Override |
| 77 | 102 | public List<TradeTrendSummaryRespVO> getTradeStatisticsList(LocalDateTime beginTime, LocalDateTime endTime) { |
| 78 | 103 | return tradeStatisticsMapper.selectListByTimeBetween(beginTime, endTime); |
| ... | ... | @@ -80,6 +105,9 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { |
| 80 | 105 | |
| 81 | 106 | @Override |
| 82 | 107 | public String statisticsYesterdayTrade() { |
| 108 | + // TODO @疯狂:如果已经统计,则跳过; | |
| 109 | + // TODO @疯狂:改成 statisticsTrade,然后传入 days,统计多少天;days 通过 job 传参;方便把历史给统计出来;或者大家有的时候要修复数据(会 fix 业务数据,然后清理统计表),重新统计的时候; | |
| 110 | + // 1. 从各个数据表,统计对应数据 | |
| 83 | 111 | LocalDateTime yesterday = LocalDateTime.now().minusDays(1); |
| 84 | 112 | LocalDateTime beginTime = LocalDateTimeUtil.beginOfDay(yesterday); |
| 85 | 113 | LocalDateTime endTime = LocalDateTimeUtil.endOfDay(yesterday); |
| ... | ... | @@ -108,28 +136,4 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { |
| 108 | 136 | return stopWatch.prettyPrint(); |
| 109 | 137 | } |
| 110 | 138 | |
| 111 | - /** | |
| 112 | - * 统计指定日期的交易数据 | |
| 113 | - * | |
| 114 | - * @param days 增加的天数 | |
| 115 | - * @return 交易数据 | |
| 116 | - */ | |
| 117 | - private TradeSummaryRespBO getTradeSummaryByDays(int days) { | |
| 118 | - LocalDateTime date = LocalDateTime.now().plusDays(days); | |
| 119 | - return tradeStatisticsMapper.selectOrderCreateCountSumAndOrderPayPriceSumByTimeBetween( | |
| 120 | - LocalDateTimeUtil.beginOfDay(date), LocalDateTimeUtil.endOfDay(date)); | |
| 121 | - } | |
| 122 | - | |
| 123 | - /** | |
| 124 | - * 统计指定月份的交易数据 | |
| 125 | - * | |
| 126 | - * @param months 增加的月数 | |
| 127 | - * @return 交易数据 | |
| 128 | - */ | |
| 129 | - private TradeSummaryRespBO getTradeSummaryByMonths(int months) { | |
| 130 | - LocalDateTime monthDate = LocalDateTime.now().plusMonths(months); | |
| 131 | - return tradeStatisticsMapper.selectOrderCreateCountSumAndOrderPayPriceSumByTimeBetween( | |
| 132 | - LocalDateTimeUtils.beginOfMonth(monthDate), LocalDateTimeUtils.endOfMonth(monthDate)); | |
| 133 | - } | |
| 134 | - | |
| 135 | 139 | } | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/pay/PayWalletStatisticsMapper.xml
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 3 | 3 | <mapper namespace="cn.iocoder.yudao.module.statistics.dal.mysql.pay.PayWalletStatisticsMapper"> |
| 4 | + | |
| 4 | 5 | <select id="selectRechargeSummaryByPayTimeBetween" |
| 5 | 6 | resultType="cn.iocoder.yudao.module.statistics.service.trade.bo.WalletSummaryRespBO"> |
| 6 | 7 | SELECT COUNT(1) AS rechargePayCount, | ... | ... |
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeStatisticsMapper.xml
yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderOperateTypeEnum.java
| ... | ... | @@ -20,7 +20,8 @@ public enum TradeOrderOperateTypeEnum { |
| 20 | 20 | ADMIN_DELIVERY(20, "已发货,快递公司:{deliveryName},快递单号:{logisticsNo}"), |
| 21 | 21 | MEMBER_RECEIVE(30, "用户已收货"), |
| 22 | 22 | SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"), |
| 23 | - PICK_UP_RECEIVE(32, "自提收货"), | |
| 23 | + ADMIN_PICK_UP_RECEIVE(32, "管理员自提收货"), | |
| 24 | + MEMBER_PICK_UP_RECEIVE(32, "用户自提收货"), | |
| 24 | 25 | MEMBER_COMMENT(33, "用户评价"), |
| 25 | 26 | SYSTEM_COMMENT(34, "到期未评价,系统自动评价"), |
| 26 | 27 | MEMBER_CANCEL(40, "取消订单"), | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java
| ... | ... | @@ -126,11 +126,17 @@ public class TradeOrderController { |
| 126 | 126 | return success(true); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | + // TODO @疯狂:1、在【订单列表】界面,增加一个【核销按钮】。点击后,弹窗出一个核销码输入的窗口。 | |
| 130 | + // | |
| 131 | + //2、输入核销码后,点击确认,基于 code 查询对应的订单,之后弹窗展示。 | |
| 132 | + // | |
| 133 | + //3、新的弹窗,下面有个【确认核销】按钮。确认后,进行订单核销逻辑。注意,只有门店自提的订单,才可以核销。 | |
| 134 | + // TODO 这里的 id 应该是 pickUpVerifyCode 参数哈; | |
| 129 | 135 | @PutMapping("/pick-up") |
| 130 | 136 | @Operation(summary = "订单核销") |
| 131 | 137 | @PreAuthorize("@ss.hasPermission('trade:order:pick-up')") |
| 132 | 138 | public CommonResult<Boolean> pickUpOrder(@RequestParam("id") Long id) { |
| 133 | - tradeOrderUpdateService.pickUpOrder(id); | |
| 139 | + tradeOrderUpdateService.pickUpOrderByMember(id); | |
| 134 | 140 | return success(true); |
| 135 | 141 | } |
| 136 | 142 | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/order/TradeOrderMapper.java
| ... | ... | @@ -93,16 +93,20 @@ public interface TradeOrderMapper extends BaseMapperX<TradeOrderDO> { |
| 93 | 93 | return selectOne(TradeOrderDO::getPickUpVerifyCode, pickUpVerifyCode); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - // TODO @hui999:是不是只针对 combinationActivityId 的查询呀? | |
| 96 | + // TODO @puhui999:selectByUserIdAndCombinationActivityIdAndStatus,这样更容易理解哈。 | |
| 97 | + /** | |
| 98 | + * 只针对 combinationActivityId 的查询 | |
| 99 | + * | |
| 100 | + * @param userId 用户编号 | |
| 101 | + * @param activityId 拼团活动编号 | |
| 102 | + * @param status 订单状态 | |
| 103 | + * @return 交易订单 | |
| 104 | + */ | |
| 97 | 105 | default TradeOrderDO selectByUserIdAndActivityIdAndStatus(Long userId, Long activityId, Integer status) { |
| 98 | 106 | return selectOne(new LambdaQueryWrapperX<TradeOrderDO>() |
| 99 | - .and(q -> q.eq(TradeOrderDO::getUserId, userId) | |
| 100 | - .eq(TradeOrderDO::getStatus, status)) | |
| 101 | - .and(q -> q.eq(TradeOrderDO::getCombinationActivityId, activityId) | |
| 102 | - .or() | |
| 103 | - .eq(TradeOrderDO::getSeckillActivityId, activityId) | |
| 104 | - .or() | |
| 105 | - .eq(TradeOrderDO::getBargainActivityId, activityId)) | |
| 107 | + .eq(TradeOrderDO::getUserId, userId) | |
| 108 | + .eq(TradeOrderDO::getStatus, status) | |
| 109 | + .eq(TradeOrderDO::getCombinationActivityId, activityId) | |
| 106 | 110 | ); |
| 107 | 111 | } |
| 108 | 112 | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateService.java
| ... | ... | @@ -120,14 +120,14 @@ public interface TradeOrderUpdateService { |
| 120 | 120 | * |
| 121 | 121 | * @param id 订单编号 |
| 122 | 122 | */ |
| 123 | - void pickUpOrder(Long id); | |
| 123 | + void pickUpOrderByMember(Long id); | |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | 126 | * 【管理员】核销订单 |
| 127 | 127 | * |
| 128 | 128 | * @param pickUpVerifyCode 自提核销码 |
| 129 | 129 | */ |
| 130 | - void pickUpOrder(String pickUpVerifyCode); | |
| 130 | + void pickUpOrderByAdmin(String pickUpVerifyCode); | |
| 131 | 131 | |
| 132 | 132 | // =================== Order Item =================== |
| 133 | 133 | |
| ... | ... | @@ -178,9 +178,9 @@ public interface TradeOrderUpdateService { |
| 178 | 178 | * @param combinationRecordId 拼团记录编号 |
| 179 | 179 | * @param headId 团长编号 |
| 180 | 180 | */ |
| 181 | - // TODO 芋艿:再 review 拼团 | |
| 182 | 181 | void updateOrderCombinationInfo(Long orderId, Long activityId, Long combinationRecordId, Long headId); |
| 183 | 182 | |
| 183 | + // TODO 芋艿:拼团取消,不调这个接口哈; | |
| 184 | 184 | /** |
| 185 | 185 | * 取消支付订单 |
| 186 | 186 | * | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java
| ... | ... | @@ -670,17 +670,18 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | @Override |
| 673 | - public void pickUpOrder(Long id) { | |
| 673 | + @TradeOrderLog(operateType = TradeOrderOperateTypeEnum.MEMBER_PICK_UP_RECEIVE) | |
| 674 | + public void pickUpOrderByMember(Long id) { | |
| 674 | 675 | getSelf().pickUpOrder(tradeOrderMapper.selectById(id)); |
| 675 | 676 | } |
| 676 | 677 | |
| 677 | 678 | @Override |
| 678 | - public void pickUpOrder(String pickUpVerifyCode) { | |
| 679 | + @TradeOrderLog(operateType = TradeOrderOperateTypeEnum.ADMIN_PICK_UP_RECEIVE) | |
| 680 | + public void pickUpOrderByAdmin(String pickUpVerifyCode) { | |
| 679 | 681 | getSelf().pickUpOrder(tradeOrderMapper.selectOneByPickUpVerifyCode(pickUpVerifyCode)); |
| 680 | 682 | } |
| 681 | 683 | |
| 682 | 684 | @Transactional(rollbackFor = Exception.class) |
| 683 | - @TradeOrderLog(operateType = TradeOrderOperateTypeEnum.PICK_UP_RECEIVE) | |
| 684 | 685 | public void pickUpOrder(TradeOrderDO order) { |
| 685 | 686 | if (order == null) { |
| 686 | 687 | throw exception(ORDER_NOT_FOUND); |
| ... | ... | @@ -688,7 +689,6 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { |
| 688 | 689 | if (ObjUtil.notEqual(DeliveryTypeEnum.PICK_UP.getType(), order.getDeliveryType())) { |
| 689 | 690 | throw exception(ORDER_RECEIVE_FAIL_DELIVERY_TYPE_NOT_PICK_UP); |
| 690 | 691 | } |
| 691 | - // todo 校验核销操作人? | |
| 692 | 692 | receiveOrder0(order); |
| 693 | 693 | } |
| 694 | 694 | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeCombinationOrderHandler.java
| 1 | 1 | package cn.iocoder.yudao.module.trade.service.order.handler; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.lang.Assert; |
| 4 | -import cn.iocoder.yudao.framework.common.core.KeyValue; | |
| 5 | 4 | import cn.iocoder.yudao.module.promotion.api.combination.CombinationRecordApi; |
| 5 | +import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateRespDTO; | |
| 6 | 6 | import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert; |
| 7 | 7 | import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; |
| 8 | 8 | import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; |
| ... | ... | @@ -49,7 +49,6 @@ public class TradeCombinationOrderHandler implements TradeOrderHandler { |
| 49 | 49 | order.getCombinationHeadId(), item.getSkuId(), item.getCount()); |
| 50 | 50 | |
| 51 | 51 | // 2. 校验该用户是否存在未支付的拼团活动订单,避免一个拼团可以下多个单子了 |
| 52 | - // TODO @puhui999:只校验未支付的拼团订单噢 | |
| 53 | 52 | TradeOrderDO activityOrder = orderQueryService.getActivityOrderByUserIdAndActivityIdAndStatus( |
| 54 | 53 | order.getUserId(), order.getCombinationActivityId(), TradeOrderStatusEnum.UNPAID.getStatus()); |
| 55 | 54 | if (activityOrder != null) { |
| ... | ... | @@ -67,13 +66,14 @@ public class TradeCombinationOrderHandler implements TradeOrderHandler { |
| 67 | 66 | |
| 68 | 67 | // 2. 创建拼团记录 |
| 69 | 68 | TradeOrderItemDO item = orderItems.get(0); |
| 70 | - KeyValue<Long, Long> recordIdAndHeadId = combinationRecordApi.createCombinationRecord( | |
| 69 | + CombinationRecordCreateRespDTO combinationRecord = combinationRecordApi.createCombinationRecord( | |
| 71 | 70 | TradeOrderConvert.INSTANCE.convert(order, item)); |
| 72 | 71 | |
| 73 | 72 | // 3. 更新拼团相关信息到订单 |
| 74 | - // TODO 芋艿,只需要更新 record | |
| 73 | + // 为什么几个字段都要更新?原因是: | |
| 74 | + // 如果创建订单时自己是团长的情况下 combinationHeadId 是为 null 的,设置团长编号这个操作时在订单是否后创建拼团记录时才设置的。 | |
| 75 | 75 | orderUpdateService.updateOrderCombinationInfo(order.getId(), order.getCombinationActivityId(), |
| 76 | - recordIdAndHeadId.getKey(), recordIdAndHeadId.getValue()); | |
| 76 | + combinationRecord.getCombinationRecordId(), combinationRecord.getCombinationHeadId()); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | @Override | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletController.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.controller.admin.wallet; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | -import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.PayWalletRespVO; | |
| 5 | -import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.PayWalletUserReqVO; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet.PayWalletPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet.PayWalletRespVO; | |
| 7 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet.PayWalletUserReqVO; | |
| 6 | 8 | import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletConvert; |
| 7 | 9 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO; |
| 8 | 10 | import cn.iocoder.yudao.module.pay.service.wallet.PayWalletService; |
| ... | ... | @@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
| 16 | 18 | import org.springframework.web.bind.annotation.RestController; |
| 17 | 19 | |
| 18 | 20 | import javax.annotation.Resource; |
| 21 | +import javax.validation.Valid; | |
| 19 | 22 | |
| 20 | 23 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 24 | |
| ... | ... | @@ -37,4 +40,12 @@ public class PayWalletController { |
| 37 | 40 | return success(PayWalletConvert.INSTANCE.convert02(wallet)); |
| 38 | 41 | } |
| 39 | 42 | |
| 43 | + @GetMapping("/page") | |
| 44 | + @Operation(summary = "获得会员钱包分页") | |
| 45 | + @PreAuthorize("@ss.hasPermission('pay:wallet:query')") | |
| 46 | + public CommonResult<PageResult<PayWalletRespVO>> getWalletPage(@Valid PayWalletPageReqVO pageVO) { | |
| 47 | + PageResult<PayWalletDO> pageResult = payWalletService.getWalletPage(pageVO); | |
| 48 | + return success(PayWalletConvert.INSTANCE.convertPage(pageResult)); | |
| 49 | + } | |
| 50 | + | |
| 40 | 51 | } | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletTransactionController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.pay.controller.admin.wallet; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionRespVO; | |
| 7 | +import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletTransactionConvert; | |
| 8 | +import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | |
| 9 | +import cn.iocoder.yudao.module.pay.service.wallet.PayWalletTransactionService; | |
| 10 | +import io.swagger.v3.oas.annotations.Operation; | |
| 11 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 12 | +import lombok.extern.slf4j.Slf4j; | |
| 13 | +import org.springframework.validation.annotation.Validated; | |
| 14 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 15 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 16 | +import org.springframework.web.bind.annotation.RestController; | |
| 17 | + | |
| 18 | +import javax.annotation.Resource; | |
| 19 | +import javax.validation.Valid; | |
| 20 | + | |
| 21 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +@Tag(name = "管理后台 - 钱包余额明细") | |
| 24 | +@RestController | |
| 25 | +@RequestMapping("/pay/wallet-transaction") | |
| 26 | +@Validated | |
| 27 | +@Slf4j | |
| 28 | +public class PayWalletTransactionController { | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private PayWalletTransactionService payWalletTransactionService; | |
| 32 | + | |
| 33 | + @GetMapping("/page") | |
| 34 | + @Operation(summary = "获得钱包流水分页") | |
| 35 | + public CommonResult<PageResult<PayWalletTransactionRespVO>> getWalletTransactionPage( | |
| 36 | + @Valid PayWalletTransactionPageReqVO pageReqVO) { | |
| 37 | + PageResult<PayWalletTransactionDO> result = payWalletTransactionService.getWalletTransactionPage(pageReqVO); | |
| 38 | + return success(PayWalletTransactionConvert.INSTANCE.convertPage2(result)); | |
| 39 | + } | |
| 40 | +} | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/transaction/PayWalletTransactionPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@Schema(description = "管理后台 - 钱包流水分页 Request VO") | |
| 8 | +@Data | |
| 9 | +public class PayWalletTransactionPageReqVO extends PageParam { | |
| 10 | + | |
| 11 | + @Schema(description = "钱包编号", example = "1") | |
| 12 | + private Long walletId; | |
| 13 | +} | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/transaction/PayWalletTransactionRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | + | |
| 8 | +@Schema(description = "用户 APP - 钱包流水分页 Response VO") | |
| 9 | +@Data | |
| 10 | +public class PayWalletTransactionRespVO { | |
| 11 | + | |
| 12 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | + @Schema(description = "钱包编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5") | |
| 16 | + private Long walletId; | |
| 17 | + | |
| 18 | + @Schema(description = "业务分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 19 | + private Integer bizType; | |
| 20 | + | |
| 21 | + @Schema(description = "交易金额,单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") | |
| 22 | + private Long price; | |
| 23 | + | |
| 24 | + @Schema(description = "流水标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "土豆土豆") | |
| 25 | + private String title; | |
| 26 | + | |
| 27 | + @Schema(description = "交易时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 28 | + private LocalDateTime createTime; | |
| 29 | +} | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/PayWalletBaseVO.java renamed to yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletBaseVO.java
| 1 | -package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo; | |
| 1 | +package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.Data; |
| ... | ... | @@ -18,7 +18,7 @@ public class PayWalletBaseVO { |
| 18 | 18 | |
| 19 | 19 | @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 20 | 20 | @NotNull(message = "用户类型不能为空") |
| 21 | - private Byte userType; | |
| 21 | + private Integer userType; | |
| 22 | 22 | |
| 23 | 23 | @Schema(description = "余额,单位分", requiredMode = Schema.RequiredMode.REQUIRED) |
| 24 | 24 | @NotNull(message = "余额,单位分不能为空") | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 6 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 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 = "管理后台 - 会员钱包分页 Request VO") | |
| 12 | +@Data | |
| 13 | +@EqualsAndHashCode(callSuper = true) | |
| 14 | +@ToString(callSuper = true) | |
| 15 | +public class PayWalletPageReqVO extends PageParam { | |
| 16 | + | |
| 17 | + @Schema(description = "用户编号", example = "14138") | |
| 18 | + private Long userId; | |
| 19 | + | |
| 20 | + @Schema(description = "用户类型", example = "1") | |
| 21 | + private Integer userType; | |
| 22 | + | |
| 23 | + @Schema(description = "创建时间") | |
| 24 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 25 | + private LocalDateTime[] createTime; | |
| 26 | + | |
| 27 | +} | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/PayWalletRespVO.java renamed to yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletRespVO.java
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/PayWalletUserReqVO.java renamed to yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletUserReqVO.java
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/wallet/vo/transaction/AppPayWalletTransactionRespVO.java
| ... | ... | @@ -9,9 +9,6 @@ import java.time.LocalDateTime; |
| 9 | 9 | @Data |
| 10 | 10 | public class AppPayWalletTransactionRespVO { |
| 11 | 11 | |
| 12 | - @Schema(description = "交易金额, 单位分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") | |
| 13 | - private Integer amount; | |
| 14 | - | |
| 15 | 12 | @Schema(description = "业务分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 16 | 13 | private Integer bizType; |
| 17 | 14 | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/wallet/PayWalletConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.convert.wallet; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.PayWalletRespVO; | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet.PayWalletRespVO; | |
| 4 | 5 | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.wallet.AppPayWalletRespVO; |
| 5 | 6 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO; |
| 6 | 7 | import org.mapstruct.Mapper; |
| ... | ... | @@ -14,4 +15,6 @@ public interface PayWalletConvert { |
| 14 | 15 | AppPayWalletRespVO convert(PayWalletDO bean); |
| 15 | 16 | |
| 16 | 17 | PayWalletRespVO convert02(PayWalletDO wallet); |
| 18 | + | |
| 19 | + PageResult<PayWalletRespVO> convertPage(PageResult<PayWalletDO> page); | |
| 17 | 20 | } | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/wallet/PayWalletTransactionConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.convert.wallet; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionRespVO; | |
| 4 | 5 | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionRespVO; |
| 5 | 6 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; |
| 6 | 7 | import cn.iocoder.yudao.module.pay.service.wallet.bo.WalletTransactionCreateReqBO; |
| ... | ... | @@ -14,6 +15,8 @@ public interface PayWalletTransactionConvert { |
| 14 | 15 | |
| 15 | 16 | PageResult<AppPayWalletTransactionRespVO> convertPage(PageResult<PayWalletTransactionDO> page); |
| 16 | 17 | |
| 18 | + PageResult<PayWalletTransactionRespVO> convertPage2(PageResult<PayWalletTransactionDO> page); | |
| 19 | + | |
| 17 | 20 | PayWalletTransactionDO convert(WalletTransactionCreateReqBO bean); |
| 18 | 21 | |
| 19 | 22 | } | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletMapper.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.dal.mysql.wallet; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | 5 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet.PayWalletPageReqVO; | |
| 5 | 8 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO; |
| 6 | 9 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 7 | 10 | import org.apache.ibatis.annotations.Mapper; |
| ... | ... | @@ -14,6 +17,14 @@ public interface PayWalletMapper extends BaseMapperX<PayWalletDO> { |
| 14 | 17 | PayWalletDO::getUserType, userType); |
| 15 | 18 | } |
| 16 | 19 | |
| 20 | + default PageResult<PayWalletDO> selectPage(PayWalletPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<PayWalletDO>() | |
| 22 | + .eqIfPresent(PayWalletDO::getUserId, reqVO.getUserId()) | |
| 23 | + .eqIfPresent(PayWalletDO::getUserType, reqVO.getUserType()) | |
| 24 | + .betweenIfPresent(PayWalletDO::getCreateTime, reqVO.getCreateTime()) | |
| 25 | + .orderByDesc(PayWalletDO::getId)); | |
| 26 | + } | |
| 27 | + | |
| 17 | 28 | /** |
| 18 | 29 | * 当消费退款时候, 更新钱包 |
| 19 | 30 | * | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletTransactionMapper.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.dal.mysql.wallet; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 6 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 6 | 7 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| ... | ... | @@ -13,17 +14,17 @@ import java.util.Objects; |
| 13 | 14 | @Mapper |
| 14 | 15 | public interface PayWalletTransactionMapper extends BaseMapperX<PayWalletTransactionDO> { |
| 15 | 16 | |
| 16 | - default PageResult<PayWalletTransactionDO> selectPage(Long walletId, | |
| 17 | - AppPayWalletTransactionPageReqVO pageReqVO) { | |
| 17 | + default PageResult<PayWalletTransactionDO> selectPage(Long walletId, Integer type, | |
| 18 | + PageParam pageParam) { | |
| 18 | 19 | LambdaQueryWrapperX<PayWalletTransactionDO> query = new LambdaQueryWrapperX<PayWalletTransactionDO>() |
| 19 | - .eq(PayWalletTransactionDO::getWalletId, walletId); | |
| 20 | - if (Objects.equals(pageReqVO.getType(), AppPayWalletTransactionPageReqVO.TYPE_INCOME)) { | |
| 20 | + .eqIfPresent(PayWalletTransactionDO::getWalletId, walletId); | |
| 21 | + if (Objects.equals(type, AppPayWalletTransactionPageReqVO.TYPE_INCOME)) { | |
| 21 | 22 | query.gt(PayWalletTransactionDO::getPrice, 0); |
| 22 | - } else if (Objects.equals(pageReqVO.getType(), AppPayWalletTransactionPageReqVO.TYPE_EXPENSE)) { | |
| 23 | + } else if (Objects.equals(type, AppPayWalletTransactionPageReqVO.TYPE_EXPENSE)) { | |
| 23 | 24 | query.lt(PayWalletTransactionDO::getPrice, 0); |
| 24 | 25 | } |
| 25 | 26 | query.orderByDesc(PayWalletTransactionDO::getId); |
| 26 | - return selectPage(pageReqVO, query); | |
| 27 | + return selectPage(pageParam, query); | |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | default PayWalletTransactionDO selectByNo(String no) { | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletService.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.service.wallet; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet.PayWalletPageReqVO; | |
| 3 | 5 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO; |
| 4 | 6 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; |
| 5 | 7 | import cn.iocoder.yudao.module.pay.enums.member.PayWalletBizTypeEnum; |
| ... | ... | @@ -28,6 +30,15 @@ public interface PayWalletService { |
| 28 | 30 | */ |
| 29 | 31 | PayWalletDO getWallet(Long walletId); |
| 30 | 32 | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 获得会员钱包分页 | |
| 36 | + * | |
| 37 | + * @param pageReqVO 分页查询 | |
| 38 | + * @return 会员钱包分页 | |
| 39 | + */ | |
| 40 | + PageResult<PayWalletDO> getWalletPage(PayWalletPageReqVO pageReqVO); | |
| 41 | + | |
| 31 | 42 | /** |
| 32 | 43 | * 钱包订单支付 |
| 33 | 44 | * | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.service.wallet; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.lang.Assert; |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.wallet.PayWalletPageReqVO; | |
| 4 | 6 | import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderExtensionDO; |
| 5 | 7 | import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO; |
| 6 | 8 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO; |
| ... | ... | @@ -61,6 +63,11 @@ public class PayWalletServiceImpl implements PayWalletService { |
| 61 | 63 | } |
| 62 | 64 | |
| 63 | 65 | @Override |
| 66 | + public PageResult<PayWalletDO> getWalletPage(PayWalletPageReqVO pageReqVO) { | |
| 67 | + return walletMapper.selectPage(pageReqVO); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @Override | |
| 64 | 71 | @Transactional(rollbackFor = Exception.class) |
| 65 | 72 | public PayWalletTransactionDO orderPay(Long userId, Integer userType, String outTradeNo, Integer price) { |
| 66 | 73 | // 1. 判断支付交易拓展单是否存 | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletTransactionService.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.service.wallet; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionPageReqVO; | |
| 4 | 5 | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; |
| 5 | 6 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; |
| 6 | 7 | import cn.iocoder.yudao.module.pay.enums.member.PayWalletBizTypeEnum; |
| ... | ... | @@ -26,6 +27,13 @@ public interface PayWalletTransactionService { |
| 26 | 27 | AppPayWalletTransactionPageReqVO pageVO); |
| 27 | 28 | |
| 28 | 29 | /** |
| 30 | + * 查询钱包余额流水分页 | |
| 31 | + * | |
| 32 | + * @param pageVO 分页查询参数 | |
| 33 | + */ | |
| 34 | + PageResult<PayWalletTransactionDO> getWalletTransactionPage(PayWalletTransactionPageReqVO pageVO); | |
| 35 | + | |
| 36 | + /** | |
| 29 | 37 | * 新增钱包余额流水 |
| 30 | 38 | * |
| 31 | 39 | * @param bo 创建钱包流水 bo | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletTransactionServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.service.wallet; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionPageReqVO; | |
| 4 | 5 | import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; |
| 5 | 6 | import cn.iocoder.yudao.module.pay.convert.wallet.PayWalletTransactionConvert; |
| 6 | 7 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO; |
| ... | ... | @@ -39,7 +40,12 @@ public class PayWalletTransactionServiceImpl implements PayWalletTransactionServ |
| 39 | 40 | public PageResult<PayWalletTransactionDO> getWalletTransactionPage(Long userId, Integer userType, |
| 40 | 41 | AppPayWalletTransactionPageReqVO pageVO) { |
| 41 | 42 | PayWalletDO wallet = payWalletService.getOrCreateWallet(userId, userType); |
| 42 | - return payWalletTransactionMapper.selectPage(wallet.getId(), pageVO); | |
| 43 | + return payWalletTransactionMapper.selectPage(wallet.getId(), pageVO.getType(), pageVO); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @Override | |
| 47 | + public PageResult<PayWalletTransactionDO> getWalletTransactionPage(PayWalletTransactionPageReqVO pageVO) { | |
| 48 | + return payWalletTransactionMapper.selectPage(pageVO.getWalletId(), null, pageVO); | |
| 43 | 49 | } |
| 44 | 50 | |
| 45 | 51 | @Override | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java
| ... | ... | @@ -18,10 +18,10 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService; |
| 18 | 18 | import cn.iocoder.yudao.module.system.service.permission.RoleService; |
| 19 | 19 | import cn.iocoder.yudao.module.system.service.social.SocialUserService; |
| 20 | 20 | import cn.iocoder.yudao.module.system.service.user.AdminUserService; |
| 21 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 21 | +import io.swagger.v3.oas.annotations.Operation; | |
| 22 | 22 | import io.swagger.v3.oas.annotations.Parameter; |
| 23 | 23 | import io.swagger.v3.oas.annotations.Parameters; |
| 24 | -import io.swagger.v3.oas.annotations.Operation; | |
| 24 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 25 | 25 | import lombok.extern.slf4j.Slf4j; |
| 26 | 26 | import org.springframework.validation.annotation.Validated; |
| 27 | 27 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -30,6 +30,7 @@ import javax.annotation.Resource; |
| 30 | 30 | import javax.annotation.security.PermitAll; |
| 31 | 31 | import javax.servlet.http.HttpServletRequest; |
| 32 | 32 | import javax.validation.Valid; |
| 33 | +import java.util.Collections; | |
| 33 | 34 | import java.util.List; |
| 34 | 35 | import java.util.Set; |
| 35 | 36 | |
| ... | ... | @@ -101,6 +102,9 @@ public class AuthController { |
| 101 | 102 | |
| 102 | 103 | // 1.2 获得角色列表 |
| 103 | 104 | Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(getLoginUserId()); |
| 105 | + if (CollUtil.isEmpty(roleIds)) { | |
| 106 | + return success(AuthConvert.INSTANCE.convert(user, Collections.emptyList(), Collections.emptyList())); | |
| 107 | + } | |
| 104 | 108 | List<RoleDO> roles = roleService.getRoleList(roleIds); |
| 105 | 109 | roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); // 移除禁用的角色 |
| 106 | 110 | |
| ... | ... | @@ -154,4 +158,4 @@ public class AuthController { |
| 154 | 158 | return success(authService.socialLogin(reqVO)); |
| 155 | 159 | } |
| 156 | 160 | |
| 157 | -} | |
| 158 | 161 | \ No newline at end of file |
| 162 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyTemplateController.java
| 1 | 1 | package cn.iocoder.yudao.module.system.controller.admin.notify; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 6 | import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.*; |
| ... | ... | @@ -76,8 +77,12 @@ public class NotifyTemplateController { |
| 76 | 77 | @Operation(summary = "发送站内信") |
| 77 | 78 | @PreAuthorize("@ss.hasPermission('system:notify-template:send-notify')") |
| 78 | 79 | public CommonResult<Long> sendNotify(@Valid @RequestBody NotifyTemplateSendReqVO sendReqVO) { |
| 79 | - return success(notifySendService.sendSingleNotifyToAdmin(sendReqVO.getUserId(), | |
| 80 | - sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); | |
| 80 | + if (UserTypeEnum.MEMBER.getValue().equals(sendReqVO.getUserType())) { | |
| 81 | + return success(notifySendService.sendSingleNotifyToMember(sendReqVO.getUserId(), | |
| 82 | + sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); | |
| 83 | + } else { | |
| 84 | + return success(notifySendService.sendSingleNotifyToAdmin(sendReqVO.getUserId(), | |
| 85 | + sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); | |
| 86 | + } | |
| 81 | 87 | } |
| 82 | - | |
| 83 | 88 | } | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java
| ... | ... | @@ -15,6 +15,10 @@ public class NotifyTemplateSendReqVO { |
| 15 | 15 | @NotNull(message = "用户id不能为空") |
| 16 | 16 | private Long userId; |
| 17 | 17 | |
| 18 | + @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 19 | + @NotNull(message = "用户类型不能为空") | |
| 20 | + private Integer userType; | |
| 21 | + | |
| 18 | 22 | @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01") |
| 19 | 23 | @NotEmpty(message = "模板编码不能为空") |
| 20 | 24 | private String templateCode; | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.system.convert.auth; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 3 | 4 | import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; |
| 4 | 5 | import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; |
| 5 | 6 | import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; |
| ... | ... | @@ -46,6 +47,9 @@ public interface AuthConvert { |
| 46 | 47 | * @return 菜单树 |
| 47 | 48 | */ |
| 48 | 49 | default List<AuthPermissionInfoRespVO.MenuVO> buildMenuTree(List<MenuDO> menuList) { |
| 50 | + if (CollUtil.isEmpty(menuList)) { | |
| 51 | + return Collections.emptyList(); | |
| 52 | + } | |
| 49 | 53 | // 移除按钮 |
| 50 | 54 | menuList.removeIf(menu -> menu.getType().equals(MenuTypeEnum.BUTTON.getType())); |
| 51 | 55 | // 排序,保证菜单的有序性 | ... | ... |
yudao-server/src/main/resources/application-local.yaml
| ... | ... | @@ -174,8 +174,8 @@ debug: false |
| 174 | 174 | --- #################### 微信公众号、小程序相关配置 #################### |
| 175 | 175 | wx: |
| 176 | 176 | mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 |
| 177 | -# app-id: wx041349c6f39b268b | |
| 178 | -# secret: 5abee519483bc9f8cb37ce280e814bd0 | |
| 177 | + # app-id: wx041349c6f39b268b | |
| 178 | + # secret: 5abee519483bc9f8cb37ce280e814bd0 | |
| 179 | 179 | app-id: wx5b23ba7a5589ecbb # 测试号 |
| 180 | 180 | secret: 2a7b3b20c537e52e74afd395eb85f61f |
| 181 | 181 | # 存储配置,解决 AccessToken 的跨节点的共享 |
| ... | ... | @@ -184,8 +184,8 @@ wx: |
| 184 | 184 | key-prefix: wx # Redis Key 的前缀 |
| 185 | 185 | http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 |
| 186 | 186 | miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档 |
| 187 | -# appid: wx62056c0d5e8db250 | |
| 188 | -# secret: 333ae72f41552af1e998fe1f54e1584a | |
| 187 | + # appid: wx62056c0d5e8db250 | |
| 188 | + # secret: 333ae72f41552af1e998fe1f54e1584a | |
| 189 | 189 | appid: wx63c280fe3248a3e7 # wenhualian的接口测试号 |
| 190 | 190 | secret: 6f270509224a7ae1296bbf1c8cb97aed |
| 191 | 191 | config-storage: | ... | ... |