Commit d0caa77f8063d4527a5a311fc28b6e4855968c6c
Merge branch 'feature/mall_product' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
Showing
290 changed files
with
6324 additions
and
1592 deletions
Too many changes.
To preserve performance only 100 of 290 files are displayed.
pom.xml
| ... | ... | @@ -13,14 +13,14 @@ |
| 13 | 13 | <!-- Server 主项目 --> |
| 14 | 14 | <module>yudao-server</module> |
| 15 | 15 | <!-- 各种 module 拓展 --> |
| 16 | -<!-- <module>yudao-module-member</module>--> | |
| 16 | + <module>yudao-module-member</module> | |
| 17 | 17 | <module>yudao-module-system</module> |
| 18 | 18 | <module>yudao-module-infra</module> |
| 19 | 19 | <!-- <module>yudao-module-bpm</module>--> |
| 20 | 20 | <!-- <module>yudao-module-report</module>--> |
| 21 | 21 | <!-- <module>yudao-module-mp</module>--> |
| 22 | -<!-- <module>yudao-module-pay</module>--> | |
| 23 | -<!-- <module>yudao-module-mall</module>--> | |
| 22 | + <module>yudao-module-pay</module> | |
| 23 | + <module>yudao-module-mall</module> | |
| 24 | 24 | <!-- 示例项目 --> |
| 25 | 25 | <module>yudao-example</module> |
| 26 | 26 | </modules> | ... | ... |
sql/mysql/mall.sql
0 → 100644
sql/mysql/pay_wallet.sql
| ... | ... | @@ -9,7 +9,7 @@ CREATE TABLE `pay_transfer` |
| 9 | 9 | `app_id` bigint NOT NULL COMMENT '应用编号', |
| 10 | 10 | `merchant_order_id` varchar(64) NOT NULL COMMENT '商户订单编号', |
| 11 | 11 | `price` int NOT NULL COMMENT '转账金额,单位:分', |
| 12 | - `title` varchar(512) NOT NULL COMMENT '转账标题', | |
| 12 | + `subject` varchar(512) NOT NULL COMMENT '转账标题', | |
| 13 | 13 | `payee_info` varchar(512) NOT NULL COMMENT '收款人信息,不同类型和渠道不同', |
| 14 | 14 | `status` tinyint NOT NULL COMMENT '转账状态', |
| 15 | 15 | `success_time` datetime NULL COMMENT '转账成功时间', |
| ... | ... | @@ -76,3 +76,130 @@ CREATE TABLE `pay_demo_transfer` ( |
| 76 | 76 | ALTER TABLE `pay_channel` |
| 77 | 77 | MODIFY COLUMN `config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '支付渠道配置' AFTER `app_id`; |
| 78 | 78 | |
| 79 | +-- ---------------------------- | |
| 80 | +-- 充值套餐表 | |
| 81 | +-- ---------------------------- | |
| 82 | +DROP TABLE IF EXISTS `pay_wallet_recharge_package`; | |
| 83 | +CREATE TABLE `pay_wallet_recharge_package` | |
| 84 | +( | |
| 85 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', | |
| 86 | + `name` varchar(64) NOT NULL COMMENT '套餐名', | |
| 87 | + `pay_price` int NOT NULL COMMENT '支付金额', | |
| 88 | + `bonus_price` int NOT NULL COMMENT '赠送金额', | |
| 89 | + `status` tinyint NOT NULL COMMENT '状态', | |
| 90 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '创建者', | |
| 91 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 92 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | |
| 93 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 94 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 95 | + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', | |
| 96 | + PRIMARY KEY (`id`) USING BTREE | |
| 97 | +) ENGINE=InnoDB COMMENT='充值套餐表'; | |
| 98 | + | |
| 99 | +-- ---------------------------- | |
| 100 | +-- Table structure for pay_wallet_recharge | |
| 101 | +-- ---------------------------- | |
| 102 | +DROP TABLE IF EXISTS `pay_wallet_recharge`; | |
| 103 | +CREATE TABLE `pay_wallet_recharge` ( | |
| 104 | + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '编号', | |
| 105 | + `wallet_id` bigint(0) NOT NULL COMMENT '会员钱包 id', | |
| 106 | + `total_price` int(0) NOT NULL COMMENT '用户实际到账余额,例如充 100 送 20,则该值是 120', | |
| 107 | + `pay_price` int(0) NOT NULL COMMENT '实际支付金额', | |
| 108 | + `bonus_price` int(0) NOT NULL COMMENT '钱包赠送金额', | |
| 109 | + `package_id` bigint(0) DEFAULT NULL COMMENT '充值套餐编号', | |
| 110 | + `pay_status` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已支付:[0:未支付 1:已经支付过]', | |
| 111 | + `pay_order_id` bigint(0) DEFAULT NULL COMMENT '支付订单编号', | |
| 112 | + `pay_channel_code` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支付成功的支付渠道', | |
| 113 | + `pay_time` datetime(0) DEFAULT NULL COMMENT '订单支付时间', | |
| 114 | + `pay_refund_id` bigint(0) DEFAULT NULL COMMENT '支付退款单编号', | |
| 115 | + `refund_total_price` int(0) NOT NULL DEFAULT 0 COMMENT '退款金额,包含赠送金额', | |
| 116 | + `refund_pay_price` int(0) NOT NULL DEFAULT 0 COMMENT '退款支付金额', | |
| 117 | + `refund_bonus_price` int(0) NOT NULL DEFAULT 0 COMMENT '退款钱包赠送金额', | |
| 118 | + `refund_time` datetime(0) DEFAULT NULL COMMENT '退款时间', | |
| 119 | + `refund_status` int(0) NOT NULL DEFAULT 0 COMMENT '退款状态', | |
| 120 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者', | |
| 121 | + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 122 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者', | |
| 123 | + `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', | |
| 124 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 125 | + `tenant_id` bigint(0) NOT NULL DEFAULT 0 COMMENT '租户编号', | |
| 126 | + PRIMARY KEY (`id`) USING BTREE | |
| 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 @parentId1 := LAST_INSERT_ID(); | |
| 140 | + | |
| 141 | +INSERT INTO system_menu( | |
| 142 | + name, permission, type, sort, parent_id, | |
| 143 | + path, icon, component, status, component_name | |
| 144 | +) | |
| 145 | +VALUES ( | |
| 146 | + '充值套餐', '', 2, 2, @parentId1, | |
| 147 | + 'wallet-recharge-package', 'fa:leaf', 'pay/wallet/rechargePackage/index', 0, 'WalletRechargePackage' | |
| 148 | + ); | |
| 149 | +SELECT @parentId := LAST_INSERT_ID(); | |
| 150 | + | |
| 151 | +-- 按钮 SQL | |
| 152 | +INSERT INTO system_menu( | |
| 153 | + name, permission, type, sort, parent_id, | |
| 154 | + path, icon, component, status | |
| 155 | +) | |
| 156 | +VALUES ( | |
| 157 | + '钱包充值套餐查询', 'pay:wallet-recharge-package:query', 3, 1, @parentId, | |
| 158 | + '', '', '', 0 | |
| 159 | + ); | |
| 160 | +INSERT INTO system_menu( | |
| 161 | + name, permission, type, sort, parent_id, | |
| 162 | + path, icon, component, status | |
| 163 | +) | |
| 164 | +VALUES ( | |
| 165 | + '钱包充值套餐创建', 'pay:wallet-recharge-package:create', 3, 2, @parentId, | |
| 166 | + '', '', '', 0 | |
| 167 | + ); | |
| 168 | +INSERT INTO system_menu( | |
| 169 | + name, permission, type, sort, parent_id, | |
| 170 | + path, icon, component, status | |
| 171 | +) | |
| 172 | +VALUES ( | |
| 173 | + '钱包充值套餐更新', 'pay:wallet-recharge-package:update', 3, 3, @parentId, | |
| 174 | + '', '', '', 0 | |
| 175 | + ); | |
| 176 | +INSERT INTO system_menu( | |
| 177 | + name, permission, type, sort, parent_id, | |
| 178 | + path, icon, component, status | |
| 179 | +) | |
| 180 | +VALUES ( | |
| 181 | + '钱包充值套餐删除', 'pay:wallet-recharge-package:delete', 3, 4, @parentId, | |
| 182 | + '', '', '', 0 | |
| 183 | + ); | |
| 184 | + | |
| 185 | +INSERT INTO system_menu( | |
| 186 | + name, permission, type, sort, parent_id, | |
| 187 | + path, icon, component, status, component_name | |
| 188 | +) | |
| 189 | +VALUES ( | |
| 190 | + '钱包余额', '', 2, 1, @parentId1, | |
| 191 | + 'wallet-balance', 'fa:leaf', 'pay/wallet/balance/index', 0, 'WalletBalance' | |
| 192 | + ); | |
| 193 | + | |
| 194 | +SELECT @parentId := LAST_INSERT_ID(); | |
| 195 | + | |
| 196 | +-- 按钮 SQL | |
| 197 | +INSERT INTO system_menu( | |
| 198 | + name, permission, type, sort, parent_id, | |
| 199 | + path, icon, component, status | |
| 200 | +) | |
| 201 | +VALUES ( | |
| 202 | + '钱包余额查询', 'pay:wallet:query', 3, 1, @parentId, | |
| 203 | + '', '', '', 0 | |
| 204 | + ); | |
| 205 | + | ... | ... |
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: 18/10/2023 23:33:15 | |
| 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 = 1739 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 |
| ... | ... | @@ -538,7 +538,7 @@ CREATE TABLE `infra_file` ( |
| 538 | 538 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 539 | 539 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 540 | 540 | PRIMARY KEY (`id`) USING BTREE |
| 541 | -) ENGINE = InnoDB AUTO_INCREMENT = 1095 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; | |
| 541 | +) ENGINE = InnoDB AUTO_INCREMENT = 1098 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; | |
| 542 | 542 | |
| 543 | 543 | -- ---------------------------- |
| 544 | 544 | -- Records of infra_file |
| ... | ... | @@ -587,7 +587,7 @@ CREATE TABLE `infra_file_content` ( |
| 587 | 587 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 588 | 588 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 589 | 589 | PRIMARY KEY (`id`) USING BTREE |
| 590 | -) ENGINE = InnoDB AUTO_INCREMENT = 188 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; | |
| 590 | +) ENGINE = InnoDB AUTO_INCREMENT = 191 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; | |
| 591 | 591 | |
| 592 | 592 | -- ---------------------------- |
| 593 | 593 | -- Records of infra_file_content |
| ... | ... | @@ -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 | -- ---------------------------- |
| ... | ... | @@ -1003,6 +1072,7 @@ CREATE TABLE `member_user` ( |
| 1003 | 1072 | `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码', |
| 1004 | 1073 | `status` tinyint NOT NULL COMMENT '状态', |
| 1005 | 1074 | `register_ip` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '注册 IP', |
| 1075 | + `register_terminal` tinyint NULL DEFAULT NULL COMMENT '注册终端', | |
| 1006 | 1076 | `login_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '最后登录IP', |
| 1007 | 1077 | `login_date` datetime NULL DEFAULT NULL COMMENT '最后登录时间', |
| 1008 | 1078 | `nickname` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称', |
| ... | ... | @@ -1092,7 +1162,7 @@ CREATE TABLE `system_dict_data` ( |
| 1092 | 1162 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 1093 | 1163 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1094 | 1164 | PRIMARY KEY (`id`) USING BTREE |
| 1095 | -) ENGINE = InnoDB AUTO_INCREMENT = 1386 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; | |
| 1165 | +) ENGINE = InnoDB AUTO_INCREMENT = 1398 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; | |
| 1096 | 1166 | |
| 1097 | 1167 | -- ---------------------------- |
| 1098 | 1168 | -- Records of system_dict_data |
| ... | ... | @@ -1298,7 +1368,7 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st |
| 1298 | 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 (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 | 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 (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 | 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 (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'); | |
| 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 (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 | 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 (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 | 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 (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 | 1374 | 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 +1378,11 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st |
| 1308 | 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 (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 | 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 (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 | 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 (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'); | |
| 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 (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 | 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 (1350, 0, '管理员调整', '0', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); |
| 1313 | 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 (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'); | |
| 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 (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'); | |
| 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 (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 | 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 (1354, 4, '签到奖励', '4', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); |
| 1317 | 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 (1355, 5, '抽奖奖励', '5', 'member_experience_biz_type', 0, '', '', NULL, '', '2023-08-22 12:41:01', '', '2023-08-22 12:41:01', b'0'); |
| 1318 | 1388 | 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 +1418,15 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st |
| 1348 | 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 (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 | 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 (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 | 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 (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'); |
| 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 (1389, 1, '拼团中', '1', 'promotion_combination_record_status', 0, '', '', '', '1', '2023-10-08 07:24:44', '1', '2023-10-08 07:24:44', 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 (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'); | |
| 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 (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'); | |
| 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 (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'); | |
| 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 (1393, 13, '订单积分抵扣(单个退款)', '13', 'member_point_biz_type', 0, '', '', '', '1', '2023-10-11 07:42:29', '1', '2023-10-11 07:42:29', 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 (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'); | |
| 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 (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'); | |
| 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 (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'); | |
| 1429 | +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 | 1430 | COMMIT; |
| 1352 | 1431 | |
| 1353 | 1432 | -- ---------------------------- |
| ... | ... | @@ -1368,7 +1447,7 @@ CREATE TABLE `system_dict_type` ( |
| 1368 | 1447 | `deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间', |
| 1369 | 1448 | PRIMARY KEY (`id`) USING BTREE, |
| 1370 | 1449 | UNIQUE INDEX `dict_type`(`type` ASC) USING BTREE |
| 1371 | -) ENGINE = InnoDB AUTO_INCREMENT = 183 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; | |
| 1450 | +) ENGINE = InnoDB AUTO_INCREMENT = 185 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; | |
| 1372 | 1451 | |
| 1373 | 1452 | -- ---------------------------- |
| 1374 | 1453 | -- Records of system_dict_type |
| ... | ... | @@ -1441,6 +1520,7 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat |
| 1441 | 1520 | 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 | 1521 | 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 | 1522 | 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'); |
| 1523 | +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 | 1524 | COMMIT; |
| 1445 | 1525 | |
| 1446 | 1526 | -- ---------------------------- |
| ... | ... | @@ -1489,7 +1569,7 @@ CREATE TABLE `system_login_log` ( |
| 1489 | 1569 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1490 | 1570 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 1491 | 1571 | PRIMARY KEY (`id`) USING BTREE |
| 1492 | -) ENGINE = InnoDB AUTO_INCREMENT = 2516 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; | |
| 1572 | +) ENGINE = InnoDB AUTO_INCREMENT = 2599 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; | |
| 1493 | 1573 | |
| 1494 | 1574 | -- ---------------------------- |
| 1495 | 1575 | -- Records of system_login_log |
| ... | ... | @@ -1619,7 +1699,7 @@ CREATE TABLE `system_menu` ( |
| 1619 | 1699 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 1620 | 1700 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1621 | 1701 | PRIMARY KEY (`id`) USING BTREE |
| 1622 | -) ENGINE = InnoDB AUTO_INCREMENT = 2366 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表'; | |
| 1702 | +) ENGINE = InnoDB AUTO_INCREMENT = 2389 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表'; | |
| 1623 | 1703 | |
| 1624 | 1704 | -- ---------------------------- |
| 1625 | 1705 | -- Records of system_menu |
| ... | ... | @@ -1871,7 +1951,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 1871 | 1951 | 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 (2021, '规格创建', 'product:property:create', 3, 2, 2019, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:30', b'0'); |
| 1872 | 1952 | 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 (2022, '规格更新', 'product:property:update', 3, 3, 2019, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:33', b'0'); |
| 1873 | 1953 | 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 (2023, '规格删除', 'product:property:delete', 3, 4, 2019, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:37', b'0'); |
| 1874 | -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 (2025, 'Banner管理', '', 2, 100, 2030, 'banner', '', 'mall/market/banner/index', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '1', '2023-08-21 10:27:51', b'0'); | |
| 1954 | +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 (2025, 'Banner管理', '', 2, 100, 2387, 'banner', 'fa:bandcamp', 'mall/market/banner/index', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '1', '2023-10-16 09:41:54', b'0'); | |
| 1875 | 1955 | 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 (2026, 'Banner查询', 'market:banner:query', 3, 1, 2025, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); |
| 1876 | 1956 | 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 (2027, 'Banner创建', 'market:banner:create', 3, 2, 2025, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); |
| 1877 | 1957 | 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 (2028, 'Banner更新', 'market:banner:update', 3, 3, 2025, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); |
| ... | ... | @@ -2037,7 +2117,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 2037 | 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 (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 | 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 (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 | 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 (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'); | |
| 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 (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 | 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 (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 | 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 (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 | 2123 | 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 +2177,22 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 2097 | 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 (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 | 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 (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 | 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 (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'); |
| 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 (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'); | |
| 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 (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'); | |
| 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 (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'); | |
| 2183 | +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'); | |
| 2184 | +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 (2377, '文章分类', '', 2, 0, 2387, 'article/category', 'fa:certificate', 'mall/promotion/article/category/index', 'ArticleCategory', 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '1', '2023-10-16 09:38:26', b'0'); | |
| 2185 | +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 (2378, '分类查询', 'promotion:article-category:query', 3, 1, 2377, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '', '2023-10-16 01:26:18', b'0'); | |
| 2186 | +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 (2379, '分类创建', 'promotion:article-category:create', 3, 2, 2377, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '', '2023-10-16 01:26:18', b'0'); | |
| 2187 | +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 (2380, '分类更新', 'promotion:article-category:update', 3, 3, 2377, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '', '2023-10-16 01:26:18', b'0'); | |
| 2188 | +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 (2381, '分类删除', 'promotion:article-category:delete', 3, 4, 2377, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '', '2023-10-16 01:26:18', b'0'); | |
| 2189 | +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 (2382, '文章列表', '', 2, 2, 2387, 'article', 'ep:connection', 'mall/promotion/article/index', 'Article', 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '1', '2023-10-16 09:41:19', b'0'); | |
| 2190 | +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 (2383, '文章管理查询', 'promotion:article:query', 3, 1, 2382, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '', '2023-10-16 01:26:18', b'0'); | |
| 2191 | +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 (2384, '文章管理创建', 'promotion:article:create', 3, 2, 2382, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '', '2023-10-16 01:26:18', b'0'); | |
| 2192 | +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 (2385, '文章管理更新', 'promotion:article:update', 3, 3, 2382, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '', '2023-10-16 01:26:18', b'0'); | |
| 2193 | +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 (2386, '文章管理删除', 'promotion:article:delete', 3, 4, 2382, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-10-16 01:26:18', '', '2023-10-16 01:26:18', b'0'); | |
| 2194 | +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 (2387, '内容管理', '', 1, 1, 2030, 'content', 'ep:collection', '', '', 0, b'1', b'1', b'1', '1', '2023-10-16 09:37:31', '1', '2023-10-16 09:37:31', b'0'); | |
| 2195 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2388, '商城首页', '', 2, 1, 2362, 'home', 'ep:home-filled', 'mall/home/index', 'MallHome', 0, b'1', b'1', b'1', '', '2023-10-16 12:10:33', '', '2023-10-16 12:10:33', b'0'); | |
| 2100 | 2196 | COMMIT; |
| 2101 | 2197 | |
| 2102 | 2198 | -- ---------------------------- |
| ... | ... | @@ -2215,7 +2311,7 @@ CREATE TABLE `system_oauth2_access_token` ( |
| 2215 | 2311 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2216 | 2312 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2217 | 2313 | PRIMARY KEY (`id`) USING BTREE |
| 2218 | -) ENGINE = InnoDB AUTO_INCREMENT = 2880 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; | |
| 2314 | +) ENGINE = InnoDB AUTO_INCREMENT = 3063 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; | |
| 2219 | 2315 | |
| 2220 | 2316 | -- ---------------------------- |
| 2221 | 2317 | -- Records of system_oauth2_access_token |
| ... | ... | @@ -2337,7 +2433,7 @@ CREATE TABLE `system_oauth2_refresh_token` ( |
| 2337 | 2433 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2338 | 2434 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2339 | 2435 | PRIMARY KEY (`id`) USING BTREE |
| 2340 | -) ENGINE = InnoDB AUTO_INCREMENT = 1014 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌'; | |
| 2436 | +) ENGINE = InnoDB AUTO_INCREMENT = 1070 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌'; | |
| 2341 | 2437 | |
| 2342 | 2438 | -- ---------------------------- |
| 2343 | 2439 | -- Records of system_oauth2_refresh_token |
| ... | ... | @@ -2377,7 +2473,7 @@ CREATE TABLE `system_operate_log` ( |
| 2377 | 2473 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2378 | 2474 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2379 | 2475 | PRIMARY KEY (`id`) USING BTREE |
| 2380 | -) ENGINE = InnoDB AUTO_INCREMENT = 8643 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; | |
| 2476 | +) ENGINE = InnoDB AUTO_INCREMENT = 8738 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; | |
| 2381 | 2477 | |
| 2382 | 2478 | -- ---------------------------- |
| 2383 | 2479 | -- Records of system_operate_log |
| ... | ... | @@ -3385,7 +3481,7 @@ CREATE TABLE `system_sms_code` ( |
| 3385 | 3481 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 3386 | 3482 | PRIMARY KEY (`id`) USING BTREE, |
| 3387 | 3483 | INDEX `idx_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号' |
| 3388 | -) ENGINE = InnoDB AUTO_INCREMENT = 515 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码'; | |
| 3484 | +) ENGINE = InnoDB AUTO_INCREMENT = 531 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码'; | |
| 3389 | 3485 | |
| 3390 | 3486 | -- ---------------------------- |
| 3391 | 3487 | -- Records of system_sms_code |
| ... | ... | @@ -3428,7 +3524,7 @@ CREATE TABLE `system_sms_log` ( |
| 3428 | 3524 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 3429 | 3525 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 3430 | 3526 | PRIMARY KEY (`id`) USING BTREE |
| 3431 | -) ENGINE = InnoDB AUTO_INCREMENT = 426 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志'; | |
| 3527 | +) ENGINE = InnoDB AUTO_INCREMENT = 445 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志'; | |
| 3432 | 3528 | |
| 3433 | 3529 | -- ---------------------------- |
| 3434 | 3530 | -- Records of system_sms_log |
| ... | ... | @@ -3479,6 +3575,33 @@ INSERT INTO `system_sms_template` (`id`, `type`, `status`, `code`, `name`, `cont |
| 3479 | 3575 | COMMIT; |
| 3480 | 3576 | |
| 3481 | 3577 | -- ---------------------------- |
| 3578 | +-- Table structure for system_social_client | |
| 3579 | +-- ---------------------------- | |
| 3580 | +DROP TABLE IF EXISTS `system_social_client`; | |
| 3581 | +CREATE TABLE `system_social_client` ( | |
| 3582 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', | |
| 3583 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '应用名', | |
| 3584 | + `social_type` tinyint NOT NULL COMMENT '社交平台的类型', | |
| 3585 | + `user_type` tinyint NOT NULL COMMENT '用户类型', | |
| 3586 | + `client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端编号', | |
| 3587 | + `client_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端密钥', | |
| 3588 | + `status` tinyint NOT NULL COMMENT '状态', | |
| 3589 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | |
| 3590 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 3591 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | |
| 3592 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 3593 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 3594 | + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', | |
| 3595 | + PRIMARY KEY (`id`) USING BTREE | |
| 3596 | +) ENGINE = InnoDB AUTO_INCREMENT = 43 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交客户端表'; | |
| 3597 | + | |
| 3598 | +-- ---------------------------- | |
| 3599 | +-- Records of system_social_client | |
| 3600 | +-- ---------------------------- | |
| 3601 | +BEGIN; | |
| 3602 | +COMMIT; | |
| 3603 | + | |
| 3604 | +-- ---------------------------- | |
| 3482 | 3605 | -- Table structure for system_social_user |
| 3483 | 3606 | -- ---------------------------- |
| 3484 | 3607 | DROP TABLE IF EXISTS `system_social_user`; |
| ... | ... | @@ -3500,7 +3623,7 @@ CREATE TABLE `system_social_user` ( |
| 3500 | 3623 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 3501 | 3624 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 3502 | 3625 | PRIMARY KEY (`id`) USING BTREE |
| 3503 | -) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交用户表'; | |
| 3626 | +) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交用户表'; | |
| 3504 | 3627 | |
| 3505 | 3628 | -- ---------------------------- |
| 3506 | 3629 | -- Records of system_social_user |
| ... | ... | @@ -3525,7 +3648,7 @@ CREATE TABLE `system_social_user_bind` ( |
| 3525 | 3648 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 3526 | 3649 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 3527 | 3650 | PRIMARY KEY (`id`) USING BTREE |
| 3528 | -) ENGINE = InnoDB AUTO_INCREMENT = 77 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交绑定表'; | |
| 3651 | +) ENGINE = InnoDB AUTO_INCREMENT = 79 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交绑定表'; | |
| 3529 | 3652 | |
| 3530 | 3653 | -- ---------------------------- |
| 3531 | 3654 | -- Records of system_social_user_bind |
| ... | ... | @@ -3701,7 +3824,7 @@ CREATE TABLE `system_users` ( |
| 3701 | 3824 | -- Records of system_users |
| 3702 | 3825 | -- ---------------------------- |
| 3703 | 3826 | 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); | |
| 3827 | +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-18 22:31:35', 'admin', '2021-01-05 17:03:47', NULL, '2023-10-18 22:31:35', b'0', 1); | |
| 3705 | 3828 | 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 | 3829 | 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 | 3830 | 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); |
| ... | ... | @@ -3709,7 +3832,7 @@ INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, |
| 3709 | 3832 | 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 (108, 'admin108', '$2a$10$y6mfvKoNYL1GXWak8nYwVOH.kCWqjactkzdoIDgiKl93WN3Ejg.Lu', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '', NULL, '1', '2022-02-20 23:00:50', '1', '2022-02-27 08:26:53', b'0', 119); |
| 3710 | 3833 | 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 (109, 'admin109', '$2a$10$JAqvH0tEc0I7dfDVBI7zyuB4E3j.uH6daIjV53.vUS6PknFkDJkuK', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '', NULL, '1', '2022-02-20 23:11:50', '1', '2022-02-27 08:26:56', b'0', 120); |
| 3711 | 3834 | 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 (110, 'admin110', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '小王', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '127.0.0.1', '2022-09-25 22:47:33', '1', '2022-02-22 00:56:14', NULL, '2022-09-25 22:47:33', b'0', 121); |
| 3712 | -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 (111, 'test', '$2a$10$mExveopHUx9Q4QiLtAzhDeH3n4/QlNLzEsM4AqgxKrU.ciUZDXZCy', '测试用户', NULL, NULL, '[]', '', '', 0, '', 0, '', NULL, '110', '2022-02-23 13:14:33', '110', '2022-02-23 13:14:33', b'0', 121); | |
| 3835 | +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 (111, 'test', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '测试用户', NULL, NULL, '[]', '', '', 0, '', 0, '0:0:0:0:0:0:0:1', '2023-10-18 23:31:51', '110', '2022-02-23 13:14:33', NULL, '2023-10-18 23:31:51', b'0', 121); | |
| 3713 | 3836 | 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 (112, 'newobject', '$2a$10$3alwklxqfq8/hKoW6oUV0OJp0IdQpBDauLy4633SpUjrRsStl6kMa', '新对象', NULL, 100, '[]', '', '', 1, '', 0, '0:0:0:0:0:0:0:1', '2023-02-10 13:48:13', '1', '2022-02-23 19:08:03', NULL, '2023-02-10 13:48:13', b'0', 1); |
| 3714 | 3837 | INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (113, 'aoteman', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道', NULL, NULL, NULL, '', '15601691300', 0, '', 0, '127.0.0.1', '2022-03-19 18:38:51', '1', '2022-03-07 21:37:58', NULL, '2022-03-19 18:38:51', b'0', 122); |
| 3715 | 3838 | 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 (114, 'hrmgr', '$2a$10$TR4eybBioGRhBmDBWkqWLO6NIh3mzYa8KBKDDB5woiGYFVlRAi.fu', 'hr 小姐姐', NULL, NULL, '[3]', '', '', 0, '', 0, '127.0.0.1', '2022-03-19 22:15:43', '1', '2022-03-19 21:50:58', NULL, '2022-03-19 22:15:43', b'0', 1); | ... | ... |
sql/mysql/statistics.sql deleted
| 1 | --- 交易统计表 | |
| 2 | -CREATE TABLE trade_statistics | |
| 3 | -( | |
| 4 | - id bigint AUTO_INCREMENT COMMENT '编号,主键自增' | |
| 5 | - PRIMARY KEY, | |
| 6 | - time datetime NOT NULL COMMENT '统计日期', | |
| 7 | - order_create_count int DEFAULT 0 NOT NULL COMMENT '创建订单数', | |
| 8 | - order_pay_count int DEFAULT 0 NOT NULL COMMENT '支付订单商品数', | |
| 9 | - order_pay_price int DEFAULT 0 NOT NULL COMMENT '总支付金额,单位:分', | |
| 10 | - order_wallet_pay_price int DEFAULT 0 NOT NULL COMMENT '总支付金额(余额),单位:分', | |
| 11 | - after_sale_count int DEFAULT 0 NOT NULL COMMENT '退款订单数', | |
| 12 | - after_sale_refund_price int DEFAULT 0 NOT NULL COMMENT '总退款金额,单位:分', | |
| 13 | - brokerage_settlement_price int DEFAULT 0 NOT NULL COMMENT '佣金金额(已结算),单位:分', | |
| 14 | - recharge_pay_count int DEFAULT 0 NOT NULL COMMENT '充值订单数', | |
| 15 | - recharge_pay_price int DEFAULT 0 NOT NULL COMMENT '充值金额,单位:分', | |
| 16 | - recharge_refund_count int DEFAULT 0 NOT NULL COMMENT '充值退款订单数', | |
| 17 | - recharge_refund_price int DEFAULT 0 NOT NULL COMMENT '充值退款金额,单位:分', | |
| 18 | - creator varchar(64) DEFAULT '' NULL COMMENT '创建者', | |
| 19 | - create_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间', | |
| 20 | - updater varchar(64) DEFAULT '' NULL COMMENT '更新者', | |
| 21 | - update_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 22 | - deleted bit DEFAULT b'0' NOT NULL COMMENT '是否删除', | |
| 23 | - tenant_id bigint DEFAULT 0 NOT NULL COMMENT '租户编号' | |
| 24 | -) | |
| 25 | - COMMENT '交易统计表'; | |
| 26 | - | |
| 27 | -CREATE INDEX trade_statistics_time_index | |
| 28 | - ON trade_statistics (time); | |
| 29 | - | |
| 30 | --- 菜单 | |
| 31 | -INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, component_name) | |
| 32 | -VALUES ('统计管理', '', 1, 4, 0, '/statistics', 'ep:data-line', '', ''); | |
| 33 | -SELECT @parentId := LAST_INSERT_ID(); | |
| 34 | --- 交易统计 | |
| 35 | -INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, component_name) | |
| 36 | -VALUES ('交易统计', '', 2, 1, @parentId, 'trade', 'fa-solid:credit-card', 'statistics/trade/index', 'TradeStatistics'); | |
| 37 | -SELECT @parentId := LAST_INSERT_ID(); | |
| 38 | -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) | |
| 39 | -VALUES ('交易统计查询', 'statistics:trade:query', 3, 1, @parentId, '', '', '', 0); | |
| 40 | -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) | |
| 41 | -VALUES ('交易统计导出', 'statistics:trade:export', 3, 2, @parentId, '', '', '', 0); | |
| 42 | --- 会员统计 | |
| 43 | -INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, component_name) | |
| 44 | -VALUES ('会员统计', '', 2, 2, @parentId, 'member', 'ep:avatar', 'statistics/member/index', 'MemberStatistics'); | |
| 45 | -SELECT @parentId := LAST_INSERT_ID(); | |
| 46 | -INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) | |
| 47 | -VALUES ('会员统计查询', 'statistics:member:query', 3, 1, @parentId, '', '', '', 0); | |
| 48 | - | |
| 49 | - |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TerminalEnum.java
| ... | ... | @@ -18,8 +18,7 @@ public enum TerminalEnum implements IntArrayValuable { |
| 18 | 18 | WECHAT_MINI_PROGRAM(10, "微信小程序"), |
| 19 | 19 | WECHAT_WAP(11, "微信公众号"), |
| 20 | 20 | H5(20, "H5 网页"), |
| 21 | - IOS(31, "苹果 App"), | |
| 22 | - ANDROID(32, "安卓 App"), | |
| 21 | + APP(31, "手机 App"), | |
| 23 | 22 | ; |
| 24 | 23 | |
| 25 | 24 | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray(); | ... | ... |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/servlet/ServletUtils.java
| ... | ... | @@ -27,7 +27,7 @@ public class ServletUtils { |
| 27 | 27 | * 返回 JSON 字符串 |
| 28 | 28 | * |
| 29 | 29 | * @param response 响应 |
| 30 | - * @param object 对象,会序列化成 JSON 字符串 | |
| 30 | + * @param object 对象,会序列化成 JSON 字符串 | |
| 31 | 31 | */ |
| 32 | 32 | @SuppressWarnings("deprecation") // 必须使用 APPLICATION_JSON_UTF8_VALUE,否则会乱码 |
| 33 | 33 | public static void writeJSON(HttpServletResponse response, Object object) { |
| ... | ... | @@ -40,7 +40,7 @@ public class ServletUtils { |
| 40 | 40 | * |
| 41 | 41 | * @param response 响应 |
| 42 | 42 | * @param filename 文件名 |
| 43 | - * @param content 附件内容 | |
| 43 | + * @param content 附件内容 | |
| 44 | 44 | */ |
| 45 | 45 | public static void writeAttachment(HttpServletResponse response, String filename, byte[] content) throws IOException { |
| 46 | 46 | // 设置 header 和 contentType |
| ... | ... | @@ -88,6 +88,8 @@ public class ServletUtils { |
| 88 | 88 | return ServletUtil.getClientIP(request); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | + // TODO @疯狂:terminal 还是从 ServletUtils 里拿,更容易全局治理; | |
| 92 | + | |
| 91 | 93 | public static boolean isJsonRequest(ServletRequest request) { |
| 92 | 94 | return StrUtil.startWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE); |
| 93 | 95 | } |
| ... | ... | @@ -107,4 +109,5 @@ public class ServletUtils { |
| 107 | 109 | public static Map<String, String> getParamMap(HttpServletRequest request) { |
| 108 | 110 | return ServletUtil.getParamMap(request); |
| 109 | 111 | } |
| 112 | + | |
| 110 | 113 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java
| ... | ... | @@ -132,25 +132,31 @@ public class AreaUtils { |
| 132 | 132 | return convertList(areas.values(), func, area -> type.getType().equals(area.getType())); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - // TODO @疯狂:注释写下; | |
| 135 | + /** | |
| 136 | + * 根据区域编号、上级区域类型,获取上级区域编号 | |
| 137 | + * | |
| 138 | + * @param id 区域编号 | |
| 139 | + * @param type 区域类型 | |
| 140 | + * @return 上级区域编号 | |
| 141 | + */ | |
| 136 | 142 | public static Integer getParentIdByType(Integer id, @NonNull AreaTypeEnum type) { |
| 137 | - // TODO @疯狂:这种不要用 while true;因为万一脏数据,可能会死循环;可以转换成 for (int i = 0; i < Byte.MAX; i++) 一般是优先层级; | |
| 138 | - do { | |
| 143 | + for (int i = 0; i < Byte.MAX_VALUE; i++) { | |
| 139 | 144 | Area area = AreaUtils.getArea(id); |
| 140 | 145 | if (area == null) { |
| 141 | 146 | return null; |
| 142 | 147 | } |
| 143 | - | |
| 148 | + // 情况一:匹配到,返回它 | |
| 144 | 149 | if (type.getType().equals(area.getType())) { |
| 145 | 150 | return area.getId(); |
| 146 | 151 | } |
| 147 | - | |
| 152 | + // 情况二:找到根节点,返回空 | |
| 148 | 153 | if (area.getParent() == null || area.getParent().getId() == null) { |
| 149 | 154 | return null; |
| 150 | 155 | } |
| 151 | - | |
| 156 | + // 其它:继续向上查找 | |
| 152 | 157 | id = area.getParent().getId(); |
| 153 | - } while (true); | |
| 158 | + } | |
| 159 | + return null; | |
| 154 | 160 | } |
| 155 | 161 | |
| 156 | 162 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/transfer/PayTransferUnifiedReqDTO.java
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImpl.java
| ... | ... | @@ -50,8 +50,6 @@ public class PayClientFactoryImpl implements PayClientFactory { |
| 50 | 50 | clientClass.put(ALIPAY_APP, AlipayAppPayClient.class); |
| 51 | 51 | clientClass.put(ALIPAY_PC, AlipayPcPayClient.class); |
| 52 | 52 | clientClass.put(ALIPAY_BAR, AlipayBarPayClient.class); |
| 53 | - // 支付包转账客户端 | |
| 54 | - clientClass.put(ALIPAY_TRANSFER, AlipayTransferClient.class); | |
| 55 | 53 | // Mock 支付客户端 |
| 56 | 54 | clientClass.put(MOCK, MockPayClient.class); |
| 57 | 55 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayPayClient.java
| ... | ... | @@ -6,24 +6,28 @@ import cn.hutool.core.lang.Assert; |
| 6 | 6 | import cn.hutool.core.map.MapUtil; |
| 7 | 7 | import cn.hutool.core.util.StrUtil; |
| 8 | 8 | import cn.hutool.http.HttpUtil; |
| 9 | +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | |
| 9 | 10 | import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; |
| 10 | 11 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; |
| 11 | 12 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| 12 | 13 | import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundRespDTO; |
| 13 | 14 | import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO; |
| 15 | +import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; | |
| 16 | +import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; | |
| 14 | 17 | import cn.iocoder.yudao.framework.pay.core.client.impl.AbstractPayClient; |
| 15 | 18 | import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderStatusRespEnum; |
| 19 | +import cn.iocoder.yudao.framework.pay.core.enums.transfer.PayTransferTypeEnum; | |
| 16 | 20 | import com.alipay.api.AlipayApiException; |
| 17 | 21 | import com.alipay.api.AlipayConfig; |
| 18 | 22 | import com.alipay.api.AlipayResponse; |
| 19 | 23 | import com.alipay.api.DefaultAlipayClient; |
| 20 | -import com.alipay.api.domain.AlipayTradeFastpayRefundQueryModel; | |
| 21 | -import com.alipay.api.domain.AlipayTradeQueryModel; | |
| 22 | -import com.alipay.api.domain.AlipayTradeRefundModel; | |
| 24 | +import com.alipay.api.domain.*; | |
| 23 | 25 | import com.alipay.api.internal.util.AlipaySignature; |
| 26 | +import com.alipay.api.request.AlipayFundTransUniTransferRequest; | |
| 24 | 27 | import com.alipay.api.request.AlipayTradeFastpayRefundQueryRequest; |
| 25 | 28 | import com.alipay.api.request.AlipayTradeQueryRequest; |
| 26 | 29 | import com.alipay.api.request.AlipayTradeRefundRequest; |
| 30 | +import com.alipay.api.response.AlipayFundTransUniTransferResponse; | |
| 27 | 31 | import com.alipay.api.response.AlipayTradeFastpayRefundQueryResponse; |
| 28 | 32 | import com.alipay.api.response.AlipayTradeQueryResponse; |
| 29 | 33 | import com.alipay.api.response.AlipayTradeRefundResponse; |
| ... | ... | @@ -39,6 +43,9 @@ import java.util.Objects; |
| 39 | 43 | import java.util.function.Supplier; |
| 40 | 44 | |
| 41 | 45 | import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMATTER; |
| 46 | +import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; | |
| 47 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; | |
| 48 | +import static cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig.MODE_CERTIFICATE; | |
| 42 | 49 | |
| 43 | 50 | /** |
| 44 | 51 | * 支付宝抽象类,实现支付宝统一的接口、以及部分实现(退款) |
| ... | ... | @@ -105,16 +112,20 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa |
| 105 | 112 | // 1.2 构建 AlipayTradeQueryRequest 请求 |
| 106 | 113 | AlipayTradeQueryRequest request = new AlipayTradeQueryRequest(); |
| 107 | 114 | request.setBizModel(model); |
| 108 | - | |
| 109 | - // 2.1 执行请求 | |
| 110 | - AlipayTradeQueryResponse response = client.execute(request); | |
| 115 | + AlipayTradeQueryResponse response; | |
| 116 | + if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) { | |
| 117 | + // 证书模式 | |
| 118 | + response = client.certificateExecute(request); | |
| 119 | + } else { | |
| 120 | + response = client.execute(request); | |
| 121 | + } | |
| 111 | 122 | if (!response.isSuccess()) { // 不成功,例如说订单不存在 |
| 112 | 123 | return PayOrderRespDTO.closedOf(response.getSubCode(), response.getSubMsg(), |
| 113 | 124 | outTradeNo, response); |
| 114 | 125 | } |
| 115 | 126 | // 2.2 解析订单的状态 |
| 116 | 127 | Integer status = parseStatus(response.getTradeStatus()); |
| 117 | - Assert.notNull(status, (Supplier<Throwable>) () -> { | |
| 128 | + Assert.notNull(status, () -> { | |
| 118 | 129 | throw new IllegalArgumentException(StrUtil.format("body({}) 的 trade_status 不正确", response.getBody())); |
| 119 | 130 | }); |
| 120 | 131 | return PayOrderRespDTO.of(status, response.getTradeNo(), response.getBuyerUserId(), LocalDateTimeUtil.of(response.getSendPayDate()), |
| ... | ... | @@ -148,7 +159,12 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa |
| 148 | 159 | request.setBizModel(model); |
| 149 | 160 | |
| 150 | 161 | // 2.1 执行请求 |
| 151 | - AlipayTradeRefundResponse response = client.execute(request); | |
| 162 | + AlipayTradeRefundResponse response; | |
| 163 | + if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) { // 证书模式 | |
| 164 | + response = client.certificateExecute(request); | |
| 165 | + } else { | |
| 166 | + response = client.execute(request); | |
| 167 | + } | |
| 152 | 168 | if (!response.isSuccess()) { |
| 153 | 169 | // 当出现 ACQ.SYSTEM_ERROR, 退款可能成功也可能失败。 返回 WAIT 状态. 后续 job 会轮询 |
| 154 | 170 | if (ObjectUtils.equalsAny(response.getSubCode(), "ACQ.SYSTEM_ERROR", "SYSTEM_ERROR")) { |
| ... | ... | @@ -185,7 +201,12 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa |
| 185 | 201 | request.setBizModel(model); |
| 186 | 202 | |
| 187 | 203 | // 2.1 执行请求 |
| 188 | - AlipayTradeFastpayRefundQueryResponse response = client.execute(request); | |
| 204 | + AlipayTradeFastpayRefundQueryResponse response; | |
| 205 | + if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) { // 证书模式 | |
| 206 | + response = client.certificateExecute(request); | |
| 207 | + } else { | |
| 208 | + response = client.execute(request); | |
| 209 | + } | |
| 189 | 210 | if (!response.isSuccess()) { |
| 190 | 211 | // 明确不存在的情况,应该就是失败,可进行关闭 |
| 191 | 212 | if (ObjectUtils.equalsAny(response.getSubCode(), "TRADE_NOT_EXIST", "ACQ.TRADE_NOT_EXIST")) { |
| ... | ... | @@ -202,7 +223,69 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa |
| 202 | 223 | return PayRefundRespDTO.waitingOf(null, outRefundNo, response); |
| 203 | 224 | } |
| 204 | 225 | |
| 226 | + @Override | |
| 227 | + protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) throws AlipayApiException { | |
| 228 | + // 1.1 校验公钥类型 必须使用公钥证书模式 | |
| 229 | + if (!Objects.equals(config.getMode(), MODE_CERTIFICATE)) { | |
| 230 | + throw new IllegalStateException("支付宝单笔转账必须使用公钥证书模式"); | |
| 231 | + } | |
| 205 | 232 | |
| 233 | + // 1.2 构建 AlipayFundTransUniTransferModel | |
| 234 | + AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel(); | |
| 235 | + // ① 通用的参数 | |
| 236 | + model.setTransAmount(formatAmount(reqDTO.getPrice())); // 转账金额 | |
| 237 | + model.setOrderTitle(reqDTO.getTitle()); // 转账业务的标题,用于在支付宝用户的账单里显示。 | |
| 238 | + model.setOutBizNo(reqDTO.getOutTransferNo()); | |
| 239 | + model.setProductCode("TRANS_ACCOUNT_NO_PWD"); // 销售产品码。单笔无密转账固定为 TRANS_ACCOUNT_NO_PWD | |
| 240 | + model.setBizScene("DIRECT_TRANSFER"); // 业务场景 单笔无密转账固定为 DIRECT_TRANSFER | |
| 241 | + model.setBusinessParams(JsonUtils.toJsonString(reqDTO.getChannelExtras())); | |
| 242 | + PayTransferTypeEnum transferType = PayTransferTypeEnum.typeOf(reqDTO.getType()); | |
| 243 | + switch (transferType) { | |
| 244 | + // TODO @jason:是不是不用传递 transferType 参数哈?因为应该已经明确是支付宝啦? | |
| 245 | + // @芋艿。 是不是还要考虑转账到银行卡。所以传 transferType 但是转账到银行卡不知道要如何测试?? | |
| 246 | + case ALIPAY_BALANCE: { | |
| 247 | + // ② 个性化的参数 | |
| 248 | + Participant payeeInfo = new Participant(); | |
| 249 | + payeeInfo.setIdentityType("ALIPAY_LOGON_ID"); | |
| 250 | + String logonId = MapUtil.getStr(reqDTO.getPayeeInfo(), "ALIPAY_LOGON_ID"); | |
| 251 | + if (StrUtil.isEmpty(logonId)) { | |
| 252 | + throw exception0(BAD_REQUEST.getCode(), "支付包登录 ID 不能为空"); | |
| 253 | + } | |
| 254 | + String accountName = MapUtil.getStr(reqDTO.getPayeeInfo(), "ALIPAY_ACCOUNT_NAME"); | |
| 255 | + if (StrUtil.isEmpty(accountName)) { | |
| 256 | + throw exception0(BAD_REQUEST.getCode(), "支付包账户名称不能为空"); | |
| 257 | + } | |
| 258 | + payeeInfo.setIdentity(logonId); // 支付宝登录号 | |
| 259 | + payeeInfo.setName(accountName); // 支付宝账号姓名 | |
| 260 | + model.setPayeeInfo(payeeInfo); | |
| 261 | + // 1.3 构建 AlipayFundTransUniTransferRequest | |
| 262 | + AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest(); | |
| 263 | + request.setBizModel(model); | |
| 264 | + // 执行请求 | |
| 265 | + AlipayFundTransUniTransferResponse response = client.certificateExecute(request); | |
| 266 | + // 处理结果 | |
| 267 | + if (!response.isSuccess()) { | |
| 268 | + // 当出现 SYSTEM_ERROR, 转账可能成功也可能失败。 返回 WAIT 状态. 后续 job 会轮询 | |
| 269 | + if (ObjectUtils.equalsAny(response.getSubCode(), "SYSTEM_ERROR", "ACQ.SYSTEM_ERROR")) { | |
| 270 | + return PayTransferRespDTO.waitingOf(null, reqDTO.getOutTransferNo(), response); | |
| 271 | + } | |
| 272 | + return PayTransferRespDTO.closedOf(response.getSubCode(), response.getSubMsg(), | |
| 273 | + reqDTO.getOutTransferNo(), response); | |
| 274 | + } | |
| 275 | + return PayTransferRespDTO.successOf(response.getOrderId(), parseTime(response.getTransDate()), | |
| 276 | + response.getOutBizNo(), response); | |
| 277 | + } | |
| 278 | + case BANK_CARD: { | |
| 279 | + Participant payeeInfo = new Participant(); | |
| 280 | + payeeInfo.setIdentityType("BANKCARD_ACCOUNT"); | |
| 281 | + // TODO 待实现 | |
| 282 | + throw new UnsupportedOperationException("待实现"); | |
| 283 | + } | |
| 284 | + default: { | |
| 285 | + throw new IllegalStateException("不正确的转账类型: " + transferType); | |
| 286 | + } | |
| 287 | + } | |
| 288 | + } | |
| 206 | 289 | |
| 207 | 290 | // ========== 各种工具方法 ========== |
| 208 | 291 | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayAppPayClient.java
| ... | ... | @@ -2,8 +2,6 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; |
| 4 | 4 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| 5 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; | |
| 6 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; | |
| 7 | 5 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; |
| 8 | 6 | import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum; |
| 9 | 7 | import com.alipay.api.AlipayApiException; |
| ... | ... | @@ -58,9 +56,4 @@ public class AlipayAppPayClient extends AbstractAlipayPayClient { |
| 58 | 56 | return PayOrderRespDTO.waitingOf(displayMode, response.getBody(), |
| 59 | 57 | reqDTO.getOutTradeNo(), response); |
| 60 | 58 | } |
| 61 | - | |
| 62 | - @Override | |
| 63 | - protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) { | |
| 64 | - throw new UnsupportedOperationException("支付宝【App 支付】不支持转账操作"); | |
| 65 | - } | |
| 66 | 59 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayBarPayClient.java
| ... | ... | @@ -5,8 +5,6 @@ import cn.hutool.core.map.MapUtil; |
| 5 | 5 | import cn.hutool.core.util.StrUtil; |
| 6 | 6 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; |
| 7 | 7 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| 8 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; | |
| 9 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; | |
| 10 | 8 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; |
| 11 | 9 | import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum; |
| 12 | 10 | import com.alipay.api.AlipayApiException; |
| ... | ... | @@ -16,9 +14,11 @@ import com.alipay.api.response.AlipayTradePayResponse; |
| 16 | 14 | import lombok.extern.slf4j.Slf4j; |
| 17 | 15 | |
| 18 | 16 | import java.time.LocalDateTime; |
| 17 | +import java.util.Objects; | |
| 19 | 18 | |
| 20 | 19 | import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; |
| 21 | 20 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; |
| 21 | +import static cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig.MODE_CERTIFICATE; | |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * 支付宝【条码支付】的 PayClient 实现类 |
| ... | ... | @@ -61,7 +61,13 @@ public class AlipayBarPayClient extends AbstractAlipayPayClient { |
| 61 | 61 | request.setReturnUrl(reqDTO.getReturnUrl()); |
| 62 | 62 | |
| 63 | 63 | // 2.1 执行请求 |
| 64 | - AlipayTradePayResponse response = client.execute(request); | |
| 64 | + AlipayTradePayResponse response; | |
| 65 | + if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) { | |
| 66 | + // 证书模式 | |
| 67 | + response = client.certificateExecute(request); | |
| 68 | + } else { | |
| 69 | + response = client.execute(request); | |
| 70 | + } | |
| 65 | 71 | // 2.2 处理结果 |
| 66 | 72 | if (!response.isSuccess()) { |
| 67 | 73 | return buildClosedPayOrderRespDTO(reqDTO, response); |
| ... | ... | @@ -76,9 +82,4 @@ public class AlipayBarPayClient extends AbstractAlipayPayClient { |
| 76 | 82 | return PayOrderRespDTO.waitingOf(displayMode, "", |
| 77 | 83 | reqDTO.getOutTradeNo(), response); |
| 78 | 84 | } |
| 79 | - | |
| 80 | - @Override | |
| 81 | - protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) { | |
| 82 | - throw new UnsupportedOperationException("支付宝【条码支付】不支持转账操作"); | |
| 83 | - } | |
| 84 | 85 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPcPayClient.java
| ... | ... | @@ -4,8 +4,6 @@ import cn.hutool.core.util.ObjectUtil; |
| 4 | 4 | import cn.hutool.http.Method; |
| 5 | 5 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; |
| 6 | 6 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| 7 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; | |
| 8 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; | |
| 9 | 7 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; |
| 10 | 8 | import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum; |
| 11 | 9 | import com.alipay.api.AlipayApiException; |
| ... | ... | @@ -68,9 +66,4 @@ public class AlipayPcPayClient extends AbstractAlipayPayClient { |
| 68 | 66 | return PayOrderRespDTO.waitingOf(displayMode, response.getBody(), |
| 69 | 67 | reqDTO.getOutTradeNo(), response); |
| 70 | 68 | } |
| 71 | - | |
| 72 | - @Override | |
| 73 | - protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) { | |
| 74 | - throw new UnsupportedOperationException("支付宝【PC 网站】不支持转账操作"); | |
| 75 | - } | |
| 76 | 69 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayQrPayClient.java
| ... | ... | @@ -2,8 +2,6 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; |
| 4 | 4 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| 5 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; | |
| 6 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; | |
| 7 | 5 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; |
| 8 | 6 | import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum; |
| 9 | 7 | import com.alipay.api.AlipayApiException; |
| ... | ... | @@ -12,6 +10,10 @@ import com.alipay.api.request.AlipayTradePrecreateRequest; |
| 12 | 10 | import com.alipay.api.response.AlipayTradePrecreateResponse; |
| 13 | 11 | import lombok.extern.slf4j.Slf4j; |
| 14 | 12 | |
| 13 | +import java.util.Objects; | |
| 14 | + | |
| 15 | +import static cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig.MODE_CERTIFICATE; | |
| 16 | + | |
| 15 | 17 | /** |
| 16 | 18 | * 支付宝【扫码支付】的 PayClient 实现类 |
| 17 | 19 | * |
| ... | ... | @@ -47,7 +49,13 @@ public class AlipayQrPayClient extends AbstractAlipayPayClient { |
| 47 | 49 | request.setReturnUrl(reqDTO.getReturnUrl()); |
| 48 | 50 | |
| 49 | 51 | // 2.1 执行请求 |
| 50 | - AlipayTradePrecreateResponse response = client.execute(request); | |
| 52 | + AlipayTradePrecreateResponse response; | |
| 53 | + if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) { | |
| 54 | + // 证书模式 | |
| 55 | + response = client.certificateExecute(request); | |
| 56 | + } else { | |
| 57 | + response = client.execute(request); | |
| 58 | + } | |
| 51 | 59 | // 2.2 处理结果 |
| 52 | 60 | if (!response.isSuccess()) { |
| 53 | 61 | return buildClosedPayOrderRespDTO(reqDTO, response); |
| ... | ... | @@ -55,9 +63,4 @@ public class AlipayQrPayClient extends AbstractAlipayPayClient { |
| 55 | 63 | return PayOrderRespDTO.waitingOf(displayMode, response.getQrCode(), |
| 56 | 64 | reqDTO.getOutTradeNo(), response); |
| 57 | 65 | } |
| 58 | - | |
| 59 | - @Override | |
| 60 | - protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) { | |
| 61 | - throw new UnsupportedOperationException("支付宝【扫码支付】不支持转账操作"); | |
| 62 | - } | |
| 63 | 66 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayTransferClient.java deleted
| 1 | -package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; | |
| 2 | - | |
| 3 | -import cn.hutool.core.map.MapUtil; | |
| 4 | -import cn.hutool.core.util.StrUtil; | |
| 5 | -import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | |
| 6 | -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; | |
| 7 | -import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; | |
| 8 | -import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; | |
| 9 | -import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundRespDTO; | |
| 10 | -import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO; | |
| 11 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; | |
| 12 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; | |
| 13 | -import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; | |
| 14 | -import cn.iocoder.yudao.framework.pay.core.enums.transfer.PayTransferTypeEnum; | |
| 15 | -import com.alipay.api.AlipayApiException; | |
| 16 | -import com.alipay.api.domain.AlipayFundTransUniTransferModel; | |
| 17 | -import com.alipay.api.domain.Participant; | |
| 18 | -import com.alipay.api.request.AlipayFundTransUniTransferRequest; | |
| 19 | -import com.alipay.api.response.AlipayFundTransUniTransferResponse; | |
| 20 | -import lombok.extern.slf4j.Slf4j; | |
| 21 | - | |
| 22 | -import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; | |
| 23 | -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; | |
| 24 | - | |
| 25 | -/** | |
| 26 | - * 支付宝转账的 PayClient 实现类 | |
| 27 | - * | |
| 28 | - * @author jason | |
| 29 | - */ | |
| 30 | -@Slf4j | |
| 31 | -public class AlipayTransferClient extends AbstractAlipayPayClient { | |
| 32 | - public AlipayTransferClient(Long channelId, AlipayPayClientConfig config) { | |
| 33 | - super(channelId, PayChannelEnum.ALIPAY_TRANSFER.getCode(), config); | |
| 34 | - } | |
| 35 | - @Override | |
| 36 | - protected PayOrderRespDTO doUnifiedOrder(PayOrderUnifiedReqDTO reqDTO) { | |
| 37 | - throw new UnsupportedOperationException("支付宝转账不支持统一下单请求"); | |
| 38 | - } | |
| 39 | - @Override | |
| 40 | - protected PayRefundRespDTO doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) { | |
| 41 | - throw new UnsupportedOperationException("支付宝转账不支持统一退款请求"); | |
| 42 | - } | |
| 43 | - @Override | |
| 44 | - protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) throws AlipayApiException { | |
| 45 | - // 1.1 构建 AlipayFundTransUniTransferModel | |
| 46 | - AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel(); | |
| 47 | - // ① 通用的参数 | |
| 48 | - model.setTransAmount(formatAmount(reqDTO.getPrice())); // 转账金额 | |
| 49 | - model.setOrderTitle(reqDTO.getTitle()); // 转账业务的标题,用于在支付宝用户的账单里显示。 | |
| 50 | - model.setOutBizNo(reqDTO.getOutTransferNo()); | |
| 51 | - model.setProductCode("TRANS_ACCOUNT_NO_PWD"); // 销售产品码。单笔无密转账固定为 TRANS_ACCOUNT_NO_PWD | |
| 52 | - model.setBizScene("DIRECT_TRANSFER"); // 业务场景 单笔无密转账固定为 DIRECT_TRANSFER。 | |
| 53 | - model.setBusinessParams(JsonUtils.toJsonString(reqDTO.getChannelExtras())); | |
| 54 | - PayTransferTypeEnum transferType = PayTransferTypeEnum.ofType(reqDTO.getType()); | |
| 55 | - switch(transferType){ | |
| 56 | - case WX_BALANCE : | |
| 57 | - case WALLET_BALANCE : { | |
| 58 | - log.error("[doUnifiedTransfer],支付宝转账不支持的转账类型{}", transferType); | |
| 59 | - throw new UnsupportedOperationException(String.format("支付宝转账不支持转账类型: %s",transferType.getName())); | |
| 60 | - } | |
| 61 | - case ALIPAY_BALANCE : { | |
| 62 | - // ② 个性化的参数 | |
| 63 | - Participant payeeInfo = new Participant(); | |
| 64 | - payeeInfo.setIdentityType("ALIPAY_LOGON_ID"); | |
| 65 | - String logonId = MapUtil.getStr(reqDTO.getPayeeInfo(), "ALIPAY_LOGON_ID"); | |
| 66 | - if (StrUtil.isEmpty(logonId)) { | |
| 67 | - throw exception0(BAD_REQUEST.getCode(), "支付包登录 ID 不能为空"); | |
| 68 | - } | |
| 69 | - String accountName = MapUtil.getStr(reqDTO.getPayeeInfo(), "ALIPAY_ACCOUNT_NAME"); | |
| 70 | - if (StrUtil.isEmpty(accountName)) { | |
| 71 | - throw exception0(BAD_REQUEST.getCode(), "支付包账户名称不能为空"); | |
| 72 | - } | |
| 73 | - payeeInfo.setIdentity(logonId); // 支付宝登录号 | |
| 74 | - payeeInfo.setName(accountName); // 支付宝账号姓名 | |
| 75 | - model.setPayeeInfo(payeeInfo); | |
| 76 | - // 1.2 构建 AlipayFundTransUniTransferRequest | |
| 77 | - AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest(); | |
| 78 | - request.setBizModel(model); | |
| 79 | - // 执行请求 | |
| 80 | - AlipayFundTransUniTransferResponse response = client.certificateExecute(request); | |
| 81 | - // 处理结果 | |
| 82 | - if (!response.isSuccess()) { | |
| 83 | - // 当出现 SYSTEM_ERROR, 转账可能成功也可能失败。 返回 WAIT 状态. 后续 job 会轮询 | |
| 84 | - if (ObjectUtils.equalsAny(response.getSubCode(), "SYSTEM_ERROR", "ACQ.SYSTEM_ERROR")) { | |
| 85 | - return PayTransferRespDTO.waitingOf(null, reqDTO.getOutTransferNo(), response); | |
| 86 | - } | |
| 87 | - return PayTransferRespDTO.closedOf(response.getSubCode(), response.getSubMsg(), | |
| 88 | - reqDTO.getOutTransferNo(), response); | |
| 89 | - } | |
| 90 | - return PayTransferRespDTO.successOf(response.getOrderId(), parseTime(response.getTransDate()), | |
| 91 | - response.getOutBizNo(), response); | |
| 92 | - } | |
| 93 | - case BANK_CARD : { | |
| 94 | - Participant payeeInfo = new Participant(); | |
| 95 | - payeeInfo.setIdentityType("BANKCARD_ACCOUNT"); | |
| 96 | - throw new UnsupportedOperationException("待实现"); | |
| 97 | - } | |
| 98 | - default: { | |
| 99 | - throw new IllegalStateException("不正确的转账类型: " + transferType); | |
| 100 | - } | |
| 101 | - } | |
| 102 | - } | |
| 103 | -} |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayWapPayClient.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; |
| 3 | 3 | import cn.hutool.http.Method; |
| 4 | 4 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; |
| 5 | 5 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| 6 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; | |
| 7 | -import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; | |
| 8 | 6 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; |
| 9 | 7 | import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum; |
| 10 | 8 | import com.alipay.api.AlipayApiException; |
| ... | ... | @@ -57,9 +55,4 @@ public class AlipayWapPayClient extends AbstractAlipayPayClient { |
| 57 | 55 | return PayOrderRespDTO.waitingOf(displayMode, response.getBody(), |
| 58 | 56 | reqDTO.getOutTradeNo(), response); |
| 59 | 57 | } |
| 60 | - | |
| 61 | - @Override | |
| 62 | - public PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) { | |
| 63 | - throw new UnsupportedOperationException("支付宝【Wap 网站】不支持转账操作"); | |
| 64 | - } | |
| 65 | 58 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/mock/MockPayClient.java
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/enums/channel/PayChannelEnum.java
| ... | ... | @@ -28,8 +28,6 @@ public enum PayChannelEnum { |
| 28 | 28 | ALIPAY_APP("alipay_app", "支付宝App 支付", AlipayPayClientConfig.class), |
| 29 | 29 | ALIPAY_QR("alipay_qr", "支付宝扫码支付", AlipayPayClientConfig.class), |
| 30 | 30 | ALIPAY_BAR("alipay_bar", "支付宝条码支付", AlipayPayClientConfig.class), |
| 31 | - ALIPAY_TRANSFER("alipay_transfer", "支付宝转账", AlipayPayClientConfig.class), | |
| 32 | - | |
| 33 | 31 | MOCK("mock", "模拟支付", NonePayClientConfig.class), |
| 34 | 32 | |
| 35 | 33 | WALLET("wallet", "钱包支付", NonePayClientConfig.class); | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/enums/transfer/PayTransferStatusRespEnum.java
| ... | ... | @@ -18,10 +18,10 @@ public enum PayTransferStatusRespEnum { |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * TODO 转账到银行卡. 会有T+0 T+1 到账的请情况。 还未实现 |
| 21 | + * TODO @jason:可以看看其它开源项目,针对这个场景,处理策略是怎么样的?例如说,每天主动轮询?这个状态的单子? | |
| 21 | 22 | */ |
| 22 | 23 | IN_PROGRESS(10, "转账进行中"), |
| 23 | 24 | |
| 24 | - | |
| 25 | 25 | SUCCESS(20, "转账成功"), |
| 26 | 26 | /** |
| 27 | 27 | * 转账关闭 (失败,或者其它情况) | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/enums/transfer/PayTransferTypeEnum.java
| ... | ... | @@ -15,6 +15,7 @@ import java.util.Arrays; |
| 15 | 15 | @AllArgsConstructor |
| 16 | 16 | @Getter |
| 17 | 17 | public enum PayTransferTypeEnum implements IntArrayValuable { |
| 18 | + | |
| 18 | 19 | ALIPAY_BALANCE(1, "支付宝余额"), |
| 19 | 20 | WX_BALANCE(2, "微信余额"), |
| 20 | 21 | BANK_CARD(3, "银行卡"), |
| ... | ... | @@ -33,7 +34,8 @@ public enum PayTransferTypeEnum implements IntArrayValuable { |
| 33 | 34 | return ARRAYS; |
| 34 | 35 | } |
| 35 | 36 | |
| 36 | - public static PayTransferTypeEnum ofType(Integer type) { | |
| 37 | + public static PayTransferTypeEnum typeOf(Integer type) { | |
| 37 | 38 | return ArrayUtil.firstMatch(item -> item.getType().equals(type), values()); |
| 38 | 39 | } |
| 40 | + | |
| 39 | 41 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/MPJLambdaWrapperX.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.mybatis.core.query; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.ArrayUtil; | |
| 4 | +import cn.hutool.core.util.ObjectUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; | |
| 6 | +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | |
| 7 | +import com.github.yulichang.toolkit.MPJWrappers; | |
| 8 | +import com.github.yulichang.wrapper.MPJLambdaWrapper; | |
| 9 | +import org.springframework.util.StringUtils; | |
| 10 | + | |
| 11 | +import java.util.Collection; | |
| 12 | +import java.util.function.Consumer; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 拓展 MyBatis Plus Join QueryWrapper 类,主要增加如下功能: | |
| 16 | + * <p> | |
| 17 | + * 1. 拼接条件的方法,增加 xxxIfPresent 方法,用于判断值不存在的时候,不要拼接到条件中。 | |
| 18 | + * | |
| 19 | + * @param <T> 数据类型 | |
| 20 | + */ | |
| 21 | +public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | |
| 22 | + | |
| 23 | + public MPJLambdaWrapperX<T> likeIfPresent(SFunction<T, ?> column, String val) { | |
| 24 | + MPJWrappers.lambdaJoin().like(column, val); | |
| 25 | + if (StringUtils.hasText(val)) { | |
| 26 | + return (MPJLambdaWrapperX<T>) super.like(column, val); | |
| 27 | + } | |
| 28 | + return this; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public MPJLambdaWrapperX<T> inIfPresent(SFunction<T, ?> column, Collection<?> values) { | |
| 32 | + if (ObjectUtil.isAllNotEmpty(values) && !ArrayUtil.isEmpty(values)) { | |
| 33 | + return (MPJLambdaWrapperX<T>) super.in(column, values); | |
| 34 | + } | |
| 35 | + return this; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public MPJLambdaWrapperX<T> inIfPresent(SFunction<T, ?> column, Object... values) { | |
| 39 | + if (ObjectUtil.isAllNotEmpty(values) && !ArrayUtil.isEmpty(values)) { | |
| 40 | + return (MPJLambdaWrapperX<T>) super.in(column, values); | |
| 41 | + } | |
| 42 | + return this; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public MPJLambdaWrapperX<T> eqIfPresent(SFunction<T, ?> column, Object val) { | |
| 46 | + if (ObjectUtil.isNotEmpty(val)) { | |
| 47 | + return (MPJLambdaWrapperX<T>) super.eq(column, val); | |
| 48 | + } | |
| 49 | + return this; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public MPJLambdaWrapperX<T> neIfPresent(SFunction<T, ?> column, Object val) { | |
| 53 | + if (ObjectUtil.isNotEmpty(val)) { | |
| 54 | + return (MPJLambdaWrapperX<T>) super.ne(column, val); | |
| 55 | + } | |
| 56 | + return this; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public MPJLambdaWrapperX<T> gtIfPresent(SFunction<T, ?> column, Object val) { | |
| 60 | + if (val != null) { | |
| 61 | + return (MPJLambdaWrapperX<T>) super.gt(column, val); | |
| 62 | + } | |
| 63 | + return this; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public MPJLambdaWrapperX<T> geIfPresent(SFunction<T, ?> column, Object val) { | |
| 67 | + if (val != null) { | |
| 68 | + return (MPJLambdaWrapperX<T>) super.ge(column, val); | |
| 69 | + } | |
| 70 | + return this; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public MPJLambdaWrapperX<T> ltIfPresent(SFunction<T, ?> column, Object val) { | |
| 74 | + if (val != null) { | |
| 75 | + return (MPJLambdaWrapperX<T>) super.lt(column, val); | |
| 76 | + } | |
| 77 | + return this; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public MPJLambdaWrapperX<T> leIfPresent(SFunction<T, ?> column, Object val) { | |
| 81 | + if (val != null) { | |
| 82 | + return (MPJLambdaWrapperX<T>) super.le(column, val); | |
| 83 | + } | |
| 84 | + return this; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public MPJLambdaWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object val1, Object val2) { | |
| 88 | + if (val1 != null && val2 != null) { | |
| 89 | + return (MPJLambdaWrapperX<T>) super.between(column, val1, val2); | |
| 90 | + } | |
| 91 | + if (val1 != null) { | |
| 92 | + return (MPJLambdaWrapperX<T>) ge(column, val1); | |
| 93 | + } | |
| 94 | + if (val2 != null) { | |
| 95 | + return (MPJLambdaWrapperX<T>) le(column, val2); | |
| 96 | + } | |
| 97 | + return this; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public MPJLambdaWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object[] values) { | |
| 101 | + Object val1 = ArrayUtils.get(values, 0); | |
| 102 | + Object val2 = ArrayUtils.get(values, 1); | |
| 103 | + return betweenIfPresent(column, val1, val2); | |
| 104 | + } | |
| 105 | + | |
| 106 | + // ========== 重写父类方法,方便链式调用 ========== | |
| 107 | + | |
| 108 | + @Override | |
| 109 | + public <X> MPJLambdaWrapperX<T> eq(boolean condition, SFunction<X, ?> column, Object val) { | |
| 110 | + super.eq(condition, column, val); | |
| 111 | + return this; | |
| 112 | + } | |
| 113 | + | |
| 114 | + @Override | |
| 115 | + public <X> MPJLambdaWrapperX<T> eq(SFunction<X, ?> column, Object val) { | |
| 116 | + super.eq(column, val); | |
| 117 | + return this; | |
| 118 | + } | |
| 119 | + | |
| 120 | + @Override | |
| 121 | + public <X> MPJLambdaWrapperX<T> orderByDesc(SFunction<X, ?> column) { | |
| 122 | + //noinspection unchecked | |
| 123 | + super.orderByDesc(true, column); | |
| 124 | + return this; | |
| 125 | + } | |
| 126 | + | |
| 127 | + @Override | |
| 128 | + public MPJLambdaWrapperX<T> last(String lastSql) { | |
| 129 | + super.last(lastSql); | |
| 130 | + return this; | |
| 131 | + } | |
| 132 | + | |
| 133 | + @Override | |
| 134 | + public <X> MPJLambdaWrapperX<T> in(SFunction<X, ?> column, Collection<?> coll) { | |
| 135 | + super.in(column, coll); | |
| 136 | + return this; | |
| 137 | + } | |
| 138 | + | |
| 139 | + @Override | |
| 140 | + public MPJLambdaWrapperX<T> selectAll(Class<?> clazz) { | |
| 141 | + super.selectAll(clazz); | |
| 142 | + return this; | |
| 143 | + } | |
| 144 | + | |
| 145 | + @Override | |
| 146 | + public MPJLambdaWrapperX<T> selectAll(Class<?> clazz, String prefix) { | |
| 147 | + super.selectAll(clazz, prefix); | |
| 148 | + return this; | |
| 149 | + } | |
| 150 | + | |
| 151 | + @Override | |
| 152 | + public <S> MPJLambdaWrapperX<T> selectAs(SFunction<S, ?> column, String alias) { | |
| 153 | + super.selectAs(column, alias); | |
| 154 | + return this; | |
| 155 | + } | |
| 156 | + | |
| 157 | + @Override | |
| 158 | + public <E> MPJLambdaWrapperX<T> selectAs(String column, SFunction<E, ?> alias) { | |
| 159 | + super.selectAs(column, alias); | |
| 160 | + return this; | |
| 161 | + } | |
| 162 | + | |
| 163 | + @Override | |
| 164 | + public <S, X> MPJLambdaWrapperX<T> selectAs(SFunction<S, ?> column, SFunction<X, ?> alias) { | |
| 165 | + super.selectAs(column, alias); | |
| 166 | + return this; | |
| 167 | + } | |
| 168 | + | |
| 169 | + @Override | |
| 170 | + public <E, X> MPJLambdaWrapperX<T> selectAs(String index, SFunction<E, ?> column, SFunction<X, ?> alias) { | |
| 171 | + super.selectAs(index, column, alias); | |
| 172 | + return this; | |
| 173 | + } | |
| 174 | + | |
| 175 | + @Override | |
| 176 | + public <E> MPJLambdaWrapperX<T> selectAsClass(Class<E> source, Class<?> tag) { | |
| 177 | + super.selectAsClass(source, tag); | |
| 178 | + return this; | |
| 179 | + } | |
| 180 | + | |
| 181 | + @Override | |
| 182 | + public <E, F> MPJLambdaWrapperX<T> selectSub(Class<E> clazz, Consumer<MPJLambdaWrapper<E>> consumer, SFunction<F, ?> alias) { | |
| 183 | + super.selectSub(clazz, consumer, alias); | |
| 184 | + return this; | |
| 185 | + } | |
| 186 | + | |
| 187 | + @Override | |
| 188 | + public <E, F> MPJLambdaWrapperX<T> selectSub(Class<E> clazz, String st, Consumer<MPJLambdaWrapper<E>> consumer, SFunction<F, ?> alias) { | |
| 189 | + super.selectSub(clazz, st, consumer, alias); | |
| 190 | + return this; | |
| 191 | + } | |
| 192 | + | |
| 193 | + @Override | |
| 194 | + public <S> MPJLambdaWrapperX<T> selectCount(SFunction<S, ?> column) { | |
| 195 | + super.selectCount(column); | |
| 196 | + return this; | |
| 197 | + } | |
| 198 | + | |
| 199 | + @Override | |
| 200 | + public MPJLambdaWrapperX<T> selectCount(Object column, String alias) { | |
| 201 | + super.selectCount(column, alias); | |
| 202 | + return this; | |
| 203 | + } | |
| 204 | + | |
| 205 | + @Override | |
| 206 | + public <X> MPJLambdaWrapperX<T> selectCount(Object column, SFunction<X, ?> alias) { | |
| 207 | + super.selectCount(column, alias); | |
| 208 | + return this; | |
| 209 | + } | |
| 210 | + | |
| 211 | + @Override | |
| 212 | + public <S, X> MPJLambdaWrapperX<T> selectCount(SFunction<S, ?> column, String alias) { | |
| 213 | + super.selectCount(column, alias); | |
| 214 | + return this; | |
| 215 | + } | |
| 216 | + | |
| 217 | + @Override | |
| 218 | + public <S, X> MPJLambdaWrapperX<T> selectCount(SFunction<S, ?> column, SFunction<X, ?> alias) { | |
| 219 | + super.selectCount(column, alias); | |
| 220 | + return this; | |
| 221 | + } | |
| 222 | + | |
| 223 | + @Override | |
| 224 | + public <S> MPJLambdaWrapperX<T> selectSum(SFunction<S, ?> column) { | |
| 225 | + super.selectSum(column); | |
| 226 | + return this; | |
| 227 | + } | |
| 228 | + | |
| 229 | + @Override | |
| 230 | + public <S, X> MPJLambdaWrapperX<T> selectSum(SFunction<S, ?> column, String alias) { | |
| 231 | + super.selectSum(column, alias); | |
| 232 | + return this; | |
| 233 | + } | |
| 234 | + | |
| 235 | + @Override | |
| 236 | + public <S, X> MPJLambdaWrapperX<T> selectSum(SFunction<S, ?> column, SFunction<X, ?> alias) { | |
| 237 | + super.selectSum(column, alias); | |
| 238 | + return this; | |
| 239 | + } | |
| 240 | + | |
| 241 | + @Override | |
| 242 | + public <S> MPJLambdaWrapperX<T> selectMax(SFunction<S, ?> column) { | |
| 243 | + super.selectMax(column); | |
| 244 | + return this; | |
| 245 | + } | |
| 246 | + | |
| 247 | + @Override | |
| 248 | + public <S, X> MPJLambdaWrapperX<T> selectMax(SFunction<S, ?> column, String alias) { | |
| 249 | + super.selectMax(column, alias); | |
| 250 | + return this; | |
| 251 | + } | |
| 252 | + | |
| 253 | + @Override | |
| 254 | + public <S, X> MPJLambdaWrapperX<T> selectMax(SFunction<S, ?> column, SFunction<X, ?> alias) { | |
| 255 | + super.selectMax(column, alias); | |
| 256 | + return this; | |
| 257 | + } | |
| 258 | + | |
| 259 | + @Override | |
| 260 | + public <S> MPJLambdaWrapperX<T> selectMin(SFunction<S, ?> column) { | |
| 261 | + super.selectMin(column); | |
| 262 | + return this; | |
| 263 | + } | |
| 264 | + | |
| 265 | + @Override | |
| 266 | + public <S, X> MPJLambdaWrapperX<T> selectMin(SFunction<S, ?> column, String alias) { | |
| 267 | + super.selectMin(column, alias); | |
| 268 | + return this; | |
| 269 | + } | |
| 270 | + | |
| 271 | + @Override | |
| 272 | + public <S, X> MPJLambdaWrapperX<T> selectMin(SFunction<S, ?> column, SFunction<X, ?> alias) { | |
| 273 | + super.selectMin(column, alias); | |
| 274 | + return this; | |
| 275 | + } | |
| 276 | + | |
| 277 | + @Override | |
| 278 | + public <S> MPJLambdaWrapperX<T> selectAvg(SFunction<S, ?> column) { | |
| 279 | + super.selectAvg(column); | |
| 280 | + return this; | |
| 281 | + } | |
| 282 | + | |
| 283 | + @Override | |
| 284 | + public <S, X> MPJLambdaWrapperX<T> selectAvg(SFunction<S, ?> column, String alias) { | |
| 285 | + super.selectAvg(column, alias); | |
| 286 | + return this; | |
| 287 | + } | |
| 288 | + | |
| 289 | + @Override | |
| 290 | + public <S, X> MPJLambdaWrapperX<T> selectAvg(SFunction<S, ?> column, SFunction<X, ?> alias) { | |
| 291 | + super.selectAvg(column, alias); | |
| 292 | + return this; | |
| 293 | + } | |
| 294 | + | |
| 295 | + @Override | |
| 296 | + public <S> MPJLambdaWrapperX<T> selectLen(SFunction<S, ?> column) { | |
| 297 | + super.selectLen(column); | |
| 298 | + return this; | |
| 299 | + } | |
| 300 | + | |
| 301 | + @Override | |
| 302 | + public <S, X> MPJLambdaWrapperX<T> selectLen(SFunction<S, ?> column, String alias) { | |
| 303 | + super.selectLen(column, alias); | |
| 304 | + return this; | |
| 305 | + } | |
| 306 | + | |
| 307 | + @Override | |
| 308 | + public <S, X> MPJLambdaWrapperX<T> selectLen(SFunction<S, ?> column, SFunction<X, ?> alias) { | |
| 309 | + super.selectLen(column, alias); | |
| 310 | + return this; | |
| 311 | + } | |
| 312 | + | |
| 313 | +} | ... | ... |
yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java
| ... | ... | @@ -34,8 +34,9 @@ public interface ErrorCodeConstants { |
| 34 | 34 | // ========== 商品 SPU 1-008-005-000 ========== |
| 35 | 35 | ErrorCode SPU_NOT_EXISTS = new ErrorCode(1_008_005_000, "商品 SPU 不存在"); |
| 36 | 36 | ErrorCode SPU_SAVE_FAIL_CATEGORY_LEVEL_ERROR = new ErrorCode(1_008_005_001, "商品分类不正确,原因:必须使用第二级的商品分类及以下"); |
| 37 | - ErrorCode SPU_NOT_ENABLE = new ErrorCode(1_008_005_002, "商品 SPU【{}】不处于上架状态"); | |
| 38 | - ErrorCode SPU_NOT_RECYCLE = new ErrorCode(1_008_005_003, "商品 SPU 不处于回收站状态"); | |
| 37 | + ErrorCode SPU_SAVE_FAIL_COUPON_TEMPLATE_NOT_EXISTS = new ErrorCode(1_008_005_002, "商品 SPU 保存失败,原因:优惠卷不存在"); | |
| 38 | + ErrorCode SPU_NOT_ENABLE = new ErrorCode(1_008_005_003, "商品 SPU【{}】不处于上架状态"); | |
| 39 | + ErrorCode SPU_NOT_RECYCLE = new ErrorCode(1_008_005_004, "商品 SPU 不处于回收站状态"); | |
| 39 | 40 | |
| 40 | 41 | // ========== 商品 SKU 1-008-006-000 ========== |
| 41 | 42 | ErrorCode SKU_NOT_EXISTS = new ErrorCode(1_008_006_000, "商品 SKU 不存在"); | ... | ... |
yudao-module-mall/yudao-module-product-biz/pom.xml
| ... | ... | @@ -28,6 +28,11 @@ |
| 28 | 28 | <artifactId>yudao-module-member-api</artifactId> |
| 29 | 29 | <version>${revision}</version> |
| 30 | 30 | </dependency> |
| 31 | + <dependency> | |
| 32 | + <groupId>cn.iocoder.boot</groupId> | |
| 33 | + <artifactId>yudao-module-promotion-api</artifactId> | |
| 34 | + <version>${revision}</version> | |
| 35 | + </dependency> | |
| 31 | 36 | |
| 32 | 37 | <!-- 业务组件 --> |
| 33 | 38 | <dependency> | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java
| ... | ... | @@ -8,8 +8,11 @@ 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; |
| 14 | +import cn.iocoder.yudao.module.promotion.api.coupon.CouponTemplateApi; | |
| 15 | +import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO; | |
| 13 | 16 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | 17 | import io.swagger.v3.oas.annotations.Parameter; |
| 15 | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | ... | @@ -22,6 +25,7 @@ import javax.servlet.http.HttpServletResponse; |
| 22 | 25 | import javax.validation.Valid; |
| 23 | 26 | import java.io.IOException; |
| 24 | 27 | import java.util.Collection; |
| 28 | +import java.util.Comparator; | |
| 25 | 29 | import java.util.List; |
| 26 | 30 | import java.util.Map; |
| 27 | 31 | |
| ... | ... | @@ -41,6 +45,9 @@ public class ProductSpuController { |
| 41 | 45 | @Resource |
| 42 | 46 | private ProductSkuService productSkuService; |
| 43 | 47 | |
| 48 | + @Resource | |
| 49 | + private CouponTemplateApi couponTemplateApi; | |
| 50 | + | |
| 44 | 51 | @PostMapping("/create") |
| 45 | 52 | @Operation(summary = "创建商品 SPU") |
| 46 | 53 | @PreAuthorize("@ss.hasPermission('product:spu:create')") |
| ... | ... | @@ -85,14 +92,20 @@ public class ProductSpuController { |
| 85 | 92 | } |
| 86 | 93 | // 查询商品 SKU |
| 87 | 94 | List<ProductSkuDO> skus = productSkuService.getSkuListBySpuId(spu.getId()); |
| 88 | - return success(ProductSpuConvert.INSTANCE.convertForSpuDetailRespVO(spu, skus)); | |
| 95 | + // 查询优惠卷 | |
| 96 | + // TODO @puhui999:优惠劵的信息,要不交给前端读取?主要是为了避免商品依赖 promotion 模块哈; | |
| 97 | + List<CouponTemplateRespDTO> couponTemplateList = couponTemplateApi.getCouponTemplateListByIds( | |
| 98 | + spu.getGiveCouponTemplateIds()); | |
| 99 | + return success(ProductSpuConvert.INSTANCE.convertForSpuDetailRespVO(spu, skus, couponTemplateList)); | |
| 89 | 100 | } |
| 90 | 101 | |
| 91 | - @GetMapping("/get-simple-list") | |
| 102 | + @GetMapping("/list-all-simple") | |
| 92 | 103 | @Operation(summary = "获得商品 SPU 精简列表") |
| 93 | 104 | @PreAuthorize("@ss.hasPermission('product:spu:query')") |
| 94 | 105 | public CommonResult<List<ProductSpuSimpleRespVO>> getSpuSimpleList() { |
| 95 | - List<ProductSpuDO> list = productSpuService.getSpuList(); | |
| 106 | + List<ProductSpuDO> list = productSpuService.getSpuListByStatus(ProductSpuStatusEnum.ENABLE.getStatus()); | |
| 107 | + // 降序排序后,返回给前端 | |
| 108 | + list.sort(Comparator.comparing(ProductSpuDO::getSort).reversed()); | |
| 96 | 109 | return success(ProductSpuConvert.INSTANCE.convertList02(list)); |
| 97 | 110 | } |
| 98 | 111 | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java
| ... | ... | @@ -96,19 +96,31 @@ public class ProductSpuBaseVO { |
| 96 | 96 | @NotNull(message = "商品赠送积分不能为空") |
| 97 | 97 | private Integer giveIntegral; |
| 98 | 98 | |
| 99 | - @Schema(description = "赠送的优惠劵编号的数组", example = "[1, 10]") // TODO 这块前端还未实现 | |
| 100 | - private List<Long> giveCouponTemplateIds; | |
| 99 | + @Schema(description = "赠送的优惠劵数组包含优惠券编号和名称") | |
| 100 | + private List<GiveCouponTemplate> giveCouponTemplates; | |
| 101 | 101 | |
| 102 | 102 | @Schema(description = "分销类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") |
| 103 | 103 | @NotNull(message = "商品分销类型不能为空") |
| 104 | 104 | private Boolean subCommissionType; |
| 105 | 105 | |
| 106 | - @Schema(description = "活动展示顺序", example = "[1, 3, 2, 4, 5]") // TODO 这块前端还未实现 | |
| 106 | + @Schema(description = "活动展示顺序", example = "[1, 3, 2, 4, 5]") | |
| 107 | 107 | private List<Integer> activityOrders; |
| 108 | 108 | |
| 109 | 109 | // ========== 统计相关字段 ========= |
| 110 | 110 | |
| 111 | - @Schema(description = "虚拟销量", example = "芋道") | |
| 111 | + @Schema(description = "虚拟销量", example = "66") | |
| 112 | 112 | private Integer virtualSalesCount; |
| 113 | 113 | |
| 114 | + @Schema(description = "管理后台 - 商品 SPU 赠送的优惠卷") | |
| 115 | + @Data | |
| 116 | + public static class GiveCouponTemplate { | |
| 117 | + | |
| 118 | + @Schema(description = "模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 119 | + private Long id; | |
| 120 | + | |
| 121 | + @Schema(description = "优惠劵名", requiredMode = Schema.RequiredMode.REQUIRED, example = "春节送送送") | |
| 122 | + private String name; | |
| 123 | + | |
| 124 | + } | |
| 125 | + | |
| 114 | 126 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/spu/ProductSpuConvert.java
| ... | ... | @@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; |
| 12 | 12 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; |
| 13 | 13 | import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; |
| 14 | 14 | import cn.iocoder.yudao.module.product.enums.DictTypeConstants; |
| 15 | +import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO; | |
| 15 | 16 | import org.mapstruct.Mapper; |
| 16 | 17 | import org.mapstruct.Mapping; |
| 17 | 18 | import org.mapstruct.Named; |
| ... | ... | @@ -100,10 +101,14 @@ public interface ProductSpuConvert { |
| 100 | 101 | |
| 101 | 102 | List<AppProductSpuDetailRespVO.Sku> convertListForGetSpuDetail(List<ProductSkuDO> skus); |
| 102 | 103 | |
| 103 | - default ProductSpuDetailRespVO convertForSpuDetailRespVO(ProductSpuDO spu, List<ProductSkuDO> skus) { | |
| 104 | - ProductSpuDetailRespVO detailRespVO = convert03(spu); | |
| 105 | - detailRespVO.setSkus(ProductSkuConvert.INSTANCE.convertList(skus)); | |
| 106 | - return detailRespVO; | |
| 104 | + List<ProductSpuDetailRespVO.GiveCouponTemplate> convertList04(List<CouponTemplateRespDTO> couponTemplateList); | |
| 105 | + | |
| 106 | + default ProductSpuDetailRespVO convertForSpuDetailRespVO(ProductSpuDO spu, List<ProductSkuDO> skus, | |
| 107 | + List<CouponTemplateRespDTO> couponTemplateList) { | |
| 108 | + ProductSpuDetailRespVO respVO = convert03(spu); | |
| 109 | + respVO.setSkus(ProductSkuConvert.INSTANCE.convertList(skus)); | |
| 110 | + respVO.setGiveCouponTemplates(convertList04(couponTemplateList)); | |
| 111 | + return respVO; | |
| 107 | 112 | } |
| 108 | 113 | |
| 109 | 114 | default List<ProductSpuDetailRespVO> convertForSpuDetailRespListVO(List<ProductSpuDO> spus, List<ProductSkuDO> skus) { | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/spu/ProductSpuDO.java
| ... | ... | @@ -194,7 +194,7 @@ public class ProductSpuDO extends BaseDO { |
| 194 | 194 | * 对应 PromotionTypeEnum 枚举 |
| 195 | 195 | */ |
| 196 | 196 | @TableField(typeHandler = JacksonTypeHandler.class) |
| 197 | - private List<Integer> activityOrders; | |
| 197 | + private List<Integer> activityOrders; // TODO @芋艿: 活动顺序字段长度需要增加 | |
| 198 | 198 | |
| 199 | 199 | // ========== 统计相关字段 ========= |
| 200 | 200 | ... | ... |
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
| ... | ... | @@ -16,8 +16,10 @@ import cn.iocoder.yudao.module.product.dal.mysql.spu.ProductSpuMapper; |
| 16 | 16 | import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum; |
| 17 | 17 | import cn.iocoder.yudao.module.product.service.brand.ProductBrandService; |
| 18 | 18 | import cn.iocoder.yudao.module.product.service.category.ProductCategoryService; |
| 19 | -import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueService; | |
| 20 | 19 | import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; |
| 20 | +import cn.iocoder.yudao.module.promotion.api.coupon.CouponTemplateApi; | |
| 21 | +import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO; | |
| 22 | +import cn.iocoder.yudao.module.promotion.enums.common.PromotionTypeEnum; | |
| 21 | 23 | import com.google.common.collect.Maps; |
| 22 | 24 | import org.springframework.context.annotation.Lazy; |
| 23 | 25 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -26,10 +28,10 @@ import org.springframework.validation.annotation.Validated; |
| 26 | 28 | |
| 27 | 29 | import javax.annotation.Resource; |
| 28 | 30 | import java.util.*; |
| 31 | +import java.util.stream.Collectors; | |
| 29 | 32 | |
| 30 | 33 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 31 | -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.getMinValue; | |
| 32 | -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.getSumValue; | |
| 34 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*; | |
| 33 | 35 | import static cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO.CATEGORY_LEVEL; |
| 34 | 36 | import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; |
| 35 | 37 | |
| ... | ... | @@ -52,9 +54,10 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 52 | 54 | private ProductBrandService brandService; |
| 53 | 55 | @Resource |
| 54 | 56 | private ProductCategoryService categoryService; |
| 57 | + | |
| 55 | 58 | @Resource |
| 56 | - @Lazy // 循环依赖,避免报错 | |
| 57 | - private ProductPropertyValueService productPropertyValueService; | |
| 59 | + @Lazy | |
| 60 | + private CouponTemplateApi couponTemplateApi; | |
| 58 | 61 | |
| 59 | 62 | @Override |
| 60 | 63 | @Transactional(rollbackFor = Exception.class) |
| ... | ... | @@ -62,6 +65,9 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 62 | 65 | // 校验分类、品牌 |
| 63 | 66 | validateCategory(createReqVO.getCategoryId()); |
| 64 | 67 | brandService.validateProductBrand(createReqVO.getBrandId()); |
| 68 | + // 校验优惠券 | |
| 69 | + Set<Long> giveCouponTemplateIds = convertSet(createReqVO.getGiveCouponTemplates(), ProductSpuCreateReqVO.GiveCouponTemplate::getId); | |
| 70 | + validateCouponTemplate(giveCouponTemplateIds); | |
| 65 | 71 | // 校验 SKU |
| 66 | 72 | List<ProductSkuCreateOrUpdateReqVO> skuSaveReqList = createReqVO.getSkus(); |
| 67 | 73 | productSkuService.validateSkuList(skuSaveReqList, createReqVO.getSpecType()); |
| ... | ... | @@ -69,6 +75,8 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 69 | 75 | ProductSpuDO spu = ProductSpuConvert.INSTANCE.convert(createReqVO); |
| 70 | 76 | // 初始化 SPU 中 SKU 相关属性 |
| 71 | 77 | initSpuFromSkus(spu, skuSaveReqList); |
| 78 | + // 设置优惠券 | |
| 79 | + spu.setGiveCouponTemplateIds(CollUtil.newArrayList(giveCouponTemplateIds)); | |
| 72 | 80 | // 插入 SPU |
| 73 | 81 | productSpuMapper.insert(spu); |
| 74 | 82 | // 插入 SKU |
| ... | ... | @@ -85,6 +93,9 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 85 | 93 | // 校验分类、品牌 |
| 86 | 94 | validateCategory(updateReqVO.getCategoryId()); |
| 87 | 95 | brandService.validateProductBrand(updateReqVO.getBrandId()); |
| 96 | + // 校验优惠券 | |
| 97 | + Set<Long> giveCouponTemplateIds = convertSet(updateReqVO.getGiveCouponTemplates(), ProductSpuUpdateReqVO.GiveCouponTemplate::getId); | |
| 98 | + validateCouponTemplate(giveCouponTemplateIds); | |
| 88 | 99 | // 校验SKU |
| 89 | 100 | List<ProductSkuCreateOrUpdateReqVO> skuSaveReqList = updateReqVO.getSkus(); |
| 90 | 101 | productSkuService.validateSkuList(skuSaveReqList, updateReqVO.getSpecType()); |
| ... | ... | @@ -92,6 +103,8 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 92 | 103 | // 更新 SPU |
| 93 | 104 | ProductSpuDO updateObj = ProductSpuConvert.INSTANCE.convert(updateReqVO); |
| 94 | 105 | initSpuFromSkus(updateObj, skuSaveReqList); |
| 106 | + // 设置优惠券 | |
| 107 | + updateObj.setGiveCouponTemplateIds(CollUtil.newArrayList(giveCouponTemplateIds)); | |
| 95 | 108 | productSpuMapper.updateById(updateObj); |
| 96 | 109 | // 批量更新 SKU |
| 97 | 110 | productSkuService.updateSkuList(updateObj.getId(), updateReqVO.getSkus()); |
| ... | ... | @@ -125,6 +138,10 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 125 | 138 | // 默认商品浏览量 |
| 126 | 139 | spu.setBrowseCount(0); |
| 127 | 140 | } |
| 141 | + // 如果活动顺序为空则默认初始化 | |
| 142 | + if (CollUtil.isEmpty(spu.getActivityOrders())) { | |
| 143 | + spu.setActivityOrders(Arrays.stream(PromotionTypeEnum.ARRAYS).boxed().collect(Collectors.toList())); | |
| 144 | + } | |
| 128 | 145 | } |
| 129 | 146 | |
| 130 | 147 | /** |
| ... | ... | @@ -140,6 +157,13 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 140 | 157 | } |
| 141 | 158 | } |
| 142 | 159 | |
| 160 | + private void validateCouponTemplate(Collection<Long> ids) { | |
| 161 | + List<CouponTemplateRespDTO> couponTemplateList = couponTemplateApi.getCouponTemplateListByIds(ids); | |
| 162 | + if (couponTemplateList.size() != ids.size()) { | |
| 163 | + throw exception(SPU_SAVE_FAIL_COUPON_TEMPLATE_NOT_EXISTS); | |
| 164 | + } | |
| 165 | + } | |
| 166 | + | |
| 143 | 167 | @Override |
| 144 | 168 | public List<ProductSpuDO> validateSpuList(Collection<Long> ids) { |
| 145 | 169 | if (CollUtil.isEmpty(ids)) { |
| ... | ... | @@ -196,8 +220,8 @@ public class ProductSpuServiceImpl implements ProductSpuService { |
| 196 | 220 | } |
| 197 | 221 | |
| 198 | 222 | @Override |
| 199 | - public List<ProductSpuDO> getSpuList() { | |
| 200 | - return productSpuMapper.selectList(); | |
| 223 | + public List<ProductSpuDO> getSpuListByStatus(Integer status) { | |
| 224 | + return productSpuMapper.selectList(ProductSpuDO::getStatus, status); | |
| 201 | 225 | } |
| 202 | 226 | |
| 203 | 227 | @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/api/coupon/CouponTemplateApi.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.api.coupon; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO; | |
| 4 | + | |
| 5 | +import java.util.Collection; | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 优惠劵模版 API 接口 | |
| 10 | + * | |
| 11 | + * @author HUIHUI | |
| 12 | + */ | |
| 13 | +public interface CouponTemplateApi { | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 获得优惠券模版的精简信息列表 | |
| 17 | + * | |
| 18 | + * @param ids 优惠券模版编号 | |
| 19 | + * @return 优惠券模版的精简信息列表 | |
| 20 | + */ | |
| 21 | + List<CouponTemplateRespDTO> getCouponTemplateListByIds(Collection<Long> ids); | |
| 22 | + | |
| 23 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/api/coupon/dto/CouponTemplateRespDTO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.api.coupon.dto; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * 优惠券模版 Response DTO | |
| 8 | + * | |
| 9 | + * @author HUIHUI | |
| 10 | + */ | |
| 11 | +@Data | |
| 12 | +public class CouponTemplateRespDTO { | |
| 13 | + /** | |
| 14 | + * 模板编号,自增唯一 | |
| 15 | + */ | |
| 16 | + | |
| 17 | + private Long id; | |
| 18 | + /** | |
| 19 | + * 优惠劵名 | |
| 20 | + */ | |
| 21 | + private String name; | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 状态 | |
| 25 | + * | |
| 26 | + * 枚举 {@link CommonStatusEnum} | |
| 27 | + */ | |
| 28 | + private Integer status; | |
| 29 | + | |
| 30 | +} | ... | ... |
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
| ... | ... | @@ -15,7 +15,6 @@ public interface ErrorCodeConstants { |
| 15 | 15 | ErrorCode DISCOUNT_ACTIVITY_UPDATE_FAIL_STATUS_CLOSED = new ErrorCode(1_013_001_002, "限时折扣活动已关闭,不能修改"); |
| 16 | 16 | ErrorCode DISCOUNT_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED = new ErrorCode(1_013_001_003, "限时折扣活动未关闭,不能删除"); |
| 17 | 17 | ErrorCode DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_CLOSED = new ErrorCode(1_013_001_004, "限时折扣活动已关闭,不能重复关闭"); |
| 18 | - ErrorCode DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_END = new ErrorCode(1_013_001_005, "限时折扣活动已结束,不能关闭"); | |
| 19 | 18 | |
| 20 | 19 | // ========== Banner 相关 1-013-002-000 ============ |
| 21 | 20 | ErrorCode BANNER_NOT_EXISTS = new ErrorCode(1_013_002_000, "Banner 不存在"); |
| ... | ... | @@ -110,4 +109,11 @@ public interface ErrorCodeConstants { |
| 110 | 109 | ErrorCode BARGAIN_HELP_CREATE_FAIL_CONFLICT = new ErrorCode(1_013_014_003, "助力失败,请重试"); |
| 111 | 110 | ErrorCode BARGAIN_HELP_CREATE_FAIL_HELP_EXISTS = new ErrorCode(1_013_014_004, "助力失败,您已经助力过了"); |
| 112 | 111 | |
| 112 | + // ========== 文章分类 1-013-015-000 ========== | |
| 113 | + ErrorCode ARTICLE_CATEGORY_NOT_EXISTS = new ErrorCode(1_013_015_000, "文章分类不存在"); | |
| 114 | + ErrorCode ARTICLE_CATEGORY_DELETE_FAIL_HAVE_ARTICLES = new ErrorCode(1_013_015_001, "文章分类删除失败,存在关联文章"); | |
| 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-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/banner/BannerPositionEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.enums.banner; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | |
| 4 | +import lombok.AllArgsConstructor; | |
| 5 | +import lombok.Getter; | |
| 6 | + | |
| 7 | +import java.util.Arrays; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * Banner Position 枚举 | |
| 11 | + * | |
| 12 | + * @author HUIHUI | |
| 13 | + */ | |
| 14 | +@AllArgsConstructor | |
| 15 | +@Getter | |
| 16 | +public enum BannerPositionEnum implements IntArrayValuable { | |
| 17 | + | |
| 18 | + HOME_POSITION(1, "首页"), | |
| 19 | + SECKILL_POSITION(2, "秒杀活动页"), | |
| 20 | + COMBINATION_POSITION(3, "砍价活动页"), | |
| 21 | + DISCOUNT_POSITION(4, "限时折扣页"), | |
| 22 | + REWARD_POSITION(5, "满减送页"); | |
| 23 | + | |
| 24 | + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BannerPositionEnum::getPosition).toArray(); | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 值 | |
| 28 | + */ | |
| 29 | + private final Integer position; | |
| 30 | + /** | |
| 31 | + * 名字 | |
| 32 | + */ | |
| 33 | + private final String name; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public int[] array() { | |
| 37 | + return ARRAYS; | |
| 38 | + } | |
| 39 | + | |
| 40 | +} | ... | ... |
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/api/coupon/CouponTemplateApiImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.api.coupon; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO; | |
| 5 | +import cn.iocoder.yudao.module.promotion.convert.coupon.CouponTemplateConvert; | |
| 6 | +import cn.iocoder.yudao.module.promotion.service.coupon.CouponTemplateService; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +import javax.annotation.Resource; | |
| 10 | +import java.util.Collection; | |
| 11 | +import java.util.Collections; | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 优惠劵模版 API 接口实现类 | |
| 16 | + * | |
| 17 | + * @author HUIHUI | |
| 18 | + */ | |
| 19 | +@Service | |
| 20 | +public class CouponTemplateApiImpl implements CouponTemplateApi { | |
| 21 | + | |
| 22 | + @Resource | |
| 23 | + private CouponTemplateService couponTemplateService; | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public List<CouponTemplateRespDTO> getCouponTemplateListByIds(Collection<Long> ids) { | |
| 27 | + if (CollUtil.isEmpty(ids)) { // 防御一下 | |
| 28 | + return Collections.emptyList(); | |
| 29 | + } | |
| 30 | + return CouponTemplateConvert.INSTANCE.convertList(couponTemplateService.getCouponTemplateListByIds(ids)); | |
| 31 | + } | |
| 32 | + | |
| 33 | +} | ... | ... |
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.module.promotion.controller.admin.article.vo.category.*; | |
| 7 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleCategoryConvert; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 9 | +import cn.iocoder.yudao.module.promotion.service.article.ArticleCategoryService; | |
| 10 | +import io.swagger.v3.oas.annotations.Operation; | |
| 11 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 12 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 13 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | +import org.springframework.web.bind.annotation.*; | |
| 16 | + | |
| 17 | +import javax.annotation.Resource; | |
| 18 | +import javax.validation.Valid; | |
| 19 | +import java.util.Comparator; | |
| 20 | +import java.util.List; | |
| 21 | + | |
| 22 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 23 | + | |
| 24 | +@Tag(name = "管理后台 - 文章分类") | |
| 25 | +@RestController | |
| 26 | +@RequestMapping("/promotion/article-category") | |
| 27 | +@Validated | |
| 28 | +public class ArticleCategoryController { | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private ArticleCategoryService articleCategoryService; | |
| 32 | + | |
| 33 | + @PostMapping("/create") | |
| 34 | + @Operation(summary = "创建文章分类") | |
| 35 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:create')") | |
| 36 | + public CommonResult<Long> createArticleCategory(@Valid @RequestBody ArticleCategoryCreateReqVO createReqVO) { | |
| 37 | + return success(articleCategoryService.createArticleCategory(createReqVO)); | |
| 38 | + } | |
| 39 | + | |
| 40 | + @PutMapping("/update") | |
| 41 | + @Operation(summary = "更新文章分类") | |
| 42 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:update')") | |
| 43 | + public CommonResult<Boolean> updateArticleCategory(@Valid @RequestBody ArticleCategoryUpdateReqVO updateReqVO) { | |
| 44 | + articleCategoryService.updateArticleCategory(updateReqVO); | |
| 45 | + return success(true); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @DeleteMapping("/delete") | |
| 49 | + @Operation(summary = "删除文章分类") | |
| 50 | + @Parameter(name = "id", description = "编号", required = true) | |
| 51 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:delete')") | |
| 52 | + public CommonResult<Boolean> deleteArticleCategory(@RequestParam("id") Long id) { | |
| 53 | + articleCategoryService.deleteArticleCategory(id); | |
| 54 | + return success(true); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @GetMapping("/get") | |
| 58 | + @Operation(summary = "获得文章分类") | |
| 59 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 60 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:query')") | |
| 61 | + public CommonResult<ArticleCategoryRespVO> getArticleCategory(@RequestParam("id") Long id) { | |
| 62 | + ArticleCategoryDO category = articleCategoryService.getArticleCategory(id); | |
| 63 | + return success(ArticleCategoryConvert.INSTANCE.convert(category)); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @GetMapping("/list-all-simple") | |
| 67 | + @Operation(summary = "获取文章分类精简信息列表", description = "只包含被开启的文章分类,主要用于前端的下拉选项") | |
| 68 | + public CommonResult<List<ArticleCategorySimpleRespVO>> getSimpleDeptList() { | |
| 69 | + // 获得分类列表,只要开启状态的 | |
| 70 | + List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryListByStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 71 | + // 降序排序后,返回给前端 | |
| 72 | + list.sort(Comparator.comparing(ArticleCategoryDO::getSort).reversed()); | |
| 73 | + return success(ArticleCategoryConvert.INSTANCE.convertList03(list)); | |
| 74 | + } | |
| 75 | + | |
| 76 | + @GetMapping("/page") | |
| 77 | + @Operation(summary = "获得文章分类分页") | |
| 78 | + @PreAuthorize("@ss.hasPermission('promotion:article-category:query')") | |
| 79 | + public CommonResult<PageResult<ArticleCategoryRespVO>> getArticleCategoryPage(@Valid ArticleCategoryPageReqVO pageVO) { | |
| 80 | + PageResult<ArticleCategoryDO> pageResult = articleCategoryService.getArticleCategoryPage(pageVO); | |
| 81 | + return success(ArticleCategoryConvert.INSTANCE.convertPage(pageResult)); | |
| 82 | + } | |
| 83 | + | |
| 84 | +} | ... | ... |
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.module.promotion.controller.admin.article.vo.article.ArticleCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleRespVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleConvert; | |
| 10 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 11 | +import cn.iocoder.yudao.module.promotion.service.article.ArticleService; | |
| 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.validation.Valid; | |
| 21 | + | |
| 22 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 23 | + | |
| 24 | +@Tag(name = "管理后台 - 文章管理") | |
| 25 | +@RestController | |
| 26 | +@RequestMapping("/promotion/article") | |
| 27 | +@Validated | |
| 28 | +public class ArticleController { | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private ArticleService articleService; | |
| 32 | + | |
| 33 | + @PostMapping("/create") | |
| 34 | + @Operation(summary = "创建文章管理") | |
| 35 | + @PreAuthorize("@ss.hasPermission('promotion:article:create')") | |
| 36 | + public CommonResult<Long> createArticle(@Valid @RequestBody ArticleCreateReqVO createReqVO) { | |
| 37 | + return success(articleService.createArticle(createReqVO)); | |
| 38 | + } | |
| 39 | + | |
| 40 | + @PutMapping("/update") | |
| 41 | + @Operation(summary = "更新文章管理") | |
| 42 | + @PreAuthorize("@ss.hasPermission('promotion:article:update')") | |
| 43 | + public CommonResult<Boolean> updateArticle(@Valid @RequestBody ArticleUpdateReqVO updateReqVO) { | |
| 44 | + articleService.updateArticle(updateReqVO); | |
| 45 | + return success(true); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @DeleteMapping("/delete") | |
| 49 | + @Operation(summary = "删除文章管理") | |
| 50 | + @Parameter(name = "id", description = "编号", required = true) | |
| 51 | + @PreAuthorize("@ss.hasPermission('promotion:article:delete')") | |
| 52 | + public CommonResult<Boolean> deleteArticle(@RequestParam("id") Long id) { | |
| 53 | + articleService.deleteArticle(id); | |
| 54 | + return success(true); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @GetMapping("/get") | |
| 58 | + @Operation(summary = "获得文章管理") | |
| 59 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 60 | + @PreAuthorize("@ss.hasPermission('promotion:article:query')") | |
| 61 | + public CommonResult<ArticleRespVO> getArticle(@RequestParam("id") Long id) { | |
| 62 | + ArticleDO article = articleService.getArticle(id); | |
| 63 | + return success(ArticleConvert.INSTANCE.convert(article)); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @GetMapping("/page") | |
| 67 | + @Operation(summary = "获得文章管理分页") | |
| 68 | + @PreAuthorize("@ss.hasPermission('promotion:article:query')") | |
| 69 | + public CommonResult<PageResult<ArticleRespVO>> getArticlePage(@Valid ArticlePageReqVO pageVO) { | |
| 70 | + PageResult<ArticleDO> pageResult = articleService.getArticlePage(pageVO); | |
| 71 | + return success(ArticleConvert.INSTANCE.convertPage(pageResult)); | |
| 72 | + } | |
| 73 | + | |
| 74 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/article/ArticleBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article; | |
| 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 = "1") | |
| 38 | + @NotNull(message = "排序不能为空") | |
| 39 | + private Integer sort; | |
| 40 | + | |
| 41 | + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 42 | + @NotNull(message = "状态不能为空") | |
| 43 | + private Integer status; | |
| 44 | + | |
| 45 | + @Schema(description = "是否热门(小程序)", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | |
| 46 | + @NotNull(message = "是否热门(小程序)不能为空") | |
| 47 | + private Boolean recommendHot; | |
| 48 | + | |
| 49 | + @Schema(description = "是否轮播图(小程序)", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | |
| 50 | + @NotNull(message = "是否轮播图(小程序)不能为空") | |
| 51 | + private Boolean recommendBanner; | |
| 52 | + | |
| 53 | + @Schema(description = "文章内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是文章内容") | |
| 54 | + @NotNull(message = "文章内容不能为空") | |
| 55 | + private String content; | |
| 56 | + | |
| 57 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/article/ArticleCreateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article; | |
| 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/article/ArticlePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article; | |
| 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/article/ArticleRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article; | |
| 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, example = "99999") | |
| 20 | + private Integer browseCount; | |
| 21 | + | |
| 22 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 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/article/ArticleUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article; | |
| 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/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/banner/vo/BannerBaseVO.java
| ... | ... | @@ -27,6 +27,10 @@ public class BannerBaseVO { |
| 27 | 27 | @NotNull(message = "图片地址不能为空") |
| 28 | 28 | private String picUrl; |
| 29 | 29 | |
| 30 | + @Schema(description = "position", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 31 | + @NotNull(message = "position 不能为空") | |
| 32 | + private Integer position; | |
| 33 | + | |
| 30 | 34 | @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) |
| 31 | 35 | @NotNull(message = "排序不能为空") |
| 32 | 36 | private Integer sort; | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerPageReqVO.java
| ... | ... | @@ -13,19 +13,16 @@ import java.time.LocalDateTime; |
| 13 | 13 | |
| 14 | 14 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 15 | 15 | |
| 16 | -/** | |
| 17 | - * @author xia | |
| 18 | - */ | |
| 19 | 16 | @Schema(description = "管理后台 - Banner 分页 Request VO") |
| 20 | 17 | @Data |
| 21 | 18 | @EqualsAndHashCode(callSuper = true) |
| 22 | 19 | @ToString(callSuper = true) |
| 23 | 20 | public class BannerPageReqVO extends PageParam { |
| 24 | 21 | |
| 22 | + // TODO @puhui999:example | |
| 25 | 23 | @Schema(description = "标题") |
| 26 | 24 | private String title; |
| 27 | 25 | |
| 28 | - | |
| 29 | 26 | @Schema(description = "状态") |
| 30 | 27 | @InEnum(CommonStatusEnum.class) |
| 31 | 28 | private Integer status; | ... | ... |
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/admin/discount/DiscountActivityController.java
| 1 | 1 | package cn.iocoder.yudao.module.promotion.controller.admin.discount; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | +import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi; | |
| 7 | +import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; | |
| 5 | 8 | import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.*; |
| 6 | 9 | import cn.iocoder.yudao.module.promotion.convert.discount.DiscountActivityConvert; |
| 7 | 10 | import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountActivityDO; |
| ... | ... | @@ -19,6 +22,7 @@ import javax.validation.Valid; |
| 19 | 22 | import java.util.List; |
| 20 | 23 | |
| 21 | 24 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 25 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; | |
| 22 | 26 | |
| 23 | 27 | @Tag(name = "管理后台 - 限时折扣活动") |
| 24 | 28 | @RestController |
| ... | ... | @@ -29,6 +33,9 @@ public class DiscountActivityController { |
| 29 | 33 | @Resource |
| 30 | 34 | private DiscountActivityService discountActivityService; |
| 31 | 35 | |
| 36 | + @Resource | |
| 37 | + private ProductSpuApi productSpuApi; | |
| 38 | + | |
| 32 | 39 | @PostMapping("/create") |
| 33 | 40 | @Operation(summary = "创建限时折扣活动") |
| 34 | 41 | @PreAuthorize("@ss.hasPermission('promotion:discount-activity:create')") |
| ... | ... | @@ -49,7 +56,7 @@ public class DiscountActivityController { |
| 49 | 56 | @Parameter(name = "id", description = "编号", required = true) |
| 50 | 57 | @PreAuthorize("@ss.hasPermission('promotion:discount-activity:close')") |
| 51 | 58 | public CommonResult<Boolean> closeRewardActivity(@RequestParam("id") Long id) { |
| 52 | - discountActivityService.closeRewardActivity(id); | |
| 59 | + discountActivityService.closeDiscountActivity(id); | |
| 53 | 60 | return success(true); |
| 54 | 61 | } |
| 55 | 62 | |
| ... | ... | @@ -81,7 +88,18 @@ public class DiscountActivityController { |
| 81 | 88 | @PreAuthorize("@ss.hasPermission('promotion:discount-activity:query')") |
| 82 | 89 | public CommonResult<PageResult<DiscountActivityRespVO>> getDiscountActivityPage(@Valid DiscountActivityPageReqVO pageVO) { |
| 83 | 90 | PageResult<DiscountActivityDO> pageResult = discountActivityService.getDiscountActivityPage(pageVO); |
| 84 | - return success(DiscountActivityConvert.INSTANCE.convertPage(pageResult)); | |
| 91 | + | |
| 92 | + if (CollUtil.isEmpty(pageResult.getList())) { // TODO @zhangshuai:方法里的空行,目的是让代码分块,可以更清晰;所以上面这个空格可以不要,而下面判断之后的,空格,其实加下比较好;类似的还有 spuList、以及后面的 convert | |
| 93 | + return success(PageResult.empty(pageResult.getTotal())); | |
| 94 | + } | |
| 95 | + // 拼接数据 | |
| 96 | + List<DiscountProductDO> products = discountActivityService.getDiscountProductsByActivityId( | |
| 97 | + convertSet(pageResult.getList(), DiscountActivityDO::getId)); | |
| 98 | + | |
| 99 | + List<ProductSpuRespDTO> spuList = productSpuApi.getSpuList( | |
| 100 | + convertSet(products, DiscountProductDO::getSpuId)); | |
| 101 | + | |
| 102 | + return success(DiscountActivityConvert.INSTANCE.convertPage(pageResult, products, spuList)); | |
| 85 | 103 | } |
| 86 | 104 | |
| 87 | 105 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java
| ... | ... | @@ -7,6 +7,7 @@ import lombok.ToString; |
| 7 | 7 | |
| 8 | 8 | import javax.validation.constraints.NotNull; |
| 9 | 9 | import java.time.LocalDateTime; |
| 10 | +import java.util.List; | |
| 10 | 11 | |
| 11 | 12 | @Schema(description = "管理后台 - 限时折扣活动 Response VO") |
| 12 | 13 | @Data |
| ... | ... | @@ -24,4 +25,25 @@ public class DiscountActivityRespVO extends DiscountActivityBaseVO { |
| 24 | 25 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 25 | 26 | private LocalDateTime createTime; |
| 26 | 27 | |
| 28 | + | |
| 29 | + @Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048") // TODO @zhangshuai:属性和属性之间,最多空一行噢; | |
| 30 | + private Long spuId; | |
| 31 | + | |
| 32 | + @Schema(description = "限时折扣商品", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 33 | + private List<DiscountActivityBaseVO.Product> products; | |
| 34 | + | |
| 35 | + // ========== 商品字段 ========== | |
| 36 | + | |
| 37 | + // TODO @zhangshuai:一个优惠活动,会关联多个商品,所以它不用返回 spuName 哈; | |
| 38 | + // TODO 最终界面展示字段就:编号、活动名称、参与商品数、活动状态、开始时间、结束时间、操作 | |
| 39 | + @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 name 读取 | |
| 40 | + example = "618大促") | |
| 41 | + private String spuName; | |
| 42 | + @Schema(description = "商品主图", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 picUrl 读取 | |
| 43 | + example = "https://www.iocoder.cn/xx.png") | |
| 44 | + private String picUrl; | |
| 45 | + @Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 marketPrice 读取 | |
| 46 | + example = "50") | |
| 47 | + private Integer marketPrice; | |
| 48 | + | |
| 27 | 49 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/activity/AppActivityController.java
| ... | ... | @@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam; |
| 22 | 22 | import org.springframework.web.bind.annotation.RestController; |
| 23 | 23 | |
| 24 | 24 | import javax.annotation.Resource; |
| 25 | +import java.time.LocalDateTime; | |
| 25 | 26 | import java.util.*; |
| 26 | 27 | |
| 27 | 28 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| ... | ... | @@ -45,7 +46,7 @@ public class AppActivityController { |
| 45 | 46 | @Parameter(name = "spuId", description = "商品编号", required = true) |
| 46 | 47 | public CommonResult<List<AppActivityRespVO>> getActivityListBySpuId(@RequestParam("spuId") Long spuId) { |
| 47 | 48 | // 每种活动,只返回一个 |
| 48 | - return success(getAppActivityRespVOList(Collections.singletonList(spuId))); | |
| 49 | + return success(getAppActivityList(Collections.singletonList(spuId))); | |
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | @GetMapping("/list-by-spu-ids") |
| ... | ... | @@ -56,17 +57,19 @@ public class AppActivityController { |
| 56 | 57 | return success(MapUtil.empty()); |
| 57 | 58 | } |
| 58 | 59 | // 每种活动,只返回一个;key 为 SPU 编号 |
| 59 | - return success(convertMultiMap(getAppActivityRespVOList(spuIds), AppActivityRespVO::getSpuId)); | |
| 60 | + return success(convertMultiMap(getAppActivityList(spuIds), AppActivityRespVO::getSpuId)); | |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | - private List<AppActivityRespVO> getAppActivityRespVOList(Collection<Long> spuIds) { | |
| 63 | + private List<AppActivityRespVO> getAppActivityList(Collection<Long> spuIds) { | |
| 63 | 64 | if (CollUtil.isEmpty(spuIds)) { |
| 64 | 65 | return new ArrayList<>(); |
| 65 | 66 | } |
| 67 | + LocalDateTime now = LocalDateTime.now(); | |
| 66 | 68 | List<AppActivityRespVO> activityList = new ArrayList<>(); |
| 67 | - // 拼团活动 | |
| 68 | - List<CombinationActivityDO> combinationActivities = combinationActivityService.getCombinationActivityBySpuIdsAndStatus( | |
| 69 | - spuIds, CommonStatusEnum.ENABLE.getStatus()); | |
| 69 | + | |
| 70 | + // 1. 拼团活动 - 获取开启的且开始的且没有结束的活动 | |
| 71 | + List<CombinationActivityDO> combinationActivities = combinationActivityService.getCombinationActivityBySpuIdsAndStatusAndDateTimeLt( | |
| 72 | + spuIds, CommonStatusEnum.ENABLE.getStatus(), now); | |
| 70 | 73 | if (CollUtil.isNotEmpty(combinationActivities)) { |
| 71 | 74 | combinationActivities.forEach(item -> { |
| 72 | 75 | activityList.add(new AppActivityRespVO().setId(item.getId()) |
| ... | ... | @@ -74,9 +77,10 @@ public class AppActivityController { |
| 74 | 77 | .setSpuId(item.getSpuId()).setStartTime(item.getStartTime()).setEndTime(item.getEndTime())); |
| 75 | 78 | }); |
| 76 | 79 | } |
| 77 | - // 秒杀活动 | |
| 78 | - List<SeckillActivityDO> seckillActivities = seckillActivityService.getSeckillActivityBySpuIdsAndStatus( | |
| 79 | - spuIds, CommonStatusEnum.ENABLE.getStatus()); | |
| 80 | + | |
| 81 | + // 2. 秒杀活动 - 获取开启的且开始的且没有结束的活动 | |
| 82 | + List<SeckillActivityDO> seckillActivities = seckillActivityService.getSeckillActivityBySpuIdsAndStatusAndDateTimeLt( | |
| 83 | + spuIds, CommonStatusEnum.ENABLE.getStatus(), now); | |
| 80 | 84 | if (CollUtil.isNotEmpty(seckillActivities)) { |
| 81 | 85 | seckillActivities.forEach(item -> { |
| 82 | 86 | activityList.add(new AppActivityRespVO().setId(item.getId()) |
| ... | ... | @@ -84,9 +88,10 @@ public class AppActivityController { |
| 84 | 88 | .setSpuId(item.getSpuId()).setStartTime(item.getStartTime()).setEndTime(item.getEndTime())); |
| 85 | 89 | }); |
| 86 | 90 | } |
| 87 | - // 砍价活动 | |
| 88 | - List<BargainActivityDO> bargainActivities = bargainActivityService.getBargainActivityBySpuIdsAndStatus( | |
| 89 | - spuIds, CommonStatusEnum.ENABLE.getStatus()); | |
| 91 | + | |
| 92 | + // 3. 砍价活动 - 获取开启的且开始的且没有结束的活动 | |
| 93 | + List<BargainActivityDO> bargainActivities = bargainActivityService.getBargainActivityBySpuIdsAndStatusAndDateTimeLt( | |
| 94 | + spuIds, CommonStatusEnum.ENABLE.getStatus(), now); | |
| 90 | 95 | if (CollUtil.isNotEmpty(bargainActivities)) { |
| 91 | 96 | bargainActivities.forEach(item -> { |
| 92 | 97 | activityList.add(new AppActivityRespVO().setId(item.getId()) | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/article/AppArticleCategoryController.java
| 1 | 1 | package cn.iocoder.yudao.module.promotion.controller.app.article; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 5 | import cn.iocoder.yudao.module.promotion.controller.app.article.vo.category.AppArticleCategoryRespVO; |
| 6 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleCategoryConvert; | |
| 7 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.service.article.ArticleCategoryService; | |
| 5 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 6 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 7 | 11 | import org.springframework.validation.annotation.Validated; |
| 8 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
| 9 | 13 | import org.springframework.web.bind.annotation.RestController; |
| 10 | 14 | |
| 11 | -import java.util.ArrayList; | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.Comparator; | |
| 12 | 17 | import java.util.List; |
| 13 | -import java.util.Random; | |
| 14 | 18 | |
| 15 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 16 | 20 | |
| ... | ... | @@ -20,20 +24,16 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 20 | 24 | @Validated |
| 21 | 25 | public class AppArticleCategoryController { |
| 22 | 26 | |
| 27 | + @Resource | |
| 28 | + private ArticleCategoryService articleCategoryService; | |
| 29 | + | |
| 23 | 30 | @RequestMapping("/list") |
| 24 | 31 | @Operation(summary = "获得文章分类列表") |
| 25 | - // TODO @芋艿:swagger 注解 | |
| 26 | 32 | public CommonResult<List<AppArticleCategoryRespVO>> getArticleCategoryList() { |
| 27 | - List<AppArticleCategoryRespVO> appArticleRespVOList = new ArrayList<>(); | |
| 28 | - Random random = new Random(); | |
| 29 | - for (int i = 0; i < 10; i++) { | |
| 30 | - AppArticleCategoryRespVO appArticleRespVO = new AppArticleCategoryRespVO(); | |
| 31 | - appArticleRespVO.setId((long) (i + 1)); | |
| 32 | - appArticleRespVO.setName("分类 - " + i); | |
| 33 | - appArticleRespVO.setPicUrl("https://www.iocoder.cn/" + (i + 1) + ".png"); | |
| 34 | - appArticleRespVOList.add(appArticleRespVO); | |
| 35 | - } | |
| 36 | - return success(appArticleRespVOList); | |
| 33 | + List<ArticleCategoryDO> categoryList = articleCategoryService.getArticleCategoryListByStatus( | |
| 34 | + CommonStatusEnum.ENABLE.getStatus()); | |
| 35 | + categoryList.sort(Comparator.comparing(ArticleCategoryDO::getSort)); // 按 sort 降序排列 | |
| 36 | + return success(ArticleCategoryConvert.INSTANCE.convertList04(categoryList)); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/article/AppArticleController.java
| ... | ... | @@ -4,16 +4,20 @@ 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.app.article.vo.article.AppArticlePageReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticleRespVO; |
| 7 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleConvert; | |
| 8 | +import cn.iocoder.yudao.module.promotion.service.article.ArticleService; | |
| 9 | +import io.swagger.v3.oas.annotations.Operation; | |
| 10 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 11 | +import io.swagger.v3.oas.annotations.Parameters; | |
| 7 | 12 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 8 | 13 | import org.springframework.validation.annotation.Validated; |
| 14 | +import org.springframework.web.bind.annotation.PutMapping; | |
| 9 | 15 | import org.springframework.web.bind.annotation.RequestMapping; |
| 10 | 16 | import org.springframework.web.bind.annotation.RequestParam; |
| 11 | 17 | import org.springframework.web.bind.annotation.RestController; |
| 12 | 18 | |
| 13 | -import java.time.LocalDateTime; | |
| 14 | -import java.util.ArrayList; | |
| 19 | +import javax.annotation.Resource; | |
| 15 | 20 | import java.util.List; |
| 16 | -import java.util.Random; | |
| 17 | 21 | |
| 18 | 22 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 19 | 23 | |
| ... | ... | @@ -23,68 +27,41 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 23 | 27 | @Validated |
| 24 | 28 | public class AppArticleController { |
| 25 | 29 | |
| 30 | + @Resource | |
| 31 | + private ArticleService articleService; | |
| 32 | + | |
| 26 | 33 | @RequestMapping("/list") |
| 27 | - // TODO @芋艿:swagger 注解 | |
| 28 | - public CommonResult<List<AppArticleRespVO>> getArticleList(@RequestParam(value = "recommendHot", required = false) Boolean recommendHot, | |
| 29 | - @RequestParam(value = "recommendBanner", required = false) Boolean recommendBanner) { | |
| 30 | - List<AppArticleRespVO> appArticleRespVOList = new ArrayList<>(); | |
| 31 | - Random random = new Random(); | |
| 32 | - for (int i = 0; i < 10; i++) { | |
| 33 | - AppArticleRespVO appArticleRespVO = new AppArticleRespVO(); | |
| 34 | - appArticleRespVO.setId((long) (i + 1)); | |
| 35 | - appArticleRespVO.setTitle("芋道源码 - " + i + "模块"); | |
| 36 | - appArticleRespVO.setAuthor("芋道源码"); | |
| 37 | - appArticleRespVO.setCategoryId((long) random.nextInt(10000)); | |
| 38 | - appArticleRespVO.setPicUrl("https://www.iocoder.cn/" + (i + 1) + ".png"); | |
| 39 | - appArticleRespVO.setIntroduction("我是简介"); | |
| 40 | - appArticleRespVO.setDescription("我是详细"); | |
| 41 | - appArticleRespVO.setCreateTime(LocalDateTime.now()); | |
| 42 | - appArticleRespVO.setBrowseCount(random.nextInt(10000)); | |
| 43 | - appArticleRespVO.setSpuId((long) random.nextInt(10000)); | |
| 44 | - appArticleRespVOList.add(appArticleRespVO); | |
| 45 | - } | |
| 46 | - return success(appArticleRespVOList); | |
| 34 | + @Operation(summary = "获得文章详情列表") | |
| 35 | + @Parameters({ | |
| 36 | + @Parameter(name = "recommendHot", description = "是否热门", example = "false"), // 场景一:查看指定的文章 | |
| 37 | + @Parameter(name = "recommendBanner", description = "是否轮播图", example = "false") // 场景二:查看指定的文章 | |
| 38 | + }) | |
| 39 | + public CommonResult<List<AppArticleRespVO>> getArticleList( | |
| 40 | + @RequestParam(value = "recommendHot", required = false) Boolean recommendHot, | |
| 41 | + @RequestParam(value = "recommendBanner", required = false) Boolean recommendBanner) { | |
| 42 | + return success(ArticleConvert.INSTANCE.convertList03( | |
| 43 | + articleService.getArticleCategoryListByRecommend(recommendHot, recommendBanner))); | |
| 47 | 44 | } |
| 48 | 45 | |
| 49 | 46 | @RequestMapping("/page") |
| 50 | - // TODO @芋艿:swagger 注解 | |
| 47 | + @Operation(summary = "获得文章详情分页") | |
| 51 | 48 | public CommonResult<PageResult<AppArticleRespVO>> getArticlePage(AppArticlePageReqVO pageReqVO) { |
| 52 | - List<AppArticleRespVO> appArticleRespVOList = new ArrayList<>(); | |
| 53 | - Random random = new Random(); | |
| 54 | - for (int i = 0; i < 10; i++) { | |
| 55 | - AppArticleRespVO appArticleRespVO = new AppArticleRespVO(); | |
| 56 | - appArticleRespVO.setId((long) (i + 1)); | |
| 57 | - appArticleRespVO.setTitle("芋道源码 - " + i + "模块"); | |
| 58 | - appArticleRespVO.setAuthor("芋道源码"); | |
| 59 | - appArticleRespVO.setCategoryId((long) random.nextInt(10000)); | |
| 60 | - appArticleRespVO.setPicUrl("https://www.iocoder.cn/" + (i + 1) + ".png"); | |
| 61 | - appArticleRespVO.setIntroduction("我是简介"); | |
| 62 | - appArticleRespVO.setDescription("我是详细"); | |
| 63 | - appArticleRespVO.setCreateTime(LocalDateTime.now()); | |
| 64 | - appArticleRespVO.setBrowseCount(random.nextInt(10000)); | |
| 65 | - appArticleRespVO.setSpuId((long) random.nextInt(10000)); | |
| 66 | - appArticleRespVOList.add(appArticleRespVO); | |
| 67 | - } | |
| 68 | - return success(new PageResult<>(appArticleRespVOList, 10L)); | |
| 49 | + return success(ArticleConvert.INSTANCE.convertPage02(articleService.getArticlePage(pageReqVO))); | |
| 69 | 50 | } |
| 70 | 51 | |
| 71 | 52 | @RequestMapping("/get") |
| 72 | - // TODO @芋艿:swagger 注解 | |
| 53 | + @Operation(summary = "获得文章详情") | |
| 54 | + @Parameter(name = "id", description = "文章编号", example = "1024") | |
| 73 | 55 | public CommonResult<AppArticleRespVO> getArticlePage(@RequestParam("id") Long id) { |
| 74 | - Random random = new Random(); | |
| 75 | - AppArticleRespVO appArticleRespVO = new AppArticleRespVO(); | |
| 76 | - appArticleRespVO.setId((long) (1)); | |
| 77 | - appArticleRespVO.setTitle("芋道源码 - " + 0 + "模块"); | |
| 78 | - appArticleRespVO.setAuthor("芋道源码"); | |
| 79 | - appArticleRespVO.setCategoryId((long) random.nextInt(10000)); | |
| 80 | - appArticleRespVO.setPicUrl("https://www.iocoder.cn/" + (0 + 1) + ".png"); | |
| 81 | - appArticleRespVO.setIntroduction("我是简介"); | |
| 82 | - appArticleRespVO.setDescription("我是详细"); | |
| 83 | - appArticleRespVO.setCreateTime(LocalDateTime.now()); | |
| 84 | - appArticleRespVO.setBrowseCount(random.nextInt(10000)); | |
| 85 | - appArticleRespVO.setSpuId((long) random.nextInt(10000)); | |
| 86 | - appArticleRespVO.setSpuId(633L); | |
| 87 | - return success(appArticleRespVO); | |
| 56 | + return success(ArticleConvert.INSTANCE.convert01(articleService.getArticle(id))); | |
| 57 | + } | |
| 58 | + | |
| 59 | + @PutMapping("/add-browse-count") | |
| 60 | + @Operation(summary = "增加文章浏览量") | |
| 61 | + @Parameter(name = "id", description = "文章编号", example = "1024") | |
| 62 | + public CommonResult<Boolean> addBrowseCount(@RequestParam("id") Long id) { | |
| 63 | + articleService.addArticleBrowseCount(id); | |
| 64 | + return success(true); | |
| 88 | 65 | } |
| 89 | 66 | |
| 90 | 67 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/article/vo/article/AppArticleRespVO.java
| ... | ... | @@ -39,11 +39,4 @@ public class AppArticleRespVO { |
| 39 | 39 | @Schema(description = "关联的商品 SPU 编号", example = "1024") |
| 40 | 40 | private Long spuId; |
| 41 | 41 | |
| 42 | -// TODO 芋艿:下面 2 个字段,后端要存储,前端不用返回; | |
| 43 | -// @Schema(description = "是否热卖推荐", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | |
| 44 | -// private Boolean recommendHot; | |
| 45 | -// | |
| 46 | -// @Schema(description = "是否 Banner 推荐", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | |
| 47 | -// private Boolean recommendBanner; | |
| 48 | - | |
| 49 | 42 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/article/vo/category/AppArticleCategoryRespVO.java
| ... | ... | @@ -16,11 +16,4 @@ public class AppArticleCategoryRespVO { |
| 16 | 16 | @Schema(description = "分类图标", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.png") |
| 17 | 17 | private String picUrl; |
| 18 | 18 | |
| 19 | - // TODO 芋艿:下面 2 个字段,后端要存储,前端不用返回; | |
| 20 | -// @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 21 | -// private Integer status; | |
| 22 | -// | |
| 23 | -// @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 24 | -// private Integer sort; | |
| 25 | - | |
| 26 | 19 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/banner/AppBannerController.java
| ... | ... | @@ -2,18 +2,23 @@ package cn.iocoder.yudao.module.promotion.controller.app.banner; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.module.promotion.controller.app.banner.vo.AppBannerRespVO; |
| 5 | +import cn.iocoder.yudao.module.promotion.convert.banner.BannerConvert; | |
| 6 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.banner.BannerDO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.service.banner.BannerService; | |
| 8 | +import com.google.common.cache.CacheLoader; | |
| 9 | +import com.google.common.cache.LoadingCache; | |
| 5 | 10 | import io.swagger.v3.oas.annotations.Operation; |
| 11 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 6 | 12 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 7 | 13 | import org.springframework.validation.annotation.Validated; |
| 8 | -import org.springframework.web.bind.annotation.GetMapping; | |
| 9 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 10 | -import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | -import org.springframework.web.bind.annotation.RestController; | |
| 14 | +import org.springframework.web.bind.annotation.*; | |
| 12 | 15 | |
| 13 | -import java.util.ArrayList; | |
| 16 | +import javax.annotation.Resource; | |
| 17 | +import java.time.Duration; | |
| 14 | 18 | import java.util.List; |
| 15 | 19 | |
| 16 | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | +import static cn.iocoder.yudao.framework.common.util.cache.CacheUtils.buildAsyncReloadingCache; | |
| 17 | 22 | |
| 18 | 23 | @RestController |
| 19 | 24 | @RequestMapping("/promotion/banner") |
| ... | ... | @@ -21,22 +26,41 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 26 | @Validated |
| 22 | 27 | public class AppBannerController { |
| 23 | 28 | |
| 29 | + // TODO @puhui999:这个目前不缓存,也没问题,因为首页没用到。 | |
| 30 | + /** | |
| 31 | + * {@link AppBannerRespVO} 缓存,通过它异步刷新 {@link #getBannerList0(Integer)} 所要的首页数据 | |
| 32 | + */ | |
| 33 | + private final LoadingCache<Integer, List<AppBannerRespVO>> bannerListCache = buildAsyncReloadingCache(Duration.ofSeconds(10L), | |
| 34 | + new CacheLoader<Integer, List<AppBannerRespVO>>() { | |
| 35 | + | |
| 36 | + @Override | |
| 37 | + public List<AppBannerRespVO> load(Integer position) { | |
| 38 | + return getBannerList0(position); | |
| 39 | + } | |
| 40 | + | |
| 41 | + }); | |
| 42 | + | |
| 43 | + @Resource | |
| 44 | + private BannerService bannerService; | |
| 45 | + | |
| 24 | 46 | @GetMapping("/list") |
| 25 | 47 | @Operation(summary = "获得 banner 列表") |
| 26 | - // todo @芋艿:swagger 注解,待补全 | |
| 27 | - // TODO @芋艿:可以增加缓存,提升性能 | |
| 28 | - // TODO @芋艿:position = 1 时,首页;position = 10 时,拼团活动页 | |
| 48 | + @Parameter(name = "position", description = "Banner position", example = "1") | |
| 29 | 49 | public CommonResult<List<AppBannerRespVO>> getBannerList(@RequestParam("position") Integer position) { |
| 30 | - List<AppBannerRespVO> bannerList = new ArrayList<>(); | |
| 31 | - AppBannerRespVO banner1 = new AppBannerRespVO(); | |
| 32 | - banner1.setUrl("https://www.example.com/link1"); | |
| 33 | - banner1.setPicUrl("https://api.java.crmeb.net/crmebimage/public/content/2022/08/04/0f78716213f64bfa83f191d51a832cbf73f6axavoy.jpg"); | |
| 34 | - bannerList.add(banner1); | |
| 35 | - AppBannerRespVO banner2 = new AppBannerRespVO(); | |
| 36 | - banner2.setUrl("https://www.example.com/link2"); | |
| 37 | - banner2.setPicUrl("https://api.java.crmeb.net/crmebimage/public/content/2023/01/11/be09e755268b43ee90b0db3a3e1b7132r7a6t2wvsm.jpg"); | |
| 38 | - bannerList.add(banner2); | |
| 39 | - return success(bannerList); | |
| 50 | + return success(bannerListCache.getUnchecked(position)); | |
| 51 | + } | |
| 52 | + | |
| 53 | + private List<AppBannerRespVO> getBannerList0(Integer position) { | |
| 54 | + List<BannerDO> bannerList = bannerService.getBannerListByPosition(position); | |
| 55 | + return BannerConvert.INSTANCE.convertList01(bannerList); | |
| 56 | + } | |
| 57 | + | |
| 58 | + @PutMapping("/add-browse-count") | |
| 59 | + @Operation(summary = "增加 Banner 点击量") | |
| 60 | + @Parameter(name = "id", description = "Banner 编号", example = "1024") | |
| 61 | + public CommonResult<Boolean> addBrowseCount(@RequestParam("id") Long id) { | |
| 62 | + bannerService.addBannerBrowseCount(id); | |
| 63 | + return success(true); | |
| 40 | 64 | } |
| 41 | 65 | |
| 42 | 66 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/banner/vo/AppBannerRespVO.java
| ... | ... | @@ -9,6 +9,13 @@ import javax.validation.constraints.NotNull; |
| 9 | 9 | @Data |
| 10 | 10 | public class AppBannerRespVO { |
| 11 | 11 | |
| 12 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | + @Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 16 | + @NotNull(message = "标题不能为空") | |
| 17 | + private String title; | |
| 18 | + | |
| 12 | 19 | @Schema(description = "跳转链接", requiredMode = Schema.RequiredMode.REQUIRED) |
| 13 | 20 | @NotNull(message = "跳转链接不能为空") |
| 14 | 21 | private String url; | ... | ... |
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.controller.app.article.vo.category.AppArticleCategoryRespVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.factory.Mappers; | |
| 9 | + | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 文章分类 Convert | |
| 14 | + * | |
| 15 | + * @author HUIHUI | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface ArticleCategoryConvert { | |
| 19 | + | |
| 20 | + ArticleCategoryConvert INSTANCE = Mappers.getMapper(ArticleCategoryConvert.class); | |
| 21 | + | |
| 22 | + ArticleCategoryDO convert(ArticleCategoryCreateReqVO bean); | |
| 23 | + | |
| 24 | + ArticleCategoryDO convert(ArticleCategoryUpdateReqVO bean); | |
| 25 | + | |
| 26 | + ArticleCategoryRespVO convert(ArticleCategoryDO bean); | |
| 27 | + | |
| 28 | + List<ArticleCategoryRespVO> convertList(List<ArticleCategoryDO> list); | |
| 29 | + | |
| 30 | + PageResult<ArticleCategoryRespVO> convertPage(PageResult<ArticleCategoryDO> page); | |
| 31 | + | |
| 32 | + List<ArticleCategorySimpleRespVO> convertList03(List<ArticleCategoryDO> list); | |
| 33 | + | |
| 34 | + List<AppArticleCategoryRespVO> convertList04(List<ArticleCategoryDO> categoryList); | |
| 35 | + | |
| 36 | +} | ... | ... |
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.article.ArticleCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleRespVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticleRespVO; | |
| 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 | + AppArticleRespVO convert01(ArticleDO article); | |
| 35 | + | |
| 36 | + PageResult<AppArticleRespVO> convertPage02(PageResult<ArticleDO> articlePage); | |
| 37 | + | |
| 38 | + List<AppArticleRespVO> convertList03(List<ArticleDO> articleCategoryListByRecommendHotAndRecommendBanner); | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/banner/BannerConvert.java
| ... | ... | @@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerCreateReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerRespVO; |
| 6 | 6 | import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerUpdateReqVO; |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.app.banner.vo.AppBannerRespVO; | |
| 7 | 8 | import cn.iocoder.yudao.module.promotion.dal.dataobject.banner.BannerDO; |
| 8 | 9 | import org.mapstruct.Mapper; |
| 9 | 10 | import org.mapstruct.factory.Mappers; |
| ... | ... | @@ -25,4 +26,6 @@ public interface BannerConvert { |
| 25 | 26 | |
| 26 | 27 | BannerDO convert(BannerUpdateReqVO updateReqVO); |
| 27 | 28 | |
| 29 | + List<AppBannerRespVO> convertList01(List<BannerDO> bannerList); | |
| 30 | + | |
| 28 | 31 | } | ... | ... |
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)); |
| ... | ... | @@ -200,32 +207,23 @@ public interface CombinationActivityConvert { |
| 200 | 207 | /** |
| 201 | 208 | * 转换生成虚拟成团虚拟记录 |
| 202 | 209 | * |
| 203 | - * @param virtualGroupHeadRecords 虚拟成团团长记录列表 | |
| 210 | + * @param headRecord 虚拟成团团长记录 | |
| 204 | 211 | * @return 虚拟记录列表 |
| 205 | 212 | */ |
| 206 | - default List<CombinationRecordDO> convertVirtualGroupList(List<CombinationRecordDO> virtualGroupHeadRecords) { | |
| 207 | - List<CombinationRecordDO> createRecords = new ArrayList<>(); | |
| 208 | - virtualGroupHeadRecords.forEach(headRecord -> { | |
| 209 | - // 计算需要创建的虚拟成团记录数量 | |
| 210 | - int count = headRecord.getUserSize() - headRecord.getUserCount(); | |
| 211 | - for (int i = 0; i < count; i++) { | |
| 212 | - // 基础信息和团长保持一致 | |
| 213 | - CombinationRecordDO newRecord = new CombinationRecordDO().setActivityId(headRecord.getActivityId()) | |
| 214 | - .setCombinationPrice(headRecord.getCombinationPrice()).setSpuId(headRecord.getSpuId()).setSpuName(headRecord.getSpuName()) | |
| 215 | - .setPicUrl(headRecord.getPicUrl()).setSkuId(headRecord.getSkuId()).setHeadId(headRecord.getId()) | |
| 216 | - .setStatus(headRecord.getStatus()) // 状态保持和创建时一致,创建完成后会接着处理 | |
| 217 | - .setVirtualGroup(headRecord.getVirtualGroup()).setExpireTime(headRecord.getExpireTime()) | |
| 218 | - .setStartTime(headRecord.getStartTime()).setUserSize(headRecord.getUserSize()).setUserCount(headRecord.getUserCount()); | |
| 219 | - // 虚拟信息 | |
| 220 | - newRecord.setCount(0); | |
| 221 | - newRecord.setUserId(0L); | |
| 222 | - newRecord.setNickname(""); | |
| 223 | - newRecord.setAvatar(""); | |
| 224 | - newRecord.setOrderId(0L); | |
| 225 | - createRecords.add(newRecord); | |
| 226 | - } | |
| 227 | - }); | |
| 213 | + default List<CombinationRecordDO> convertVirtualRecordList(CombinationRecordDO headRecord) { | |
| 214 | + int count = headRecord.getUserSize() - headRecord.getUserCount(); | |
| 215 | + List<CombinationRecordDO> createRecords = new ArrayList<>(count); | |
| 216 | + for (int i = 0; i < count; i++) { | |
| 217 | + // 基础信息和团长保持一致 | |
| 218 | + CombinationRecordDO newRecord = convert5(headRecord); | |
| 219 | + // 虚拟信息 | |
| 220 | + newRecord.setCount(0) // 会单独更新下,在后续的 Service 逻辑里 | |
| 221 | + .setUserId(0L).setNickname("").setAvatar("").setOrderId(0L); | |
| 222 | + createRecords.add(newRecord); | |
| 223 | + } | |
| 228 | 224 | return createRecords; |
| 229 | 225 | } |
| 226 | + @Mapping(target = "id", ignore = true) | |
| 227 | + CombinationRecordDO convert5(CombinationRecordDO headRecord); | |
| 230 | 228 | |
| 231 | 229 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/coupon/CouponTemplateConvert.java
| ... | ... | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.promotion.convert.coupon; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.map.MapUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | +import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO; | |
| 5 | 6 | import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template.CouponTemplateCreateReqVO; |
| 6 | 7 | import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template.CouponTemplatePageReqVO; |
| 7 | 8 | import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template.CouponTemplateRespVO; |
| ... | ... | @@ -58,4 +59,6 @@ public interface CouponTemplateConvert { |
| 58 | 59 | } |
| 59 | 60 | } |
| 60 | 61 | |
| 62 | + List<CouponTemplateRespDTO> convertList(List<CouponTemplateDO> list); | |
| 63 | + | |
| 61 | 64 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/discount/DiscountActivityConvert.java
| ... | ... | @@ -2,6 +2,9 @@ package cn.iocoder.yudao.module.promotion.convert.discount; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.util.ObjectUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 6 | +import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | |
| 7 | +import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; | |
| 5 | 8 | import cn.iocoder.yudao.module.promotion.api.discount.dto.DiscountProductRespDTO; |
| 6 | 9 | import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.*; |
| 7 | 10 | import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountActivityDO; |
| ... | ... | @@ -11,6 +14,7 @@ import org.mapstruct.Mapper; |
| 11 | 14 | import org.mapstruct.factory.Mappers; |
| 12 | 15 | |
| 13 | 16 | import java.util.List; |
| 17 | +import java.util.Map; | |
| 14 | 18 | |
| 15 | 19 | /** |
| 16 | 20 | * 限时折扣活动 Convert |
| ... | ... | @@ -29,14 +33,57 @@ public interface DiscountActivityConvert { |
| 29 | 33 | DiscountActivityRespVO convert(DiscountActivityDO bean); |
| 30 | 34 | |
| 31 | 35 | List<DiscountActivityRespVO> convertList(List<DiscountActivityDO> list); |
| 36 | + List<DiscountActivityBaseVO.Product> convertList2(List<DiscountProductDO> list); | |
| 32 | 37 | |
| 33 | 38 | List<DiscountProductRespDTO> convertList02(List<DiscountProductDO> list); |
| 34 | 39 | |
| 35 | 40 | PageResult<DiscountActivityRespVO> convertPage(PageResult<DiscountActivityDO> page); |
| 36 | 41 | |
| 42 | + default PageResult<DiscountActivityRespVO> convertPage(PageResult<DiscountActivityDO> page, | |
| 43 | + List<DiscountProductDO> discountProductDOList, | |
| 44 | + List<ProductSpuRespDTO> spuList) { | |
| 45 | + PageResult<DiscountActivityRespVO> pageResult = convertPage(page); | |
| 46 | + | |
| 47 | + // 拼接商品 TODO @zhangshuai:类似空行的问题,也可以看看 | |
| 48 | + Map<Long, DiscountProductDO> discountActivityMap = CollectionUtils.convertMap(discountProductDOList, DiscountProductDO::getActivityId); | |
| 49 | + Map<Long, ProductSpuRespDTO> spuMap = CollectionUtils.convertMap(spuList, ProductSpuRespDTO::getId); | |
| 50 | + pageResult.getList().forEach(item -> { | |
| 51 | + item.setProducts(convertList2(discountProductDOList)); | |
| 52 | + item.setSpuId(discountActivityMap.get(item.getId())==null?null: discountActivityMap.get(item.getId()).getSpuId()); | |
| 53 | + if (item.getSpuId() != null) { | |
| 54 | + MapUtils.findAndThen(spuMap, item.getSpuId(), | |
| 55 | + spu -> item.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice())); | |
| 56 | + } | |
| 57 | + | |
| 58 | + }); | |
| 59 | + return pageResult; | |
| 60 | + } | |
| 61 | + | |
| 37 | 62 | DiscountProductDO convert(DiscountActivityBaseVO.Product bean); |
| 38 | 63 | |
| 39 | - DiscountActivityDetailRespVO convert(DiscountActivityDO activity, List<DiscountProductDO> products); | |
| 64 | + default DiscountActivityDetailRespVO convert(DiscountActivityDO activity, List<DiscountProductDO> products){ | |
| 65 | + if ( activity == null && products == null ) { | |
| 66 | + return null; | |
| 67 | + } | |
| 68 | + | |
| 69 | + DiscountActivityDetailRespVO discountActivityDetailRespVO = new DiscountActivityDetailRespVO(); | |
| 70 | + | |
| 71 | + if ( activity != null ) { | |
| 72 | + discountActivityDetailRespVO.setName( activity.getName() ); | |
| 73 | + discountActivityDetailRespVO.setStartTime( activity.getStartTime() ); | |
| 74 | + discountActivityDetailRespVO.setEndTime( activity.getEndTime() ); | |
| 75 | + discountActivityDetailRespVO.setRemark( activity.getRemark() ); | |
| 76 | + discountActivityDetailRespVO.setId( activity.getId() ); | |
| 77 | + discountActivityDetailRespVO.setStatus( activity.getStatus() ); | |
| 78 | + discountActivityDetailRespVO.setCreateTime( activity.getCreateTime() ); | |
| 79 | + } | |
| 80 | + if (!products.isEmpty()) { | |
| 81 | + discountActivityDetailRespVO.setSpuId(products.get(0).getSpuId()); | |
| 82 | + } | |
| 83 | + discountActivityDetailRespVO.setProducts( convertList2( products ) ); | |
| 84 | + | |
| 85 | + return discountActivityDetailRespVO; | |
| 86 | + } | |
| 40 | 87 | |
| 41 | 88 | // =========== 比较是否相等 ========== |
| 42 | 89 | /** | ... | ... |
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 Integer 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/banner/BannerDO.java
| 1 | 1 | package cn.iocoder.yudao.module.promotion.dal.dataobject.banner; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 3 | 4 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 5 | +import cn.iocoder.yudao.module.promotion.enums.banner.BannerPositionEnum; | |
| 4 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 5 | 7 | import lombok.*; |
| 6 | 8 | |
| 9 | +// TODO @puhui999:表名改成 promotion_banner,然后有序加下;另外,sql 给我下哈;还有那个 position 字典,嘿嘿。 | |
| 7 | 10 | /** |
| 8 | 11 | * banner DO |
| 9 | 12 | * |
| ... | ... | @@ -40,14 +43,23 @@ public class BannerDO extends BaseDO { |
| 40 | 43 | private Integer sort; |
| 41 | 44 | |
| 42 | 45 | /** |
| 43 | - * 状态 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum} | |
| 46 | + * 状态 {@link CommonStatusEnum} | |
| 44 | 47 | */ |
| 45 | 48 | private Integer status; |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 定位 {@link BannerPositionEnum} | |
| 52 | + */ | |
| 53 | + private Integer position; | |
| 54 | + | |
| 46 | 55 | /** |
| 47 | 56 | * 备注 |
| 48 | 57 | */ |
| 49 | 58 | private String memo; |
| 50 | 59 | |
| 51 | - // TODO 芋艿 点击次数。&& 其他数据相关 | |
| 60 | + /** | |
| 61 | + * 点击次数 | |
| 62 | + */ | |
| 63 | + private Integer browseCount; | |
| 52 | 64 | |
| 53 | 65 | } | ... | ... |
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 | * |
| ... | ... | @@ -65,4 +66,23 @@ public class DiscountProductDO extends BaseDO { |
| 65 | 66 | */ |
| 66 | 67 | private Integer discountPrice; |
| 67 | 68 | |
| 69 | + /** | |
| 70 | + * 活动状态 | |
| 71 | + * | |
| 72 | + * 关联 {@link DiscountActivityDO#getStatus()} | |
| 73 | + */ | |
| 74 | + private Integer activityStatus; | |
| 75 | + /** | |
| 76 | + * 活动开始时间点 | |
| 77 | + * | |
| 78 | + * 冗余 {@link DiscountActivityDO#getStartTime()} | |
| 79 | + */ | |
| 80 | + private LocalDateTime activityStartTime; | |
| 81 | + /** | |
| 82 | + * 活动结束时间点 | |
| 83 | + * | |
| 84 | + * 冗余 {@link DiscountActivityDO#getEndTime()} | |
| 85 | + */ | |
| 86 | + private LocalDateTime activityEndTime; | |
| 87 | + | |
| 68 | 88 | } | ... | ... |
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.ArticleCategoryPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 文章分类 Mapper | |
| 14 | + * | |
| 15 | + * @author HUIHUI | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface ArticleCategoryMapper extends BaseMapperX<ArticleCategoryDO> { | |
| 19 | + | |
| 20 | + default PageResult<ArticleCategoryDO> selectPage(ArticleCategoryPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<ArticleCategoryDO>() | |
| 22 | + .likeIfPresent(ArticleCategoryDO::getName, reqVO.getName()) | |
| 23 | + .eqIfPresent(ArticleCategoryDO::getStatus, reqVO.getStatus()) | |
| 24 | + .betweenIfPresent(ArticleCategoryDO::getCreateTime, reqVO.getCreateTime()) | |
| 25 | + .orderByDesc(ArticleCategoryDO::getSort)); | |
| 26 | + } | |
| 27 | + | |
| 28 | + default List<ArticleCategoryDO> selectListByStatus(Integer status) { | |
| 29 | + return selectList(ArticleCategoryDO::getStatus, status); | |
| 30 | + } | |
| 31 | + | |
| 32 | +} | ... | ... |
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.article.ArticlePageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 9 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
| 10 | +import org.apache.ibatis.annotations.Mapper; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 文章管理 Mapper | |
| 16 | + * | |
| 17 | + * @author HUIHUI | |
| 18 | + */ | |
| 19 | +@Mapper | |
| 20 | +public interface ArticleMapper extends BaseMapperX<ArticleDO> { | |
| 21 | + | |
| 22 | + default PageResult<ArticleDO> selectPage(ArticlePageReqVO reqVO) { | |
| 23 | + return selectPage(reqVO, new LambdaQueryWrapperX<ArticleDO>() | |
| 24 | + .eqIfPresent(ArticleDO::getCategoryId, reqVO.getCategoryId()) | |
| 25 | + .eqIfPresent(ArticleDO::getTitle, reqVO.getTitle()) | |
| 26 | + .eqIfPresent(ArticleDO::getAuthor, reqVO.getAuthor()) | |
| 27 | + .eqIfPresent(ArticleDO::getStatus, reqVO.getStatus()) | |
| 28 | + .eqIfPresent(ArticleDO::getSpuId, reqVO.getSpuId()) | |
| 29 | + .eqIfPresent(ArticleDO::getRecommendHot, reqVO.getRecommendHot()) | |
| 30 | + .eqIfPresent(ArticleDO::getRecommendBanner, reqVO.getRecommendBanner()) | |
| 31 | + .betweenIfPresent(ArticleDO::getCreateTime, reqVO.getCreateTime()) | |
| 32 | + .orderByDesc(ArticleDO::getId)); | |
| 33 | + } | |
| 34 | + | |
| 35 | + default List<ArticleDO> selectList(Boolean recommendHot, Boolean recommendBanner) { | |
| 36 | + return selectList(new LambdaQueryWrapperX<ArticleDO>() | |
| 37 | + .eqIfPresent(ArticleDO::getRecommendHot, recommendHot) | |
| 38 | + .eqIfPresent(ArticleDO::getRecommendBanner, recommendBanner)); | |
| 39 | + } | |
| 40 | + | |
| 41 | + default PageResult<ArticleDO> selectPage(AppArticlePageReqVO pageReqVO) { | |
| 42 | + return selectPage(pageReqVO, new LambdaQueryWrapperX<ArticleDO>() | |
| 43 | + .eqIfPresent(ArticleDO::getCategoryId, pageReqVO.getCategoryId())); | |
| 44 | + } | |
| 45 | + | |
| 46 | + default void updateBrowseCount(Long id) { | |
| 47 | + update(null, new LambdaUpdateWrapper<ArticleDO>() | |
| 48 | + .eq(ArticleDO::getId, id) | |
| 49 | + .setSql("browse_count = browse_count + 1")); | |
| 50 | + } | |
| 51 | + | |
| 52 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/banner/BannerMapper.java
| ... | ... | @@ -5,8 +5,11 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | 6 | import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerPageReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.promotion.dal.dataobject.banner.BannerDO; |
| 8 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
| 8 | 9 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 10 | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 10 | 13 | /** |
| 11 | 14 | * Banner Mapper |
| 12 | 15 | * |
| ... | ... | @@ -23,4 +26,14 @@ public interface BannerMapper extends BaseMapperX<BannerDO> { |
| 23 | 26 | .orderByDesc(BannerDO::getSort)); |
| 24 | 27 | } |
| 25 | 28 | |
| 29 | + default void updateBrowseCount(Long id) { | |
| 30 | + update(null, new LambdaUpdateWrapper<BannerDO>() | |
| 31 | + .eq(BannerDO::getId, id) | |
| 32 | + .setSql("browse_count = browse_count + 1")); | |
| 33 | + } | |
| 34 | + | |
| 35 | + default List<BannerDO> selectBannerListByPosition(Integer position) { | |
| 36 | + return selectList(new LambdaQueryWrapperX<BannerDO>().eq(BannerDO::getPosition, position)); | |
| 37 | + } | |
| 38 | + | |
| 26 | 39 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/bargain/BargainActivityMapper.java
| ... | ... | @@ -86,7 +86,6 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { |
| 86 | 86 | .last("LIMIT " + count)); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - // TODO @puhui999:是不是返回 BargainActivityDO 更干净哈? | |
| 90 | 89 | /** |
| 91 | 90 | * 查询出指定 spuId 的 spu 参加的活动最接近现在的一条记录。多个的话,一个 spuId 对应一个最近的活动编号 |
| 92 | 91 | * |
| ... | ... | @@ -102,9 +101,19 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { |
| 102 | 101 | .groupBy("spu_id")); |
| 103 | 102 | } |
| 104 | 103 | |
| 105 | - default List<BargainActivityDO> selectListByIds(Collection<Long> ids) { | |
| 104 | + /** | |
| 105 | + * 获取指定活动编号的活动列表且 | |
| 106 | + * 开始时间和结束时间小于给定时间 dateTime 的活动列表 | |
| 107 | + * | |
| 108 | + * @param ids 活动编号 | |
| 109 | + * @param dateTime 指定日期 | |
| 110 | + * @return 活动列表 | |
| 111 | + */ | |
| 112 | + default List<BargainActivityDO> selectListByIdsAndDateTimeLt(Collection<Long> ids, LocalDateTime dateTime) { | |
| 106 | 113 | return selectList(new LambdaQueryWrapperX<BargainActivityDO>() |
| 107 | 114 | .in(BargainActivityDO::getId, ids) |
| 115 | + .lt(BargainActivityDO::getStartTime, dateTime) | |
| 116 | + .gt(BargainActivityDO::getEndTime, dateTime)// 开始时间 < 指定时间 < 结束时间,也就是说获取指定时间段的活动 | |
| 108 | 117 | .orderByDesc(BargainActivityDO::getCreateTime)); |
| 109 | 118 | } |
| 110 | 119 | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationActivityMapper.java
| ... | ... | @@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 10 | 10 | import org.apache.ibatis.annotations.Mapper; |
| 11 | 11 | import org.apache.ibatis.annotations.Param; |
| 12 | 12 | |
| 13 | +import java.time.LocalDateTime; | |
| 13 | 14 | import java.util.Collection; |
| 14 | 15 | import java.util.List; |
| 15 | 16 | import java.util.Map; |
| ... | ... | @@ -58,9 +59,19 @@ public interface CombinationActivityMapper extends BaseMapperX<CombinationActivi |
| 58 | 59 | .groupBy("spu_id")); |
| 59 | 60 | } |
| 60 | 61 | |
| 61 | - default List<CombinationActivityDO> selectListByIds(Collection<Long> ids) { | |
| 62 | + /** | |
| 63 | + * 获取指定活动编号的活动列表且 | |
| 64 | + * 开始时间和结束时间小于给定时间 dateTime 的活动列表 | |
| 65 | + * | |
| 66 | + * @param ids 活动编号 | |
| 67 | + * @param dateTime 指定日期 | |
| 68 | + * @return 活动列表 | |
| 69 | + */ | |
| 70 | + default List<CombinationActivityDO> selectListByIdsAndDateTimeLt(Collection<Long> ids, LocalDateTime dateTime) { | |
| 62 | 71 | return selectList(new LambdaQueryWrapperX<CombinationActivityDO>() |
| 63 | 72 | .in(CombinationActivityDO::getId, ids) |
| 73 | + .lt(CombinationActivityDO::getStartTime, dateTime) | |
| 74 | + .gt(CombinationActivityDO::getEndTime, dateTime)// 开始时间 < 指定时间 < 结束时间,也就是说获取指定时间段的活动 | |
| 64 | 75 | .orderByDesc(CombinationActivityDO::getCreateTime)); |
| 65 | 76 | } |
| 66 | 77 | ... | ... |
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,13 +116,20 @@ 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 | + default Long selectUserCount() { | |
| 122 | 131 | 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) | |
| 128 | - .groupBy("user_id")); | |
| 132 | + .select("DISTINCT (user_id)")); | |
| 129 | 133 | } |
| 130 | 134 | |
| 131 | 135 | default List<CombinationRecordDO> selectListByHeadIdAndStatusAndExpireTimeLt(Long headId, Integer status, LocalDateTime dateTime) { |
| ... | ... | @@ -135,8 +139,8 @@ public interface CombinationRecordMapper extends BaseMapperX<CombinationRecordDO |
| 135 | 139 | .lt(CombinationRecordDO::getExpireTime, dateTime)); |
| 136 | 140 | } |
| 137 | 141 | |
| 138 | - default List<CombinationRecordDO> selectListByHeadIds(Collection<Long> headIds) { | |
| 139 | - return selectList(new LambdaQueryWrapperX<CombinationRecordDO>().in(CombinationRecordDO::getHeadId, headIds)); | |
| 142 | + default List<CombinationRecordDO> selectListByHeadId(Long headId) { | |
| 143 | + return selectList(CombinationRecordDO::getHeadId, headId); | |
| 140 | 144 | } |
| 141 | 145 | |
| 142 | 146 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/coupon/CouponTemplateMapper.java
| ... | ... | @@ -8,10 +8,11 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 8 | 8 | import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template.CouponTemplatePageReqVO; |
| 9 | 9 | import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponTemplateDO; |
| 10 | 10 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 11 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
| 11 | 12 | import org.apache.ibatis.annotations.Mapper; |
| 12 | -import org.apache.ibatis.annotations.Param; | |
| 13 | 13 | |
| 14 | 14 | import java.time.LocalDateTime; |
| 15 | +import java.util.Collection; | |
| 15 | 16 | import java.util.List; |
| 16 | 17 | import java.util.function.Consumer; |
| 17 | 18 | |
| ... | ... | @@ -39,7 +40,11 @@ public interface CouponTemplateMapper extends BaseMapperX<CouponTemplateDO> { |
| 39 | 40 | .orderByDesc(CouponTemplateDO::getId)); |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | - void updateTakeCount(@Param("id") Long id, @Param("incrCount") Integer incrCount); | |
| 43 | + default void updateTakeCount(Long id, Integer incrCount) { | |
| 44 | + update(null, new LambdaUpdateWrapper<CouponTemplateDO>() | |
| 45 | + .eq(CouponTemplateDO::getId, id) | |
| 46 | + .setSql("take_count = take_count + " + incrCount)); | |
| 47 | + } | |
| 43 | 48 | |
| 44 | 49 | default List<CouponTemplateDO> selectListByTakeType(Integer takeType) { |
| 45 | 50 | return selectList(CouponTemplateDO::getTakeType, takeType); |
| ... | ... | @@ -70,4 +75,8 @@ public interface CouponTemplateMapper extends BaseMapperX<CouponTemplateDO> { |
| 70 | 75 | return canTakeConsumer; |
| 71 | 76 | } |
| 72 | 77 | |
| 78 | + default List<CouponTemplateDO> selectListByIds(Collection<Long> ids) { | |
| 79 | + return selectList(new LambdaQueryWrapperX<CouponTemplateDO>().in(CouponTemplateDO::getId, ids)); | |
| 80 | + } | |
| 81 | + | |
| 73 | 82 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/discount/DiscountProductMapper.java
| ... | ... | @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.promotion.dal.mysql.discount; |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 4 | 4 | import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO; |
| 5 | 5 | import org.apache.ibatis.annotations.Mapper; |
| 6 | +import org.apache.ibatis.annotations.Param; | |
| 6 | 7 | |
| 7 | 8 | import java.util.Collection; |
| 8 | 9 | import java.util.List; |
| ... | ... | @@ -23,4 +24,10 @@ public interface DiscountProductMapper extends BaseMapperX<DiscountProductDO> { |
| 23 | 24 | return selectList(DiscountProductDO::getActivityId, activityId); |
| 24 | 25 | } |
| 25 | 26 | |
| 27 | + default List<DiscountProductDO> selectListByActivityId(Collection<Long> activityIds) { | |
| 28 | + return selectList(DiscountProductDO::getActivityId, activityIds); | |
| 29 | + } | |
| 30 | + | |
| 31 | + // TODO @zhangshuai:逻辑里,尽量避免写 join 语句哈,你可以看看这个查询,有什么办法优化?目前的一个思路,是分 2 次查询,性能也是 ok 的 | |
| 32 | + List<DiscountProductDO> getMatchDiscountProductList(@Param("skuIds") Collection<Long> skuIds); | |
| 26 | 33 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/seckill/seckillactivity/SeckillActivityMapper.java
| ... | ... | @@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 13 | 13 | import org.apache.ibatis.annotations.Mapper; |
| 14 | 14 | import org.apache.ibatis.annotations.Param; |
| 15 | 15 | |
| 16 | +import java.time.LocalDateTime; | |
| 16 | 17 | import java.util.Collection; |
| 17 | 18 | import java.util.List; |
| 18 | 19 | import java.util.Map; |
| ... | ... | @@ -90,9 +91,19 @@ public interface SeckillActivityMapper extends BaseMapperX<SeckillActivityDO> { |
| 90 | 91 | .groupBy("spu_id")); |
| 91 | 92 | } |
| 92 | 93 | |
| 93 | - default List<SeckillActivityDO> selectListByIds(Collection<Long> ids) { | |
| 94 | + /** | |
| 95 | + * 获取指定活动编号的活动列表且 | |
| 96 | + * 开始时间和结束时间小于给定时间 dateTime 的活动列表 | |
| 97 | + * | |
| 98 | + * @param ids 活动编号 | |
| 99 | + * @param dateTime 指定日期 | |
| 100 | + * @return 活动列表 | |
| 101 | + */ | |
| 102 | + default List<SeckillActivityDO> selectListByIdsAndDateTimeLt(Collection<Long> ids, LocalDateTime dateTime) { | |
| 94 | 103 | return selectList(new LambdaQueryWrapperX<SeckillActivityDO>() |
| 95 | 104 | .in(SeckillActivityDO::getId, ids) |
| 105 | + .lt(SeckillActivityDO::getStartTime, dateTime) | |
| 106 | + .gt(SeckillActivityDO::getEndTime, dateTime)// 开始时间 < 指定时间 < 结束时间,也就是说获取指定时间段的活动 | |
| 96 | 107 | .orderByDesc(SeckillActivityDO::getCreateTime)); |
| 97 | 108 | } |
| 98 | 109 | ... | ... |
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.ArticleCategoryPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 8 | + | |
| 9 | +import javax.validation.Valid; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 文章分类 Service 接口 | |
| 14 | + * | |
| 15 | + * @author HUIHUI | |
| 16 | + */ | |
| 17 | +public interface ArticleCategoryService { | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 创建文章分类 | |
| 21 | + * | |
| 22 | + * @param createReqVO 创建信息 | |
| 23 | + * @return 编号 | |
| 24 | + */ | |
| 25 | + Long createArticleCategory(@Valid ArticleCategoryCreateReqVO createReqVO); | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 更新文章分类 | |
| 29 | + * | |
| 30 | + * @param updateReqVO 更新信息 | |
| 31 | + */ | |
| 32 | + void updateArticleCategory(@Valid ArticleCategoryUpdateReqVO updateReqVO); | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 删除文章分类 | |
| 36 | + * | |
| 37 | + * @param id 编号 | |
| 38 | + */ | |
| 39 | + void deleteArticleCategory(Long id); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 获得文章分类 | |
| 43 | + * | |
| 44 | + * @param id 编号 | |
| 45 | + * @return 文章分类 | |
| 46 | + */ | |
| 47 | + ArticleCategoryDO getArticleCategory(Long id); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 获得文章分类分页 | |
| 51 | + * | |
| 52 | + * @param pageReqVO 分页查询 | |
| 53 | + * @return 文章分类分页 | |
| 54 | + */ | |
| 55 | + PageResult<ArticleCategoryDO> getArticleCategoryPage(ArticleCategoryPageReqVO pageReqVO); | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 获得指定状态的文章分类列表 | |
| 59 | + * | |
| 60 | + * @param status 状态 | |
| 61 | + * @return 文章分类列表 | |
| 62 | + */ | |
| 63 | + List<ArticleCategoryDO> getArticleCategoryListByStatus(Integer status); | |
| 64 | + | |
| 65 | +} | ... | ... |
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.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.ArticleCategoryPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleCategoryConvert; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 9 | +import cn.iocoder.yudao.module.promotion.dal.mysql.article.ArticleCategoryMapper; | |
| 10 | +import org.springframework.context.annotation.Lazy; | |
| 11 | +import org.springframework.stereotype.Service; | |
| 12 | +import org.springframework.validation.annotation.Validated; | |
| 13 | + | |
| 14 | +import javax.annotation.Resource; | |
| 15 | +import java.util.List; | |
| 16 | + | |
| 17 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 18 | +import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.ARTICLE_CATEGORY_DELETE_FAIL_HAVE_ARTICLES; | |
| 19 | +import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.ARTICLE_CATEGORY_NOT_EXISTS; | |
| 20 | + | |
| 21 | +/** | |
| 22 | + * 文章分类 Service 实现类 | |
| 23 | + * | |
| 24 | + * @author HUIHUI | |
| 25 | + */ | |
| 26 | +@Service | |
| 27 | +@Validated | |
| 28 | +public class ArticleCategoryServiceImpl implements ArticleCategoryService { | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private ArticleCategoryMapper articleCategoryMapper; | |
| 32 | + | |
| 33 | + @Resource | |
| 34 | + @Lazy // 延迟加载,解决循环依赖问题 | |
| 35 | + private ArticleService articleService; | |
| 36 | + | |
| 37 | + @Override | |
| 38 | + public Long createArticleCategory(ArticleCategoryCreateReqVO createReqVO) { | |
| 39 | + // 插入 | |
| 40 | + ArticleCategoryDO category = ArticleCategoryConvert.INSTANCE.convert(createReqVO); | |
| 41 | + articleCategoryMapper.insert(category); | |
| 42 | + // 返回 | |
| 43 | + return category.getId(); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @Override | |
| 47 | + public void updateArticleCategory(ArticleCategoryUpdateReqVO updateReqVO) { | |
| 48 | + // 校验存在 | |
| 49 | + validateArticleCategoryExists(updateReqVO.getId()); | |
| 50 | + // 更新 | |
| 51 | + ArticleCategoryDO updateObj = ArticleCategoryConvert.INSTANCE.convert(updateReqVO); | |
| 52 | + articleCategoryMapper.updateById(updateObj); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Override | |
| 56 | + public void deleteArticleCategory(Long id) { | |
| 57 | + // 校验存在 | |
| 58 | + validateArticleCategoryExists(id); | |
| 59 | + // 校验是不是存在关联文章 | |
| 60 | + Long count = articleService.getArticleCountByCategoryId(id); | |
| 61 | + if (count > 0) { | |
| 62 | + throw exception(ARTICLE_CATEGORY_DELETE_FAIL_HAVE_ARTICLES); | |
| 63 | + } | |
| 64 | + | |
| 65 | + // 删除 | |
| 66 | + articleCategoryMapper.deleteById(id); | |
| 67 | + } | |
| 68 | + | |
| 69 | + private void validateArticleCategoryExists(Long id) { | |
| 70 | + if (articleCategoryMapper.selectById(id) == null) { | |
| 71 | + throw exception(ARTICLE_CATEGORY_NOT_EXISTS); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + | |
| 75 | + @Override | |
| 76 | + public ArticleCategoryDO getArticleCategory(Long id) { | |
| 77 | + return articleCategoryMapper.selectById(id); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public PageResult<ArticleCategoryDO> getArticleCategoryPage(ArticleCategoryPageReqVO pageReqVO) { | |
| 82 | + return articleCategoryMapper.selectPage(pageReqVO); | |
| 83 | + } | |
| 84 | + | |
| 85 | + @Override | |
| 86 | + public List<ArticleCategoryDO> getArticleCategoryListByStatus(Integer status) { | |
| 87 | + return articleCategoryMapper.selectListByStatus(status); | |
| 88 | + } | |
| 89 | + | |
| 90 | +} | ... | ... |
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.article.ArticleCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 9 | + | |
| 10 | +import javax.validation.Valid; | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 文章详情 Service 接口 | |
| 15 | + * | |
| 16 | + * @author HUIHUI | |
| 17 | + */ | |
| 18 | +public interface ArticleService { | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 创建文章详情 | |
| 22 | + * | |
| 23 | + * @param createReqVO 创建信息 | |
| 24 | + * @return 编号 | |
| 25 | + */ | |
| 26 | + Long createArticle(@Valid ArticleCreateReqVO createReqVO); | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 更新文章详情 | |
| 30 | + * | |
| 31 | + * @param updateReqVO 更新信息 | |
| 32 | + */ | |
| 33 | + void updateArticle(@Valid ArticleUpdateReqVO updateReqVO); | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 删除文章详情 | |
| 37 | + * | |
| 38 | + * @param id 编号 | |
| 39 | + */ | |
| 40 | + void deleteArticle(Long id); | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 获得文章详情 | |
| 44 | + * | |
| 45 | + * @param id 编号 | |
| 46 | + * @return 文章详情 | |
| 47 | + */ | |
| 48 | + ArticleDO getArticle(Long id); | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 获得文章详情分页 | |
| 52 | + * | |
| 53 | + * @param pageReqVO 分页查询 | |
| 54 | + * @return 文章详情分页 | |
| 55 | + */ | |
| 56 | + PageResult<ArticleDO> getArticlePage(ArticlePageReqVO pageReqVO); | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 获得文章详情列表 | |
| 60 | + * | |
| 61 | + * @param recommendHot 是否热门 | |
| 62 | + * @param recommendBanner 是否轮播图 | |
| 63 | + * @return 文章详情列表 | |
| 64 | + */ | |
| 65 | + List<ArticleDO> getArticleCategoryListByRecommend(Boolean recommendHot, Boolean recommendBanner); | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 获得文章详情分页 | |
| 69 | + * | |
| 70 | + * @param pageReqVO 分页查询 | |
| 71 | + * @return 文章详情分页 | |
| 72 | + */ | |
| 73 | + PageResult<ArticleDO> getArticlePage(AppArticlePageReqVO pageReqVO); | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * 获得指定分类的文章列表 | |
| 77 | + * | |
| 78 | + * @param categoryId 文章分类编号 | |
| 79 | + * @return 文章列表 | |
| 80 | + */ | |
| 81 | + List<ArticleDO> getArticleByCategoryId(Long categoryId); | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 获得指定分类的文章数量 | |
| 85 | + * | |
| 86 | + * @param categoryId 文章分类编号 | |
| 87 | + * @return 文章数量 | |
| 88 | + */ | |
| 89 | + Long getArticleCountByCategoryId(Long categoryId); | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * 增加文章浏览量 | |
| 93 | + * | |
| 94 | + * @param id 文章编号 | |
| 95 | + */ | |
| 96 | + void addArticleBrowseCount(Long id); | |
| 97 | + | |
| 98 | +} | ... | ... |
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.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.promotion.convert.article.ArticleConvert; | |
| 9 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO; | |
| 10 | +import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO; | |
| 11 | +import cn.iocoder.yudao.module.promotion.dal.mysql.article.ArticleMapper; | |
| 12 | +import org.springframework.stereotype.Service; | |
| 13 | +import org.springframework.validation.annotation.Validated; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 19 | +import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.ARTICLE_CATEGORY_NOT_EXISTS; | |
| 20 | +import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.ARTICLE_NOT_EXISTS; | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * 文章管理 Service 实现类 | |
| 24 | + * | |
| 25 | + * @author HUIHUI | |
| 26 | + */ | |
| 27 | +@Service | |
| 28 | +@Validated | |
| 29 | +public class ArticleServiceImpl implements ArticleService { | |
| 30 | + | |
| 31 | + @Resource | |
| 32 | + private ArticleMapper articleMapper; | |
| 33 | + | |
| 34 | + @Resource | |
| 35 | + private ArticleCategoryService articleCategoryService; | |
| 36 | + | |
| 37 | + @Override | |
| 38 | + public Long createArticle(ArticleCreateReqVO createReqVO) { | |
| 39 | + // 校验分类存在 | |
| 40 | + validateArticleCategoryExists(createReqVO.getCategoryId()); | |
| 41 | + | |
| 42 | + // 插入 | |
| 43 | + ArticleDO article = ArticleConvert.INSTANCE.convert(createReqVO); | |
| 44 | + article.setBrowseCount(0); // 初始浏览量 | |
| 45 | + articleMapper.insert(article); | |
| 46 | + // 返回 | |
| 47 | + return article.getId(); | |
| 48 | + } | |
| 49 | + | |
| 50 | + @Override | |
| 51 | + public void updateArticle(ArticleUpdateReqVO updateReqVO) { | |
| 52 | + // 校验存在 | |
| 53 | + validateArticleExists(updateReqVO.getId()); | |
| 54 | + // 校验分类存在 | |
| 55 | + validateArticleCategoryExists(updateReqVO.getCategoryId()); | |
| 56 | + | |
| 57 | + // 更新 | |
| 58 | + ArticleDO updateObj = ArticleConvert.INSTANCE.convert(updateReqVO); | |
| 59 | + articleMapper.updateById(updateObj); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public void deleteArticle(Long id) { | |
| 64 | + // 校验存在 | |
| 65 | + validateArticleExists(id); | |
| 66 | + // 删除 | |
| 67 | + articleMapper.deleteById(id); | |
| 68 | + } | |
| 69 | + | |
| 70 | + private void validateArticleExists(Long id) { | |
| 71 | + if (articleMapper.selectById(id) == null) { | |
| 72 | + throw exception(ARTICLE_NOT_EXISTS); | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | + private void validateArticleCategoryExists(Long categoryId) { | |
| 77 | + ArticleCategoryDO articleCategory = articleCategoryService.getArticleCategory(categoryId); | |
| 78 | + if (articleCategory == null) { | |
| 79 | + throw exception(ARTICLE_CATEGORY_NOT_EXISTS); | |
| 80 | + } | |
| 81 | + } | |
| 82 | + | |
| 83 | + @Override | |
| 84 | + public ArticleDO getArticle(Long id) { | |
| 85 | + return articleMapper.selectById(id); | |
| 86 | + } | |
| 87 | + | |
| 88 | + @Override | |
| 89 | + public PageResult<ArticleDO> getArticlePage(ArticlePageReqVO pageReqVO) { | |
| 90 | + return articleMapper.selectPage(pageReqVO); | |
| 91 | + } | |
| 92 | + | |
| 93 | + @Override | |
| 94 | + public List<ArticleDO> getArticleCategoryListByRecommend(Boolean recommendHot, Boolean recommendBanner) { | |
| 95 | + return articleMapper.selectList(recommendHot, recommendBanner); | |
| 96 | + } | |
| 97 | + | |
| 98 | + @Override | |
| 99 | + public PageResult<ArticleDO> getArticlePage(AppArticlePageReqVO pageReqVO) { | |
| 100 | + return articleMapper.selectPage(pageReqVO); | |
| 101 | + } | |
| 102 | + | |
| 103 | + @Override | |
| 104 | + public List<ArticleDO> getArticleByCategoryId(Long categoryId) { | |
| 105 | + return articleMapper.selectList(ArticleDO::getCategoryId, categoryId); | |
| 106 | + } | |
| 107 | + | |
| 108 | + @Override | |
| 109 | + public Long getArticleCountByCategoryId(Long categoryId) { | |
| 110 | + return articleMapper.selectCount(ArticleDO::getCategoryId, categoryId); | |
| 111 | + } | |
| 112 | + | |
| 113 | + @Override | |
| 114 | + public void addArticleBrowseCount(Long id) { | |
| 115 | + // 校验文章是否存在 | |
| 116 | + validateArticleExists(id); | |
| 117 | + // 增加浏览次数 | |
| 118 | + articleMapper.updateBrowseCount(id); | |
| 119 | + } | |
| 120 | + | |
| 121 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/banner/BannerService.java
| ... | ... | @@ -47,12 +47,6 @@ public interface BannerService { |
| 47 | 47 | BannerDO getBanner(Long id); |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * 获得所有 Banner列表 | |
| 51 | - * @return Banner列表 | |
| 52 | - */ | |
| 53 | - List<BannerDO> getBannerList(); | |
| 54 | - | |
| 55 | - /** | |
| 56 | 50 | * 获得 Banner 分页 |
| 57 | 51 | * |
| 58 | 52 | * @param pageReqVO 分页查询 |
| ... | ... | @@ -60,4 +54,19 @@ public interface BannerService { |
| 60 | 54 | */ |
| 61 | 55 | PageResult<BannerDO> getBannerPage(BannerPageReqVO pageReqVO); |
| 62 | 56 | |
| 57 | + /** | |
| 58 | + * 增加 Banner 点击量 | |
| 59 | + * | |
| 60 | + * @param id Banner编号 | |
| 61 | + */ | |
| 62 | + void addBannerBrowseCount(Long id); | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 获得 Banner 列表 | |
| 66 | + * | |
| 67 | + * @param position 定位 | |
| 68 | + * @return Banner 列表 | |
| 69 | + */ | |
| 70 | + List<BannerDO> getBannerListByPosition(Integer position); | |
| 71 | + | |
| 63 | 72 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/banner/BannerServiceImpl.java
| ... | ... | @@ -66,13 +66,21 @@ public class BannerServiceImpl implements BannerService { |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | @Override |
| 69 | - public List<BannerDO> getBannerList() { | |
| 70 | - return bannerMapper.selectList(); | |
| 69 | + public PageResult<BannerDO> getBannerPage(BannerPageReqVO pageReqVO) { | |
| 70 | + return bannerMapper.selectPage(pageReqVO); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | @Override |
| 74 | - public PageResult<BannerDO> getBannerPage(BannerPageReqVO pageReqVO) { | |
| 75 | - return bannerMapper.selectPage(pageReqVO); | |
| 74 | + public void addBannerBrowseCount(Long id) { | |
| 75 | + // 校验 Banner 是否存在 | |
| 76 | + validateBannerExists(id); | |
| 77 | + // 增加点击次数 | |
| 78 | + bannerMapper.updateBrowseCount(id); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Override | |
| 82 | + public List<BannerDO> getBannerListByPosition(Integer position) { | |
| 83 | + return bannerMapper.selectBannerListByPosition(position); | |
| 76 | 84 | } |
| 77 | 85 | |
| 78 | 86 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/bargain/BargainActivityService.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.Ba |
| 8 | 8 | import cn.iocoder.yudao.module.promotion.dal.dataobject.bargain.BargainActivityDO; |
| 9 | 9 | |
| 10 | 10 | import javax.validation.Valid; |
| 11 | +import java.time.LocalDateTime; | |
| 11 | 12 | import java.util.Collection; |
| 12 | 13 | import java.util.List; |
| 13 | 14 | import java.util.Set; |
| ... | ... | @@ -102,10 +103,11 @@ public interface BargainActivityService { |
| 102 | 103 | /** |
| 103 | 104 | * 获取指定 spu 编号最近参加的活动,每个 spuId 只返回一条记录 |
| 104 | 105 | * |
| 105 | - * @param spuIds spu 编号 | |
| 106 | - * @param status 状态 | |
| 106 | + * @param spuIds spu 编号 | |
| 107 | + * @param status 状态 | |
| 108 | + * @param dateTime 日期时间 | |
| 107 | 109 | * @return 砍价活动列表 |
| 108 | 110 | */ |
| 109 | - List<BargainActivityDO> getBargainActivityBySpuIdsAndStatus(Collection<Long> spuIds, Integer status); | |
| 111 | + List<BargainActivityDO> getBargainActivityBySpuIdsAndStatusAndDateTimeLt(Collection<Long> spuIds, Integer status, LocalDateTime dateTime); | |
| 110 | 112 | |
| 111 | 113 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/bargain/BargainActivityServiceImpl.java
| ... | ... | @@ -182,15 +182,15 @@ public class BargainActivityServiceImpl implements BargainActivityService { |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | @Override |
| 185 | - public List<BargainActivityDO> getBargainActivityBySpuIdsAndStatus(Collection<Long> spuIds, Integer status) { | |
| 185 | + public List<BargainActivityDO> getBargainActivityBySpuIdsAndStatusAndDateTimeLt(Collection<Long> spuIds, Integer status, LocalDateTime dateTime) { | |
| 186 | 186 | // 1. 查询出指定 spuId 的 spu 参加的活动最接近现在的一条记录。多个的话,一个 spuId 对应一个最近的活动编号 |
| 187 | - // TODO @puhui999:我想了下,这种是不是只展示当前正在进行中的。已经结束、或者未开始的,可能没啥意义? | |
| 188 | 187 | List<Map<String, Object>> spuIdAndActivityIdMaps = bargainActivityMapper.selectSpuIdAndActivityIdMapsBySpuIdsAndStatus(spuIds, status); |
| 189 | 188 | if (CollUtil.isEmpty(spuIdAndActivityIdMaps)) { |
| 190 | 189 | return Collections.emptyList(); |
| 191 | 190 | } |
| 192 | 191 | // 2. 查询活动详情 |
| 193 | - return bargainActivityMapper.selectListByIds(convertSet(spuIdAndActivityIdMaps, map -> MapUtil.getLong(map, "activityId"))); | |
| 192 | + return bargainActivityMapper.selectListByIdsAndDateTimeLt( | |
| 193 | + convertSet(spuIdAndActivityIdMaps, map -> MapUtil.getLong(map, "activityId")), dateTime); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityService.java
| ... | ... | @@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationA |
| 9 | 9 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationProductDO; |
| 10 | 10 | |
| 11 | 11 | import javax.validation.Valid; |
| 12 | +import java.time.LocalDateTime; | |
| 12 | 13 | import java.util.Collection; |
| 13 | 14 | import java.util.Collections; |
| 14 | 15 | import java.util.List; |
| ... | ... | @@ -35,6 +36,8 @@ public interface CombinationActivityService { |
| 35 | 36 | */ |
| 36 | 37 | void updateCombinationActivity(@Valid CombinationActivityUpdateReqVO updateReqVO); |
| 37 | 38 | |
| 39 | + // TODO @puhui999:这里少了一个关闭活动的接口;因为关闭的活动,才可以删除 | |
| 40 | + | |
| 38 | 41 | /** |
| 39 | 42 | * 删除拼团活动 |
| 40 | 43 | * |
| ... | ... | @@ -120,10 +123,11 @@ public interface CombinationActivityService { |
| 120 | 123 | /** |
| 121 | 124 | * 获取指定 spu 编号最近参加的活动,每个 spuId 只返回一条记录 |
| 122 | 125 | * |
| 123 | - * @param spuIds spu 编号 | |
| 124 | - * @param status 状态 | |
| 126 | + * @param spuIds spu 编号 | |
| 127 | + * @param status 状态 | |
| 128 | + * @param dateTime 日期时间 | |
| 125 | 129 | * @return 拼团活动列表 |
| 126 | 130 | */ |
| 127 | - List<CombinationActivityDO> getCombinationActivityBySpuIdsAndStatus(Collection<Long> spuIds, Integer status); | |
| 131 | + List<CombinationActivityDO> getCombinationActivityBySpuIdsAndStatusAndDateTimeLt(Collection<Long> spuIds, Integer status, LocalDateTime dateTime); | |
| 128 | 132 | |
| 129 | 133 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityServiceImpl.java
| ... | ... | @@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional; |
| 25 | 25 | import org.springframework.validation.annotation.Validated; |
| 26 | 26 | |
| 27 | 27 | import javax.annotation.Resource; |
| 28 | +import java.time.LocalDateTime; | |
| 28 | 29 | import java.util.Collection; |
| 29 | 30 | import java.util.Collections; |
| 30 | 31 | import java.util.List; |
| ... | ... | @@ -228,14 +229,15 @@ public class CombinationActivityServiceImpl implements CombinationActivityServic |
| 228 | 229 | } |
| 229 | 230 | |
| 230 | 231 | @Override |
| 231 | - public List<CombinationActivityDO> getCombinationActivityBySpuIdsAndStatus(Collection<Long> spuIds, Integer status) { | |
| 232 | + public List<CombinationActivityDO> getCombinationActivityBySpuIdsAndStatusAndDateTimeLt(Collection<Long> spuIds, Integer status, LocalDateTime dateTime) { | |
| 232 | 233 | // 1.查询出指定 spuId 的 spu 参加的活动最接近现在的一条记录。多个的话,一个 spuId 对应一个最近的活动编号 |
| 233 | 234 | List<Map<String, Object>> spuIdAndActivityIdMaps = combinationActivityMapper.selectSpuIdAndActivityIdMapsBySpuIdsAndStatus(spuIds, status); |
| 234 | 235 | if (CollUtil.isEmpty(spuIdAndActivityIdMaps)) { |
| 235 | 236 | return Collections.emptyList(); |
| 236 | 237 | } |
| 237 | 238 | // 2.查询活动详情 |
| 238 | - return combinationActivityMapper.selectListByIds(convertSet(spuIdAndActivityIdMaps, map -> MapUtil.getLong(map, "activityId"))); | |
| 239 | + return combinationActivityMapper.selectListByIdsAndDateTimeLt( | |
| 240 | + convertSet(spuIdAndActivityIdMaps, map -> MapUtil.getLong(map, "activityId")), dateTime); | |
| 239 | 241 | } |
| 240 | 242 | |
| 241 | 243 | } | ... | ... |
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
| ... | ... | @@ -6,6 +6,7 @@ import cn.hutool.extra.spring.SpringUtil; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.core.KeyValue; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | |
| 9 | 10 | import cn.iocoder.yudao.module.member.api.user.MemberUserApi; |
| 10 | 11 | import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; |
| 11 | 12 | import cn.iocoder.yudao.module.product.api.sku.ProductSkuApi; |
| ... | ... | @@ -14,7 +15,6 @@ import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi; |
| 14 | 15 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 15 | 16 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO; |
| 16 | 17 | import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO; |
| 17 | -import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPage2VO; | |
| 18 | 18 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPageVO; |
| 19 | 19 | import cn.iocoder.yudao.module.promotion.convert.combination.CombinationActivityConvert; |
| 20 | 20 | import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationActivityDO; |
| ... | ... | @@ -23,7 +23,7 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationR |
| 23 | 23 | import cn.iocoder.yudao.module.promotion.dal.mysql.combination.CombinationRecordMapper; |
| 24 | 24 | import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum; |
| 25 | 25 | import cn.iocoder.yudao.module.trade.api.order.TradeOrderApi; |
| 26 | -import org.springframework.scheduling.annotation.Async; | |
| 26 | +import lombok.extern.slf4j.Slf4j; | |
| 27 | 27 | import org.springframework.stereotype.Service; |
| 28 | 28 | import org.springframework.transaction.annotation.Transactional; |
| 29 | 29 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -47,6 +47,7 @@ import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*; |
| 47 | 47 | * @author HUIHUI |
| 48 | 48 | */ |
| 49 | 49 | @Service |
| 50 | +@Slf4j | |
| 50 | 51 | @Validated |
| 51 | 52 | public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 52 | 53 | |
| ... | ... | @@ -72,9 +73,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 72 | 73 | CombinationRecordDO record = validateCombinationRecord(userId, orderId); |
| 73 | 74 | |
| 74 | 75 | // 更新状态 |
| 75 | - // TODO @puhui999:不要整个更新,new 一个出来;why?例如说,两个线程都去更新,这样存在相互覆盖的问题 | |
| 76 | - record.setStatus(status); | |
| 77 | - combinationRecordMapper.updateById(record); | |
| 76 | + combinationRecordMapper.updateById(new CombinationRecordDO().setId(record.getId()).setStatus(status)); | |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | private CombinationRecordDO validateCombinationRecord(Long userId, Long orderId) { |
| ... | ... | @@ -164,7 +163,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 164 | 163 | |
| 165 | 164 | @Override |
| 166 | 165 | @Transactional(rollbackFor = Exception.class) |
| 167 | - public KeyValue<Long, Long> createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) { | |
| 166 | + public CombinationRecordDO createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) { | |
| 168 | 167 | // 1. 校验拼团活动 |
| 169 | 168 | KeyValue<CombinationActivityDO, CombinationProductDO> keyValue = validateCombinationRecord(reqDTO.getUserId(), |
| 170 | 169 | reqDTO.getActivityId(), reqDTO.getHeadId(), reqDTO.getSkuId(), reqDTO.getCount()); |
| ... | ... | @@ -191,7 +190,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 191 | 190 | if (ObjUtil.notEqual(CombinationRecordDO.HEAD_ID_GROUP, record.getHeadId())) { |
| 192 | 191 | updateCombinationRecordWhenCreate(reqDTO.getHeadId(), keyValue.getKey()); |
| 193 | 192 | } |
| 194 | - return new KeyValue<>(record.getId(), record.getHeadId()); | |
| 193 | + return record; | |
| 195 | 194 | } |
| 196 | 195 | |
| 197 | 196 | /** |
| ... | ... | @@ -250,6 +249,11 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 250 | 249 | } |
| 251 | 250 | |
| 252 | 251 | @Override |
| 252 | + public Long getCombinationUserCount() { | |
| 253 | + return combinationRecordMapper.selectUserCount(); | |
| 254 | + } | |
| 255 | + | |
| 256 | + @Override | |
| 253 | 257 | public List<CombinationRecordDO> getLatestCombinationRecordList(int count) { |
| 254 | 258 | return combinationRecordMapper.selectLatestList(count); |
| 255 | 259 | } |
| ... | ... | @@ -276,11 +280,6 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 276 | 280 | } |
| 277 | 281 | |
| 278 | 282 | @Override |
| 279 | - public PageResult<CombinationRecordDO> getCombinationRecordPage2(CombinationRecordReqPage2VO pageVO) { | |
| 280 | - return combinationRecordMapper.selectPage(pageVO); | |
| 281 | - } | |
| 282 | - | |
| 283 | - @Override | |
| 284 | 283 | public Map<Long, Integer> getCombinationRecordCountMapByActivity(Collection<Long> activityIds, |
| 285 | 284 | @Nullable Integer status, @Nullable Long headId) { |
| 286 | 285 | return combinationRecordMapper.selectCombinationRecordCountMapByActivityIdAndStatusAndHeadId(activityIds, status, headId); |
| ... | ... | @@ -343,8 +342,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 343 | 342 | |
| 344 | 343 | @Override |
| 345 | 344 | public KeyValue<Integer, Integer> expireCombinationRecord() { |
| 346 | - // TODO @puhui999:数字一般是 1. 2. 这种格式哈 | |
| 347 | - // 1。获取所有正在进行中的过期的父拼团 | |
| 345 | + // 1. 获取所有正在进行中的过期的父拼团 | |
| 348 | 346 | List<CombinationRecordDO> headExpireRecords = combinationRecordMapper.selectListByHeadIdAndStatusAndExpireTimeLt( |
| 349 | 347 | CombinationRecordDO.HEAD_ID_GROUP, CombinationRecordStatusEnum.IN_PROGRESS.getStatus(), LocalDateTime.now()); |
| 350 | 348 | if (CollUtil.isEmpty(headExpireRecords)) { |
| ... | ... | @@ -352,91 +350,84 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 352 | 350 | } |
| 353 | 351 | |
| 354 | 352 | // 2. 获取拼团活动 |
| 355 | - // TODO @puhui999:在自己模块里,变量可以简略点;例如说 activityList | |
| 356 | - List<CombinationActivityDO> combinationActivities = combinationActivityService.getCombinationActivityListByIds( | |
| 353 | + List<CombinationActivityDO> activities = combinationActivityService.getCombinationActivityListByIds( | |
| 357 | 354 | convertSet(headExpireRecords, CombinationRecordDO::getActivityId)); |
| 358 | - Map<Long, CombinationActivityDO> activityMap = convertMap(combinationActivities, CombinationActivityDO::getId); | |
| 359 | - | |
| 360 | - // TODO @puhui999:job 一般不建议异步跑;因为可能下次跑,结果上次还没跑完; | |
| 361 | - // TODO 这里,我们可以每个 record 处理下;然后按照是否需要虚拟拼团,各搞一个方法逻辑 + 事务;这样,保证 job 里面尽量不要大事务,而是 n 个独立小事务的处理。 | |
| 362 | - // 3. 校验是否虚拟成团 | |
| 363 | - List<CombinationRecordDO> virtualGroupHeadRecords = new ArrayList<>(); // 虚拟成团 | |
| 364 | - for (Iterator<CombinationRecordDO> iterator = headExpireRecords.iterator(); iterator.hasNext(); ) { | |
| 365 | - CombinationRecordDO record = iterator.next(); | |
| 366 | - // 3.1 不匹配,则直接跳过 | |
| 367 | - CombinationActivityDO activity = activityMap.get(record.getActivityId()); | |
| 368 | - if (activity == null || !activity.getVirtualGroup()) { // 取不到活动的或者不是虚拟拼团的 | |
| 369 | - continue; | |
| 355 | + Map<Long, CombinationActivityDO> activityMap = convertMap(activities, CombinationActivityDO::getId); | |
| 356 | + | |
| 357 | + // 3. 逐个处理拼团,过期 or 虚拟成团 | |
| 358 | + KeyValue<Integer, Integer> keyValue = new KeyValue<>(0, 0); // 统计过期拼团和虚拟成团 | |
| 359 | + for (CombinationRecordDO record : headExpireRecords) { | |
| 360 | + try { | |
| 361 | + CombinationActivityDO activity = activityMap.get(record.getActivityId()); | |
| 362 | + if (activity == null || !activity.getVirtualGroup()) { // 取不到活动的或者不是虚拟拼团的 | |
| 363 | + // 3.1. 处理过期的拼团 | |
| 364 | + getSelf().handleExpireRecord(record); | |
| 365 | + keyValue.setKey(keyValue.getKey() + 1); | |
| 366 | + } else { | |
| 367 | + // 3.2. 处理虚拟成团 | |
| 368 | + getSelf().handleVirtualGroupRecord(record); | |
| 369 | + keyValue.setValue(keyValue.getValue() + 1); | |
| 370 | + } | |
| 371 | + } catch (Exception ignored) { // 处理异常继续循环 | |
| 372 | + log.error("[expireCombinationRecord][record({}) 处理异常,请进行处理!record 数据是:{}]", | |
| 373 | + record.getId(), JsonUtils.toJsonString(record)); | |
| 370 | 374 | } |
| 371 | - // 3.2 匹配,则移除,添加到虚拟成团中,并结束寻找 | |
| 372 | - virtualGroupHeadRecords.add(record); | |
| 373 | - iterator.remove(); | |
| 374 | - break; | |
| 375 | 375 | } |
| 376 | - | |
| 377 | - // 4.处理过期的拼团 | |
| 378 | - getSelf().handleExpireRecord(headExpireRecords); | |
| 379 | - // 5.虚拟成团 | |
| 380 | - getSelf().handleVirtualGroupRecord(virtualGroupHeadRecords); | |
| 381 | - return new KeyValue<>(headExpireRecords.size(), virtualGroupHeadRecords.size()); | |
| 376 | + return keyValue; | |
| 382 | 377 | } |
| 383 | 378 | |
| 384 | - @Async | |
| 385 | - protected void handleExpireRecord(List<CombinationRecordDO> headExpireRecords) { | |
| 386 | - if (CollUtil.isEmpty(headExpireRecords)) { | |
| 387 | - return; | |
| 388 | - } | |
| 389 | - | |
| 390 | - // 1.更新拼团记录 | |
| 391 | - List<CombinationRecordDO> headsAndRecords = updateBatchCombinationRecords(headExpireRecords, | |
| 379 | + /** | |
| 380 | + * 处理过期拼团 | |
| 381 | + * | |
| 382 | + * @param headRecord 过期拼团团长记录 | |
| 383 | + */ | |
| 384 | + @Transactional(rollbackFor = Exception.class) | |
| 385 | + public void handleExpireRecord(CombinationRecordDO headRecord) { | |
| 386 | + // 1. 更新拼团记录 | |
| 387 | + List<CombinationRecordDO> headAndRecords = updateBatchCombinationRecords(headRecord, | |
| 392 | 388 | CombinationRecordStatusEnum.FAILED); |
| 393 | - if (headsAndRecords == null) { | |
| 394 | - return; | |
| 395 | - } | |
| 396 | - | |
| 397 | - // 2.订单取消 TODO 以现在的取消回滚逻辑好像只能循环了 | |
| 398 | - headsAndRecords.forEach(item -> { | |
| 399 | - tradeOrderApi.cancelPaidOrder(item.getUserId(), item.getOrderId()); | |
| 400 | - }); | |
| 389 | + // 2. 订单取消 | |
| 390 | + headAndRecords.forEach(item -> tradeOrderApi.cancelPaidOrder(item.getUserId(), item.getOrderId())); | |
| 401 | 391 | } |
| 402 | 392 | |
| 403 | - @Async | |
| 404 | - protected void handleVirtualGroupRecord(List<CombinationRecordDO> virtualGroupHeadRecords) { | |
| 405 | - if (CollUtil.isEmpty(virtualGroupHeadRecords)) { | |
| 406 | - return; | |
| 407 | - } | |
| 408 | - | |
| 393 | + /** | |
| 394 | + * 处理虚拟拼团 | |
| 395 | + * | |
| 396 | + * @param headRecord 虚拟成团团长记录 | |
| 397 | + */ | |
| 398 | + @Transactional(rollbackFor = Exception.class) | |
| 399 | + public void handleVirtualGroupRecord(CombinationRecordDO headRecord) { | |
| 409 | 400 | // 1. 团员补齐 |
| 410 | - combinationRecordMapper.insertBatch(CombinationActivityConvert.INSTANCE.convertVirtualGroupList(virtualGroupHeadRecords)); | |
| 401 | + combinationRecordMapper.insertBatch(CombinationActivityConvert.INSTANCE.convertVirtualRecordList(headRecord)); | |
| 411 | 402 | // 2. 更新拼团记录 |
| 412 | - updateBatchCombinationRecords(virtualGroupHeadRecords, CombinationRecordStatusEnum.SUCCESS); | |
| 403 | + updateBatchCombinationRecords(headRecord, CombinationRecordStatusEnum.SUCCESS); | |
| 413 | 404 | } |
| 414 | 405 | |
| 415 | - private List<CombinationRecordDO> updateBatchCombinationRecords(List<CombinationRecordDO> headRecords, CombinationRecordStatusEnum status) { | |
| 416 | - // 1. 查询团成员 | |
| 417 | - List<CombinationRecordDO> records = combinationRecordMapper.selectListByHeadIds( | |
| 418 | - convertSet(headRecords, CombinationRecordDO::getId)); | |
| 419 | - if (CollUtil.isEmpty(records)) { | |
| 420 | - return null; | |
| 421 | - } | |
| 422 | - Map<Long, List<CombinationRecordDO>> recordsMap = convertMultiMap(records, CombinationRecordDO::getHeadId); | |
| 423 | - headRecords.forEach(item -> { | |
| 424 | - recordsMap.get(item.getId()).add(item); // 把团长加进团里 | |
| 425 | - }); | |
| 426 | - // 2.批量更新拼团记录 status 和 失败/成团时间 | |
| 427 | - List<CombinationRecordDO> headsAndRecords = mergeValuesFromMap(recordsMap); | |
| 428 | - List<CombinationRecordDO> updateRecords = new ArrayList<>(headsAndRecords.size()); | |
| 406 | + /** | |
| 407 | + * 更新拼团记录 | |
| 408 | + * | |
| 409 | + * @param headRecord 团长记录 | |
| 410 | + * @param status 状态-拼团失败 FAILED 成功 SUCCESS | |
| 411 | + * @return 整团记录(包含团长和团成员) | |
| 412 | + */ | |
| 413 | + private List<CombinationRecordDO> updateBatchCombinationRecords(CombinationRecordDO headRecord, CombinationRecordStatusEnum status) { | |
| 414 | + // 1. 查询团成员(包含团长) | |
| 415 | + List<CombinationRecordDO> records = combinationRecordMapper.selectListByHeadId(headRecord.getId()); | |
| 416 | + records.add(headRecord);// 把团长加进去 | |
| 417 | + | |
| 418 | + // 2. 批量更新拼团记录 status 和 endTime | |
| 419 | + List<CombinationRecordDO> updateRecords = new ArrayList<>(records.size()); | |
| 429 | 420 | LocalDateTime now = LocalDateTime.now(); |
| 430 | - headsAndRecords.forEach(item -> { | |
| 431 | - CombinationRecordDO record = new CombinationRecordDO().setId(item.getId()) | |
| 421 | + records.forEach(item -> { | |
| 422 | + CombinationRecordDO updateRecord = new CombinationRecordDO().setId(item.getId()) | |
| 432 | 423 | .setStatus(status.getStatus()).setEndTime(now); |
| 433 | 424 | if (CombinationRecordStatusEnum.isSuccess(status.getStatus())) { // 虚拟成团完事更改状态成功后还需要把参与人数修改为成团需要人数 |
| 434 | - record.setUserCount(record.getUserSize()); | |
| 425 | + updateRecord.setUserCount(updateRecord.getUserSize()); | |
| 435 | 426 | } |
| 436 | - updateRecords.add(record); | |
| 427 | + updateRecords.add(updateRecord); | |
| 437 | 428 | }); |
| 438 | 429 | combinationRecordMapper.updateBatch(updateRecords); |
| 439 | - return headsAndRecords; | |
| 430 | + return records; | |
| 440 | 431 | } |
| 441 | 432 | |
| 442 | 433 | /** | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponTemplateService.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponTemplateDO; |
| 8 | 8 | import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTakeTypeEnum; |
| 9 | 9 | |
| 10 | 10 | import javax.validation.Valid; |
| 11 | +import java.util.Collection; | |
| 11 | 12 | import java.util.List; |
| 12 | 13 | |
| 13 | 14 | /** |
| ... | ... | @@ -91,4 +92,12 @@ public interface CouponTemplateService { |
| 91 | 92 | List<CouponTemplateDO> getCouponTemplateList(List<Integer> canTakeTypes, Integer productScope, |
| 92 | 93 | Long productScopeValue, Integer count); |
| 93 | 94 | |
| 95 | + /** | |
| 96 | + * 获得优惠券模版列表 | |
| 97 | + * | |
| 98 | + * @param ids 优惠券模版编号 | |
| 99 | + * @return 优惠券模版列表 | |
| 100 | + */ | |
| 101 | + List<CouponTemplateDO> getCouponTemplateListByIds(Collection<Long> ids); | |
| 102 | + | |
| 94 | 103 | } | ... | ... |