Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/crm

This commit is contained in:
YunaiV 2023-10-29 14:25:38 +08:00
commit 0657c357bf
394 changed files with 6984 additions and 3530 deletions

View File

@ -256,7 +256,7 @@ _前端基于 crmeb uniapp 经过授权重构,优化代码实现,接入芋
| 框架 | 说明 | 版本 | 学习指南 |
|---------------------------------------------------------------------------------------------|------------------|----------------|----------------------------------------------------------------|
| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.16 | [文档](https://github.com/YunaiV/SpringBoot-Labs) |
| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.17 | [文档](https://github.com/YunaiV/SpringBoot-Labs) |
| [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | |
| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.19 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) |

10
pom.xml
View File

@ -13,17 +13,17 @@
<!-- Server 主项目 -->
<module>yudao-server</module>
<!-- 各种 module 拓展 -->
<!-- <module>yudao-module-member</module>-->
<module>yudao-module-system</module>
<module>yudao-module-infra</module>
<!-- <module>yudao-module-bpm</module>-->
<!-- <module>yudao-module-member</module>-->
<!-- <module>yudao-module-bpm</module>-->
<!-- <module>yudao-module-report</module>-->
<!-- <module>yudao-module-mp</module>-->
<!-- <module>yudao-module-pay</module>-->
<!-- <module>yudao-module-mall</module>-->
<module>yudao-module-crm</module>
<!-- 示例项目 -->
<module>yudao-example</module>
<!-- <module>yudao-example</module>-->
</modules>
<name>${project.artifactId}</name>
@ -31,7 +31,7 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<properties>
<revision>1.8.2-snapshot</revision>
<revision>1.8.3-snapshot</revision>
<!-- Maven 相关 -->
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
@ -41,7 +41,7 @@
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
<!-- 看看咋放到 bom 里 -->
<lombok.version>1.18.30</lombok.version>
<spring.boot.version>2.7.16</spring.boot.version>
<spring.boot.version>2.7.17</spring.boot.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

View File

@ -9,7 +9,7 @@ CREATE TABLE `pay_transfer`
`app_id` bigint NOT NULL COMMENT '应用编号',
`merchant_order_id` varchar(64) NOT NULL COMMENT '商户订单编号',
`price` int NOT NULL COMMENT '转账金额单位',
`title` varchar(512) NOT NULL COMMENT '转账标题',
`subject` varchar(512) NOT NULL COMMENT '转账标题',
`payee_info` varchar(512) NOT NULL COMMENT '收款人信息不同类型和渠道不同',
`status` tinyint NOT NULL COMMENT '转账状态',
`success_time` datetime NULL COMMENT '转账成功时间',
@ -76,3 +76,130 @@ CREATE TABLE `pay_demo_transfer` (
ALTER TABLE `pay_channel`
MODIFY COLUMN `config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '支付渠道配置' AFTER `app_id`;
-- ----------------------------
-- 充值套餐表
-- ----------------------------
DROP TABLE IF EXISTS `pay_wallet_recharge_package`;
CREATE TABLE `pay_wallet_recharge_package`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
`name` varchar(64) NOT NULL COMMENT '套餐名',
`pay_price` int NOT NULL COMMENT '支付金额',
`bonus_price` int NOT NULL COMMENT '赠送金额',
`status` tinyint NOT NULL COMMENT '状态',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB COMMENT='充值套餐表';
-- ----------------------------
-- Table structure for pay_wallet_recharge
-- ----------------------------
DROP TABLE IF EXISTS `pay_wallet_recharge`;
CREATE TABLE `pay_wallet_recharge` (
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '编号',
`wallet_id` bigint(0) NOT NULL COMMENT '会员钱包 id',
`total_price` int(0) NOT NULL COMMENT '用户实际到账余额例如充 100 20则该值是 120',
`pay_price` int(0) NOT NULL COMMENT '实际支付金额',
`bonus_price` int(0) NOT NULL COMMENT '钱包赠送金额',
`package_id` bigint(0) DEFAULT NULL COMMENT '充值套餐编号',
`pay_status` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已支付[0:未支付 1:已经支付过]',
`pay_order_id` bigint(0) DEFAULT NULL COMMENT '支付订单编号',
`pay_channel_code` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支付成功的支付渠道',
`pay_time` datetime(0) DEFAULT NULL COMMENT '订单支付时间',
`pay_refund_id` bigint(0) DEFAULT NULL COMMENT '支付退款单编号',
`refund_total_price` int(0) NOT NULL DEFAULT 0 COMMENT '退款金额包含赠送金额',
`refund_pay_price` int(0) NOT NULL DEFAULT 0 COMMENT '退款支付金额',
`refund_bonus_price` int(0) NOT NULL DEFAULT 0 COMMENT '退款钱包赠送金额',
`refund_time` datetime(0) DEFAULT NULL COMMENT '退款时间',
`refund_status` int(0) NOT NULL DEFAULT 0 COMMENT '退款状态',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint(0) NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员钱包充值' ROW_FORMAT = Dynamic;
-- 钱包充值套餐,钱包余额菜单脚本
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'钱包管理', '', 1, 5, 1117,
'wallet', 'ep:caret-right', '', 0, ''
);
SELECT @parentId1 := LAST_INSERT_ID();
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'充值套餐', '', 2, 2, @parentId1,
'wallet-recharge-package', 'fa:leaf', 'pay/wallet/rechargePackage/index', 0, 'WalletRechargePackage'
);
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'钱包充值套餐查询', 'pay:wallet-recharge-package:query', 3, 1, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'钱包充值套餐创建', 'pay:wallet-recharge-package:create', 3, 2, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'钱包充值套餐更新', 'pay:wallet-recharge-package:update', 3, 3, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'钱包充值套餐删除', 'pay:wallet-recharge-package:delete', 3, 4, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'钱包余额', '', 2, 1, @parentId1,
'wallet-balance', 'fa:leaf', 'pay/wallet/balance/index', 0, 'WalletBalance'
);
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'钱包余额查询', 'pay:wallet:query', 3, 1, @parentId,
'', '', '', 0
);

View File

@ -11,7 +11,7 @@
Target Server Version : 80034
File Encoding : 65001
Date: 05/10/2023 12:42:16
Date: 24/10/2023 20:48:38
*/
SET NAMES utf8mb4;
@ -384,7 +384,7 @@ CREATE TABLE `infra_api_error_log` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1662 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
) ENGINE = InnoDB AUTO_INCREMENT = 1745 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
-- ----------------------------
-- Records of infra_api_error_log
@ -422,7 +422,7 @@ CREATE TABLE `infra_codegen_column` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1778 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义';
) ENGINE = InnoDB AUTO_INCREMENT = 1805 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义';
-- ----------------------------
-- Records of infra_codegen_column
@ -455,7 +455,7 @@ CREATE TABLE `infra_codegen_table` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 135 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表定义';
) ENGINE = InnoDB AUTO_INCREMENT = 137 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表定义';
-- ----------------------------
-- Records of infra_codegen_table
@ -538,7 +538,7 @@ CREATE TABLE `infra_file` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1095 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
) ENGINE = InnoDB AUTO_INCREMENT = 1108 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
-- ----------------------------
-- Records of infra_file
@ -587,7 +587,7 @@ CREATE TABLE `infra_file_content` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 188 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
) ENGINE = InnoDB AUTO_INCREMENT = 201 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
-- ----------------------------
-- Records of infra_file_content
@ -709,7 +709,7 @@ CREATE TABLE `member_address` (
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_userId`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '用户收件地址';
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '用户收件地址';
-- ----------------------------
-- Records of member_address
@ -717,6 +717,33 @@ CREATE TABLE `member_address` (
BEGIN;
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);
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);
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);
COMMIT;
-- ----------------------------
-- Table structure for member_config
-- ----------------------------
DROP TABLE IF EXISTS `member_config`;
CREATE TABLE `member_config` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`point_trade_deduct_enable` bit(1) NOT NULL COMMENT '是否开启积分抵扣',
`point_trade_deduct_unit_price` int NOT NULL COMMENT '积分抵扣(单位)',
`point_trade_deduct_max_price` int NULL DEFAULT NULL COMMENT '积分抵扣最大值',
`point_trade_give_point` bigint NULL DEFAULT NULL COMMENT '1 元赠送多少分',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员配置表';
-- ----------------------------
-- Records of member_config
-- ----------------------------
BEGIN;
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);
COMMIT;
-- ----------------------------
@ -741,7 +768,7 @@ CREATE TABLE `member_experience_record` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_user_id`(`user_id` ASC) USING BTREE COMMENT '会员经验记录-用户编号',
INDEX `idx_user_biz_type`(`user_id` ASC, `biz_type` ASC) USING BTREE COMMENT '会员经验记录-用户业务类型'
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员经验记录';
) ENGINE = InnoDB AUTO_INCREMENT = 41 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员经验记录';
-- ----------------------------
-- Records of member_experience_record
@ -759,6 +786,28 @@ INSERT INTO `member_experience_record` (`id`, `user_id`, `biz_id`, `biz_type`, `
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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 (41, 248, '131', 11, '下单奖励', '下单获得 700100 经验', 700100, 700100, NULL, '2023-10-24 12:33:22', NULL, '2023-10-24 12:33:22', b'0', 1);
COMMIT;
-- ----------------------------
@ -835,7 +884,7 @@ CREATE TABLE `member_level_record` (
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_user_id`(`user_id` ASC) USING BTREE COMMENT '会员等级记录-用户编号'
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员等级记录';
) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员等级记录';
-- ----------------------------
-- Records of member_level_record
@ -865,7 +914,7 @@ CREATE TABLE `member_point_record` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `index_userId`(`user_id` ASC) USING BTREE,
INDEX `index_title`(`title` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户积分记录';
) ENGINE = InnoDB AUTO_INCREMENT = 60 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户积分记录';
-- ----------------------------
-- Records of member_point_record
@ -902,6 +951,28 @@ INSERT INTO `member_point_record` (`id`, `user_id`, `biz_id`, `biz_type`, `title
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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 (60, 248, '131', 21, '订单积分奖励', '下单获得 21003 积分', 21003, 21003, NULL, '2023-10-24 12:33:22', NULL, '2023-10-24 12:33:22', b'0', 1);
COMMIT;
-- ----------------------------
@ -1003,6 +1074,7 @@ CREATE TABLE `member_user` (
`password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码',
`status` tinyint NOT NULL COMMENT '状态',
`register_ip` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '注册 IP',
`register_terminal` tinyint NULL DEFAULT NULL COMMENT '注册终端',
`login_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '最后登录IP',
`login_date` datetime NULL DEFAULT NULL COMMENT '最后登录时间',
`nickname` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
@ -1092,7 +1164,7 @@ CREATE TABLE `system_dict_data` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1386 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表';
) ENGINE = InnoDB AUTO_INCREMENT = 1398 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表';
-- ----------------------------
-- Records of system_dict_data
@ -1178,6 +1250,11 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
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 (123, 10, '支付成功', '10', 'pay_order_status', 0, 'success', '', '支付成功', '1', '2021-12-03 11:18:29', '1', '2023-07-19 18:04:28', b'0');
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 (124, 30, '支付关闭', '30', 'pay_order_status', 0, 'info', '', '支付关闭', '1', '2021-12-03 11:18:42', '1', '2023-07-19 18:05:07', b'0');
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 (125, 0, '等待支付', '0', 'pay_order_status', 0, 'info', '', '未支付', '1', '2021-12-03 11:18:18', '1', '2023-07-19 18:04:15', b'0');
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 (600, 5, '首页', '1', 'promotion_banner_position', 0, 'warning', '', '', '1', '2023-10-11 07:45:24', '1', '2023-10-11 07:45:38', b'0');
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 (601, 4, '秒杀活动页', '2', 'promotion_banner_position', 0, 'warning', '', '', '1', '2023-10-11 07:45:24', '1', '2023-10-11 07:45:38', b'0');
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 (602, 3, '砍价活动页', '3', 'promotion_banner_position', 0, 'warning', '', '', '1', '2023-10-11 07:45:24', '1', '2023-10-11 07:45:38', b'0');
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 (603, 2, '限时折扣页', '4', 'promotion_banner_position', 0, 'warning', '', '', '1', '2023-10-11 07:45:24', '1', '2023-10-11 07:45:38', b'0');
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 (604, 1, '满减送页', '5', 'promotion_banner_position', 0, 'warning', '', '', '1', '2023-10-11 07:45:24', '1', '2023-10-11 07:45:38', b'0');
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 (1118, 0, '等待退款', '0', 'pay_refund_status', 0, 'info', '', '等待退款', '1', '2021-12-10 16:44:59', '1', '2023-07-19 10:14:39', b'0');
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 (1119, 20, '退款失败', '20', 'pay_refund_status', 0, 'danger', '', '退款失败', '1', '2021-12-10 16:45:10', '1', '2023-07-19 10:15:10', b'0');
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 (1124, 10, '退款成功', '10', 'pay_refund_status', 0, 'success', '', '退款成功', '1', '2021-12-10 16:46:26', '1', '2023-07-19 10:15:00', b'0');
@ -1298,7 +1375,7 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
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');
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');
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');
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');
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');
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');
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');
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 +1385,11 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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 +1425,15 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
COMMIT;
-- ----------------------------
@ -1368,7 +1454,7 @@ CREATE TABLE `system_dict_type` (
`deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `dict_type`(`type` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 183 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
) ENGINE = InnoDB AUTO_INCREMENT = 185 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
-- ----------------------------
-- Records of system_dict_type
@ -1441,6 +1527,8 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat
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);
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);
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');
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');
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (600, 'Banner Position', 'promotion_banner_position', 0, '', '1', '2023-10-08 07:24:25', '1', '2023-10-08 07:24:25', b'0', '1970-01-01 00:00:00');
COMMIT;
-- ----------------------------
@ -1489,7 +1577,7 @@ CREATE TABLE `system_login_log` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2516 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
) ENGINE = InnoDB AUTO_INCREMENT = 2620 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
-- ----------------------------
-- Records of system_login_log
@ -1619,7 +1707,7 @@ CREATE TABLE `system_menu` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2366 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表';
) ENGINE = InnoDB AUTO_INCREMENT = 2391 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表';
-- ----------------------------
-- Records of system_menu
@ -1871,11 +1959,11 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
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');
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');
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');
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');
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');
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');
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');
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 (2029, 'Banner删除', 'market:banner:delete', 3, 4, 2025, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0');
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/promotion/banner/index', NULL, 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '1', '2023-10-24 20:20:06', b'0');
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查询', 'promotion:banner:query', 3, 1, 2025, '', '', '', '', 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '1', '2023-10-24 20:20:18', b'0');
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创建', 'promotion:banner:create', 3, 2, 2025, '', '', '', '', 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '1', '2023-10-24 20:20:23', b'0');
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更新', 'promotion:banner:update', 3, 3, 2025, '', '', '', '', 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '1', '2023-10-24 20:20:28', b'0');
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 (2029, 'Banner删除', 'promotion:banner:delete', 3, 4, 2025, '', '', '', '', 0, b'1', b'1', b'1', '', '2022-08-01 14:56:14', '1', '2023-10-24 20:20:36', b'0');
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 (2030, '营销中心', '', 1, 70, 2362, 'promotion', 'ep:present', NULL, NULL, 0, b'1', b'1', b'1', '1', '2022-10-31 21:25:09', '1', '2023-09-30 11:54:27', b'0');
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 (2032, '优惠劵列表', '', 2, 1, 2365, 'template', 'ep:discount', 'mall/promotion/coupon/template/index', 'PromotionCouponTemplate', 0, b'1', b'1', b'1', '', '2022-10-31 22:27:14', '1', '2023-10-03 12:40:06', b'0');
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 (2033, '优惠劵模板查询', 'promotion:coupon-template:query', 3, 1, 2032, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0');
@ -1885,13 +1973,13 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
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 (2038, '领取记录', '', 2, 2, 2365, 'list', 'ep:collection-tag', 'mall/promotion/coupon/index', 'PromotionCoupon', 0, b'1', b'1', b'1', '', '2022-11-03 23:21:31', '1', '2023-10-03 12:55:30', b'0');
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 (2039, '优惠劵查询', 'promotion:coupon:query', 3, 1, 2038, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-03 23:21:31', '', '2022-11-03 23:21:31', b'0');
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 (2040, '优惠劵删除', 'promotion:coupon:delete', 3, 4, 2038, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-03 23:21:31', '', '2022-11-03 23:21:31', b'0');
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 (2041, '满减送活动', '', 2, 10, 2030, 'reward-activity', 'ep:goblet-square-full', 'mall/promotion/rewardActivity/index', 'PromotionRewardActivity', 0, b'1', b'1', b'1', '', '2022-11-04 23:47:49', '1', '2023-10-05 00:16:38', b'0');
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 (2041, '满减送', '', 2, 10, 2390, 'reward-activity', 'ep:goblet-square-full', 'mall/promotion/rewardActivity/index', 'PromotionRewardActivity', 0, b'1', b'1', b'1', '', '2022-11-04 23:47:49', '1', '2023-10-21 19:24:46', b'0');
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 (2042, '满减送活动查询', 'promotion:reward-activity:query', 3, 1, 2041, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-04 23:47:49', '', '2022-11-04 23:47:49', b'0');
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 (2043, '满减送活动创建', 'promotion:reward-activity:create', 3, 2, 2041, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-04 23:47:49', '', '2022-11-04 23:47:49', b'0');
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 (2044, '满减送活动更新', 'promotion:reward-activity:update', 3, 3, 2041, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-04 23:47:50', '', '2022-11-04 23:47:50', b'0');
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 (2045, '满减送活动删除', 'promotion:reward-activity:delete', 3, 4, 2041, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-04 23:47:50', '', '2022-11-04 23:47:50', b'0');
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 (2046, '满减送活动关闭', 'promotion:reward-activity:close', 3, 5, 2041, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2022-11-05 10:42:53', '1', '2022-11-05 10:42:53', b'0');
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 (2047, '限时折扣活动', '', 2, 7, 2030, 'discount-activity', 'ep:timer', 'mall/promotion/discountActivity/index', 'PromotionDiscountActivity', 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '1', '2023-10-05 00:16:25', b'0');
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 (2047, '限时折扣', '', 2, 7, 2390, 'discount-activity', 'ep:timer', 'mall/promotion/discountActivity/index', 'PromotionDiscountActivity', 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '1', '2023-10-21 19:24:21', b'0');
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 (2048, '限时折扣活动查询', 'promotion:discount-activity:query', 3, 1, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0');
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 (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0');
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 (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
@ -2037,7 +2125,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
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');
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');
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');
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');
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');
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');
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');
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 +2185,24 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
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');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2389, '核销订单', '', 2, 2, 2166, 'pick-up-order', 'ep:list', 'mall/trade/delivery/pickUpOrder/index', 'PickUpOrder', 0, b'1', b'1', b'1', '', '2023-10-19 16:09:51', '', '2023-10-19 16:09:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2390, '优惠活动', '', 1, 99, 2030, 'youhui', 'ep:aim', '', '', 0, b'1', b'1', b'1', '1', '2023-10-21 19:23:49', '1', '2023-10-21 19:23:49', b'0');
COMMIT;
-- ----------------------------
@ -2215,7 +2321,7 @@ CREATE TABLE `system_oauth2_access_token` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2880 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
) ENGINE = InnoDB AUTO_INCREMENT = 3130 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
-- ----------------------------
-- Records of system_oauth2_access_token
@ -2337,7 +2443,7 @@ CREATE TABLE `system_oauth2_refresh_token` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1014 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
) ENGINE = InnoDB AUTO_INCREMENT = 1089 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
-- ----------------------------
-- Records of system_oauth2_refresh_token
@ -2377,7 +2483,7 @@ CREATE TABLE `system_operate_log` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8643 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录';
) ENGINE = InnoDB AUTO_INCREMENT = 8757 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录';
-- ----------------------------
-- Records of system_operate_log
@ -3385,7 +3491,7 @@ CREATE TABLE `system_sms_code` (
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号'
) ENGINE = InnoDB AUTO_INCREMENT = 515 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码';
) ENGINE = InnoDB AUTO_INCREMENT = 535 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '手机验证码';
-- ----------------------------
-- Records of system_sms_code
@ -3428,7 +3534,7 @@ CREATE TABLE `system_sms_log` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 426 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志';
) ENGINE = InnoDB AUTO_INCREMENT = 449 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志';
-- ----------------------------
-- Records of system_sms_log
@ -3478,6 +3584,33 @@ INSERT INTO `system_sms_template` (`id`, `type`, `status`, `code`, `name`, `cont
INSERT INTO `system_sms_template` (`id`, `type`, `status`, `code`, `name`, `content`, `params`, `remark`, `api_template_id`, `channel_id`, `channel_code`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (16, 1, 0, 'user-reset-password', '会员用户 - 重置密码', '您的验证码{code}该验证码 5 分钟内有效请勿泄漏于他人', '[\"code\"]', '', 'null', 4, 'DEBUG_DING_TALK', '1', '2023-08-19 18:58:01', '1', '2023-08-19 11:34:18', b'0');
COMMIT;
-- ----------------------------
-- Table structure for system_social_client
-- ----------------------------
DROP TABLE IF EXISTS `system_social_client`;
CREATE TABLE `system_social_client` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '应用名',
`social_type` tinyint NOT NULL COMMENT '社交平台的类型',
`user_type` tinyint NOT NULL COMMENT '用户类型',
`client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端编号',
`client_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户端密钥',
`status` tinyint NOT NULL COMMENT '状态',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 44 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交客户端表';
-- ----------------------------
-- Records of system_social_client
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for system_social_user
-- ----------------------------
@ -3500,7 +3633,7 @@ CREATE TABLE `system_social_user` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交用户表';
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交用户表';
-- ----------------------------
-- Records of system_social_user
@ -3525,7 +3658,7 @@ CREATE TABLE `system_social_user_bind` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 77 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交绑定表';
) ENGINE = InnoDB AUTO_INCREMENT = 81 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '社交绑定表';
-- ----------------------------
-- Records of system_social_user_bind
@ -3701,7 +3834,7 @@ CREATE TABLE `system_users` (
-- Records of system_users
-- ----------------------------
BEGIN;
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);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://127.0.0.1:48080/admin-api/infra/file/4/get/37e56010ecbee472cdd821ac4b608e151e62a74d9633f15d085aee026eedeb60.png', 0, '0:0:0:0:0:0:0:1', '2023-10-24 20:20:54', 'admin', '2021-01-05 17:03:47', NULL, '2023-10-24 20:20:54', b'0', 1);
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);
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);
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 +3842,7 @@ INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`,
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);
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);
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);
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);
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);
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);
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);
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);

View File

@ -1,49 +0,0 @@
-- 交易统计表
CREATE TABLE trade_statistics
(
id bigint AUTO_INCREMENT COMMENT '编号主键自增'
PRIMARY KEY,
time datetime NOT NULL COMMENT '统计日期',
order_create_count int DEFAULT 0 NOT NULL COMMENT '创建订单数',
order_pay_count int DEFAULT 0 NOT NULL COMMENT '支付订单商品数',
order_pay_price int DEFAULT 0 NOT NULL COMMENT '总支付金额单位',
order_wallet_pay_price int DEFAULT 0 NOT NULL COMMENT '总支付金额余额单位',
after_sale_count int DEFAULT 0 NOT NULL COMMENT '退款订单数',
after_sale_refund_price int DEFAULT 0 NOT NULL COMMENT '总退款金额单位',
brokerage_settlement_price int DEFAULT 0 NOT NULL COMMENT '佣金金额已结算单位',
recharge_pay_count int DEFAULT 0 NOT NULL COMMENT '充值订单数',
recharge_pay_price int DEFAULT 0 NOT NULL COMMENT '充值金额单位',
recharge_refund_count int DEFAULT 0 NOT NULL COMMENT '充值退款订单数',
recharge_refund_price int DEFAULT 0 NOT NULL COMMENT '充值退款金额单位',
creator varchar(64) DEFAULT '' NULL COMMENT '创建者',
create_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间',
updater varchar(64) DEFAULT '' NULL COMMENT '更新者',
update_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
deleted bit DEFAULT b'0' NOT NULL COMMENT '是否删除',
tenant_id bigint DEFAULT 0 NOT NULL COMMENT '租户编号'
)
COMMENT '交易统计表';
CREATE INDEX trade_statistics_time_index
ON trade_statistics (time);
-- 菜单
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, component_name)
VALUES ('统计管理', '', 1, 4, 0, '/statistics', 'ep:data-line', '', '');
SELECT @parentId := LAST_INSERT_ID();
-- 交易统计
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, component_name)
VALUES ('交易统计', '', 2, 1, @parentId, 'trade', 'fa-solid:credit-card', 'statistics/trade/index', 'TradeStatistics');
SELECT @parentId := LAST_INSERT_ID();
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('交易统计查询', 'statistics:trade:query', 3, 1, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('交易统计导出', 'statistics:trade:export', 3, 2, @parentId, '', '', '', 0);
-- 会员统计
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, component_name)
VALUES ('会员统计', '', 2, 2, @parentId, 'member', 'ep:avatar', 'statistics/member/index', 'MemberStatistics');
SELECT @parentId := LAST_INSERT_ID();
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('会员统计查询', 'statistics:member:query', 3, 1, @parentId, '', '', '', 0);

View File

@ -14,28 +14,28 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<properties>
<revision>1.8.2-snapshot</revision>
<revision>1.8.3-snapshot</revision>
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
<!-- 统一依赖管理 -->
<spring.boot.version>2.7.16</spring.boot.version>
<spring.boot.version>2.7.17</spring.boot.version>
<!-- Web 相关 -->
<springdoc.version>1.6.15</springdoc.version>
<knife4j.version>4.3.0</knife4j.version>
<servlet.versoin>2.5</servlet.versoin>
<!-- DB 相关 -->
<druid.version>1.2.19</druid.version>
<mybatis-plus.version>3.5.3.2</mybatis-plus.version>
<mybatis-plus-generator.version>3.5.3.2</mybatis-plus-generator.version>
<druid.version>1.2.20</druid.version>
<mybatis-plus.version>3.5.4</mybatis-plus.version>
<mybatis-plus-generator.version>3.5.4</mybatis-plus-generator.version>
<dynamic-datasource.version>3.6.1</dynamic-datasource.version>
<mybatis-plus-join.version>1.4.6</mybatis-plus-join.version>
<redisson.version>3.18.0</redisson.version>
<dm8.jdbc.version>8.1.2.141</dm8.jdbc.version>
<dm8.jdbc.version>8.1.3.62</dm8.jdbc.version>
<!-- 服务保障相关 -->
<lock4j.version>2.2.3</lock4j.version>
<lock4j.version>2.2.5</lock4j.version>
<resilience4j.version>1.7.1</resilience4j.version>
<!-- 监控相关 -->
<skywalking.version>8.12.0</skywalking.version>
<spring-boot-admin.version>2.7.10</spring-boot-admin.version>
<spring-boot-admin.version>2.7.11</spring-boot-admin.version>
<opentracing.version>0.33.0</opentracing.version>
<!-- Test 测试相关 -->
<podam.version>7.2.11.RELEASE</podam.version>
@ -44,8 +44,8 @@
<!-- Bpm 工作流相关 -->
<flowable.version>6.8.0</flowable.version>
<!-- 工具类相关 -->
<captcha-plus.version>1.0.8</captcha-plus.version>
<jsoup.version>1.16.1</jsoup.version>
<captcha-plus.version>1.0.10</captcha-plus.version>
<jsoup.version>1.16.2</jsoup.version>
<lombok.version>1.18.30</lombok.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<hutool.version>5.8.22</hutool.version>
@ -53,10 +53,10 @@
<velocity.version>2.3</velocity.version>
<screw.version>1.0.5</screw.version>
<fastjson.version>1.2.83</fastjson.version>
<guava.version>32.1.2-jre</guava.version>
<guava.version>32.1.3-jre</guava.version>
<guice.version>5.1.0</guice.version>
<transmittable-thread-local.version>2.14.2</transmittable-thread-local.version>
<commons-net.version>3.9.0</commons-net.version>
<commons-net.version>3.10.0</commons-net.version>
<jsch.version>0.1.55</jsch.version>
<tika-core.version>2.7.0</tika-core.version>
<ip2region.version>2.7.0</ip2region.version>
@ -67,8 +67,8 @@
<minio.version>8.5.6</minio.version>
<aliyun-java-sdk-core.version>4.6.4</aliyun-java-sdk-core.version>
<aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
<tencentcloud-sdk-java.version>3.1.853</tencentcloud-sdk-java.version>
<justauth.version>1.0.5</justauth.version>
<tencentcloud-sdk-java.version>3.1.880</tencentcloud-sdk-java.version>
<justauth.version>1.0.7</justauth.version>
<jimureport.version>1.6.1</jimureport.version>
<xercesImpl.version>2.12.2</xercesImpl.version>
<weixin-java.version>4.5.0</weixin-java.version>

View File

@ -21,7 +21,7 @@
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- 统一依赖管理 -->
<spring.boot.version>2.7.16</spring.boot.version>
<spring.boot.version>2.7.17</spring.boot.version>
</properties>
<dependencyManagement>

View File

@ -21,7 +21,7 @@
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- 统一依赖管理 -->
<spring.boot.version>2.7.16</spring.boot.version>
<spring.boot.version>2.7.17</spring.boot.version>
</properties>
<dependencyManagement>

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.framework.common.enums;
import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -34,4 +35,12 @@ public enum CommonStatusEnum implements IntArrayValuable {
return ARRAYS;
}
public static boolean isEnable(Integer status) {
return ObjUtil.equal(ENABLE.status, status);
}
public static boolean isDisable(Integer status) {
return ObjUtil.equal(DISABLE.status, status);
}
}

View File

@ -1,49 +0,0 @@
package cn.iocoder.yudao.framework.common.enums;
// TODO 这种简单的暂时不用枚举哈直接代码里写死就好啦
/**
* 符号常量
*/
public interface SymbolConstant {
String D =",";
/**
* _
*/
String XH="_";
/**
* -
*/
String HG="-";
/**
* /
*/
String XG="/";
/**
* 箭头
*/
String ARROWHEAD="->";
/**
* 数组的开始元素
*/
String ARRAY_START="[";
/**
* 数组的结束元素
*/
String ARRAY_END="]";
/**
* null 字符串
*/
String NULL_STRING="null";
/**
* 点号
*/
String DIAN="\\.";
}

View File

@ -18,8 +18,7 @@ public enum TerminalEnum implements IntArrayValuable {
WECHAT_MINI_PROGRAM(10, "微信小程序"),
WECHAT_WAP(11, "微信公众号"),
H5(20, "H5 网页"),
IOS(31, "苹果 App"),
ANDROID(32, "安卓 App"),
APP(31, "手机 App"),
;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray();

View File

@ -8,6 +8,7 @@ import com.google.common.collect.ImmutableMap;
import java.util.*;
import java.util.function.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.Arrays.asList;
@ -267,4 +268,20 @@ public class CollectionUtils {
return deptId == null ? Collections.emptyList() : Collections.singleton(deptId);
}
public static <T, U> List<U> convertListByFlatMap(Collection<T> from,
Function<T, ? extends Stream<? extends U>> func) {
if (CollUtil.isEmpty(from)) {
return new ArrayList<>();
}
return from.stream().flatMap(func).filter(Objects::nonNull).collect(Collectors.toList());
}
public static <T, U> Set<U> convertSetByFlatMap(Collection<T> from,
Function<T, ? extends Stream<? extends U>> func) {
if (CollUtil.isEmpty(from)) {
return new HashSet<>();
}
return from.stream().flatMap(func).filter(Objects::nonNull).collect(Collectors.toSet());
}
}

View File

@ -27,7 +27,7 @@ public class ServletUtils {
* 返回 JSON 字符串
*
* @param response 响应
* @param object 对象会序列化成 JSON 字符串
* @param object 对象会序列化成 JSON 字符串
*/
@SuppressWarnings("deprecation") // 必须使用 APPLICATION_JSON_UTF8_VALUE否则会乱码
public static void writeJSON(HttpServletResponse response, Object object) {
@ -40,7 +40,7 @@ public class ServletUtils {
*
* @param response 响应
* @param filename 文件名
* @param content 附件内容
* @param content 附件内容
*/
public static void writeAttachment(HttpServletResponse response, String filename, byte[] content) throws IOException {
// 设置 header contentType
@ -88,6 +88,8 @@ public class ServletUtils {
return ServletUtil.getClientIP(request);
}
// TODO @疯狂terminal 还是从 ServletUtils 里拿更容易全局治理
public static boolean isJsonRequest(ServletRequest request) {
return StrUtil.startWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE);
}
@ -107,4 +109,5 @@ public class ServletUtils {
public static Map<String, String> getParamMap(HttpServletRequest request) {
return ServletUtil.getParamMap(request);
}
}

View File

@ -21,7 +21,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@ConditionalOnProperty(prefix = "yudao.error-code", value = "enable", matchIfMissing = true) // 允许使用 yudao.error-code.enable=false 禁用访问日志
@EnableConfigurationProperties(ErrorCodeProperties.class)
@EnableScheduling // 开启调度任务的功能因为 ErrorCodeRemoteLoader 通过定时刷新错误码
public class YudaoErrorCodeConfiguration {
public class YudaoErrorCodeAutoConfiguration {
@Bean
public ErrorCodeAutoGenerator errorCodeAutoGenerator(@Value("${spring.application.name}") String applicationName,

View File

@ -1 +1 @@
cn.iocoder.yudao.framework.errorcode.config.YudaoErrorCodeConfiguration
cn.iocoder.yudao.framework.errorcode.config.YudaoErrorCodeAutoConfiguration

View File

@ -132,25 +132,31 @@ public class AreaUtils {
return convertList(areas.values(), func, area -> type.getType().equals(area.getType()));
}
// TODO @疯狂注释写下
/**
* 根据区域编号上级区域类型获取上级区域编号
*
* @param id 区域编号
* @param type 区域类型
* @return 上级区域编号
*/
public static Integer getParentIdByType(Integer id, @NonNull AreaTypeEnum type) {
// TODO @疯狂这种不要用 while true因为万一脏数据可能会死循环可以转换成 for (int i = 0; i < Byte.MAX; i++) 一般是优先层级
do {
for (int i = 0; i < Byte.MAX_VALUE; i++) {
Area area = AreaUtils.getArea(id);
if (area == null) {
return null;
}
// 情况一匹配到返回它
if (type.getType().equals(area.getType())) {
return area.getId();
}
// 情况二找到根节点返回空
if (area.getParent() == null || area.getParent().getId() == null) {
return null;
}
// 其它继续向上查找
id = area.getParent().getId();
} while (true);
}
return null;
}
}

View File

@ -51,7 +51,9 @@ public class PayTransferUnifiedReqDTO {
private String title;
/**
* 收款方信息转账类型不同收款方信息不同
* 收款方信息
*
* 转账类型 {@link #type} 不同收款方信息不同
*/
@NotEmpty(message = "收款方信息 不能为空")
private Map<String, String> payeeInfo;

View File

@ -50,8 +50,6 @@ public class PayClientFactoryImpl implements PayClientFactory {
clientClass.put(ALIPAY_APP, AlipayAppPayClient.class);
clientClass.put(ALIPAY_PC, AlipayPcPayClient.class);
clientClass.put(ALIPAY_BAR, AlipayBarPayClient.class);
// 支付包转账客户端
clientClass.put(ALIPAY_TRANSFER, AlipayTransferClient.class);
// Mock 支付客户端
clientClass.put(MOCK, MockPayClient.class);
}

View File

@ -6,24 +6,28 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.impl.AbstractPayClient;
import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderStatusRespEnum;
import cn.iocoder.yudao.framework.pay.core.enums.transfer.PayTransferTypeEnum;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayConfig;
import com.alipay.api.AlipayResponse;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.domain.AlipayTradeFastpayRefundQueryModel;
import com.alipay.api.domain.AlipayTradeQueryModel;
import com.alipay.api.domain.AlipayTradeRefundModel;
import com.alipay.api.domain.*;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayFundTransUniTransferRequest;
import com.alipay.api.request.AlipayTradeFastpayRefundQueryRequest;
import com.alipay.api.request.AlipayTradeQueryRequest;
import com.alipay.api.request.AlipayTradeRefundRequest;
import com.alipay.api.response.AlipayFundTransUniTransferResponse;
import com.alipay.api.response.AlipayTradeFastpayRefundQueryResponse;
import com.alipay.api.response.AlipayTradeQueryResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;
@ -39,6 +43,9 @@ import java.util.Objects;
import java.util.function.Supplier;
import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMATTER;
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
import static cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig.MODE_CERTIFICATE;
/**
* 支付宝抽象类实现支付宝统一的接口以及部分实现退款
@ -105,16 +112,20 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa
// 1.2 构建 AlipayTradeQueryRequest 请求
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
request.setBizModel(model);
// 2.1 执行请求
AlipayTradeQueryResponse response = client.execute(request);
AlipayTradeQueryResponse response;
if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) {
// 证书模式
response = client.certificateExecute(request);
} else {
response = client.execute(request);
}
if (!response.isSuccess()) { // 不成功例如说订单不存在
return PayOrderRespDTO.closedOf(response.getSubCode(), response.getSubMsg(),
outTradeNo, response);
}
// 2.2 解析订单的状态
Integer status = parseStatus(response.getTradeStatus());
Assert.notNull(status, (Supplier<Throwable>) () -> {
Assert.notNull(status, () -> {
throw new IllegalArgumentException(StrUtil.format("body({}) 的 trade_status 不正确", response.getBody()));
});
return PayOrderRespDTO.of(status, response.getTradeNo(), response.getBuyerUserId(), LocalDateTimeUtil.of(response.getSendPayDate()),
@ -148,7 +159,12 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa
request.setBizModel(model);
// 2.1 执行请求
AlipayTradeRefundResponse response = client.execute(request);
AlipayTradeRefundResponse response;
if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) { // 证书模式
response = client.certificateExecute(request);
} else {
response = client.execute(request);
}
if (!response.isSuccess()) {
// 当出现 ACQ.SYSTEM_ERROR, 退款可能成功也可能失败 返回 WAIT 状态. 后续 job 会轮询
if (ObjectUtils.equalsAny(response.getSubCode(), "ACQ.SYSTEM_ERROR", "SYSTEM_ERROR")) {
@ -185,7 +201,12 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa
request.setBizModel(model);
// 2.1 执行请求
AlipayTradeFastpayRefundQueryResponse response = client.execute(request);
AlipayTradeFastpayRefundQueryResponse response;
if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) { // 证书模式
response = client.certificateExecute(request);
} else {
response = client.execute(request);
}
if (!response.isSuccess()) {
// 明确不存在的情况应该就是失败可进行关闭
if (ObjectUtils.equalsAny(response.getSubCode(), "TRADE_NOT_EXIST", "ACQ.TRADE_NOT_EXIST")) {
@ -202,7 +223,69 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa
return PayRefundRespDTO.waitingOf(null, outRefundNo, response);
}
@Override
protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) throws AlipayApiException {
// 1.1 校验公钥类型 必须使用公钥证书模式
if (!Objects.equals(config.getMode(), MODE_CERTIFICATE)) {
throw new IllegalStateException("支付宝单笔转账必须使用公钥证书模式");
}
// 1.2 构建 AlipayFundTransUniTransferModel
AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
// 通用的参数
model.setTransAmount(formatAmount(reqDTO.getPrice())); // 转账金额
model.setOrderTitle(reqDTO.getTitle()); // 转账业务的标题用于在支付宝用户的账单里显示
model.setOutBizNo(reqDTO.getOutTransferNo());
model.setProductCode("TRANS_ACCOUNT_NO_PWD"); // 销售产品码单笔无密转账固定为 TRANS_ACCOUNT_NO_PWD
model.setBizScene("DIRECT_TRANSFER"); // 业务场景 单笔无密转账固定为 DIRECT_TRANSFER
model.setBusinessParams(JsonUtils.toJsonString(reqDTO.getChannelExtras()));
PayTransferTypeEnum transferType = PayTransferTypeEnum.typeOf(reqDTO.getType());
switch (transferType) {
// TODO @jason是不是不用传递 transferType 参数哈因为应该已经明确是支付宝啦
// @芋艿 是不是还要考虑转账到银行卡所以传 transferType 但是转账到银行卡不知道要如何测试??
case ALIPAY_BALANCE: {
// 个性化的参数
Participant payeeInfo = new Participant();
payeeInfo.setIdentityType("ALIPAY_LOGON_ID");
String logonId = MapUtil.getStr(reqDTO.getPayeeInfo(), "ALIPAY_LOGON_ID");
if (StrUtil.isEmpty(logonId)) {
throw exception0(BAD_REQUEST.getCode(), "支付包登录 ID 不能为空");
}
String accountName = MapUtil.getStr(reqDTO.getPayeeInfo(), "ALIPAY_ACCOUNT_NAME");
if (StrUtil.isEmpty(accountName)) {
throw exception0(BAD_REQUEST.getCode(), "支付包账户名称不能为空");
}
payeeInfo.setIdentity(logonId); // 支付宝登录号
payeeInfo.setName(accountName); // 支付宝账号姓名
model.setPayeeInfo(payeeInfo);
// 1.3 构建 AlipayFundTransUniTransferRequest
AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
request.setBizModel(model);
// 执行请求
AlipayFundTransUniTransferResponse response = client.certificateExecute(request);
// 处理结果
if (!response.isSuccess()) {
// 当出现 SYSTEM_ERROR, 转账可能成功也可能失败 返回 WAIT 状态. 后续 job 会轮询
if (ObjectUtils.equalsAny(response.getSubCode(), "SYSTEM_ERROR", "ACQ.SYSTEM_ERROR")) {
return PayTransferRespDTO.waitingOf(null, reqDTO.getOutTransferNo(), response);
}
return PayTransferRespDTO.closedOf(response.getSubCode(), response.getSubMsg(),
reqDTO.getOutTransferNo(), response);
}
return PayTransferRespDTO.successOf(response.getOrderId(), parseTime(response.getTransDate()),
response.getOutBizNo(), response);
}
case BANK_CARD: {
Participant payeeInfo = new Participant();
payeeInfo.setIdentityType("BANKCARD_ACCOUNT");
// TODO 待实现
throw new UnsupportedOperationException("待实现");
}
default: {
throw new IllegalStateException("不正确的转账类型: " + transferType);
}
}
}
// ========== 各种工具方法 ==========

View File

@ -2,8 +2,6 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.alipay;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum;
import com.alipay.api.AlipayApiException;
@ -58,9 +56,4 @@ public class AlipayAppPayClient extends AbstractAlipayPayClient {
return PayOrderRespDTO.waitingOf(displayMode, response.getBody(),
reqDTO.getOutTradeNo(), response);
}
@Override
protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) {
throw new UnsupportedOperationException("支付宝【App 支付】不支持转账操作");
}
}

View File

@ -5,8 +5,6 @@ import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum;
import com.alipay.api.AlipayApiException;
@ -16,9 +14,11 @@ import com.alipay.api.response.AlipayTradePayResponse;
import lombok.extern.slf4j.Slf4j;
import java.time.LocalDateTime;
import java.util.Objects;
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
import static cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig.MODE_CERTIFICATE;
/**
* 支付宝条码支付 PayClient 实现类
@ -61,7 +61,13 @@ public class AlipayBarPayClient extends AbstractAlipayPayClient {
request.setReturnUrl(reqDTO.getReturnUrl());
// 2.1 执行请求
AlipayTradePayResponse response = client.execute(request);
AlipayTradePayResponse response;
if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) {
// 证书模式
response = client.certificateExecute(request);
} else {
response = client.execute(request);
}
// 2.2 处理结果
if (!response.isSuccess()) {
return buildClosedPayOrderRespDTO(reqDTO, response);
@ -76,9 +82,4 @@ public class AlipayBarPayClient extends AbstractAlipayPayClient {
return PayOrderRespDTO.waitingOf(displayMode, "",
reqDTO.getOutTradeNo(), response);
}
@Override
protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) {
throw new UnsupportedOperationException("支付宝【条码支付】不支持转账操作");
}
}

View File

@ -4,8 +4,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.Method;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum;
import com.alipay.api.AlipayApiException;
@ -68,9 +66,4 @@ public class AlipayPcPayClient extends AbstractAlipayPayClient {
return PayOrderRespDTO.waitingOf(displayMode, response.getBody(),
reqDTO.getOutTradeNo(), response);
}
@Override
protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) {
throw new UnsupportedOperationException("支付宝【PC 网站】不支持转账操作");
}
}

View File

@ -2,8 +2,6 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.alipay;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum;
import com.alipay.api.AlipayApiException;
@ -12,6 +10,10 @@ import com.alipay.api.request.AlipayTradePrecreateRequest;
import com.alipay.api.response.AlipayTradePrecreateResponse;
import lombok.extern.slf4j.Slf4j;
import java.util.Objects;
import static cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig.MODE_CERTIFICATE;
/**
* 支付宝扫码支付 PayClient 实现类
*
@ -47,7 +49,13 @@ public class AlipayQrPayClient extends AbstractAlipayPayClient {
request.setReturnUrl(reqDTO.getReturnUrl());
// 2.1 执行请求
AlipayTradePrecreateResponse response = client.execute(request);
AlipayTradePrecreateResponse response;
if (Objects.equals(config.getMode(), MODE_CERTIFICATE)) {
// 证书模式
response = client.certificateExecute(request);
} else {
response = client.execute(request);
}
// 2.2 处理结果
if (!response.isSuccess()) {
return buildClosedPayOrderRespDTO(reqDTO, response);
@ -55,9 +63,4 @@ public class AlipayQrPayClient extends AbstractAlipayPayClient {
return PayOrderRespDTO.waitingOf(displayMode, response.getQrCode(),
reqDTO.getOutTradeNo(), response);
}
@Override
protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) {
throw new UnsupportedOperationException("支付宝【扫码支付】不支持转账操作");
}
}

View File

@ -1,103 +0,0 @@
package cn.iocoder.yudao.framework.pay.core.client.impl.alipay;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
import cn.iocoder.yudao.framework.pay.core.enums.transfer.PayTransferTypeEnum;
import com.alipay.api.AlipayApiException;
import com.alipay.api.domain.AlipayFundTransUniTransferModel;
import com.alipay.api.domain.Participant;
import com.alipay.api.request.AlipayFundTransUniTransferRequest;
import com.alipay.api.response.AlipayFundTransUniTransferResponse;
import lombok.extern.slf4j.Slf4j;
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
/**
* 支付宝转账的 PayClient 实现类
*
* @author jason
*/
@Slf4j
public class AlipayTransferClient extends AbstractAlipayPayClient {
public AlipayTransferClient(Long channelId, AlipayPayClientConfig config) {
super(channelId, PayChannelEnum.ALIPAY_TRANSFER.getCode(), config);
}
@Override
protected PayOrderRespDTO doUnifiedOrder(PayOrderUnifiedReqDTO reqDTO) {
throw new UnsupportedOperationException("支付宝转账不支持统一下单请求");
}
@Override
protected PayRefundRespDTO doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) {
throw new UnsupportedOperationException("支付宝转账不支持统一退款请求");
}
@Override
protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) throws AlipayApiException {
// 1.1 构建 AlipayFundTransUniTransferModel
AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
// 通用的参数
model.setTransAmount(formatAmount(reqDTO.getPrice())); // 转账金额
model.setOrderTitle(reqDTO.getTitle()); // 转账业务的标题用于在支付宝用户的账单里显示
model.setOutBizNo(reqDTO.getOutTransferNo());
model.setProductCode("TRANS_ACCOUNT_NO_PWD"); // 销售产品码单笔无密转账固定为 TRANS_ACCOUNT_NO_PWD
model.setBizScene("DIRECT_TRANSFER"); // 业务场景 单笔无密转账固定为 DIRECT_TRANSFER
model.setBusinessParams(JsonUtils.toJsonString(reqDTO.getChannelExtras()));
PayTransferTypeEnum transferType = PayTransferTypeEnum.ofType(reqDTO.getType());
switch(transferType){
case WX_BALANCE :
case WALLET_BALANCE : {
log.error("[doUnifiedTransfer],支付宝转账不支持的转账类型{}", transferType);
throw new UnsupportedOperationException(String.format("支付宝转账不支持转账类型: %s",transferType.getName()));
}
case ALIPAY_BALANCE : {
// 个性化的参数
Participant payeeInfo = new Participant();
payeeInfo.setIdentityType("ALIPAY_LOGON_ID");
String logonId = MapUtil.getStr(reqDTO.getPayeeInfo(), "ALIPAY_LOGON_ID");
if (StrUtil.isEmpty(logonId)) {
throw exception0(BAD_REQUEST.getCode(), "支付包登录 ID 不能为空");
}
String accountName = MapUtil.getStr(reqDTO.getPayeeInfo(), "ALIPAY_ACCOUNT_NAME");
if (StrUtil.isEmpty(accountName)) {
throw exception0(BAD_REQUEST.getCode(), "支付包账户名称不能为空");
}
payeeInfo.setIdentity(logonId); // 支付宝登录号
payeeInfo.setName(accountName); // 支付宝账号姓名
model.setPayeeInfo(payeeInfo);
// 1.2 构建 AlipayFundTransUniTransferRequest
AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
request.setBizModel(model);
// 执行请求
AlipayFundTransUniTransferResponse response = client.certificateExecute(request);
// 处理结果
if (!response.isSuccess()) {
// 当出现 SYSTEM_ERROR, 转账可能成功也可能失败 返回 WAIT 状态. 后续 job 会轮询
if (ObjectUtils.equalsAny(response.getSubCode(), "SYSTEM_ERROR", "ACQ.SYSTEM_ERROR")) {
return PayTransferRespDTO.waitingOf(null, reqDTO.getOutTransferNo(), response);
}
return PayTransferRespDTO.closedOf(response.getSubCode(), response.getSubMsg(),
reqDTO.getOutTransferNo(), response);
}
return PayTransferRespDTO.successOf(response.getOrderId(), parseTime(response.getTransDate()),
response.getOutBizNo(), response);
}
case BANK_CARD : {
Participant payeeInfo = new Participant();
payeeInfo.setIdentityType("BANKCARD_ACCOUNT");
throw new UnsupportedOperationException("待实现");
}
default: {
throw new IllegalStateException("不正确的转账类型: " + transferType);
}
}
}
}

View File

@ -3,8 +3,6 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.alipay;
import cn.hutool.http.Method;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum;
import com.alipay.api.AlipayApiException;
@ -57,9 +55,4 @@ public class AlipayWapPayClient extends AbstractAlipayPayClient {
return PayOrderRespDTO.waitingOf(displayMode, response.getBody(),
reqDTO.getOutTradeNo(), response);
}
@Override
public PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) {
throw new UnsupportedOperationException("支付宝【Wap 网站】不支持转账操作");
}
}

View File

@ -70,4 +70,5 @@ public class MockPayClient extends AbstractPayClient<NonePayClientConfig> {
protected PayTransferRespDTO doUnifiedTransfer(PayTransferUnifiedReqDTO reqDTO) {
throw new UnsupportedOperationException("待实现");
}
}

View File

@ -28,8 +28,6 @@ public enum PayChannelEnum {
ALIPAY_APP("alipay_app", "支付宝App 支付", AlipayPayClientConfig.class),
ALIPAY_QR("alipay_qr", "支付宝扫码支付", AlipayPayClientConfig.class),
ALIPAY_BAR("alipay_bar", "支付宝条码支付", AlipayPayClientConfig.class),
ALIPAY_TRANSFER("alipay_transfer", "支付宝转账", AlipayPayClientConfig.class),
MOCK("mock", "模拟支付", NonePayClientConfig.class),
WALLET("wallet", "钱包支付", NonePayClientConfig.class);

View File

@ -18,10 +18,10 @@ public enum PayTransferStatusRespEnum {
/**
* TODO 转账到银行卡. 会有T+0 T+1 到账的请情况 还未实现
* TODO @jason可以看看其它开源项目针对这个场景处理策略是怎么样的例如说每天主动轮询这个状态的单子
*/
IN_PROGRESS(10, "转账进行中"),
SUCCESS(20, "转账成功"),
/**
* 转账关闭 (失败或者其它情况)

View File

@ -15,6 +15,7 @@ import java.util.Arrays;
@AllArgsConstructor
@Getter
public enum PayTransferTypeEnum implements IntArrayValuable {
ALIPAY_BALANCE(1, "支付宝余额"),
WX_BALANCE(2, "微信余额"),
BANK_CARD(3, "银行卡"),
@ -33,7 +34,8 @@ public enum PayTransferTypeEnum implements IntArrayValuable {
return ARRAYS;
}
public static PayTransferTypeEnum ofType(Integer type) {
public static PayTransferTypeEnum typeOf(Integer type) {
return ArrayUtil.firstMatch(item -> item.getType().equals(type), values());
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.framework.tenant.core.job;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@Component
public class TestJob implements JobHandler {
private final List<Long> tenantIds = new CopyOnWriteArrayList<>();
@Override
@TenantJob // 标记多租户
public String execute(String param) throws Exception {
tenantIds.add(TenantContextHolder.getTenantId());
return "success";
}
public List<Long> getTenantIds() {
CollUtil.sort(tenantIds, Long::compareTo);
return tenantIds;
}
}

View File

@ -0,0 +1,313 @@
package cn.iocoder.yudao.framework.mybatis.core.query;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.github.yulichang.toolkit.MPJWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.springframework.util.StringUtils;
import java.util.Collection;
import java.util.function.Consumer;
/**
* 拓展 MyBatis Plus Join QueryWrapper 主要增加如下功能
* <p>
* 1. 拼接条件的方法增加 xxxIfPresent 方法用于判断值不存在的时候不要拼接到条件中
*
* @param <T> 数据类型
*/
public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> {
public MPJLambdaWrapperX<T> likeIfPresent(SFunction<T, ?> column, String val) {
MPJWrappers.lambdaJoin().like(column, val);
if (StringUtils.hasText(val)) {
return (MPJLambdaWrapperX<T>) super.like(column, val);
}
return this;
}
public MPJLambdaWrapperX<T> inIfPresent(SFunction<T, ?> column, Collection<?> values) {
if (ObjectUtil.isAllNotEmpty(values) && !ArrayUtil.isEmpty(values)) {
return (MPJLambdaWrapperX<T>) super.in(column, values);
}
return this;
}
public MPJLambdaWrapperX<T> inIfPresent(SFunction<T, ?> column, Object... values) {
if (ObjectUtil.isAllNotEmpty(values) && !ArrayUtil.isEmpty(values)) {
return (MPJLambdaWrapperX<T>) super.in(column, values);
}
return this;
}
public MPJLambdaWrapperX<T> eqIfPresent(SFunction<T, ?> column, Object val) {
if (ObjectUtil.isNotEmpty(val)) {
return (MPJLambdaWrapperX<T>) super.eq(column, val);
}
return this;
}
public MPJLambdaWrapperX<T> neIfPresent(SFunction<T, ?> column, Object val) {
if (ObjectUtil.isNotEmpty(val)) {
return (MPJLambdaWrapperX<T>) super.ne(column, val);
}
return this;
}
public MPJLambdaWrapperX<T> gtIfPresent(SFunction<T, ?> column, Object val) {
if (val != null) {
return (MPJLambdaWrapperX<T>) super.gt(column, val);
}
return this;
}
public MPJLambdaWrapperX<T> geIfPresent(SFunction<T, ?> column, Object val) {
if (val != null) {
return (MPJLambdaWrapperX<T>) super.ge(column, val);
}
return this;
}
public MPJLambdaWrapperX<T> ltIfPresent(SFunction<T, ?> column, Object val) {
if (val != null) {
return (MPJLambdaWrapperX<T>) super.lt(column, val);
}
return this;
}
public MPJLambdaWrapperX<T> leIfPresent(SFunction<T, ?> column, Object val) {
if (val != null) {
return (MPJLambdaWrapperX<T>) super.le(column, val);
}
return this;
}
public MPJLambdaWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object val1, Object val2) {
if (val1 != null && val2 != null) {
return (MPJLambdaWrapperX<T>) super.between(column, val1, val2);
}
if (val1 != null) {
return (MPJLambdaWrapperX<T>) ge(column, val1);
}
if (val2 != null) {
return (MPJLambdaWrapperX<T>) le(column, val2);
}
return this;
}
public MPJLambdaWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object[] values) {
Object val1 = ArrayUtils.get(values, 0);
Object val2 = ArrayUtils.get(values, 1);
return betweenIfPresent(column, val1, val2);
}
// ========== 重写父类方法方便链式调用 ==========
@Override
public <X> MPJLambdaWrapperX<T> eq(boolean condition, SFunction<X, ?> column, Object val) {
super.eq(condition, column, val);
return this;
}
@Override
public <X> MPJLambdaWrapperX<T> eq(SFunction<X, ?> column, Object val) {
super.eq(column, val);
return this;
}
@Override
public <X> MPJLambdaWrapperX<T> orderByDesc(SFunction<X, ?> column) {
//noinspection unchecked
super.orderByDesc(true, column);
return this;
}
@Override
public MPJLambdaWrapperX<T> last(String lastSql) {
super.last(lastSql);
return this;
}
@Override
public <X> MPJLambdaWrapperX<T> in(SFunction<X, ?> column, Collection<?> coll) {
super.in(column, coll);
return this;
}
@Override
public MPJLambdaWrapperX<T> selectAll(Class<?> clazz) {
super.selectAll(clazz);
return this;
}
@Override
public MPJLambdaWrapperX<T> selectAll(Class<?> clazz, String prefix) {
super.selectAll(clazz, prefix);
return this;
}
@Override
public <S> MPJLambdaWrapperX<T> selectAs(SFunction<S, ?> column, String alias) {
super.selectAs(column, alias);
return this;
}
@Override
public <E> MPJLambdaWrapperX<T> selectAs(String column, SFunction<E, ?> alias) {
super.selectAs(column, alias);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectAs(SFunction<S, ?> column, SFunction<X, ?> alias) {
super.selectAs(column, alias);
return this;
}
@Override
public <E, X> MPJLambdaWrapperX<T> selectAs(String index, SFunction<E, ?> column, SFunction<X, ?> alias) {
super.selectAs(index, column, alias);
return this;
}
@Override
public <E> MPJLambdaWrapperX<T> selectAsClass(Class<E> source, Class<?> tag) {
super.selectAsClass(source, tag);
return this;
}
@Override
public <E, F> MPJLambdaWrapperX<T> selectSub(Class<E> clazz, Consumer<MPJLambdaWrapper<E>> consumer, SFunction<F, ?> alias) {
super.selectSub(clazz, consumer, alias);
return this;
}
@Override
public <E, F> MPJLambdaWrapperX<T> selectSub(Class<E> clazz, String st, Consumer<MPJLambdaWrapper<E>> consumer, SFunction<F, ?> alias) {
super.selectSub(clazz, st, consumer, alias);
return this;
}
@Override
public <S> MPJLambdaWrapperX<T> selectCount(SFunction<S, ?> column) {
super.selectCount(column);
return this;
}
@Override
public MPJLambdaWrapperX<T> selectCount(Object column, String alias) {
super.selectCount(column, alias);
return this;
}
@Override
public <X> MPJLambdaWrapperX<T> selectCount(Object column, SFunction<X, ?> alias) {
super.selectCount(column, alias);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectCount(SFunction<S, ?> column, String alias) {
super.selectCount(column, alias);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectCount(SFunction<S, ?> column, SFunction<X, ?> alias) {
super.selectCount(column, alias);
return this;
}
@Override
public <S> MPJLambdaWrapperX<T> selectSum(SFunction<S, ?> column) {
super.selectSum(column);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectSum(SFunction<S, ?> column, String alias) {
super.selectSum(column, alias);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectSum(SFunction<S, ?> column, SFunction<X, ?> alias) {
super.selectSum(column, alias);
return this;
}
@Override
public <S> MPJLambdaWrapperX<T> selectMax(SFunction<S, ?> column) {
super.selectMax(column);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectMax(SFunction<S, ?> column, String alias) {
super.selectMax(column, alias);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectMax(SFunction<S, ?> column, SFunction<X, ?> alias) {
super.selectMax(column, alias);
return this;
}
@Override
public <S> MPJLambdaWrapperX<T> selectMin(SFunction<S, ?> column) {
super.selectMin(column);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectMin(SFunction<S, ?> column, String alias) {
super.selectMin(column, alias);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectMin(SFunction<S, ?> column, SFunction<X, ?> alias) {
super.selectMin(column, alias);
return this;
}
@Override
public <S> MPJLambdaWrapperX<T> selectAvg(SFunction<S, ?> column) {
super.selectAvg(column);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectAvg(SFunction<S, ?> column, String alias) {
super.selectAvg(column, alias);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectAvg(SFunction<S, ?> column, SFunction<X, ?> alias) {
super.selectAvg(column, alias);
return this;
}
@Override
public <S> MPJLambdaWrapperX<T> selectLen(SFunction<S, ?> column) {
super.selectLen(column);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectLen(SFunction<S, ?> column, String alias) {
super.selectLen(column, alias);
return this;
}
@Override
public <S, X> MPJLambdaWrapperX<T> selectLen(SFunction<S, ?> column, SFunction<X, ?> alias) {
super.selectLen(column, alias);
return this;
}
}

View File

@ -5,7 +5,6 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
// TODO @小吉祥搞个 job清理 14 天外的访问日志
/**
* API 访问日志
*

View File

@ -5,7 +5,6 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
// TODO @小吉祥搞个 job清理 14 天外的异常日志
/**
* API 错误日志
*

View File

@ -10,26 +10,26 @@ import lombok.Getter;
@AllArgsConstructor
public enum BpmCommentTypeEnum {
APPROVE(1, "通过"),
REJECT(2, "不通过"),
CANCEL(3, "已取消"),
// TODO @海18 行可以去掉哈这个是之前为了 status 隔离用的
// ========== 流程任务独有的状态 ==========
BACK(4, "退回"), // 退回
DELEGATE(5, "委派"),
ADD_SIGN(6, "加签"),
SUB_SIGN(7,"减签"),
APPROVE(1, "通过", ""),
REJECT(2, "不通过", ""),
CANCEL(3, "已取消", ""),
BACK(4, "退回", ""),
DELEGATE(5, "委派", ""),
ADD_SIGN(6, "加签", "[{}]{}给了[{}],理由为:{}"),
SUB_SIGN(7, "减签", "[{}]操作了【减签】,审批人[{}]的任务被取消"),
;
// TODO @海字段叫 type 更合适噢
/**
* 结果
* 操作类型
*/
private final Integer result;
private final Integer type;
/**
* 描述
* 操作名字
*/
private final String desc;
private final String name;
/**
* 操作描述
*/
private final String comment;
}

View File

@ -27,19 +27,27 @@ public enum BpmProcessInstanceResultEnum {
DELEGATE(6, "委派"),
/**
* 加签源任务已经审批完成但是它使用了后加签后加签的任务未完成源任务就会是这个状态
* 相当于是 通过 APPROVE 的特殊状态
* 例如A审批 A 后加签了 B并且审批通过了任务但是 B 还未审批则当前任务状态为待后加签任务完成
*/
ADD_SIGN_AFTER(7, "待后加签任务完成"), // TODO @海这个定义是不是 通过待后加签任务完成相当于是 APPROVE 的特殊状态
SIGN_AFTER(7, "待后加签任务完成"),
/**
* 加签源任务未审批但是向前加签了所以源任务状态变为待前加签任务完成
* 相当于是 处理中 PROCESS 的特殊状态
* 例如A 审批 A 前加签了 BB 还未审核
*/
ADD_SIGN_BEFORE(8, "待前加签任务完成"), // TODO @海这个定义是不是 处理中待前加签任务审批相当于是 PROCESS 的特殊状态
SIGN_BEFORE(8, "待前加签任务完成"),
/**
* 加签后加签任务被创建时的初始状态
* 相当于是 处理中 PROCESS 的特殊状态
* 因为需要源任务先完成才能到后加签的人来审批所以加了一个状态区分
*/
WAIT_BEFORE_TASK(9, "待前置任务完成"); // TODO @海这个定义是不是 处理中待前置任务审批相当于是 PROCESS 的特殊状态
WAIT_BEFORE_TASK(9, "待前置任务完成");
/**
* 能被减签的状态
*/
public static final List<Integer> CAN_SUB_SIGN_STATUS_LIST = Arrays.asList(PROCESS.result, WAIT_BEFORE_TASK.result);
/**
* 结果
@ -63,13 +71,7 @@ public enum BpmProcessInstanceResultEnum {
public static boolean isEndResult(Integer result) {
return ObjectUtils.equalsAny(result, APPROVE.getResult(), REJECT.getResult(),
CANCEL.getResult(), BACK.getResult(),
ADD_SIGN_AFTER.getResult());
SIGN_AFTER.getResult());
}
// TODO @海静态变量需要放到成员变量前面另外如果是复数可以加 S(ES) 或者 LIST
/**
* 能被减签的状态
*/
public static final List<Integer> CAN_SUB_SIGN_STATUS = Arrays.asList(PROCESS.result, WAIT_BEFORE_TASK.result);
}

View File

@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.bpm.enums.task;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 流程任务 -- 加签类型枚举类型
*/

View File

@ -4,16 +4,15 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -75,7 +74,7 @@ public class BpmTaskController {
return success(true);
}
@GetMapping("/get-return-list")
@GetMapping("/return-list")
@Operation(summary = "获取所有可回退的节点", description = "用于【流程详情】的【回退】按钮")
@Parameter(name = "taskId", description = "当前任务ID", required = true)
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
@ -95,37 +94,32 @@ public class BpmTaskController {
@Operation(summary = "委派任务", description = "用于【流程详情】的【委派】按钮。和向前【加签】有点像,唯一区别是【委托】没有单独创立任务")
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> delegateTask(@Valid @RequestBody BpmTaskDelegateReqVO reqVO) {
// TODO @海, 后面要有空格
taskService.delegateTask(reqVO,getLoginUserId());
taskService.delegateTask(getLoginUserId(), reqVO);
return success(true);
}
// TODO @海权限统一使用 bpm:task:update是否可以加减签可以交给后续的权限配置实现
@PutMapping("/add-sign")
@PutMapping("/create-sign")
@Operation(summary = "加签", description = "before 前加签after 后加签")
@PreAuthorize("@ss.hasPermission('bpm:task:add-sign')")
public CommonResult<Boolean> addSign(@Valid @RequestBody BpmTaskAddSignReqVO reqVO) {
// TODO @海userId 建议作为第一个参数一般是谁做了什么操作另外addSignTask保持风格统一哈
taskService.addSign(reqVO,getLoginUserId());
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> createSignTask(@Valid @RequestBody BpmTaskAddSignReqVO reqVO) {
taskService.createSignTask(getLoginUserId(), reqVO);
return success(true);
}
// TODO @海权限统一使用 bpm:task:update是否可以加减签可以交给后续的权限配置实现
@PutMapping("/sub-sign")
@DeleteMapping("/delete-sign")
@Operation(summary = "减签")
@PreAuthorize("@ss.hasPermission('bpm:task:sub-sign')")
// TODO @海 @RequestBody BpmTaskSubSignReqVO 应该是一个空格然后参数名可以简写成 reqVO
public CommonResult<Boolean> subSign(@Valid @RequestBody BpmTaskSubSignReqVO bpmTaskSubSignReqVO) {
taskService.subSign(bpmTaskSubSignReqVO,getLoginUserId());
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> deleteSignTask(@Valid @RequestBody BpmTaskSubSignReqVO reqVO) {
taskService.deleteSignTask(getLoginUserId(), reqVO);
return success(true);
}
// TODO @海是不是 url 和方法名 get-child-task-list更抽象和复用一些
@GetMapping("/get-sub-sign")
@GetMapping("children-list")
@Operation(summary = "获取能被减签的任务")
@PreAuthorize("@ss.hasPermission('bpm:task:sub-sign')")
public CommonResult<List<BpmTaskSubSignRespVO>> getChildrenTaskList(@RequestParam("taskId") String taskId) {
return success(taskService.getChildrenTaskList(taskId));
@Parameter(name = "parentId", description = "父级任务 ID", required = true)
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<List<BpmTaskSubSignRespVO>> getChildrenTaskList(@RequestParam("parentId") String parentId) {
return success(taskService.getChildrenTaskList(parentId));
}
}

View File

@ -4,13 +4,17 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Set;
// TODO @海洋类名应该是 create
@Schema(description = "管理后台 - 加签流程任务的 Request VO")
@Data
public class BpmTaskAddSignReqVO {
@Schema(description = "需要加签的任务 ID")
@NotEmpty(message = "任务编号不能为空")
private String id;
@Schema(description = "加签的用户 ID")
@NotEmpty(message = "加签用户 ID 不能为空")
private Set<Long> userIdList;
@ -23,9 +27,4 @@ public class BpmTaskAddSignReqVO {
@NotEmpty(message = "加签原因不能为空")
private String reason;
// TODO @海重要参数可以放到最前面哈
@Schema(description = "需要加签的任务 ID")
@NotEmpty(message = "任务编号不能为空")
private String id;
}
}

View File

@ -5,6 +5,7 @@ import lombok.Data;
import javax.validation.constraints.NotEmpty;
// TODO @海洋类名应该是 delete
@Schema(description = "管理后台 - 减签流程任务的 Request VO")
@Data
public class BpmTaskSubSignReqVO {

View File

@ -1,9 +1,10 @@
package cn.iocoder.yudao.module.bpm.convert.task;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
@ -25,6 +26,9 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMultiMap;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.filterList;
/**
* Bpm 任务 Convert
*
@ -147,7 +151,8 @@ public interface BpmTaskConvert {
.setDefinitionKey(element.getId()));
}
// TODO @海可以使用 mapstruct 映射么
//此处不用 mapstruct 映射因为 TaskEntityImpl 还有很多其他属性这里我们只设置我们需要的
//使用 mapstruct 会将里面嵌套的各个属性值都设置进去会出现意想不到的问题
default TaskEntityImpl convert(TaskEntityImpl task,TaskEntityImpl parentTask){
task.setCategory(parentTask.getCategory());
task.setDescription(parentTask.getDescription());
@ -166,32 +171,31 @@ public interface BpmTaskConvert {
default List<BpmTaskSubSignRespVO> convertList(List<BpmTaskExtDO> bpmTaskExtDOList,
Map<Long, AdminUserRespDTO> userMap,
Map<String, Task> idTaskMap){
return CollectionUtils.convertList(bpmTaskExtDOList, task->{
BpmTaskSubSignRespVO bpmTaskSubSignRespVO = new BpmTaskSubSignRespVO();
bpmTaskSubSignRespVO.setName(task.getName());
bpmTaskSubSignRespVO.setId(task.getTaskId());
Task sourceTask = idTaskMap.get(task.getTaskId());
return CollectionUtils.convertList(bpmTaskExtDOList, task -> {
BpmTaskSubSignRespVO bpmTaskSubSignRespVO = new BpmTaskSubSignRespVO()
.setId(task.getTaskId()).setName(task.getName());
// 后加签任务不会直接设置 assignee ,所以不存在 assignee 的情况则去取 owner
String assignee = StrUtil.isNotEmpty(sourceTask.getAssignee()) ? sourceTask.getAssignee() : sourceTask.getOwner();
AdminUserRespDTO assignUser = userMap.get(NumberUtils.parseLong(assignee));
if (assignUser != null) {
bpmTaskSubSignRespVO.setAssigneeUser(convert3(assignUser));
}
Task sourceTask = idTaskMap.get(task.getTaskId());
String assignee = ObjectUtil.defaultIfBlank(sourceTask.getOwner(),sourceTask.getAssignee());
MapUtils.findAndThen(userMap,NumberUtils.parseLong(assignee),
assignUser-> bpmTaskSubSignRespVO.setAssigneeUser(convert3(assignUser)));
return bpmTaskSubSignRespVO;
});
}
/**
* 转换任务为父子级
* @param result
* @return
*
* @param sourceList 原始数据
* @return 转换后的父子级数组
*/
default List<BpmTaskRespVO> convertChildrenList(List<BpmTaskRespVO> result){
List<BpmTaskRespVO> childrenTaskList = CollectionUtils.filterList(result, r -> StrUtil.isNotEmpty(r.getParentTaskId()));
Map<String, List<BpmTaskRespVO>> parentChildrenTaskListMap = CollectionUtils.convertMultiMap(childrenTaskList, BpmTaskRespVO::getParentTaskId);
for (BpmTaskRespVO bpmTaskRespVO : result) {
default List<BpmTaskRespVO> convertChildrenList(List<BpmTaskRespVO> sourceList) {
List<BpmTaskRespVO> childrenTaskList = filterList(sourceList, r -> StrUtil.isNotEmpty(r.getParentTaskId()));
Map<String, List<BpmTaskRespVO>> parentChildrenTaskListMap = convertMultiMap(childrenTaskList, BpmTaskRespVO::getParentTaskId);
for (BpmTaskRespVO bpmTaskRespVO : sourceList) {
bpmTaskRespVO.setChildren(parentChildrenTaskListMap.get(bpmTaskRespVO.getId()));
}
return CollectionUtils.filterList(result, r -> StrUtil.isEmpty(r.getParentTaskId()));
return filterList(sourceList, r -> StrUtil.isEmpty(r.getParentTaskId()));
}
}

View File

@ -21,13 +21,13 @@ public interface BpmTaskExtMapper extends BaseMapperX<BpmTaskExtDO> {
return selectList(BpmTaskExtDO::getTaskId, taskIds);
}
// TODO @海BpmProcessInstanceResultEnum.CAN_SUB_SIGN_STATUS_LIST) 应该作为条件mapper 不要有业务
default List<BpmTaskExtDO> selectProcessListByTaskIds(Collection<String> taskIds) {
return selectList(new LambdaQueryWrapperX<BpmTaskExtDO>()
.in(BpmTaskExtDO::getTaskId, taskIds)
.in(BpmTaskExtDO::getResult, BpmProcessInstanceResultEnum.CAN_SUB_SIGN_STATUS));
.in(BpmTaskExtDO::getResult, BpmProcessInstanceResultEnum.CAN_SUB_SIGN_STATUS_LIST));
}
default BpmTaskExtDO selectByTaskId(String taskId) {
return selectOne(BpmTaskExtDO::getTaskId, taskId);
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.bpm.framework.bpm.config;
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
/**
* @author kemengkai
* @create 2022-05-07 08:15
*/
@Configuration("bpmSecurityConfiguration")
public class BpmSecurityConfiguration {
@Bean("bpmAuthorizeRequestsCustomizer")
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
return new AuthorizeRequestsCustomizer() {
@Override
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
// 任务回退接口
registry.antMatchers(buildAdminApi("/bpm/task/back")).permitAll();
}
};
}
}

View File

@ -12,6 +12,7 @@ import javax.validation.Valid;
* @author yunlongn
*/
public interface BpmModelService {
/**
* 获得流程模型分页
*

View File

@ -288,5 +288,4 @@ public class BpmModelServiceImpl implements BpmModelService {
processDefinitionService.updateProcessDefinitionState(oldDefinition.getId(), SuspensionState.SUSPENDED.getStateCode());
}
}

View File

@ -65,7 +65,8 @@ public interface BpmTaskService {
/**
* 通过任务 ID 集合获取任务扩展表信息集合 // TODO @海洋方法注释和下面的参数需要空一行
* 通过任务 ID 集合获取任务扩展表信息集合
*
* @param taskIdList 任务 ID 集合
* @return 任务列表
*/
@ -143,41 +144,41 @@ public interface BpmTaskService {
* 将任务回退到指定的 targetDefinitionKey 位置
*
* @param userId 用户编号
* @param reqVO 回退的任务key和当前所在的任务ID
* @param reqVO 回退的任务key和当前所在的任务ID
*/
void returnTask(Long userId, BpmTaskReturnReqVO reqVO);
// TODO @海userId 放前面
/**
* 将指定任务委派给其他人处理等接收人处理后再回到原审批人手中审批
*
* @param reqVO 被委派人和被委派的任务编号理由参数
* @param userId 用户编号
* @param reqVO 被委派人和被委派的任务编号理由参数
*/
void delegateTask(BpmTaskDelegateReqVO reqVO, Long userId);
void delegateTask(Long userId, BpmTaskDelegateReqVO reqVO);
/**
* 任务加签
*
* @param reqVO 被加签的用户和任务 ID加签类型
* @param userId 当前用户 ID
* @param userId 被加签的用户和任务 ID加签类型
* @param reqVO 当前用户 ID
*/
void addSign(BpmTaskAddSignReqVO reqVO, Long userId);
void createSignTask(Long userId, BpmTaskAddSignReqVO reqVO);
/**
* 任务减签名
*
* @param bpmTaskSubSignReqVO 被减签的任务 ID理由
* @param loginUserId 当前用户ID
* @param userId 当前用户ID
* @param reqVO 被减签的任务 ID理由
*/
void subSign(BpmTaskSubSignReqVO bpmTaskSubSignReqVO, Long loginUserId);
void deleteSignTask(Long userId, BpmTaskSubSignReqVO reqVO);
/**
* 获取指定任务的子任务和审批人信息
*
* @param taskId 指定任务ID
* @param parentId 指定任务ID
* @return 子任务列表
*/
List<BpmTaskSubSignRespVO> getChildrenTaskList(String taskId);
List<BpmTaskSubSignRespVO> getChildrenTaskList(String parentId);
}

View File

@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.bpm.service.task;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.enums.SymbolConstant;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
@ -15,7 +15,10 @@ import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert;
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO;
import cn.iocoder.yudao.module.bpm.dal.mysql.task.BpmTaskExtMapper;
import cn.iocoder.yudao.module.bpm.enums.task.*;
import cn.iocoder.yudao.module.bpm.enums.task.BpmCommentTypeEnum;
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceDeleteReasonEnum;
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskAddSignTypeEnum;
import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService;
import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
@ -50,7 +53,6 @@ import javax.annotation.Resource;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -222,8 +224,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
// 情况二后加签的任务
if (BpmTaskAddSignTypeEnum.AFTER.getType().equals(task.getScopeType())) {
// 后加签处理
// TODO @海洋这个是不是 approveAfterSignTask
handleAfterSignTask(task, reqVO);
approveAfterSignTask(task, reqVO);
return;
}
@ -238,18 +239,19 @@ public class BpmTaskServiceImpl implements BpmTaskService {
handleParentTask(task);
}
/**
* 审批通过存在后加签的任务
* <p>
* 注意该任务不能马上完成需要一个中间状态SIGN_AFTER并激活剩余所有子任务PROCESS为可审批处理
*
* 注意该任务不能马上完成需要一个中间状态ADD_SIGN_AFTER并激活剩余所有子任务PROCESS为可审批处理
*
* @param task 当前任务
* @param task 当前任务
* @param reqVO 前端请求参数
*/
private void handleAfterSignTask(Task task,BpmTaskApproveReqVO reqVO){
private void approveAfterSignTask(Task task, BpmTaskApproveReqVO reqVO) {
// 1. 有向后加签则该任务状态临时设置为 ADD_SIGN_AFTER 状态
taskExtMapper.updateByTaskId(
new BpmTaskExtDO().setTaskId(task.getId()).setResult(BpmProcessInstanceResultEnum.ADD_SIGN_AFTER.getResult())
new BpmTaskExtDO().setTaskId(task.getId()).setResult(BpmProcessInstanceResultEnum.SIGN_AFTER.getResult())
.setReason(reqVO.getReason()).setEndTime(LocalDateTime.now()));
// 2. 激活子任务
@ -257,118 +259,123 @@ public class BpmTaskServiceImpl implements BpmTaskService {
for (String childrenTaskId : childrenTaskIdList) {
taskService.resolveTask(childrenTaskId);
}
// 更新任务扩展表中子任务为进行中
// 2.1 更新任务扩展表中子任务为进行中
taskExtMapper.updateBatchByTaskIdList(childrenTaskIdList,
new BpmTaskExtDO().setResult(BpmProcessInstanceResultEnum.PROCESS.getResult()));
}
/**
* 处理当前任务的父任务
* 处理当前任务的父任务主要处理加签的情况
*
* @param task 当前任务
*/
private void handleParentTask(Task task) {
String parentTaskId = task.getParentTaskId();
// TODO @ if return 原则
if (StrUtil.isNotBlank(parentTaskId)) {
// 1. 判断当前任务的父任务是否还有子任务
long subTaskCount = getSubTaskCount(parentTaskId);
// TODO @ if >= 0 return这样括号又可以少一层
if (subTaskCount == 0) {
// 2. 获取父任务
Task parentTask = validateTaskExist(parentTaskId);
// 3. 情况一处理向前加签
String scopeType = parentTask.getScopeType();
if (BpmTaskAddSignTypeEnum.BEFORE.getType().equals(scopeType)) {
// 3.1 如果是向前加签的任务则调用 resolveTask 指派父任务 owner 重新赋值给父任务的 assignee
taskService.resolveTask(parentTaskId);
// 3.2 更新任务拓展表为处理中
taskExtMapper.updateByTaskId(
new BpmTaskExtDO().setTaskId(parentTask.getId()).setResult(BpmProcessInstanceResultEnum.PROCESS.getResult()));
} else if (BpmTaskAddSignTypeEnum.AFTER.getType().equals(scopeType)) {
// 3. 情况二处理向后加签
handleAfterSign(parentTask);
}
// 4. 子任务已处理完成清空 scopeType 字段修改 parentTask 信息方便后续可以继续向前后向后加签
// 再查询一次的原因是避免报错Task was updated by another transaction concurrently
// 因为前面处理后可能会导致 parentTask rev 字段被修改需要重新获取最新的
parentTask = getTask(parentTaskId);
// TODO @ if return 原则
if (parentTask != null) {
// 为空的情况是已经通过 handleAfterSign 方法将任务完成了所以 ru_task 表会查不到数据
clearTaskScopeTypeAndSave(parentTask);
}
}
if (StrUtil.isBlank(parentTaskId)) {
return;
}
// 1. 判断当前任务的父任务是否还有子任务
Long childrenTaskCount = getChildrenTaskCount(parentTaskId);
if (childrenTaskCount > 0) {
return;
}
// 2. 获取父任务
Task parentTask = validateTaskExist(parentTaskId);
// 3. 处理加签情况
String scopeType = parentTask.getScopeType();
if(!validateSignType(scopeType)){
return;
}
// 3.1 情况一处理向前加签
if (BpmTaskAddSignTypeEnum.BEFORE.getType().equals(scopeType)) {
// 3.1.1 如果是向前加签的任务则调用 resolveTask 指派父任务 owner 重新赋值给父任务的 assignee这样它就可以被审批
taskService.resolveTask(parentTaskId);
// 3.1.2 更新任务拓展表为处理中
taskExtMapper.updateByTaskId(
new BpmTaskExtDO().setTaskId(parentTask.getId()).setResult(BpmProcessInstanceResultEnum.PROCESS.getResult()));
} else if (BpmTaskAddSignTypeEnum.AFTER.getType().equals(scopeType)) {
// 3.2 情况二处理向后加签
handleParentTaskForAfterSign(parentTask);
}
// 4. 子任务已处理完成清空 scopeType 字段修改 parentTask 信息方便后续可以继续向前后向后加签
// 再查询一次的原因是避免报错Task was updated by another transaction concurrently
// 因为前面处理后可能会导致 parentTask rev 字段被修改需要重新获取最新的
parentTask = getTask(parentTaskId);
if (parentTask == null) {
// 为空的情况是已经通过 handleAfterSign 方法将任务完成了所以 ru_task 表会查不到数据
return;
}
clearTaskScopeTypeAndSave(parentTask);
}
// TODO @海这个方法的 4.1 1 开始计数哈另外看看能不能用 if return 进一步简化代码的层级
/**
* 处理后加签任务
*
* @param parentTask 当前审批任务的父任务
* @param parentTask 当前审批任务的父任务
*/
private void handleAfterSign(Task parentTask) {
// TODO @海这个方法在注释下感觉整体是先完成自己然后递归处理父节点但是完成机子被放到了 5.1就感觉上有点割裂
// TODO @海这个逻辑怎么感觉可以是 parentTask parent再去调用 handleParentTask 方法可以微信聊下
private void handleParentTaskForAfterSign(Task parentTask) {
String parentTaskId = parentTask.getId();
//4.1 更新 parentTask 的任务拓展表为通过
// 1. 更新 parentTask 的任务拓展表为通过并调用 complete 完成自己
BpmTaskExtDO currentTaskExt = taskExtMapper.selectByTaskId(parentTask.getId());
BpmTaskExtDO currentTaskUpdateEntity = new BpmTaskExtDO().setTaskId(parentTask.getId())
BpmTaskExtDO currentTaskExtUpdateObj = new BpmTaskExtDO().setTaskId(parentTask.getId())
.setResult(BpmProcessInstanceResultEnum.APPROVE.getResult());
if (currentTaskExt.getEndTime() == null) {
// 有这个判断是因为
// 4.2 以前没设置过结束时间才去设置
currentTaskUpdateEntity.setEndTime(LocalDateTime.now());
// 1.1 有这个判断是因为,以前没设置过结束时间才去设置
currentTaskExtUpdateObj.setEndTime(LocalDateTime.now());
}
taskExtMapper.updateByTaskId(currentTaskUpdateEntity);
// 5. 继续往上处理父任务继续往上查询
// 5.1 先完成自己
taskExtMapper.updateByTaskId(currentTaskExtUpdateObj);
// 1.2 完成自己因为它已经没有子任务所以也可以完成
taskService.complete(parentTaskId);
// 5.2 如果有父级递归查询上级任务是否都已经完成
// TODO @海这块待讨论脑子略乱感觉 handleAfterSign 的后半段 handleParentTask 有点重叠
if (StrUtil.isNotEmpty(parentTask.getParentTaskId())) {
// 判断整条链路的任务是否完成
// 例如从 A 任务加签了一个 B 任务B 任务又加签了一个 C 任务C 任务加签了 D 任务
// 此时D 任务完成要一直往上找到祖先任务 A调用 complete 方法完成 A 任务
boolean allChildrenTaskFinish = true;
while (StrUtil.isNotBlank(parentTask.getParentTaskId())) {
parentTask = validateTaskExist(parentTask.getParentTaskId());
BpmTaskExtDO bpmTaskExtDO = taskExtMapper.selectByTaskId(parentTask.getId());
if (bpmTaskExtDO == null) {
break;
}
boolean currentTaskFinish = BpmProcessInstanceResultEnum.isEndResult(bpmTaskExtDO.getResult());
// 5.3 如果 allChildrenTaskFinish 已经被赋值为 false ,则不会再赋值为 true因为整个链路没有完成
if (allChildrenTaskFinish) {
allChildrenTaskFinish = currentTaskFinish;
}
if (!currentTaskFinish) {
// 6 处理非完成状态的任务
// 6.1 判断当前任务的父任务是否还有子任务
Long subTaskCount = getSubTaskCount(bpmTaskExtDO.getTaskId());
if (subTaskCount == 0) {
// 6.2 没有子任务判断当前任务状态是否为 ADD_SIGN_BEFORE 待前加签任务完成
if (BpmProcessInstanceResultEnum.ADD_SIGN_BEFORE.getResult().equals(bpmTaskExtDO.getResult())) {
// 6.3 需要修改该任务状态为处理中
taskService.resolveTask(bpmTaskExtDO.getTaskId());
bpmTaskExtDO.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
taskExtMapper.updateByTaskId(bpmTaskExtDO);
}
// 6.4 清空 scopeType 字段用于任务没有子任务时使用该方法方便任务可以再次被不同的方式加签
parentTask = getTask(bpmTaskExtDO.getTaskId());
if (parentTask != null) {
clearTaskScopeTypeAndSave(parentTask);
}
}
}
// 2. 如果有父级递归查询上级任务是否都已经完成
if (StrUtil.isEmpty(parentTask.getParentTaskId())) {
return;
}
// 2.1 判断整条链路的任务是否完成
// 例如从 A 任务加签了一个 B 任务B 任务又加签了一个 C 任务C 任务加签了 D 任务
// 此时D 任务完成要一直往上找到祖先任务 A调用 complete 方法完成 A 任务
boolean allChildrenTaskFinish = true;
while (StrUtil.isNotBlank(parentTask.getParentTaskId())) {
parentTask = validateTaskExist(parentTask.getParentTaskId());
BpmTaskExtDO parentTaskExt = taskExtMapper.selectByTaskId(parentTask.getId());
if (parentTaskExt == null) {
break;
}
boolean currentTaskFinish = BpmProcessInstanceResultEnum.isEndResult(parentTaskExt.getResult());
// 2.2 如果 allChildrenTaskFinish 已经被赋值为 false则不会再赋值为 true因为整个链路没有完成
if (allChildrenTaskFinish) {
// 7. 完成最后的顶级祖先任务
taskService.complete(parentTask.getId());
allChildrenTaskFinish = currentTaskFinish;
}
// 2.3 任务已完成则不处理
if (currentTaskFinish) {
continue;
}
// 3 处理非完成状态的任务
// 3.1 判断当前任务的父任务是否还有子任务
Long childrenTaskCount = getChildrenTaskCount(parentTaskExt.getTaskId());
if (childrenTaskCount > 0) {
continue;
}
// 3.2 没有子任务判断当前任务状态是否为 ADD_SIGN_BEFORE 待前加签任务完成
if (BpmProcessInstanceResultEnum.SIGN_BEFORE.getResult().equals(parentTaskExt.getResult())) {
// 3.3 需要修改该任务状态为处理中
taskService.resolveTask(parentTaskExt.getTaskId());
parentTaskExt.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
taskExtMapper.updateByTaskId(parentTaskExt);
}
// 3.4 清空 scopeType 字段用于任务没有子任务时使用该方法方便任务可以再次被不同的方式加签
parentTask = validateTaskExist(parentTaskExt.getTaskId());
clearTaskScopeTypeAndSave(parentTask);
}
// 4. 完成最后的顶级祖先任务
if (allChildrenTaskFinish) {
taskService.complete(parentTask.getId());
}
}
@ -383,14 +390,13 @@ public class BpmTaskServiceImpl implements BpmTaskService {
taskService.saveTask(task);
}
// TODO @海Sub 还有 Child 感觉整体用词不是很统一是不是要统一下然后 Sub 还可以指的减签看看是不是名词确实得一致哈
/**
* 获取子任务个数
*
* @param parentTaskId 父任务 ID
* @return 剩余子任务个数
*/
private Long getSubTaskCount(String parentTaskId) {
private Long getChildrenTaskCount(String parentTaskId) {
String tableName = managementService.getTableName(TaskEntity.class);
String sql = "SELECT COUNT(1) from " + tableName + " WHERE PARENT_TASK_ID_=#{parentTaskId}";
return taskService.createNativeTaskQuery().sql(sql).parameter("parentTaskId", parentTaskId).count();
@ -410,7 +416,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
String comment = StrUtil.format("[{}]完成委派任务,任务重新回到[{}]手中,审批意见为:{}", currentUser.getNickname(),
sourceApproveUser.getNickname(), reqVO.getReason());
taskService.addComment(reqVO.getId(), task.getProcessInstanceId(),
BpmCommentTypeEnum.DELEGATE.getResult().toString(), comment);
BpmCommentTypeEnum.DELEGATE.getType().toString(), comment);
// 2.1 调用 resolveTask 完成任务
// 底层调用 TaskHelper.changeTaskAssignee(task, task.getOwner()) owner 设置为 assignee
@ -528,7 +534,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
if(StrUtil.isNotEmpty(task.getAssignee())){
if (StrUtil.isNotEmpty(task.getAssignee())) {
ProcessInstance processInstance =
processInstanceService.getProcessInstance(task.getProcessInstanceId());
AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId()));
@ -539,8 +545,8 @@ public class BpmTaskServiceImpl implements BpmTaskService {
});
}
private Task validateTaskExist(String id){
Task task = taskService.createTaskQuery().taskId(id).singleResult();
private Task validateTaskExist(String id) {
Task task = getTask(id);
if (task == null) {
throw exception(TASK_NOT_EXISTS);
}
@ -646,7 +652,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
return;
}
taskService.addComment(task.getId(), currentTask.getProcessInstanceId(),
BpmCommentTypeEnum.BACK.getResult().toString(), reqVO.getReason());
BpmCommentTypeEnum.BACK.getType().toString(), reqVO.getReason());
});
// 3. 执行驳回
@ -659,7 +665,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
@Override
@Transactional(rollbackFor = Exception.class)
public void delegateTask(BpmTaskDelegateReqVO reqVO, Long userId) {
public void delegateTask(Long userId, BpmTaskDelegateReqVO reqVO) {
// 1.1 校验任务
Task task = validateTaskCanDelegate(userId, reqVO);
// 1.2 校验目标用户存在
@ -674,7 +680,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
delegateUser.getNickname(), reqVO.getReason());
String taskId = reqVO.getId();
taskService.addComment(taskId, task.getProcessInstanceId(),
BpmCommentTypeEnum.DELEGATE.getResult().toString(), comment);
BpmCommentTypeEnum.DELEGATE.getType().toString(), comment);
// 3.1 设置任务所有人 (owner) 为原任务的处理人 (assignee)
taskService.setOwner(taskId, task.getAssignee());
@ -705,23 +711,18 @@ public class BpmTaskServiceImpl implements BpmTaskService {
@Override
@Transactional(rollbackFor = Exception.class)
public void addSign(BpmTaskAddSignReqVO reqVO, Long userId) {
// TODO @海// 后面要有个空格中英文之间也要有空格例如说// 1. 获取和校验任务
//1.获取和校验任务
public void createSignTask(Long userId, BpmTaskAddSignReqVO reqVO) {
// 1. 获取和校验任务
TaskEntityImpl taskEntity = validateAddSign(userId, reqVO);
// TODO @海每个变量以及相关逻辑一定要和自己的逻辑块呆在一起例如说这里的 currentUser 获取应该在 4. 那块
AdminUserRespDTO currentUser = adminUserApi.getUser(userId);
List<AdminUserRespDTO> userList = adminUserApi.getUserList(reqVO.getUserIdList());
if (CollUtil.isEmpty(userList)) {
throw exception(TASK_ADD_SIGN_USER_NOT_EXIST);
}
// TODO @海大的逻辑块之间最好有一个空格这样的目的是避免逻辑堆砌在一起方便流量
// 2.处理当前任务
// 2.1 开启计数功能 // TODO @海这个目的可以写下
// 2. 处理当前任务
// 2.1 开启计数功能主要用于为了让表 ACT_RU_TASK 中的 SUB_TASK_COUNT_ 字段记录下总共有多少子任务后续可能有用
taskEntity.setCountEnabled(true);
// TODO @海可以直接 if不搞一个变量哈
boolean addSignToBefore = reqVO.getType().equals(BpmTaskAddSignTypeEnum.BEFORE.getType());
if (addSignToBefore) {
if (reqVO.getType().equals(BpmTaskAddSignTypeEnum.BEFORE.getType())) {
// 2.2 向前加签设置 owner置空 assign等子任务都完成后再调用 resolveTask 重新将 owner 设置为 assign
// 原因是不能和向前加签的子任务一起审批需要等前面的子任务都完成才能审批
taskEntity.setOwner(taskEntity.getAssignee());
@ -729,7 +730,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
// 2.3 更新扩展表状态
taskExtMapper.updateByTaskId(
new BpmTaskExtDO().setTaskId(taskEntity.getId())
.setResult(BpmProcessInstanceResultEnum.ADD_SIGN_BEFORE.getResult())
.setResult(BpmProcessInstanceResultEnum.SIGN_BEFORE.getResult())
.setReason(reqVO.getReason()));
}
// 2.4 记录加签方式完成任务时需要用到判断
@ -738,20 +739,20 @@ public class BpmTaskServiceImpl implements BpmTaskService {
taskService.saveTask(taskEntity);
// 3. 创建加签任务
createSignSubTasks(convertList(reqVO.getUserIdList(), String::valueOf), taskEntity);
createSignTask(convertList(reqVO.getUserIdList(), String::valueOf), taskEntity);
// 4. 记录加签 comment拼接结果为 [当前用户]向前加签/向后加签给了[多个用户]理由为reason
// TODO @海BpmCommentTypeEnum 可以加一个 comment 字段作为评论模版统一管理
String comment = StrUtil.format("[{}]{}给了[{}],理由为:{}", currentUser.getNickname(), BpmTaskAddSignTypeEnum.formatDesc(reqVO.getType()),
String.join(SymbolConstant.D, convertList(userList, AdminUserRespDTO::getNickname)), reqVO.getReason());
AdminUserRespDTO currentUser = adminUserApi.getUser(userId);
String comment = StrUtil.format(BpmCommentTypeEnum.ADD_SIGN.getComment(), currentUser.getNickname(),
BpmTaskAddSignTypeEnum.formatDesc(reqVO.getType()), String.join(",", convertList(userList, AdminUserRespDTO::getNickname)), reqVO.getReason());
taskService.addComment(reqVO.getId(), taskEntity.getProcessInstanceId(),
BpmCommentTypeEnum.ADD_SIGN.getResult().toString(), comment);
BpmCommentTypeEnum.ADD_SIGN.getType().toString(), comment);
}
/**
* 校验任务的加签是否一致
*
* <p>
* 1. 如果存在向前加签的任务则不能向后加签
* 2. 如果存在向后加签的任务则不能向前加签
*
@ -763,25 +764,20 @@ public class BpmTaskServiceImpl implements BpmTaskService {
TaskEntityImpl taskEntity = (TaskEntityImpl) validateTask(userId, reqVO.getId());
// 向前加签和向后加签不能同时存在
if (StrUtil.isNotBlank(taskEntity.getScopeType())
&& !BpmTaskAddSignTypeEnum.AFTER_CHILDREN_TASK.getDesc().equals(taskEntity.getScopeType())) {
// TODO @海下面这个判断是不是可以写上面这个判断后面
// TODO @海一个小技巧如果写不等于的时候一般可以用 ObjectUtil.notEquals这样少一层取反理解起来简单点
if (!taskEntity.getScopeType().equals(reqVO.getType())) {
throw exception(TASK_ADD_SIGN_TYPE_ERROR,
BpmTaskAddSignTypeEnum.formatDesc(taskEntity.getScopeType()), BpmTaskAddSignTypeEnum.formatDesc(reqVO.getType()));
}
&& ObjectUtil.notEqual(BpmTaskAddSignTypeEnum.AFTER_CHILDREN_TASK.getType(), taskEntity.getScopeType())
&& ObjectUtil.notEqual(taskEntity.getScopeType(), reqVO.getType())) {
throw exception(TASK_ADD_SIGN_TYPE_ERROR,
BpmTaskAddSignTypeEnum.formatDesc(taskEntity.getScopeType()), BpmTaskAddSignTypeEnum.formatDesc(reqVO.getType()));
}
// 同一个 key 的任务审批人不重复
List<Task> taskList = taskService.createTaskQuery().processInstanceId(taskEntity.getProcessInstanceId())
.taskDefinitionKey(taskEntity.getTaskDefinitionKey()).list();
// TODO @海这里是不是 Task::getAssignee 解析成 List<Long> 下面会更简洁一点
List<String> currentAssigneeList = convertList(taskList, Task::getAssignee);
// TODO @海frontAssigneeList 改成 addAssigneeList新增的避免和 front 前端这样界面耦合的名词哈
List<String> frontAssigneeList = convertList(reqVO.getUserIdList(), String::valueOf);
currentAssigneeList.retainAll(frontAssigneeList);
List<Long> currentAssigneeList = convertList(taskList, task -> NumberUtils.parseLong(task.getAssignee()));
// 保留交集在 currentAssigneeList
currentAssigneeList.retainAll(reqVO.getUserIdList());
if (CollUtil.isNotEmpty(currentAssigneeList)) {
List<AdminUserRespDTO> userList = adminUserApi.getUserList(convertList(currentAssigneeList, NumberUtils::parseLong));
throw exception(TASK_ADD_SIGN_USER_REPEAT, String.join(SymbolConstant.D, convertList(userList, AdminUserRespDTO::getNickname)));
List<AdminUserRespDTO> userList = adminUserApi.getUserList(currentAssigneeList);
throw exception(TASK_ADD_SIGN_USER_REPEAT, String.join(",", convertList(userList, AdminUserRespDTO::getNickname)));
}
return taskEntity;
}
@ -792,32 +788,31 @@ public class BpmTaskServiceImpl implements BpmTaskService {
* @param addSingUserIdList 被加签的用户 ID
* @param taskEntity 被加签的任务
*/
private void createSignSubTasks(List<String> addSingUserIdList, TaskEntityImpl taskEntity) {
// TODO @海可以 if return这样括号层级少一点下面的 if (StrUtil.isNotBlank(addSignId)) { 也是类似
if (CollUtil.isNotEmpty(addSingUserIdList)) {
// 创建加签人的新任务全部基于 taskEntity 为父任务来创建
addSingUserIdList.forEach(addSignId -> {
if (StrUtil.isNotBlank(addSignId)) {
createSubTask(taskEntity, addSignId);
}
});
private void createSignTask(List<String> addSingUserIdList, TaskEntityImpl taskEntity) {
if (CollUtil.isEmpty(addSingUserIdList)) {
return;
}
// 创建加签人的新任务全部基于 taskEntity 为父任务来创建
for (String addSignId : addSingUserIdList) {
if (StrUtil.isBlank(addSignId)) {
continue;
}
createSignTask(taskEntity, addSignId);
}
}
// TODO @海这个是不是命名上要和 createSignSubTasks 保持一致
/**
* 创建子任务
* 创建加签子任务
*
* @param parentTask 父任务
* @param assignee 子任务的执行人
* @return
*/
private void createSubTask(TaskEntityImpl parentTask, String assignee) {
private void createSignTask(TaskEntityImpl parentTask, String assignee) {
// 1. 生成子任务
TaskEntityImpl task = (TaskEntityImpl) taskService.newTask(IdUtil.fastSimpleUUID());
task = BpmTaskConvert.INSTANCE.convert(task,parentTask);
task = BpmTaskConvert.INSTANCE.convert(task, parentTask);
if (BpmTaskAddSignTypeEnum.BEFORE.getType().equals(parentTask.getScopeType())) {
// 2.1 前加签设置审批人否则设置 owner
// 2.1 前加签设置审批人
task.setAssignee(assignee);
} else {
// 2.2.1 设置 owner 不设置 assignee 是因为不能同时审批需要等父任务完成
@ -831,106 +826,144 @@ public class BpmTaskServiceImpl implements BpmTaskService {
@Override
@Transactional(rollbackFor = Exception.class)
public void subSign(BpmTaskSubSignReqVO reqVO,Long userId) {
public void deleteSignTask(Long userId, BpmTaskSubSignReqVO reqVO) {
// 1.1 校验 task 可以被减签
Task task = validateSubSign(reqVO.getId());
AdminUserRespDTO user = adminUserApi.getUser(userId);
// 1.2 校验取消人存在
AdminUserRespDTO cancelUser = null;
if(StrUtil.isNotBlank(task.getAssignee())){
if (StrUtil.isNotBlank(task.getAssignee())) {
cancelUser = adminUserApi.getUser(NumberUtils.parseLong(task.getAssignee()));
}
if(cancelUser == null && StrUtil.isNotBlank(task.getOwner())){
if (cancelUser == null && StrUtil.isNotBlank(task.getOwner())) {
cancelUser = adminUserApi.getUser(NumberUtils.parseLong(task.getOwner()));
}
Assert.notNull(cancelUser,"任务中没有所有者和审批人,数据错误");
//1. 获取所有需要删除的任务 ID 包含当前任务和所有子任务
List<String> allTaskIdList = getAllChildTaskIds(task.getId());
//2. 删除任务和所有子任务
taskService.deleteTasks(allTaskIdList);
//3. 修改扩展表状态为取消
taskExtMapper.updateBatchByTaskIdList(allTaskIdList,new BpmTaskExtDO().setResult(BpmProcessInstanceResultEnum.CANCEL.getResult())
.setReason(StrUtil.format("由于{}操作[减签],任务被取消",user.getNickname())));
//4.记录日志到父任务中 先记录日志是因为通过 handleParentTask 方法之后任务可能被完成了并且不存在了会报异常所以先记录
String comment = StrUtil.format("{}操作了【减签】,审批人{}的任务被取消",user.getNickname(),cancelUser.getNickname());
taskService.addComment(task.getParentTaskId(),task.getProcessInstanceId(),
BpmCommentTypeEnum.SUB_SIGN.getResult().toString(),comment);
//5. 处理当前任务的父任务
this.handleParentTask(task);
Assert.notNull(cancelUser, "任务中没有所有者和审批人,数据错误");
// 2. 删除任务和对应子任务
// 2.1 获取所有需要删除的任务 ID 包含当前任务和所有子任务
List<String> allTaskIdList = getAllChildTaskIds(task.getId());
// 2.2 删除任务和所有子任务
taskService.deleteTasks(allTaskIdList);
// 2.3 修改扩展表状态为取消
AdminUserRespDTO user = adminUserApi.getUser(userId);
taskExtMapper.updateBatchByTaskIdList(allTaskIdList, new BpmTaskExtDO().setResult(BpmProcessInstanceResultEnum.CANCEL.getResult())
.setReason(StrUtil.format("由于{}操作[减签],任务被取消", user.getNickname())));
// 3. 记录日志到父任务中先记录日志是因为通过 handleParentTask 方法之后任务可能被完成了并且不存在了会报异常所以先记录
String comment = StrUtil.format(BpmCommentTypeEnum.SUB_SIGN.getComment(), user.getNickname(), cancelUser.getNickname());
taskService.addComment(task.getParentTaskId(), task.getProcessInstanceId(),
BpmCommentTypeEnum.SUB_SIGN.getType().toString(), comment);
// 4. 处理当前任务的父任务
handleParentTask(task);
}
/**
* 校验任务是否能被减签
*
* @param id 任务ID
* @return 任务信息
*/
private Task validateSubSign(String id) {
Task task = validateTaskExist(id);
//必须有parentId
if(StrUtil.isEmpty(task.getParentTaskId())){
// 必须有 scopeType
String scopeType = task.getScopeType();
if (StrUtil.isEmpty(scopeType)) {
throw exception(TASK_SUB_SIGN_NO_PARENT);
}
// 并且值为 向前和向后加签
if (!validateSignType(scopeType)) {
throw exception(TASK_SUB_SIGN_NO_PARENT);
}
return task;
}
/**
* 判断当前类型是否为加签
* @param scopeType 任务的 scopeType
* @return 当前 scopeType 为加签则返回 true
*/
private boolean validateSignType(String scopeType){
return StrUtil.equalsAny(scopeType,BpmTaskAddSignTypeEnum.BEFORE.getType(),scopeType, BpmTaskAddSignTypeEnum.AFTER.getType());
}
/**
* 获取所有要被取消的删除的任务 ID 集合
*
* @param parentTaskId 父级任务ID
* @return 所有任务ID
*/
public List<String> getAllChildTaskIds(String parentTaskId) {
List<String> allChildTaskIds = new ArrayList<>();
//1. 先将自己放入
allChildTaskIds.add(parentTaskId);
//2. 递归获取子级
recursiveGetChildTaskIds(parentTaskId, allChildTaskIds);
// 1. 递归获取子级
Stack<String> stack = new Stack<>();
// 1.1 将根任务ID入栈
stack.push(parentTaskId);
//控制遍历的次数不超过 Byte.MAX_VALUE避免脏数据造成死循环
int count = 0;
// TODO @海< 的前后空格要注意哈
while (!stack.isEmpty() && count<Byte.MAX_VALUE) {
// 1.2 弹出栈顶任务ID
String taskId = stack.pop();
// 1.3 将任务ID添加到结果集合中
allChildTaskIds.add(taskId);
// 1.4 获取该任务的子任务列表
// TODO @海有个更高效的写法一次性去 in 一层不然每个节点都去查询一次 db 太浪费了每次 in最终就是 O(h) 查询而不是 O(n) 查询
List<String> childrenTaskIdList = getChildrenTaskIdList(taskId);
if (CollUtil.isNotEmpty(childrenTaskIdList)) {
for (String childTaskId : childrenTaskIdList) {
// 1.5 将子任务ID入栈以便后续处理
stack.push(childTaskId);
}
}
count++;
}
return allChildTaskIds;
}
/**
* 递归处理子级任务
* @param taskId 当前任务ID
* @param taskIds 结果
* 获取指定父级任务的所有子任务 ID 集合
*
* @param parentTaskId 父任务 ID
* @return 所有子任务的 ID 集合
*/
private void recursiveGetChildTaskIds(String taskId, List<String> taskIds) {
List<String> childrenTaskIdList = getChildrenTaskIdList(taskId);
for (String childTaskId : childrenTaskIdList) {
taskIds.add(childTaskId); // 将子任务的ID添加到集合中
recursiveGetChildTaskIds(childTaskId, taskIds); // 递归获取子任务的子任务
}
private List<String> getChildrenTaskIdList(String parentTaskId) {
return convertList(getChildrenTaskList0(parentTaskId), Task::getId);
}
/**
* 获取指定父级任务的所有子任务 ID 集合
*
* @param parentTaskId 父任务 ID
* @return 所有子任务的 ID 集合
*/
private List<String> getChildrenTaskIdList(String parentTaskId){
private List<Task> getChildrenTaskList0(String parentTaskId) {
String tableName = managementService.getTableName(TaskEntity.class);
String sql = "select ID_ from " + tableName + " where PARENT_TASK_ID_=#{parentTaskId}";
List<Task> childrenTaskList = taskService.createNativeTaskQuery().sql(sql).parameter("parentTaskId", parentTaskId).list();
return convertList(childrenTaskList, Task::getId);
// taskService.createTaskQuery() 没有 parentId 参数所以写 sql 查询
String sql = "select ID_,OWNER_,ASSIGNEE_ from " + tableName + " where PARENT_TASK_ID_=#{parentTaskId}";
return taskService.createNativeTaskQuery().sql(sql).parameter("parentTaskId", parentTaskId).list();
}
@Override
public List<BpmTaskSubSignRespVO> getChildrenTaskList(String taskId){
List<String> childrenTaskIdList = getChildrenTaskIdList(taskId);
if(CollUtil.isEmpty(childrenTaskIdList)){
public List<BpmTaskSubSignRespVO> getChildrenTaskList(String parentId) {
// 1. 只查询进行中的任务 后加签的任务可能不存在 assignee所以还需要查询 owner
List<Task> taskList = getChildrenTaskList0(parentId);
if (CollUtil.isEmpty(taskList)) {
return Collections.emptyList();
}
//1. 只查询进行中的任务
List<BpmTaskExtDO> bpmTaskExtDOList = taskExtMapper.selectProcessListByTaskIds(childrenTaskIdList);
//2. 后加签的任务可能不存在 assignee,所以还需要查询 owner
List<Task> taskList = taskService.createTaskQuery().taskIds(childrenTaskIdList).list();
Map<String, Task> idTaskMap = convertMap(taskList, TaskInfo::getId);
//3. owner assignee 统一到一个集合中
List<Long> userIds = taskList.stream()
.flatMap(control ->
Stream.of(control.getAssignee(), control.getOwner())
.filter(Objects::nonNull))
.distinct()
.map(NumberUtils::parseLong)
.collect(Collectors.toList());
List<String> childrenTaskIdList = convertList(taskList, Task::getId);
// 2.1 owner assignee 统一到一个集合中
List<Long> userIds = convertListByFlatMap(taskList, control ->
Stream.of(NumberUtils.parseLong(control.getAssignee()), NumberUtils.parseLong(control.getOwner()))
.filter(Objects::nonNull));
// 2.2 组装数据
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(userIds);
return BpmTaskConvert.INSTANCE.convertList(bpmTaskExtDOList,userMap,idTaskMap);
List<BpmTaskExtDO> taskExtList = taskExtMapper.selectProcessListByTaskIds(childrenTaskIdList);
Map<String, Task> idTaskMap = convertMap(taskList, TaskInfo::getId);
return BpmTaskConvert.INSTANCE.convertList(taskExtList, userMap, idTaskMap);
}
}

View File

@ -147,7 +147,7 @@ public class DatabaseDocController {
*/
private static ProcessConfig buildProcessConfig() {
return ProcessConfig.builder()
.ignoreTablePrefix(Arrays.asList("QRTZ_", "ACT_")) // 忽略表前缀
.ignoreTablePrefix(Arrays.asList("QRTZ_", "ACT_", "FLW_")) // 忽略表前缀
.build();
}

View File

@ -29,8 +29,6 @@ public class SecurityConfiguration {
.antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous();
// 积木报表
registry.antMatchers("/jmreport/**").permitAll();
// Spring Boot Actuator 的安全配置
registry.antMatchers("/actuator").anonymous()
.antMatchers("/actuator/**").anonymous();

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.infra.job.logger;
package cn.iocoder.yudao.module.infra.job.job;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
@ -33,7 +33,7 @@ public class JobLogCleanJob implements JobHandler {
@TenantIgnore
public String execute(String param) {
Integer count = jobLogService.cleanJobLog(JOB_CLEAN_RETAIN_DAY, DELETE_LIMIT);
log.info("[count][定时执行清理定时任务日志数量 ({}) 个]", count);
log.info("[execute][定时执行清理定时任务日志数量 ({}) 个]", count);
return String.format("定时执行清理定时任务日志数量 %s 个", count);
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.infra.job.job;
package cn.iocoder.yudao.module.infra.job.logger;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
@ -34,7 +34,7 @@ public class AccessLogCleanJob implements JobHandler {
@TenantIgnore
public String execute(String param) {
Integer count = apiAccessLogService.cleanAccessLog(JOB_CLEAN_RETAIN_DAY, DELETE_LIMIT);
log.info("[count][定时执行清理访问日志数量 ({}) 个]", count);
log.info("[execute][定时执行清理访问日志数量 ({}) 个]", count);
return String.format("定时执行清理错误日志数量 %s 个", count);
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.infra.job.job;
package cn.iocoder.yudao.module.infra.job.logger;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
@ -34,7 +34,7 @@ public class ErrorLogCleanJob implements JobHandler {
@TenantIgnore
public String execute(String param) {
Integer count = apiErrorLogService.cleanErrorLog(JOB_CLEAN_RETAIN_DAY,DELETE_LIMIT);
log.info("[count][定时执行清理错误日志数量 ({}) 个]", count);
log.info("[execute][定时执行清理错误日志数量 ({}) 个]", count);
return String.format("定时执行清理错误日志数量 %s 个", count);
}

View File

@ -58,9 +58,9 @@ public class FileConfigServiceImpl implements FileConfigService {
FileConfigDO config = Objects.equals(CACHE_MASTER_ID, id) ?
fileConfigMapper.selectByMaster() : fileConfigMapper.selectById(id);
if (config != null) {
fileClientFactory.createOrUpdateFileClient(id, config.getStorage(), config.getConfig());
fileClientFactory.createOrUpdateFileClient(config.getId(), config.getStorage(), config.getConfig());
}
return fileClientFactory.getFileClient(id);
return fileClientFactory.getFileClient(null == config ? id : config.getId());
}
});

View File

@ -1,4 +1,4 @@
import { defHttp } from '@/utils/http/axios'
import {defHttp} from '@/utils/http/axios'
#set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}")
// 查询${table.classComment}列表
@ -28,5 +28,5 @@ export function delete${simpleClassName}(id: number) {
// 导出${table.classComment} Excel
export function export${simpleClassName}(params) {
return defHttp.download({ url: '${baseURL}/export-excel', params }, '${table.classComment}.xls')
return defHttp.download({ url: '${baseURL}/export-excel', params }, '${table.classComment}.xls')
}

View File

@ -1,6 +1,6 @@
import type { BasicColumn, FormSchema } from '@/components/Table'
import { useRender } from '@/components/Table'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import type {BasicColumn, FormSchema} from '@/components/Table'
import {useRender} from '@/components/Table'
import {DICT_TYPE, getDictOptions} from '@/utils/dict'
export const columns: BasicColumn[] = [
#foreach($column in $columns)
@ -50,7 +50,7 @@ export const searchFormSchema: FormSchema[] = [
field: '${javaField}',
#if ($column.htmlType == "input")
component: 'Input',
#elseif ($column.htmlType == "select" || $column.htmlType == "radio")
#elseif ($column.htmlType == "select")
component: 'Select',
componentProps: {
#if ("" != $dictType)## 设置了 dictType 数据字典的情况
@ -59,6 +59,15 @@ export const searchFormSchema: FormSchema[] = [
options: [],
#end
},
#elseif ($column.htmlType == "radio")
component: 'Radio',
componentProps: {
#if ("" != $dictType)## 设置了 dictType 数据字典的情况
options: getDictOptions(DICT_TYPE.$dictType.toUpperCase()),
#else## 未设置 dictType 数据字典的情况
options: [],
#end
},
#elseif($column.htmlType == "datetime")
component: 'RangePicker',
#end
@ -181,7 +190,8 @@ export const updateFormSchema: FormSchema[] = [
fileType: 'file',
maxCount: 1,
},
#elseif($column.htmlType == "editor")## 文本编辑器component: 'Editor',
#elseif($column.htmlType == "editor")## 文本编辑器
component: 'Editor',
#elseif($column.htmlType == "select")## 下拉框
component: 'Select',
componentProps: {

View File

@ -1,12 +1,10 @@
<script lang="ts" setup>
import ${ simpleClassName }Modal from './${simpleClassName}Modal.vue'
import { columns, searchFormSchema } from './${classNameVar}.data'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { delete${ simpleClassName }, export${ simpleClassName }, get${ simpleClassName } Page } from '@/api/${table.moduleName}/${classNameVar}'
import {columns, searchFormSchema} from './'
import {useI18n} from '@/hooks/web/useI18n'
import {useMessage} from '@/hooks/web/useMessage'
import {useModal} from '@/components/Modal'
import {useTable} from '@/components/Table'
import { delete${ simpleClassName }, export${ simpleClassName }, get${ simpleClassName } Page } from '@/api/${table.moduleName}/${classNameVar}'
defineOptions({ name: '${table.className}' })
@ -62,7 +60,7 @@ async function handleDelete(record: Recordable) {
<a-button type="primary" v-auth="['${permissionPrefix}:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
<a-button type="warning" v-auth="['${permissionPrefix}:export']" :preIcon="IconEnum.EXPORT" @click="handleExport">
<a-button v-auth="['${permissionPrefix}:export']" :preIcon="IconEnum.EXPORT" @click="handleExport">
{{ t('action.export') }}
</a-button>
</template>

View File

@ -258,12 +258,12 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest {
Long id = fileConfig.getId();
// mock 获得 Client
FileClient fileClient = new LocalFileClient(id, new LocalFileClientConfig());
when(fileClientFactory.getFileClient(eq(0L))).thenReturn(fileClient);
when(fileClientFactory.getFileClient(eq(fileConfig.getId()))).thenReturn(fileClient);
// 调用并断言
assertSame(fileClient, fileConfigService.getMasterFileClient());
// 断言缓存
verify(fileClientFactory).createOrUpdateFileClient(eq(0L), eq(fileConfig.getStorage()),
verify(fileClientFactory).createOrUpdateFileClient(eq(fileConfig.getId()), eq(fileConfig.getStorage()),
eq(fileConfig.getConfig()));
}

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.product.api.comment.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
@ -15,6 +16,7 @@ public class ProductCommentCreateReqDTO {
/**
* 商品 SKU 编号
*/
@NotNull(message = "商品 SKU 编号不能为空")
private Long skuId;
/**
* 订单编号
@ -25,21 +27,20 @@ public class ProductCommentCreateReqDTO {
*/
private Long orderItemId;
/**
* 评分星级 1-5
*/
private Integer scores;
/**
* 描述星级 1-5
*/
@NotNull(message = "描述星级不能为空")
private Integer descriptionScores;
/**
* 服务星级 1-5
*/
@NotNull(message = "服务星级不能为空")
private Integer benefitScores;
/**
* 评论内容
*/
@NotNull(message = "评论内容不能为空")
private String content;
/**
* 评论图片地址数组以逗号分隔最多上传 9
@ -49,11 +50,12 @@ public class ProductCommentCreateReqDTO {
/**
* 是否匿名
*/
@NotNull(message = "是否匿名不能为空")
private Boolean anonymous;
/**
* 评价人
*/
@NotNull(message = "评价人不能为空")
private Long userId;
}

View File

@ -1,23 +0,0 @@
package cn.iocoder.yudao.module.product.api.property;
import cn.iocoder.yudao.module.product.api.property.dto.ProductPropertyValueDetailRespDTO;
import java.util.Collection;
import java.util.List;
/**
* 商品属性值 API 接口
*
* @author 芋道源码
*/
public interface ProductPropertyValueApi {
/**
* 根据编号数组获得属性值列表
*
* @param ids 编号数组
* @return 属性值明细列表
*/
List<ProductPropertyValueDetailRespDTO> getPropertyValueDetailList(Collection<Long> ids);
}

View File

@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.product.api.spu.dto;
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
import lombok.Data;
import java.util.List;
// TODO @LeeYan9: ProductSpuRespDTO
/**
* 商品 SPU 信息 Response DTO
@ -26,55 +24,22 @@ public class ProductSpuRespDTO {
* 商品名称
*/
private String name;
/**
* 关键字
*/
private String keyword;
/**
* 单位
*
* 对应 product_unit 数据字典
*/
private Integer unit;
/**
* 商品简介
*/
private String introduction;
/**
* 商品详情
*/
private String description;
// TODO @芋艿是不是要删除
/**
* 商品条码一维码
*/
private String barCode;
/**
* 商品分类编号
*/
private Long categoryId;
/**
* 商品品牌编号
*/
private Long brandId;
/**
* 商品封面图
*/
private String picUrl;
/**
* 商品轮播图
*/
private List<String> sliderPicUrls;
/**
* 商品视频
*/
private String videoUrl;
/**
* 排序字段
*/
private Integer sort;
/**
* 商品状态
* <p>
@ -124,22 +89,6 @@ public class ProductSpuRespDTO {
*/
private Integer giveIntegral;
// ========== 统计相关字段 =========
/**
* 商品销量
*/
private Integer salesCount;
/**
* 虚拟销量
*/
private Integer virtualSalesCount;
/**
* 商品点击量
*/
private Integer clickCount;
// ========== 分销相关字段 =========
/**

View File

@ -34,8 +34,9 @@ public interface ErrorCodeConstants {
// ========== 商品 SPU 1-008-005-000 ==========
ErrorCode SPU_NOT_EXISTS = new ErrorCode(1_008_005_000, "商品 SPU 不存在");
ErrorCode SPU_SAVE_FAIL_CATEGORY_LEVEL_ERROR = new ErrorCode(1_008_005_001, "商品分类不正确,原因:必须使用第二级的商品分类及以下");
ErrorCode SPU_NOT_ENABLE = new ErrorCode(1_008_005_002, "商品 SPU【{}】不处于上架状态");
ErrorCode SPU_NOT_RECYCLE = new ErrorCode(1_008_005_003, "商品 SPU 不处于回收站状态");
ErrorCode SPU_SAVE_FAIL_COUPON_TEMPLATE_NOT_EXISTS = new ErrorCode(1_008_005_002, "商品 SPU 保存失败,原因:优惠卷不存在");
ErrorCode SPU_NOT_ENABLE = new ErrorCode(1_008_005_003, "商品 SPU【{}】不处于上架状态");
ErrorCode SPU_NOT_RECYCLE = new ErrorCode(1_008_005_004, "商品 SPU 不处于回收站状态");
// ========== 商品 SKU 1-008-006-000 ==========
ErrorCode SKU_NOT_EXISTS = new ErrorCode(1_008_006_000, "商品 SKU 不存在");

View File

@ -1,38 +0,0 @@
package cn.iocoder.yudao.module.product.enums.group;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* 商品分组的样式枚举
*
* @author 芋道源码
*/
@Getter
@AllArgsConstructor
public enum ProductGroupStyleEnum implements IntArrayValuable {
ONE(1, "每列一个"),
TWO(2, "每列两个"),
THREE(2, "每列三个"),;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductGroupStyleEnum::getStyle).toArray();
/**
* 列表样式
*/
private final Integer style;
/**
* 状态名
*/
private final String name;
@Override
public int[] array() {
return ARRAYS;
}
}

View File

@ -1,31 +0,0 @@
package cn.iocoder.yudao.module.product.api.property;
import cn.iocoder.yudao.module.product.api.property.dto.ProductPropertyValueDetailRespDTO;
import cn.iocoder.yudao.module.product.convert.property.ProductPropertyValueConvert;
import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
/**
* 商品属性值 API 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class ProductPropertyValueApiImpl implements ProductPropertyValueApi {
@Resource
private ProductPropertyValueService productPropertyValueService;
@Override
public List<ProductPropertyValueDetailRespDTO> getPropertyValueDetailList(Collection<Long> ids) {
return ProductPropertyValueConvert.INSTANCE.convertList02(
productPropertyValueService.getPropertyValueDetailList(ids));
}
}

View File

@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.product.api.sku;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO;
import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuUpdateStockReqDTO;
import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert;
@ -11,7 +10,6 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
@ -35,18 +33,12 @@ public class ProductSkuApiImpl implements ProductSkuApi {
@Override
public List<ProductSkuRespDTO> getSkuList(Collection<Long> ids) {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<ProductSkuDO> skus = productSkuService.getSkuList(ids);
return ProductSkuConvert.INSTANCE.convertList04(skus);
}
@Override
public List<ProductSkuRespDTO> getSkuListBySpuId(Collection<Long> spuIds) {
if (CollUtil.isEmpty(spuIds)) {
return Collections.emptyList();
}
List<ProductSkuDO> skus = productSkuService.getSkuListBySpuId(spuIds);
return ProductSkuConvert.INSTANCE.convertList04(skus);
}

View File

@ -27,9 +27,6 @@ public class ProductSpuApiImpl implements ProductSpuApi {
@Override
public List<ProductSpuRespDTO> getSpuList(Collection<Long> ids) {
if (CollectionUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return ProductSpuConvert.INSTANCE.convertList2(spuService.getSpuList(ids));
}

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*;
import cn.iocoder.yudao.module.product.convert.spu.ProductSpuConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO;
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
import cn.iocoder.yudao.module.product.service.sku.ProductSkuService;
import cn.iocoder.yudao.module.product.service.spu.ProductSpuService;
import io.swagger.v3.oas.annotations.Operation;
@ -22,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
@ -88,11 +90,13 @@ public class ProductSpuController {
return success(ProductSpuConvert.INSTANCE.convertForSpuDetailRespVO(spu, skus));
}
@GetMapping("/get-simple-list")
@GetMapping("/list-all-simple")
@Operation(summary = "获得商品 SPU 精简列表")
@PreAuthorize("@ss.hasPermission('product:spu:query')")
public CommonResult<List<ProductSpuSimpleRespVO>> getSpuSimpleList() {
List<ProductSpuDO> list = productSpuService.getSpuList();
List<ProductSpuDO> list = productSpuService.getSpuListByStatus(ProductSpuStatusEnum.ENABLE.getStatus());
// 降序排序后返回给前端
list.sort(Comparator.comparing(ProductSpuDO::getSort).reversed());
return success(ProductSpuConvert.INSTANCE.convertList02(list));
}

View File

@ -96,19 +96,16 @@ public class ProductSpuBaseVO {
@NotNull(message = "商品赠送积分不能为空")
private Integer giveIntegral;
@Schema(description = "赠送的优惠劵编号的数组", example = "[1, 10]") // TODO 这块前端还未实现
private List<Long> giveCouponTemplateIds;
@Schema(description = "分销类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "商品分销类型不能为空")
private Boolean subCommissionType;
@Schema(description = "活动展示顺序", example = "[1, 3, 2, 4, 5]") // TODO 这块前端还未实现
@Schema(description = "活动展示顺序", example = "[1, 3, 2, 4, 5]")
private List<Integer> activityOrders;
// ========== 统计相关字段 =========
@Schema(description = "虚拟销量", example = "芋道")
@Schema(description = "虚拟销量", example = "66")
private Integer virtualSalesCount;
}

View File

@ -1,22 +1,14 @@
package cn.iocoder.yudao.module.product.convert.property;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.module.product.api.property.dto.ProductPropertyValueDetailRespDTO;
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueCreateReqVO;
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueRespVO;
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueUpdateReqVO;
import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO;
import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO;
import cn.iocoder.yudao.module.product.service.property.bo.ProductPropertyValueDetailRespBO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
/**
* 属性值 Convert
@ -38,18 +30,4 @@ public interface ProductPropertyValueConvert {
PageResult<ProductPropertyValueRespVO> convertPage(PageResult<ProductPropertyValueDO> page);
default List<ProductPropertyValueDetailRespBO> convertList(List<ProductPropertyValueDO> values, List<ProductPropertyDO> keys) {
Map<Long, ProductPropertyDO> keyMap = convertMap(keys, ProductPropertyDO::getId);
return CollectionUtils.convertList(values, value -> {
ProductPropertyValueDetailRespBO valueDetail = new ProductPropertyValueDetailRespBO()
.setValueId(value.getId()).setValueName(value.getName());
// 设置属性项
MapUtils.findAndThen(keyMap, value.getPropertyId(),
key -> valueDetail.setPropertyId(key.getId()).setPropertyName(key.getName()));
return valueDetail;
});
}
List<ProductPropertyValueDetailRespDTO> convertList02(List<ProductPropertyValueDetailRespBO> list);
}

View File

@ -101,9 +101,7 @@ public interface ProductSpuConvert {
List<AppProductSpuDetailRespVO.Sku> convertListForGetSpuDetail(List<ProductSkuDO> skus);
default ProductSpuDetailRespVO convertForSpuDetailRespVO(ProductSpuDO spu, List<ProductSkuDO> skus) {
ProductSpuDetailRespVO detailRespVO = convert03(spu);
detailRespVO.setSkus(ProductSkuConvert.INSTANCE.convertList(skus));
return detailRespVO;
return convert03(spu).setSkus(ProductSkuConvert.INSTANCE.convertList(skus));
}
default List<ProductSpuDetailRespVO> convertForSpuDetailRespListVO(List<ProductSpuDO> spus, List<ProductSkuDO> skus) {

View File

@ -194,7 +194,7 @@ public class ProductSpuDO extends BaseDO {
* 对应 PromotionTypeEnum 枚举
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private List<Integer> activityOrders;
private List<Integer> activityOrders; // TODO @芋艿 活动顺序字段长度需要增加
// ========== 统计相关字段 =========

View File

@ -5,7 +5,6 @@ import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.Produc
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValuePageReqVO;
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueUpdateReqVO;
import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO;
import cn.iocoder.yudao.module.product.service.property.bo.ProductPropertyValueDetailRespBO;
import java.util.Collection;
import java.util.List;
@ -56,14 +55,6 @@ public interface ProductPropertyValueService {
*/
List<ProductPropertyValueDO> getPropertyValueListByPropertyId(Collection<Long> propertyIds);
/**
* 根据编号数组获得属性值列表
*
* @param ids 编号数组
* @return 属性值明细列表
*/
List<ProductPropertyValueDetailRespBO> getPropertyValueDetailList(Collection<Long> ids);
/**
* 根据属性项编号活的属性值数量
*

View File

@ -1,15 +1,12 @@
package cn.iocoder.yudao.module.product.service.property;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueCreateReqVO;
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValuePageReqVO;
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueUpdateReqVO;
import cn.iocoder.yudao.module.product.convert.property.ProductPropertyValueConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO;
import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO;
import cn.iocoder.yudao.module.product.dal.mysql.property.ProductPropertyValueMapper;
import cn.iocoder.yudao.module.product.service.property.bo.ProductPropertyValueDetailRespBO;
import cn.iocoder.yudao.module.product.service.sku.ProductSkuService;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@ -17,11 +14,9 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PROPERTY_VALUE_EXISTS;
import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PROPERTY_VALUE_NOT_EXISTS;
@ -99,23 +94,6 @@ public class ProductPropertyValueServiceImpl implements ProductPropertyValueServ
return productPropertyValueMapper.selectListByPropertyId(propertyIds);
}
@Override
public List<ProductPropertyValueDetailRespBO> getPropertyValueDetailList(Collection<Long> ids) {
// 获得属性值列表
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<ProductPropertyValueDO> values = productPropertyValueMapper.selectBatchIds(ids);
if (CollUtil.isEmpty(values)) {
return Collections.emptyList();
}
// 获得属性项列表
List<ProductPropertyDO> keys = productPropertyService.getPropertyList(
convertSet(values, ProductPropertyValueDO::getPropertyId));
// 组装明细
return ProductPropertyValueConvert.INSTANCE.convertList(values, keys);
}
@Override
public Integer getPropertyValueCountByPropertyId(Long propertyId) {
return productPropertyValueMapper.selectCountByPropertyId(propertyId);

View File

@ -1,33 +0,0 @@
package cn.iocoder.yudao.module.product.service.property.bo;
import lombok.Data;
/**
* 商品属性项的明细 Response BO
*
* @author 芋道源码
*/
@Data
public class ProductPropertyValueDetailRespBO {
/**
* 属性的编号
*/
private Long propertyId;
/**
* 属性的名称
*/
private String propertyName;
/**
* 属性值的编号
*/
private Long valueId;
/**
* 属性值的名称
*/
private String valueName;
}

View File

@ -153,6 +153,9 @@ public class ProductSkuServiceImpl implements ProductSkuService {
@Override
public List<ProductSkuDO> getSkuListBySpuId(Collection<Long> spuIds) {
if (CollUtil.isEmpty(spuIds)) {
return Collections.emptyList();
}
return productSkuMapper.selectListBySpuId(spuIds);
}

View File

@ -68,11 +68,12 @@ public interface ProductSpuService {
}
/**
* 获得所有商品 SPU 列表
* 获得指定状态的商品 SPU 列表
*
* @param status 状态
* @return 商品 SPU 列表
*/
List<ProductSpuDO> getSpuList();
List<ProductSpuDO> getSpuListByStatus(Integer status);
/**
* 获得所有商品 SPU 列表
@ -146,4 +147,5 @@ public interface ProductSpuService {
* @return 商品 SPU 列表
*/
List<ProductSpuDO> validateSpuList(Collection<Long> ids);
}

View File

@ -16,7 +16,6 @@ import cn.iocoder.yudao.module.product.dal.mysql.spu.ProductSpuMapper;
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
import cn.iocoder.yudao.module.product.service.brand.ProductBrandService;
import cn.iocoder.yudao.module.product.service.category.ProductCategoryService;
import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueService;
import cn.iocoder.yudao.module.product.service.sku.ProductSkuService;
import com.google.common.collect.Maps;
import org.springframework.context.annotation.Lazy;
@ -52,9 +51,6 @@ public class ProductSpuServiceImpl implements ProductSpuService {
private ProductBrandService brandService;
@Resource
private ProductCategoryService categoryService;
@Resource
@Lazy // 循环依赖避免报错
private ProductPropertyValueService productPropertyValueService;
@Override
@Transactional(rollbackFor = Exception.class)
@ -192,12 +188,15 @@ public class ProductSpuServiceImpl implements ProductSpuService {
@Override
public List<ProductSpuDO> getSpuList(Collection<Long> ids) {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return productSpuMapper.selectBatchIds(ids);
}
@Override
public List<ProductSpuDO> getSpuList() {
return productSpuMapper.selectList();
public List<ProductSpuDO> getSpuListByStatus(Integer status) {
return productSpuMapper.selectList(ProductSpuDO::getStatus, status);
}
@Override

View File

@ -13,7 +13,7 @@
<name>${project.artifactId}</name>
<description>
market 模块 API暴露给其它模块调用
promotion 模块 API暴露给其它模块调用
</description>
<dependencies>

View File

@ -1,10 +0,0 @@
package cn.iocoder.yudao.module.promotion.api.combination;
/**
* 拼团活动 Api 接口
*
* @author HUIHUI
*/
public interface CombinationActivityApi {
}

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.promotion.api.combination;
import cn.iocoder.yudao.framework.common.core.KeyValue;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateRespDTO;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO;
import javax.validation.Valid;
@ -28,9 +28,9 @@ public interface CombinationRecordApi {
* 创建开团记录
*
* @param reqDTO 请求 DTO
* @return key 开团记录编号value 团长编号
* @return 拼团信息
*/
KeyValue<Long, Long> createCombinationRecord(@Valid CombinationRecordCreateReqDTO reqDTO);
CombinationRecordCreateRespDTO createCombinationRecord(@Valid CombinationRecordCreateReqDTO reqDTO);
/**
* 查询拼团记录是否成功
@ -41,14 +41,6 @@ public interface CombinationRecordApi {
*/
boolean isCombinationRecordSuccess(Long userId, Long orderId);
/**
* 更新拼团状态为失败
*
* @param userId 用户编号
* @param orderId 订单编号
*/
void updateRecordStatusToFailed(Long userId, Long orderId);
/**
* 下单前校验是否满足拼团活动条件
*

View File

@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.promotion.api.combination.dto;
import lombok.Data;
/**
* 拼团记录的创建 Response DTO
*
* @author HUIHUI
*/
@Data
public class CombinationRecordCreateRespDTO {
/**
* 拼团活动编号
*
* 关联 CombinationActivityDO id 字段
*/
private Long combinationActivityId;
/**
* 拼团团长编号
*
* 关联 CombinationRecordDO headId 字段
*/
private Long combinationHeadId;
/**
* 拼团记录编号
*
* 关联 CombinationRecordDO id 字段
*/
private Long combinationRecordId;
}

View File

@ -1,21 +0,0 @@
package cn.iocoder.yudao.module.promotion.api.price;
import cn.iocoder.yudao.module.promotion.api.price.dto.PriceCalculateReqDTO;
import cn.iocoder.yudao.module.promotion.api.price.dto.PriceCalculateRespDTO;
/**
* 价格 API 接口
*
* @author 芋道源码
*/
public interface PriceApi {
/**
* 计算商品的价格
*
* @param calculateReqDTO 价格请求
* @return 价格相应
*/
PriceCalculateRespDTO calculatePrice(PriceCalculateReqDTO calculateReqDTO);
}

View File

@ -1,35 +0,0 @@
package cn.iocoder.yudao.module.promotion.api.price.dto;
import lombok.Data;
/**
* 优惠劵的匹配信息 Response DTO
*
* why 放在 price 包下主要获取的时候需要涉及到较多的价格计算逻辑放在 price 可以更好的复用逻辑
*
* @author 芋道源码
*/
@Data
public class CouponMeetRespDTO {
/**
* 优惠劵编号
*/
private Long id;
// ========== 非优惠劵的基本信息字段 ==========
/**
* 是否匹配
*/
private Boolean meet;
/**
* 不匹配的提示 {@link #meet} = true 才有值
*
* 例如说
* 1. 所结算商品没有符合条件的商品
* 2. XXX 元可用优惠劵
* 3. 优惠劵未到使用时间
*/
private String meetTip;
}

View File

@ -1,62 +0,0 @@
package cn.iocoder.yudao.module.promotion.api.price.dto;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 价格计算 Request DTO
*
* @author 芋道源码
*/
@Data
@Deprecated
public class PriceCalculateReqDTO {
/**
* 用户编号
*
* 对应 MemberUserDO id 编号
*/
private Long userId;
/**
* 优惠劵编号
*/
private Long couponId;
/**
* 收货地址编号
*/
private Long addressId;
/**
* 商品 SKU 数组
*/
@NotNull(message = "商品数组不能为空")
private List<Item> items;
/**
* 商品 SKU
*/
@Data
public static class Item {
/**
* SKU 编号
*/
@NotNull(message = "商品 SKU 编号不能为空")
private Long skuId;
/**
* SKU 数量
*/
@NotNull(message = "商品 SKU 数量不能为空")
@Min(value = 0L, message = "商品 SKU 数量必须大于等于 0") // 可传递 0 数量用于购物车未选中的情况
private Integer count;
}
}

View File

@ -1,252 +0,0 @@
package cn.iocoder.yudao.module.promotion.api.price.dto;
import cn.iocoder.yudao.module.promotion.enums.common.PromotionTypeEnum;
import lombok.Data;
import java.util.List;
/**
* 价格计算 Response DTO
*
* 整体设计参考 taobao 的技术文档
* 1. <a href="https://developer.alibaba.com/docs/doc.htm?treeId=1&articleId=1029&docType=1">订单管理</a>
* 2. <a href="https://open.taobao.com/docV3.htm?docId=108471&docType=1">常用订单金额说明</a>
*
* 举个例子<a href="https://img.alicdn.com/top/i1/LB1mALAi4HI8KJjy1zbXXaxdpXa">订单图</a>
* 输入
* 1. 订单实付 trade.payment = 198.00订单邮费5
* 2. 商品级优惠 圣诞价: 29.00 圣诞价: 150.00 订单级优惠圣诞 2: 5.00
* 分摊
* 1. 商品 1原价 108 优惠 29 子订单实付 79 分摊主订单优惠 1.99
* 2. 商品 2原价 269 优惠 150 子订单实付 119 分摊主订单优惠 3.01
*
* @author 芋道源码
*/
@Data
@Deprecated
public class PriceCalculateRespDTO {
/**
* 订单
*/
private Order order;
/**
* 营销活动数组
*
* 只对应 {@link Order#items} 商品匹配的活动
*/
private List<Promotion> promotions;
// TODO @芋艿需要改造下主要是价格字段
/**
* 订单
*/
@Data
public static class Order {
/**
* 商品原价单位
*
* 基于 {@link OrderItem#getOriginalPrice()} 求和
*
* 对应 taobao trade.total_fee 字段
*/
private Integer totalPrice;
/**
* 订单优惠单位
*
* 订单级优惠对主订单的优惠常见如订单满 200 元减 10 订单满 80 包邮
*
* 对应 taobao order.discount_fee 字段
*/
private Integer discountPrice;
/**
* 优惠劵减免金额单位
*
* 对应 taobao trade.coupon_fee 字段
*/
private Integer couponPrice;
/**
* 积分减免金额单位
*
* 对应 taobao trade.point_fee 字段
*/
private Integer pointPrice;
/**
* 运费金额单位
*/
private Integer deliveryPrice;
/**
* 最终购买金额单位
*
* = {@link OrderItem#getPayPrice()} 求和
* - {@link #couponPrice}
* - {@link #pointPrice}
* + {@link #deliveryPrice}
* - {@link #discountPrice}
*/
private Integer payPrice;
/**
* 商品 SKU 数组
*/
private List<OrderItem> items;
// ========== 营销基本信息 ==========
/**
* 优惠劵编号
*/
private Long couponId;
}
/**
* 订单商品 SKU
*/
@Data
public static class OrderItem {
/**
* SPU 编号
*/
private Long spuId;
/**
* SKU 编号
*/
private Long skuId;
/**
* 购买数量
*/
private Integer count;
/**
* 商品原价单位
*
* = {@link #originalUnitPrice} * {@link #getCount()}
*/
private Integer originalPrice;
/**
* 商品原价单位
*
* 对应 ProductSkuDO price 字段
* 对应 taobao order.price 字段
*/
private Integer originalUnitPrice;
/**
* 商品优惠单位
*
* 商品级优惠对单个商品的常见如商品原价的 8 商品原价的减 50
*
* 对应 taobao order.discount_fee 字段
*/
private Integer discountPrice;
/**
* 子订单实付金额不算主订单分摊金额单位
*
* = {@link #originalPrice}
* - {@link #discountPrice}
*
* 对应 taobao order.payment 字段
*/
private Integer payPrice;
/**
* 子订单分摊金额单位
* 需要分摊 {@link Order#discountPrice}{@link Order#couponPrice}{@link Order#pointPrice}
*
* 对应 taobao order.part_mjz_discount 字段
* 淘宝说明子订单分摊优惠基础逻辑一般正常优惠券和满减优惠按照子订单的金额进行分摊特殊情况如果优惠券是指定商品使用的只会分摊到对应商品子订单上不分摊
*/
private Integer orderPartPrice;
/**
* 分摊后子订单实付金额单位
*
* = {@link #payPrice}
* - {@link #orderPartPrice}
*
* 对应 taobao divide_order_fee 字段
*/
private Integer orderDividePrice;
}
/**
* 营销明细
*/
@Data
@Deprecated
public static class Promotion {
/**
* 营销编号
*
* 例如说营销活动的编号优惠劵的编号
*/
private Long id;
/**
* 营销名字
*/
private String name;
/**
* 营销类型
*
* 枚举 {@link PromotionTypeEnum}
*/
private Integer type;
/**
* 营销级别
*
* 枚举 @link PromotionLevelEnum} TODO PromotionLevelEnum 没有这个枚举类
*/
private Integer level;
/**
* 计算时的原价单位
*/
private Integer totalPrice;
/**
* 计算时的优惠单位
*/
private Integer discountPrice;
/**
* 匹配的商品 SKU 数组
*/
private List<PromotionItem> items;
// ========== 匹配情况 ==========
/**
* 是否满足优惠条件
*/
private Boolean match;
/**
* 满足条件的提示
*
* 如果 {@link #match} = true 满足则提示圣诞价: 150.00
* 如果 {@link #match} = false 不满足则提示购满 85 可减 40
*/
private String description;
}
/**
* 营销匹配的商品 SKU
*/
@Data
public static class PromotionItem {
/**
* 商品 SKU 编号
*/
private Long skuId;
/**
* 计算时的原价单位
*/
private Integer originalPrice;
/**
* 计算时的优惠单位
*/
private Integer discountPrice;
}
}

View File

@ -0,0 +1,10 @@
package cn.iocoder.yudao.module.promotion.enums;
/**
* promotion 字典类型的枚举类
*
* @author HUIHUI
*/
public class DictTypeConstants {
}

View File

@ -15,7 +15,6 @@ public interface ErrorCodeConstants {
ErrorCode DISCOUNT_ACTIVITY_UPDATE_FAIL_STATUS_CLOSED = new ErrorCode(1_013_001_002, "限时折扣活动已关闭,不能修改");
ErrorCode DISCOUNT_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED = new ErrorCode(1_013_001_003, "限时折扣活动未关闭,不能删除");
ErrorCode DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_CLOSED = new ErrorCode(1_013_001_004, "限时折扣活动已关闭,不能重复关闭");
ErrorCode DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_END = new ErrorCode(1_013_001_005, "限时折扣活动已结束,不能关闭");
// ========== Banner 相关 1-013-002-000 ============
ErrorCode BANNER_NOT_EXISTS = new ErrorCode(1_013_002_000, "Banner 不存在");
@ -110,4 +109,11 @@ public interface ErrorCodeConstants {
ErrorCode BARGAIN_HELP_CREATE_FAIL_CONFLICT = new ErrorCode(1_013_014_003, "助力失败,请重试");
ErrorCode BARGAIN_HELP_CREATE_FAIL_HELP_EXISTS = new ErrorCode(1_013_014_004, "助力失败,您已经助力过了");
// ========== 文章分类 1-013-015-000 ==========
ErrorCode ARTICLE_CATEGORY_NOT_EXISTS = new ErrorCode(1_013_015_000, "文章分类不存在");
ErrorCode ARTICLE_CATEGORY_DELETE_FAIL_HAVE_ARTICLES = new ErrorCode(1_013_015_001, "文章分类删除失败,存在关联文章");
// ========== 文章管理 1-013-016-000 ==========
ErrorCode ARTICLE_NOT_EXISTS = new ErrorCode(1_013_016_000, "文章不存在");
}

View File

@ -0,0 +1,40 @@
package cn.iocoder.yudao.module.promotion.enums.banner;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* Banner Position 枚举
*
* @author HUIHUI
*/
@AllArgsConstructor
@Getter
public enum BannerPositionEnum implements IntArrayValuable {
HOME_POSITION(1, "首页"),
SECKILL_POSITION(2, "秒杀活动页"),
COMBINATION_POSITION(3, "砍价活动页"),
DISCOUNT_POSITION(4, "限时折扣页"),
REWARD_POSITION(5, "满减送页");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BannerPositionEnum::getPosition).toArray();
/**
*
*/
private final Integer position;
/**
* 名字
*/
private final String name;
@Override
public int[] array() {
return ARRAYS;
}
}

View File

@ -14,8 +14,8 @@
<name>${project.artifactId}</name>
<description>
market模块,主要实现营销相关功能
例如营销活动、banner广告、优惠券、优惠码等功能。
promotion 模块,主要实现营销相关功能
例如营销活动、banner 广告、优惠券、优惠码等功能。
</description>
<dependencies>
@ -49,10 +49,6 @@
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-weixin</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.promotion.api.bargain;
import cn.iocoder.yudao.module.promotion.service.bargain.BargainActivityService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
@ -11,6 +12,7 @@ import javax.annotation.Resource;
* @author HUIHUI
*/
@Service
@Validated
public class BargainActivityApiImpl implements BargainActivityApi {
@Resource

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.promotion.api.bargain;
import cn.iocoder.yudao.module.promotion.api.bargain.dto.BargainValidateJoinRespDTO;
import cn.iocoder.yudao.module.promotion.service.bargain.BargainRecordService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
@ -12,6 +13,7 @@ import javax.annotation.Resource;
* @author HUIHUI
*/
@Service
@Validated
public class BargainRecordApiImpl implements BargainRecordApi {
@Resource

View File

@ -1,13 +0,0 @@
package cn.iocoder.yudao.module.promotion.api.combination;
import org.springframework.stereotype.Service;
/**
* 拼团活动 Api 接口实现类
*
* @author HUIHUI
*/
@Service
public class CombinationActivityApiImpl implements CombinationActivityApi {
}

View File

@ -1,12 +1,14 @@
package cn.iocoder.yudao.module.promotion.api.combination;
import cn.iocoder.yudao.framework.common.core.KeyValue;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateRespDTO;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO;
import cn.iocoder.yudao.module.promotion.convert.combination.CombinationActivityConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationRecordDO;
import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum;
import cn.iocoder.yudao.module.promotion.service.combination.CombinationRecordService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
@ -19,6 +21,7 @@ import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.COMBINA
* @author HUIHUI
*/
@Service
@Validated
public class CombinationRecordApiImpl implements CombinationRecordApi {
@Resource
@ -29,10 +32,9 @@ public class CombinationRecordApiImpl implements CombinationRecordApi {
recordService.validateCombinationRecord(userId, activityId, headId, skuId, count);
}
// TODO @puhui999搞个创建的 RespDTO
@Override
public KeyValue<Long, Long> createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) {
return recordService.createCombinationRecord(reqDTO);
public CombinationRecordCreateRespDTO createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) {
return CombinationActivityConvert.INSTANCE.convert4(recordService.createCombinationRecord(reqDTO));
}
@Override
@ -44,11 +46,6 @@ public class CombinationRecordApiImpl implements CombinationRecordApi {
return CombinationRecordStatusEnum.isSuccess(record.getStatus());
}
@Override
public void updateRecordStatusToFailed(Long userId, Long orderId) {
recordService.updateCombinationRecordStatusByUserIdAndOrderId(CombinationRecordStatusEnum.FAILED.getStatus(), userId, orderId);
}
@Override
public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId, Long skuId, Integer count) {
return recordService.validateJoinCombination(userId, activityId, headId, skuId, count);

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.promotion.convert.coupon.CouponConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponDO;
import cn.iocoder.yudao.module.promotion.service.coupon.CouponService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
@ -17,6 +18,7 @@ import javax.annotation.Resource;
* @author 芋道源码
*/
@Service
@Validated
public class CouponApiImpl implements CouponApi {
@Resource

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.promotion.api.discount.dto.DiscountProductRespDTO
import cn.iocoder.yudao.module.promotion.convert.discount.DiscountActivityConvert;
import cn.iocoder.yudao.module.promotion.service.discount.DiscountActivityService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
@ -15,6 +16,7 @@ import java.util.List;
* @author 芋道源码
*/
@Service
@Validated
public class DiscountActivityApiImpl implements DiscountActivityApi {
@Resource

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.promotion.api.price;
import cn.iocoder.yudao.module.promotion.api.price.dto.PriceCalculateReqDTO;
import cn.iocoder.yudao.module.promotion.api.price.dto.PriceCalculateRespDTO;
import cn.iocoder.yudao.module.promotion.service.price.PriceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 价格 API 实现类
*
* @author 芋道源码
*/
@Service
public class PriceApiImpl implements PriceApi {
@Resource
private PriceService priceService;
@Override
public PriceCalculateRespDTO calculatePrice(PriceCalculateReqDTO calculateReqDTO) {
//return priceService.calculatePrice(calculateReqDTO); TODO 没有 calculatePrice 这个方法
return null;
}
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.promotion.api.reward;
import cn.iocoder.yudao.module.promotion.api.reward.dto.RewardActivityMatchRespDTO;
import cn.iocoder.yudao.module.promotion.service.reward.RewardActivityService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
@ -14,6 +15,7 @@ import java.util.List;
* @author 芋道源码
*/
@Service
@Validated
public class RewardActivityApiImpl implements RewardActivityApi {
@Resource

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.promotion.api.seckill;
import cn.iocoder.yudao.module.promotion.api.seckill.dto.SeckillValidateJoinRespDTO;
import cn.iocoder.yudao.module.promotion.service.seckill.SeckillActivityService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
@ -12,6 +13,7 @@ import javax.annotation.Resource;
* @author HUIHUI
*/
@Service
@Validated
public class SeckillActivityApiImpl implements SeckillActivityApi {
@Resource

View File

@ -0,0 +1,84 @@
package cn.iocoder.yudao.module.promotion.controller.admin.article;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.*;
import cn.iocoder.yudao.module.promotion.convert.article.ArticleCategoryConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO;
import cn.iocoder.yudao.module.promotion.service.article.ArticleCategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Comparator;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 文章分类")
@RestController
@RequestMapping("/promotion/article-category")
@Validated
public class ArticleCategoryController {
@Resource
private ArticleCategoryService articleCategoryService;
@PostMapping("/create")
@Operation(summary = "创建文章分类")
@PreAuthorize("@ss.hasPermission('promotion:article-category:create')")
public CommonResult<Long> createArticleCategory(@Valid @RequestBody ArticleCategoryCreateReqVO createReqVO) {
return success(articleCategoryService.createArticleCategory(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新文章分类")
@PreAuthorize("@ss.hasPermission('promotion:article-category:update')")
public CommonResult<Boolean> updateArticleCategory(@Valid @RequestBody ArticleCategoryUpdateReqVO updateReqVO) {
articleCategoryService.updateArticleCategory(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除文章分类")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('promotion:article-category:delete')")
public CommonResult<Boolean> deleteArticleCategory(@RequestParam("id") Long id) {
articleCategoryService.deleteArticleCategory(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得文章分类")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('promotion:article-category:query')")
public CommonResult<ArticleCategoryRespVO> getArticleCategory(@RequestParam("id") Long id) {
ArticleCategoryDO category = articleCategoryService.getArticleCategory(id);
return success(ArticleCategoryConvert.INSTANCE.convert(category));
}
@GetMapping("/list-all-simple")
@Operation(summary = "获取文章分类精简信息列表", description = "只包含被开启的文章分类,主要用于前端的下拉选项")
public CommonResult<List<ArticleCategorySimpleRespVO>> getSimpleDeptList() {
// 获得分类列表只要开启状态的
List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryListByStatus(CommonStatusEnum.ENABLE.getStatus());
// 降序排序后返回给前端
list.sort(Comparator.comparing(ArticleCategoryDO::getSort).reversed());
return success(ArticleCategoryConvert.INSTANCE.convertList03(list));
}
@GetMapping("/page")
@Operation(summary = "获得文章分类分页")
@PreAuthorize("@ss.hasPermission('promotion:article-category:query')")
public CommonResult<PageResult<ArticleCategoryRespVO>> getArticleCategoryPage(@Valid ArticleCategoryPageReqVO pageVO) {
PageResult<ArticleCategoryDO> pageResult = articleCategoryService.getArticleCategoryPage(pageVO);
return success(ArticleCategoryConvert.INSTANCE.convertPage(pageResult));
}
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.promotion.controller.admin.article;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleCreateReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleRespVO;
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO;
import cn.iocoder.yudao.module.promotion.convert.article.ArticleConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO;
import cn.iocoder.yudao.module.promotion.service.article.ArticleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 文章管理")
@RestController
@RequestMapping("/promotion/article")
@Validated
public class ArticleController {
@Resource
private ArticleService articleService;
@PostMapping("/create")
@Operation(summary = "创建文章管理")
@PreAuthorize("@ss.hasPermission('promotion:article:create')")
public CommonResult<Long> createArticle(@Valid @RequestBody ArticleCreateReqVO createReqVO) {
return success(articleService.createArticle(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新文章管理")
@PreAuthorize("@ss.hasPermission('promotion:article:update')")
public CommonResult<Boolean> updateArticle(@Valid @RequestBody ArticleUpdateReqVO updateReqVO) {
articleService.updateArticle(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除文章管理")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('promotion:article:delete')")
public CommonResult<Boolean> deleteArticle(@RequestParam("id") Long id) {
articleService.deleteArticle(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得文章管理")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('promotion:article:query')")
public CommonResult<ArticleRespVO> getArticle(@RequestParam("id") Long id) {
ArticleDO article = articleService.getArticle(id);
return success(ArticleConvert.INSTANCE.convert(article));
}
@GetMapping("/page")
@Operation(summary = "获得文章管理分页")
@PreAuthorize("@ss.hasPermission('promotion:article:query')")
public CommonResult<PageResult<ArticleRespVO>> getArticlePage(@Valid ArticlePageReqVO pageVO) {
PageResult<ArticleDO> pageResult = articleService.getArticlePage(pageVO);
return success(ArticleConvert.INSTANCE.convertPage(pageResult));
}
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 文章管理 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class ArticleBaseVO {
@Schema(description = "文章分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15458")
@NotNull(message = "文章分类编号不能为空")
private Long categoryId;
@Schema(description = "关联商品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22378")
@NotNull(message = "关联商品不能为空")
private Long spuId;
@Schema(description = "文章标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是一个标题")
@NotNull(message = "文章标题不能为空")
private String title;
@Schema(description = "文章作者", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
private String author;
@Schema(description = "文章封面图片地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
@NotNull(message = "文章封面图片地址不能为空")
private String picUrl;
@Schema(description = "文章简介", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是一个简介")
private String introduction;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "排序不能为空")
private Integer sort;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "状态不能为空")
private Integer status;
@Schema(description = "是否热门(小程序)", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "是否热门(小程序)不能为空")
private Boolean recommendHot;
@Schema(description = "是否轮播图(小程序)", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "是否轮播图(小程序)不能为空")
private Boolean recommendBanner;
@Schema(description = "文章内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是文章内容")
@NotNull(message = "文章内容不能为空")
private String content;
}

View File

@ -0,0 +1,14 @@
package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Schema(description = "管理后台 - 文章管理创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ArticleCreateReqVO extends ArticleBaseVO {
}

Some files were not shown because too many files have changed in this diff Show More