Merge remote-tracking branch 'yudao/feature/mall_product' into feature/mall_product

# Conflicts:
#	yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java
This commit is contained in:
puhui999 2023-07-05 22:08:12 +08:00
commit b697ee3298
112 changed files with 1202 additions and 2356 deletions

View File

@ -45,13 +45,11 @@ docker compose --env-file docker.env up -d
第一次执行由于数据库未初始化因此yudao-server容器会运行失败。执行如下命令初始化数据库
```shell
docker exec -i yudao-mysql \
sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" ruoyi-vue-pro' \
docker compose exec -T mysql \
sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" --default-character-set=utf8mb4 ruoyi-vue-pro' \
< ./sql/mysql/ruoyi-vue-pro.sql
```
注意这里用docker compose exec 会出现 `the input device is not a TTY` 报错
## Server:Port
- admin: http://localhost:8080

View File

@ -249,7 +249,7 @@ ps核心功能已经实现正在对接微信小程序中...
| 框架 | 说明 | 版本 | 学习指南 |
|---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------|
| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.11 | [文档](https://github.com/YunaiV/SpringBoot-Labs) |
| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.12 | [文档](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.16 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) |

View File

@ -39,7 +39,7 @@
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<!-- 看看咋放到 bom 里 -->
<lombok.version>1.18.26</lombok.version>
<spring.boot.version>2.7.11</spring.boot.version>
<spring.boot.version>2.7.12</spring.boot.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

View File

@ -0,0 +1,174 @@
/*
Navicat Premium Data Transfer
Source Server : docer-master-root(3308)
Source Server Type : MySQL
Source Server Version : 80030
Source Host : 10.211.55.5:3308
Source Schema : mall
Target Server Type : MySQL
Target Server Version : 80030
File Encoding : 65001
Date: 28/06/2023 22:40:52
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for member_point_config
-- ----------------------------
DROP TABLE IF EXISTS `member_point_config`;
CREATE TABLE `member_point_config` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`trade_deduct_enable` bit(1) DEFAULT NULL COMMENT '1 开启积分抵扣\n0 关闭积分抵扣',
`trade_deduct_unit_price` int DEFAULT NULL COMMENT '积分抵扣(单位)',
`trade_deduct_max_price` int DEFAULT NULL COMMENT '积分抵扣最大值',
`trade_give_point` bigint DEFAULT NULL COMMENT '1元赠送多少分',
`creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间',
`tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id',
`deleted` bit(1) DEFAULT b'0' COMMENT '是否被删除 0 未删除 1已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='会员积分配置表';
-- ----------------------------
-- Records of member_point_config
-- ----------------------------
BEGIN;
INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `creator`, `create_time`, `updater`, `update_time`, `tenant_id`, `deleted`) VALUES (1, b'1', 0, 10000, 1, '1', '2023-06-10 10:57:22', '1', '2023-06-10 03:06:58', '1', b'1');
INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `creator`, `create_time`, `updater`, `update_time`, `tenant_id`, `deleted`) VALUES (2, b'1', 32, 10003, 1212, '1', '2023-06-10 11:07:12', '1', '2023-06-28 21:50:34', '1', b'0');
INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `creator`, `create_time`, `updater`, `update_time`, `tenant_id`, `deleted`) VALUES (3, b'1', 12, 12, 12, '1', '2023-06-10 16:09:26', '1', '2023-06-10 08:10:53', '1', b'1');
COMMIT;
-- ----------------------------
-- Table structure for member_point_record
-- ----------------------------
DROP TABLE IF EXISTS `member_point_record`;
CREATE TABLE `member_point_record` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`biz_id` varchar(255) DEFAULT NULL COMMENT '业务编码',
`biz_type` varchar(255) DEFAULT NULL COMMENT '业务类型',
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '1增加 0扣减',
`title` varchar(255) DEFAULT NULL COMMENT '积分标题',
`description` varchar(5000) DEFAULT NULL COMMENT '积分描述',
`point` int DEFAULT NULL COMMENT '积分',
`total_point` int NOT NULL COMMENT '变动后的积分',
`status` int DEFAULT NULL COMMENT '状态1-订单创建2-冻结期3-完成4-失效订单退款\n',
`user_id` int DEFAULT NULL COMMENT '用户id',
`freezing_time` datetime DEFAULT NULL COMMENT '冻结时间',
`thawing_time` datetime DEFAULT NULL COMMENT '解冻时间',
`create_time` datetime DEFAULT NULL COMMENT '发生时间',
`tenant_id` varchar(255) DEFAULT NULL COMMENT '租户',
`deleted` int DEFAULT '0' COMMENT '是否删除',
`creator` varchar(255) DEFAULT NULL COMMENT '创建用户',
`updater` varchar(255) DEFAULT NULL COMMENT '更新用户',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_userId` (`user_id`),
KEY `index_title` (`title`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户积分记录';
-- ----------------------------
-- Records of member_point_record
-- ----------------------------
BEGIN;
INSERT INTO `member_point_record` (`id`, `biz_id`, `biz_type`, `type`, `title`, `description`, `point`, `total_point`, `status`, `user_id`, `freezing_time`, `thawing_time`, `create_time`, `tenant_id`, `deleted`, `creator`, `updater`, `update_time`) VALUES (1, '1', '1', '1', '12', NULL, 212, 12, 1, 12, '2023-06-13 00:00:00', '2023-06-20 00:00:00', '2023-06-10 12:38:48', '1', 1, '1', '1', '2023-06-10 04:42:24');
INSERT INTO `member_point_record` (`id`, `biz_id`, `biz_type`, `type`, `title`, `description`, `point`, `total_point`, `status`, `user_id`, `freezing_time`, `thawing_time`, `create_time`, `tenant_id`, `deleted`, `creator`, `updater`, `update_time`) VALUES (2, '12', '1', '0', NULL, NULL, 1212, 12, 2, 12, '2023-06-28 00:00:00', NULL, '2023-06-10 12:42:48', '1', 0, '1', '1', '2023-06-10 12:43:04');
INSERT INTO `member_point_record` (`id`, `biz_id`, `biz_type`, `type`, `title`, `description`, `point`, `total_point`, `status`, `user_id`, `freezing_time`, `thawing_time`, `create_time`, `tenant_id`, `deleted`, `creator`, `updater`, `update_time`) VALUES (3, '12', '1', '1', '12', NULL, 12, 12, 1, 12, '2023-06-27 00:00:00', '2023-06-23 00:00:00', '2023-06-10 20:06:48', '1', 0, '1', '1', '2023-06-10 20:06:48');
COMMIT;
-- ----------------------------
-- Table structure for member_sign_in_config
-- ----------------------------
DROP TABLE IF EXISTS `member_sign_in_config`;
CREATE TABLE `member_sign_in_config` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '规则自增主键',
`day` int DEFAULT NULL COMMENT '签到第x天',
`point` int DEFAULT NULL COMMENT '签到天数对应分数',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间',
`tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id',
`deleted` int DEFAULT '0' COMMENT '是否删除',
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
`updater` varchar(255) DEFAULT NULL COMMENT '变更人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='积分签到规则';
-- ----------------------------
-- Records of member_sign_in_config
-- ----------------------------
BEGIN;
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (1, 1, 10, '2023-06-10 11:34:43', '2023-06-10 11:34:43', '1', 0, '1', '1');
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (2, 2, 20, '2023-06-10 11:34:59', '2023-06-10 03:55:35', '1', 1, '1', '1');
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (3, 7, 1001, '2023-06-10 17:47:45', '2023-06-10 19:54:37', '1', 0, '1', '1');
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (4, 6, 12121, '2023-06-10 17:47:55', '2023-06-10 19:48:37', '1', 0, '1', '1');
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (5, 2, 12, '2023-06-10 19:54:52', '2023-06-10 19:54:52', '1', 0, '1', '1');
COMMIT;
-- ----------------------------
-- Table structure for member_sign_in_record
-- ----------------------------
DROP TABLE IF EXISTS `member_sign_in_record`;
CREATE TABLE `member_sign_in_record` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '签到自增id',
`user_id` int DEFAULT NULL COMMENT '签到用户',
`day` int DEFAULT NULL COMMENT '第几天签到',
`point` int DEFAULT NULL COMMENT '签到的分数',
`create_time` datetime DEFAULT NULL COMMENT '签到时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间',
`tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id',
`deleted` int DEFAULT '0' COMMENT '是否删除',
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
`updater` varchar(255) DEFAULT NULL COMMENT '更新人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户签到积分';
-- ----------------------------
-- Records of member_sign_in_record
-- ----------------------------
BEGIN;
INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (1, 121, 1, 123, '2023-06-10 12:58:18', '2023-06-10 04:59:00', '1', 1, '1', '1');
INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (2, 12, 12, 12, '2023-06-10 19:56:39', '2023-06-10 11:56:45', '1', 1, '1', '1');
INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (3, 12, 12, 1212, '2023-06-10 20:01:17', '2023-06-10 12:01:23', '1', 1, '1', '1');
INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (4, 12, 12, 1212, '2023-06-10 20:01:27', '2023-06-10 20:01:27', '1', 0, '1', '1');
COMMIT;
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (170, '积分业务类型', 'member_point_biz_type', 0, '', '1', '2023-06-10 12:15:00', '1', '2023-06-28 13:48:20', 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 (171, '积分订单状态', 'member_point_status', 0, '', '1', '2023-06-10 12:16:27', '1', '2023-06-28 13:48:17', 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 (169, '是否抵扣积分', 'trade_deduct_enable', 0, NULL, '1', '2023-06-10 00:34:12', '1', '2023-06-10 04:14:20', b'1', '2023-06-10 12:14:20');
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 (1235, 1, '购物', '1', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:27', '1', '2023-06-28 13:48: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 (1236, 2, '签到', '2', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:48', '1', '2023-06-28 13:48:31', 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 (1237, 1, '订单创建', '1', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:16:42', '1', '2023-06-28 13:48: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 (1238, 2, '冻结期', '2', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:16:58', '1', '2023-06-28 13:48:36', 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 (1239, 3, '完成', '3', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:17:07', '1', '2023-06-28 13:48: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 (1240, 4, '失效(订单退款)', '4', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:17:21', '1', '2023-06-28 13:48:42', 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 (2162, '会员中心', '', 1, 55, 0, '/member', 'date-range', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-06-10 00:42:03', '1', '2023-06-28 21:52:34', 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 (2175, '积分配置', '', 2, 0, 2199, 'config', '', 'member/point/config/index', 'PointConfig', 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '1', '2023-06-27 22:50:59', 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 (2176, '积分设置查询', 'point:config:query', 3, 1, 2175, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '', '2023-06-10 02:07:44', 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 (2177, '积分设置创建', 'point:config:save', 3, 2, 2175, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '1', '2023-06-27 20:32: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 (2181, '签到配置', '', 2, 2, 2200, 'sign-in-config', '', 'member/signin/config/index', 'SignInConfig', 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '1', '2023-06-27 22:51:45', 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 (2182, '积分签到规则查询', 'point:sign-in-config:query', 3, 1, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', 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 (2183, '积分签到规则创建', 'point:sign-in-config:create', 3, 2, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', 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 (2184, '积分签到规则更新', 'point:sign-in-config:update', 3, 3, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', 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 (2185, '积分签到规则删除', 'point:sign-in-config:delete', 3, 4, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', 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 (2186, '积分签到规则导出', 'point:sign-in-config:export', 3, 5, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', 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 (2187, '积分记录', '', 2, 1, 2199, 'record', '', 'member/point/record/index', 'PointRecord', 0, b'1', b'1', b'1', '', '2023-06-10 04:18:50', '1', '2023-06-27 22:51:07', 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 (2188, '用户积分记录查询', 'point:record:query', 3, 1, 2187, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:18:50', '', '2023-06-10 04:18: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 (2192, '用户积分记录导出', 'point:record:export', 3, 5, 2187, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:18:50', '', '2023-06-10 04:18: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 (2193, '签到记录', '', 2, 3, 2200, 'sign-in-record', '', 'member/signin/record/index', 'SignInRecord', 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '1', '2023-06-27 22:51:54', 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 (2194, '用户签到积分查询', 'point:sign-in-record:query', 3, 1, 2193, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '', '2023-06-10 04:48: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 (2197, '用户签到积分删除', 'point:sign-in-record:delete', 3, 4, 2193, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '', '2023-06-10 04:48: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 (2198, '用户签到积分导出', 'point:sign-in-record:export', 3, 5, 2193, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '', '2023-06-10 04:48: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 (2199, '会员积分', '', 1, 1, 2162, 'point', '', '', '', 0, b'1', b'1', b'1', '1', '2023-06-27 22:48:51', '1', '2023-06-27 22:48: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 (2200, '会员签到', '', 1, 2, 2162, 'signin', '', '', '', 0, b'1', b'1', b'1', '1', '2023-06-27 22:49:53', '1', '2023-06-27 22:49:53', b'0');
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -1,152 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : docer-master-root(3308)
Source Server Type : MySQL
Source Server Version : 80030
Source Host : 10.211.55.5:3308
Source Schema : mall
Target Server Type : MySQL
Target Server Version : 80030
File Encoding : 65001
Date: 10/06/2023 20:13:57
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for member_point_config
-- ----------------------------
DROP TABLE IF EXISTS `member_point_config`;
CREATE TABLE `member_point_config` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`trade_deduct_enable` int DEFAULT NULL COMMENT '1 开启积分抵扣\n0 关闭积分抵扣',
`trade_deduct_unit_price` decimal(10,2) DEFAULT NULL COMMENT '积分抵扣抵扣最低为分 以0.01表示 1积分抵扣0.01元(单位)',
`trade_deduct_max_price` bigint DEFAULT NULL COMMENT '积分抵扣最大值',
`trade_give_point` bigint DEFAULT NULL COMMENT '1元赠送多少分',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间',
`tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id',
`deleted` int DEFAULT '0' COMMENT '是否被删除 0 未删除 1已删除',
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
`updater` varchar(255) DEFAULT NULL COMMENT '更新人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='积分设置';
-- ----------------------------
-- Records of member_point_config
-- ----------------------------
BEGIN;
INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (1, 1, 0.01, 10000, 1, '2023-06-10 10:57:22', '2023-06-10 03:06:58', '1', 1, '1', '1');
INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (2, 1, 0.01, 10000, 10, '2023-06-10 11:07:12', '2023-06-10 11:07:12', '1', 0, '1', '1');
INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (3, 1, 12.00, 12, 12, '2023-06-10 16:09:26', '2023-06-10 08:10:53', '1', 1, '1', '1');
COMMIT;
-- ----------------------------
-- Table structure for member_point_record
-- ----------------------------
DROP TABLE IF EXISTS `member_point_record`;
CREATE TABLE `member_point_record` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`biz_id` varchar(255) DEFAULT NULL COMMENT '业务编码',
`biz_type` varchar(255) DEFAULT NULL COMMENT '业务类型',
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '1增加 0扣减',
`title` varchar(255) DEFAULT NULL COMMENT '积分标题',
`description` varchar(5000) DEFAULT NULL COMMENT '积分描述',
`point` int DEFAULT NULL COMMENT '积分',
`total_point` int NOT NULL COMMENT '变动后的积分',
`status` int DEFAULT NULL COMMENT '状态1-订单创建2-冻结期3-完成4-失效订单退款\n',
`user_id` int DEFAULT NULL COMMENT '用户id',
`freezing_time` datetime DEFAULT NULL COMMENT '冻结时间',
`thawing_time` datetime DEFAULT NULL COMMENT '解冻时间',
`create_time` datetime DEFAULT NULL COMMENT '发生时间',
`tenant_id` varchar(255) DEFAULT NULL COMMENT '租户',
`deleted` int DEFAULT '0' COMMENT '是否删除',
`creator` varchar(255) DEFAULT NULL COMMENT '创建用户',
`updater` varchar(255) DEFAULT NULL COMMENT '更新用户',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_userId` (`user_id`),
KEY `index_title` (`title`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户积分记录';
-- ----------------------------
-- Records of member_point_record
-- ----------------------------
BEGIN;
INSERT INTO `member_point_record` (`id`, `biz_id`, `biz_type`, `type`, `title`, `description`, `point`, `total_point`, `status`, `user_id`, `freezing_time`, `thawing_time`, `create_time`, `tenant_id`, `deleted`, `creator`, `updater`, `update_time`) VALUES (1, '1', '1', '1', '12', NULL, 212, 12, 1, 12, '2023-06-13 00:00:00', '2023-06-20 00:00:00', '2023-06-10 12:38:48', '1', 1, '1', '1', '2023-06-10 04:42:24');
INSERT INTO `member_point_record` (`id`, `biz_id`, `biz_type`, `type`, `title`, `description`, `point`, `total_point`, `status`, `user_id`, `freezing_time`, `thawing_time`, `create_time`, `tenant_id`, `deleted`, `creator`, `updater`, `update_time`) VALUES (2, '12', '1', '0', NULL, NULL, 1212, 12, 2, 12, '2023-06-28 00:00:00', NULL, '2023-06-10 12:42:48', '1', 0, '1', '1', '2023-06-10 12:43:04');
INSERT INTO `member_point_record` (`id`, `biz_id`, `biz_type`, `type`, `title`, `description`, `point`, `total_point`, `status`, `user_id`, `freezing_time`, `thawing_time`, `create_time`, `tenant_id`, `deleted`, `creator`, `updater`, `update_time`) VALUES (3, '12', '1', '1', '12', NULL, 12, 12, 1, 12, '2023-06-27 00:00:00', '2023-06-23 00:00:00', '2023-06-10 20:06:48', '1', 0, '1', '1', '2023-06-10 20:06:48');
COMMIT;
-- ----------------------------
-- Table structure for member_sign_in_config
-- ----------------------------
DROP TABLE IF EXISTS `member_sign_in_config`;
CREATE TABLE `member_sign_in_config` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '规则自增主键',
`day` int DEFAULT NULL COMMENT '签到第x天',
`point` int DEFAULT NULL COMMENT '签到天数对应分数',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间',
`tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id',
`deleted` int DEFAULT '0' COMMENT '是否删除',
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
`updater` varchar(255) DEFAULT NULL COMMENT '变更人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='积分签到规则';
-- ----------------------------
-- Records of member_sign_in_config
-- ----------------------------
BEGIN;
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (1, 1, 10, '2023-06-10 11:34:43', '2023-06-10 11:34:43', '1', 0, '1', '1');
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (2, 2, 20, '2023-06-10 11:34:59', '2023-06-10 03:55:35', '1', 1, '1', '1');
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (3, 7, 1001, '2023-06-10 17:47:45', '2023-06-10 19:54:37', '1', 0, '1', '1');
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (4, 6, 12121, '2023-06-10 17:47:55', '2023-06-10 19:48:37', '1', 0, '1', '1');
INSERT INTO `member_sign_in_config` (`id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (5, 2, 12, '2023-06-10 19:54:52', '2023-06-10 19:54:52', '1', 0, '1', '1');
COMMIT;
-- ----------------------------
-- Table structure for member_sign_in_record
-- ----------------------------
DROP TABLE IF EXISTS `member_sign_in_record`;
CREATE TABLE `member_sign_in_record` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '签到自增id',
`user_id` int DEFAULT NULL COMMENT '签到用户',
`day` int DEFAULT NULL COMMENT '第几天签到',
`point` int DEFAULT NULL COMMENT '签到的分数',
`create_time` datetime DEFAULT NULL COMMENT '签到时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间',
`tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id',
`deleted` int DEFAULT '0' COMMENT '是否删除',
`creator` varchar(255) DEFAULT NULL COMMENT '创建人',
`updater` varchar(255) DEFAULT NULL COMMENT '更新人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户签到积分';
-- ----------------------------
-- Records of member_sign_in_record
-- ----------------------------
BEGIN;
INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (1, 121, 1, 123, '2023-06-10 12:58:18', '2023-06-10 04:59:00', '1', 1, '1', '1');
INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (2, 12, 12, 12, '2023-06-10 19:56:39', '2023-06-10 11:56:45', '1', 1, '1', '1');
INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (3, 12, 12, 1212, '2023-06-10 20:01:17', '2023-06-10 12:01:23', '1', 1, '1', '1');
INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (4, 12, 12, 1212, '2023-06-10 20:01:27', '2023-06-10 20:01:27', '1', 0, '1', '1');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
INSERT INTO `mall`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ( '积分业务类型', 'point_biz_type', 0, '', '1', '2023-06-10 12:15:00', '1', '2023-06-10 04:25:07', b'0', '1970-01-01 00:00:00');
INSERT INTO `mall`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ( '积分订单状态', 'point_status', 0, '', '1', '2023-06-10 12:16:27', '1', '2023-06-10 12:16:27', b'0', '1970-01-01 00:00:00');
INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 1, '购物', '1', 'point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:27', '1', '2023-06-10 04:25:15', b'0');
INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 2, '签到', '2', 'point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:48', '1', '2023-06-10 04:25:18', b'0');
INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 1, '订单创建', '1', 'point_status', 0, '', '', '', '1', '2023-06-10 12:16:42', '1', '2023-06-10 12:16:42', b'0');
INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 2, '冻结期', '2', 'point_status', 0, '', '', '', '1', '2023-06-10 12:16:58', '1', '2023-06-10 12:16:58', b'0');
INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 3, '完成', '3', 'point_status', 0, '', '', '', '1', '2023-06-10 12:17:07', '1', '2023-06-10 12:17:07', b'0');
INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 4, '失效(订单退款)', '4', 'point_status', 0, '', '', '', '1', '2023-06-10 12:17:21', '1', '2023-06-10 12:17:21', b'0');

View File

@ -2405,6 +2405,10 @@ 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 (1158, 3, 'implicit', 'implicit', 'system_oauth2_grant_type', 0, 'success', '', '简化模式', '1', '2022-05-12 00:23:40', '1', '2022-05-11 16:26:05', 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 (1159, 4, 'client_credentials', 'client_credentials', 'system_oauth2_grant_type', 0, 'default', '', '客户端模式', '1', '2022-05-12 00:23:51', '1', '2022-05-11 16:26:08', 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 (1160, 5, 'refresh_token', 'refresh_token', 'system_oauth2_grant_type', 0, 'info', '', '刷新模式', '1', '2022-05-12 00:24:02', '1', '2022-05-11 16:26:11', 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 (1161, 4, 'Vue 3 Vben', '30', 'infra_codegen_front_type', 0, '', '', '', '1', '2023-06-14 15:24:37.447', '1', '2023-06-14 15:24:37.447', 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 (1162, 3, 'Vue 3 Schema', '21', 'infra_codegen_front_type', 0, '', '', 'Vue 3 Element Plus Schema', '1', '2023-06-14 15:24:18.714', '1', '2023-06-14 15:36:40.317', 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 (1163, 2, 'Vue 3', '20', 'infra_codegen_front_type', 0, '', '', 'Vue 3 Element Plus', '1', '2023-06-14 15:24:05.654', '1', '2023-06-14 15:24:05.654', 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 (1164, 1, 'Vue 2', '10', 'infra_codegen_front_type', 0, '', '', 'Vue 2', '1', '2023-06-14 15:23:12.211', '1', '2023-06-14 15:23:57.816', 0);
COMMIT;
-- ----------------------------
@ -2500,6 +2504,7 @@ 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") VALUES (145, '角色类型', 'system_role_type', 0, '角色类型', '1', '2022-02-16 13:01:46', '1', '2022-02-16 13:01:46', 0);
INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (146, '文件存储器', 'infra_file_storage', 0, '文件存储器', '1', '2022-03-15 00:24:38', '1', '2022-03-15 00:24:38', 0);
INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (147, 'OAuth 2.0 授权类型', 'system_oauth2_grant_type', 0, 'OAuth 2.0 授权类型模式', '1', '2022-05-12 00:20:52', '1', '2022-05-11 16:25:49', 0);
INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (148, '生成前端代码类型', 'infra_codegen_front_type', 0, '生成前端代码类型', '1', '2023-6-14 16:07:35', '1', '2023-6-14 16:07:39', 0);
COMMIT;
-- ----------------------------
@ -2589,7 +2594,7 @@ COMMIT;
-- ----------------------------
DROP TABLE IF EXISTS "system_menu";
CREATE TABLE "system_menu" (
"id" int8 NOT NULL,
"id" int8 NOT NULL DEFAULT nextval('system_menu_seq'::regclass),
"name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
"permission" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
"type" int2 NOT NULL,
@ -2599,15 +2604,15 @@ CREATE TABLE "system_menu" (
"icon" varchar(100) COLLATE "pg_catalog"."default",
"component" varchar(255) COLLATE "pg_catalog"."default",
"status" int2 NOT NULL,
"visible" bool NOT NULL,
"keep_alive" bool NOT NULL,
"visible" bool NOT NULL DEFAULT true,
"keep_alive" bool NOT NULL DEFAULT false,
"creator" varchar(64) COLLATE "pg_catalog"."default",
"create_time" timestamp(6) NOT NULL,
"create_time" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
"updater" varchar(64) COLLATE "pg_catalog"."default",
"update_time" timestamp(6) NOT NULL,
"update_time" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
"deleted" int2 NOT NULL DEFAULT 0,
"component_name" varchar(255) COLLATE "pg_catalog"."default",
"always_show" char(1) COLLATE "pg_catalog"."default"
"always_show" bool NOT NULL DEFAULT false
)
;
COMMENT ON COLUMN "system_menu"."id" IS '菜单ID';
@ -2738,19 +2743,19 @@ 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", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1091, '文件查询', 'infra:file:query', 3, 1, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1092, '文件删除', 'infra:file:delete', 3, 4, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1093, '短信管理', '', 1, 11, 1, 'sms', 'validCode', NULL, 0, 't', 't', '1', '2021-04-05 01:10:16', '1', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1094, '短信渠道', '', 2, 0, 1093, 'sms-channel', 'phone', 'system/sms/smsChannel', 0, 't', 't', '', '2021-04-01 11:07:15', '1', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1094, '短信渠道', '', 2, 0, 1093, 'sms-channel', 'phone', 'system/sms/channel', 0, 't', 't', '', '2021-04-01 11:07:15', '1', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1095, '短信渠道查询', 'system:sms-channel:query', 3, 1, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1096, '短信渠道创建', 'system:sms-channel:create', 3, 2, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1097, '短信渠道更新', 'system:sms-channel:update', 3, 3, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1098, '短信渠道删除', 'system:sms-channel:delete', 3, 4, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1100, '短信模板', '', 2, 1, 1093, 'sms-template', 'phone', 'system/sms/smsTemplate', 0, 't', 't', '', '2021-04-01 17:35:17', '1', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1100, '短信模板', '', 2, 1, 1093, 'sms-template', 'phone', 'system/sms/template', 0, 't', 't', '', '2021-04-01 17:35:17', '1', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1101, '短信模板查询', 'system:sms-template:query', 3, 1, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1102, '短信模板创建', 'system:sms-template:create', 3, 2, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1103, '短信模板更新', 'system:sms-template:update', 3, 3, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1104, '短信模板删除', 'system:sms-template:delete', 3, 4, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1105, '短信模板导出', 'system:sms-template:export', 3, 5, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1106, '发送测试短信', 'system:sms-template:send-sms', 3, 6, 1100, '', '', '', 0, 't', 't', '1', '2021-04-11 00:26:40', '1', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1107, '短信日志', '', 2, 2, 1093, 'sms-log', 'phone', 'system/sms/smsLog', 0, 't', 't', '', '2021-04-11 08:37:05', '1', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1107, '短信日志', '', 2, 2, 1093, 'sms-log', 'phone', 'system/sms/log', 0, 't', 't', '', '2021-04-11 08:37:05', '1', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1108, '短信日志查询', 'system:sms-log:query', 3, 1, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1109, '短信日志导出', 'system:sms-log:export', 3, 5, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0, NULL, '1');
INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1110, '错误码管理', '', 2, 12, 1, 'error-code', 'code', 'system/errorCode/index', 0, 't', 't', '', '2021-04-13 21:46:42', '1', '2022-04-20 17:03:10', 0, NULL, '1');
@ -4239,7 +4244,7 @@ CREATE TABLE "system_notify_message" (
"template_content" varchar(1024) COLLATE "pg_catalog"."default" NOT NULL,
"template_type" int4 NOT NULL,
"template_params" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"read_status" varchar(1) COLLATE "pg_catalog"."default" NOT NULL,
"read_status" bool NOT NULL DEFAULT false,
"read_time" timestamp(6),
"creator" varchar(64) COLLATE "pg_catalog"."default",
"create_time" timestamp(6) NOT NULL,

View File

@ -16,7 +16,7 @@
<properties>
<revision>1.7.3-snapshot</revision>
<!-- 统一依赖管理 -->
<spring.boot.version>2.7.11</spring.boot.version>
<spring.boot.version>2.7.12</spring.boot.version>
<!-- Web 相关 -->
<springdoc.version>1.6.15</springdoc.version>
<knife4j.version>4.1.0</knife4j.version>
@ -52,10 +52,10 @@
<velocity.version>2.3</velocity.version>
<screw.version>1.0.5</screw.version>
<fastjson.version>1.2.83</fastjson.version>
<guava.version>31.1-jre</guava.version>
<guava.version>32.0.0-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.8.0</commons-net.version>
<commons-net.version>3.9.0</commons-net.version>
<jsch.version>0.1.55</jsch.version>
<tika-core.version>2.7.0</tika-core.version>
<netty-all.version>4.1.90.Final</netty-all.version>
@ -67,7 +67,7 @@
<minio.version>8.5.2</minio.version>
<aliyun-java-sdk-core.version>4.6.3</aliyun-java-sdk-core.version>
<aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
<tencentcloud-sdk-java.version>3.1.715</tencentcloud-sdk-java.version>
<tencentcloud-sdk-java.version>3.1.758</tencentcloud-sdk-java.version>
<justauth.version>1.4.0</justauth.version>
<jimureport.version>1.5.6</jimureport.version>
<xercesImpl.version>2.12.2</xercesImpl.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.11</spring.boot.version>
<spring.boot.version>2.7.12</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.11</spring.boot.version>
<spring.boot.version>2.7.12</spring.boot.version>
</properties>
<dependencyManagement>

View File

@ -36,7 +36,7 @@ import java.util.Set;
* 注意使用 DeptDataPermissionRule 需要保证表中有 dept_id 部门编号的字段可自定义
*
* 实际业务场景下会存在一个经典的问题当用户修改部门时冗余的 dept_id 是否需要修改
* 1. 一般情况下dept_id 不进行修改则会导致用户看到之前的数据yudao-server 采用该方案
* 1. 一般情况下dept_id 不进行修改则会导致用户看到之前的数据yudao-server 采用该方案
* 2. 部分情况下希望该用户还是能看到之前的数据则有两种方式解决需要你改造该 DeptDataPermissionRule 的实现代码
* 1编写洗数据的脚本 dept_id 修改成新部门的编号建议
* 最终过滤条件是 WHERE dept_id = ?

View File

@ -23,13 +23,4 @@ public class PayProperties {
@URL(message = "回调地址的格式必须是 URL")
private String callbackUrl;
/**
* 回跳地址
*
* 实际上对应的 PayNotifyController returnCallback 方法的 URL
*/
@URL(message = "回跳地址的格式必须是 URL")
@NotEmpty(message = "回跳地址不能为空")
private String returnUrl;
}

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.framework.pay.core.client.impl.alipay;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.Method;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedRespDTO;
@ -41,11 +40,11 @@ public class AlipayPcPayClient extends AbstractAlipayClient {
model.setTimeExpire(formatTime(reqDTO.getExpireTime()));
model.setProductCode("FAST_INSTANT_TRADE_PAY"); // 销售产品码. 目前 PC 支付场景下仅支持 FAST_INSTANT_TRADE_PAY
// 个性化的参数
// 参考 https://www.pingxx.com/api/支付渠道 extra 参数说明.html alipay_pc_direct 部分
model.setQrPayMode(MapUtil.getStr(reqDTO.getChannelExtras(), "qr_pay_mode"));
model.setQrcodeWidth(MapUtil.getLong(reqDTO.getChannelExtras(), "qr_code_width"));
// 支付宝 PC 支付有多种展示模式因此这里需要计算
String displayMode = getDisplayMode(reqDTO.getDisplayMode(), model.getQrPayMode());
// 如果想弄更多个性化的参数参考 https://www.pingxx.com/api/支付渠道 extra 参数说明.html alipay_pc_direct 部分进行拓展
model.setQrPayMode("2"); // 跳转模式 - 订单码效果参见https://help.pingxx.com/article/1137360/
// 支付宝 PC 支付有两种展示模式FORMURL
String displayMode = ObjectUtil.defaultIfNull(reqDTO.getDisplayMode(),
PayDisplayModeEnum.URL.getMode());
// 1.2 构建 AlipayTradePagePayRequest 请求
AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
@ -67,25 +66,4 @@ public class AlipayPcPayClient extends AbstractAlipayClient {
.setDisplayContent(response.getBody());
}
/**
* 获得最终的支付 UI 展示模式
*
* @param displayMode 前端传递的 UI 展示模式
* @param qrPayMode 前端传递的二维码模式
* @return 最终的支付 UI 展示模式
*/
private String getDisplayMode(String displayMode, String qrPayMode) {
// 1.1 支付宝二维码的前置模式
if (StrUtil.equalsAny(qrPayMode, "0", "1", "3", "4")) {
return PayDisplayModeEnum.IFRAME.getMode();
}
// 1.2 支付宝二维码的跳转模式
if (StrUtil.equals(qrPayMode, "2")) {
return PayDisplayModeEnum.URL.getMode();
}
// 2. 前端传递了 UI 展示模式
return displayMode != null ? displayMode :
PayDisplayModeEnum.URL.getMode(); // 模式使用 URL 跳转
}
}

View File

@ -1,6 +1,5 @@
package cn.iocoder.yudao.framework.pay.core.client.impl.alipay;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.Method;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedRespDTO;
@ -37,9 +36,8 @@ public class AlipayWapPayClient extends AbstractAlipayClient {
model.setTotalAmount(formatAmount(reqDTO.getAmount()));
model.setProductCode("QUICK_WAP_PAY"); // 销售产品码. 目前 Wap 支付场景下仅支持 QUICK_WAP_PAY
// 个性化的参数
// 支付宝 Wap 支付只有一种展示考虑到前端可能希望二维码扫描后手机打开
String displayMode = ObjectUtil.defaultIfNull(reqDTO.getDisplayMode(),
PayDisplayModeEnum.URL.getMode());
// 支付宝 Wap 支付只有一种展示URL
String displayMode = PayDisplayModeEnum.URL.getMode();
// 1.2 构建 AlipayTradeWapPayRequest 请求
AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();

View File

@ -3,11 +3,15 @@ package cn.iocoder.yudao.framework.captcha.config;
import cn.hutool.core.util.ClassUtil;
import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants;
import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl;
import com.xingyuv.captcha.properties.AjCaptchaProperties;
import com.xingyuv.captcha.service.CaptchaCacheService;
import com.xingyuv.captcha.service.impl.CaptchaServiceFactory;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.StringRedisTemplate;
import javax.annotation.Resource;
@AutoConfiguration
public class YudaoCaptchaConfiguration {
@ -17,9 +21,17 @@ public class YudaoCaptchaConfiguration {
ClassUtil.loadClass(CaptchaRedisKeyConstants.class.getName());
}
@Resource
private StringRedisTemplate stringRedisTemplate;
@Bean
public CaptchaCacheService captchaCacheService(StringRedisTemplate stringRedisTemplate) {
return new RedisCaptchaServiceImpl(stringRedisTemplate);
public CaptchaCacheService captchaCacheService(AjCaptchaProperties config) {
// 缓存类型 redis/local/....
CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name());
if (ret instanceof RedisCaptchaServiceImpl) {
((RedisCaptchaServiceImpl) ret).setStringRedisTemplate(stringRedisTemplate);
}
return ret;
}
}

View File

@ -25,6 +25,10 @@ public class RedisCaptchaServiceImpl implements CaptchaCacheService {
return "redis";
}
public void setStringRedisTemplate(StringRedisTemplate stringRedisTemplate) {
this.stringRedisTemplate = stringRedisTemplate;
}
@Override
public void set(String key, String value, long expiresInSeconds) {
stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS);

View File

@ -7,17 +7,14 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.data.redis.connection.stream.Consumer;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.PendingMessagesSummary;
import org.springframework.data.redis.connection.stream.ReadOffset;
import org.springframework.data.redis.connection.stream.StreamOffset;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.domain.Range;
import org.springframework.data.redis.connection.stream.*;
import org.springframework.data.redis.core.StreamOperations;
import org.springframework.scheduling.annotation.Scheduled;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 这个任务用于处理crash 之后的消费者未消费完的消息
@ -28,6 +25,14 @@ public class RedisPendingMessageResendJob {
private static final String LOCK_KEY = "redis:pending:msg:lock";
/**
* 消息超时时间默认 5 分钟
*
* 1. 超时的消息才会被重新投递
* 2. 由于定时任务 1 分钟一次消息超时后不会被立即重投极端情况下消息5分钟过期后再等 1 分钟才会被扫瞄到
*/
private static final int EXPIRE_TIME = 5 * 60;
private final List<AbstractStreamMessageListener<?>> listeners;
private final RedisMQTemplate redisTemplate;
private final String groupName;
@ -51,29 +56,44 @@ public class RedisPendingMessageResendJob {
}
}
/**
* 执行清理逻辑
*
* @see <a href="https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/480/files">讨论</a>
*/
private void execute() {
StreamOperations<String, Object, Object> ops = redisTemplate.getRedisTemplate().opsForStream();
listeners.forEach(listener -> {
PendingMessagesSummary pendingMessagesSummary = ops.pending(listener.getStreamKey(), groupName);
PendingMessagesSummary pendingMessagesSummary = Objects.requireNonNull(ops.pending(listener.getStreamKey(), groupName));
// 每个消费者的 pending 队列消息数量
Map<String, Long> pendingMessagesPerConsumer = pendingMessagesSummary.getPendingMessagesPerConsumer();
pendingMessagesPerConsumer.forEach((consumerName, pendingMessageCount) -> {
log.info("[processPendingMessage][消费者({}) 消息数量({})]", consumerName, pendingMessageCount);
// 从消费者的 pending 队列中读取消息
List<MapRecord<String, Object, Object>> records = ops.read(Consumer.from(groupName, consumerName), StreamOffset.create(listener.getStreamKey(), ReadOffset.from("0")));
// 每个消费者的 pending消息的详情信息
PendingMessages pendingMessages = ops.pending(listener.getStreamKey(), Consumer.from(groupName, consumerName), Range.unbounded(), pendingMessageCount);
if (pendingMessages.isEmpty()) {
return;
}
pendingMessages.forEach(pendingMessage -> {
// 获取消息上一次传递到 consumer 的时间,
long lastDelivery = pendingMessage.getElapsedTimeSinceLastDelivery().getSeconds();
if (lastDelivery < EXPIRE_TIME){
return;
}
// 获取指定 id 的消息体
List<MapRecord<String, Object, Object>> records = ops.range(listener.getStreamKey(),
Range.of(Range.Bound.inclusive(pendingMessage.getIdAsString()), Range.Bound.inclusive(pendingMessage.getIdAsString())));
if (CollUtil.isEmpty(records)) {
return;
}
for (MapRecord<String, Object, Object> record : records) {
// 重新投递消息
redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord()
.ofObject(record.getValue()) // 设置内容
.ofObject(records.get(0).getValue()) // 设置内容
.withStreamKey(listener.getStreamKey()));
// ack 消息消费完成
redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, record);
}
redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, records.get(0));
log.info("[processPendingMessage][消息({})重新投递成功]", records.get(0).getId());
});
});
});
}

View File

@ -122,7 +122,7 @@ export const createFormSchema: FormSchema[] = [
#end
}
#elseif($column.htmlType == "radio")## 单选框
component: 'Radio',
component: 'RadioButtonGroup',
componentProps: {
#if ("" != $dictType)## 有数据字典
options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number')
@ -188,7 +188,7 @@ export const updateFormSchema: FormSchema[] = [
#end
}
#elseif($column.htmlType == "radio")## 单选框
component: 'Radio',
component: 'RadioButtonGroup',
componentProps: {
#if ("" != $dictType)## 有数据字典
options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number')

View File

@ -15,6 +15,7 @@ import java.util.Arrays;
@AllArgsConstructor
public enum DeliveryTypeEnum implements IntArrayValuable {
NULL(0, "无需物流"),
EXPRESS(1, "快递发货"),
PICK_UP(2, "用户自提"),;

View File

@ -93,6 +93,10 @@
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
</dependency>
</dependencies>

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.RandomUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.trade.controller.app.delivery.vo.pickup.AppDeliveryPickUpStoreRespVO;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@ -17,7 +18,7 @@ import java.util.Random;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "用户 App - 门店自提")
@Tag(name = "用户 App - 自提门店")
@RestController
@RequestMapping("/trade/delivery/pick-up-store")
@Validated
@ -37,8 +38,8 @@ public class AppDeliverPickUpStoreController {
store.setLogo("https://www.iocoder.cn/" + (i + 1) + ".png");
store.setPhone("15601691300");
store.setAreaId(random.nextInt(100000));
store.setAreaName(RandomUtil.randomString(10));
store.setDetailAddress(RandomUtil.randomString(10));
store.setAreaName("上海-" + RandomUtil.randomString(10));
store.setDetailAddress("普陀区-" + RandomUtil.randomString(10));
store.setLatitude(random.nextDouble() * 10);
store.setLongitude(random.nextDouble() * 10);
store.setDistance(random.nextInt(1000));
@ -49,4 +50,23 @@ public class AppDeliverPickUpStoreController {
return success(list);
}
@GetMapping("/get")
@Operation(summary = "获得自提门店")
@Parameter(name = "id", description = "门店编号")
public CommonResult<AppDeliveryPickUpStoreRespVO> getOrder(@RequestParam("id") Long id) {
AppDeliveryPickUpStoreRespVO store = new AppDeliveryPickUpStoreRespVO();
Random random = new Random();
store.setId(random.nextLong());
store.setName(RandomUtil.randomString(10));
store.setLogo("https://www.iocoder.cn/" + (1) + ".png");
store.setPhone("15601691300");
store.setAreaId(random.nextInt(100000));
store.setAreaName("上海-" + RandomUtil.randomString(10));
store.setDetailAddress("普陀区-" + RandomUtil.randomString(10));
store.setLatitude(random.nextDouble() * 10);
store.setLongitude(random.nextDouble() * 10);
store.setDistance(random.nextInt(1000));
return success(store);
}
}

View File

@ -127,6 +127,14 @@ public class AppTradeOrderController {
return success(orderCount);
}
@PutMapping("/take")
@Operation(summary = "确认交易订单收货")
@Parameter(name = "id", description = "交易订单编号")
public CommonResult<Boolean> takeOrder(@RequestParam("id") Long id) {
// TODO @芋艿未实现mock
return success(true);
}
@DeleteMapping("/cancel")
@Operation(summary = "取消交易订单")
@Parameter(name = "id", description = "交易订单编号")

View File

@ -55,8 +55,10 @@ public class AppTradeOrderDetailRespVO {
@Schema(description = "付款超时时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime payExpireTime;
@Schema(description = "支付渠道", requiredMode = Schema.RequiredMode.REQUIRED, example = "wx_lite_pay")
@Schema(description = "支付渠道", example = "wx_lite_pay")
private String payChannelCode;
@Schema(description = "支付渠道名", example = "微信小程序支付")
private String payChannelName;
@Schema(description = "商品原价(总)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
private Integer totalPrice;
@ -102,6 +104,9 @@ public class AppTradeOrderDetailRespVO {
@Schema(description = "收件人详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "中关村大街 1 号")
private String receiverDetailAddress;
@Schema(description = "自提门店编号", example = "1088")
private Long pickUpStoreId;
// ========== 售后基本信息 ==========
// ========== 营销基本信息 ==========

View File

@ -44,7 +44,7 @@ public class AppTradeOrderSettlementReqVO {
private Long addressId;
@Schema(description = "自提门店编号", example = "1088")
private Long pickupStoreId;
private Long pickUpStoreId;
@Schema(description = "收件人名称", example = "芋艿") // 选择门店自提时该字段为联系人名
private String receiverName;
@Schema(description = "收件人手机", example = "15601691300") // 选择门店自提时该字段为联系人手机

View File

@ -1,12 +1,15 @@
package cn.iocoder.yudao.module.trade.convert.order;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
import cn.iocoder.yudao.module.member.api.address.dto.AddressRespDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO;
import cn.iocoder.yudao.module.pay.enums.DictTypeConstants;
import cn.iocoder.yudao.module.product.api.comment.dto.ProductCommentCreateReqDTO;
import cn.iocoder.yudao.module.product.api.property.dto.ProductPropertyValueDetailRespDTO;
import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuUpdateStockReqDTO;
@ -234,6 +237,9 @@ public interface TradeOrderConvert {
List<ProductPropertyValueDetailRespDTO> propertyValueDetails, TradeOrderProperties tradeOrderProperties) {
AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems);
orderVO.setPayExpireTime(addTime(tradeOrderProperties.getExpireTime()));
if (StrUtil.isNotEmpty(order.getPayChannelCode())) {
orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE_TYPE, order.getPayChannelCode()));
}
// 处理商品属性
Map<Long, ProductPropertyValueDetailRespDTO> propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId);
for (int i = 0; i < orderItems.size(); i++) {

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.dataobject.order;
import cn.iocoder.yudao.framework.common.enums.TerminalEnum;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryPickUpStoreDO;
import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum;
import cn.iocoder.yudao.module.trade.enums.order.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
@ -171,13 +172,6 @@ public class TradeOrderDO extends BaseDO {
* 枚举 {@link DeliveryTypeEnum}
*/
private Integer deliveryType;
/**
* 配置模板的编号
*
* 关联 DeliveryTemplateDO id 编号
*/
// TODO 芋艿需要删除
private Long deliveryTemplateId;
/**
* 发货物流公司编号
*/
@ -197,7 +191,6 @@ public class TradeOrderDO extends BaseDO {
*/
private LocalDateTime deliveryTime;
// TODO @芋艿pickUpStoreId;
/**
* 收货时间
*/
@ -219,6 +212,13 @@ public class TradeOrderDO extends BaseDO {
*/
private String receiverDetailAddress;
/**
* 自提门店编号
*
* 关联 {@link DeliveryPickUpStoreDO#getId()}
*/
private Long pickUpStoreId;
// ========== 售后基本信息 ==========
/**
* 售后状态

View File

@ -115,7 +115,6 @@ public class TradeOrderServiceTest extends BaseDbUnitTest {
when(productSpuApi.getSpuList(eq(asSet(11L, 21L)))).thenReturn(Arrays.asList(spu01, spu02));
// mock 方法用户收件地址的校验
AddressRespDTO addressRespDTO = new AddressRespDTO().setId(10L).setUserId(userId).setName("芋艿")
//.setMobile("15601691300").setAreaId(3306).setPostCode("85757").setDetailAddress("土豆村");
.setMobile("15601691300").setAreaId(3306).setDetailAddress("土豆村");
when(addressApi.getAddress(eq(10L), eq(userId))).thenReturn(addressRespDTO);
// mock 方法价格计算
@ -177,7 +176,6 @@ public class TradeOrderServiceTest extends BaseDbUnitTest {
assertEquals(tradeOrderDO.getPayPrice(), 80);
assertEquals(tradeOrderDO.getPayOrderId(), 1000L);
assertNull(tradeOrderDO.getPayChannelCode());
assertNull(tradeOrderDO.getDeliveryTemplateId());
assertNull(tradeOrderDO.getLogisticsId());
assertEquals(tradeOrderDO.getDeliveryStatus(), TradeOrderDeliveryStatusEnum.UNDELIVERED.getStatus());
assertNull(tradeOrderDO.getDeliveryTime());

View File

@ -23,4 +23,15 @@ public interface ErrorCodeConstants {
// ========== 用户收件地址 1004004000 ==========
ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1004004000, "用户收件地址不存在");
//========== 用户积分 1004005000 ==========
// TODO @xiaqing错误码要分段例如说这里积分配置积分记录签到配置签到记录分成 4
ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(1004005003, "签到天数规则不存在");
ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(1004005004, "签到天数规则已存在");
ErrorCode RECORD_NOT_EXISTS = new ErrorCode( 1004005005, "用户积分记录不存在");
ErrorCode SIGN_IN_RECORD_NOT_EXISTS = new ErrorCode(1004005006, "用户签到积分不存在");
}

View File

@ -84,6 +84,11 @@
</dependency>
<!-- 工具类相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-ip</artifactId>

View File

@ -26,9 +26,9 @@ public class MemberPointConfigController {
@Resource
private MemberPointConfigService memberPointConfigService;
@PutMapping("/update")
@PutMapping("/save")
@Operation(summary = "保存会员积分配置")
@PreAuthorize("@ss.hasPermission('member:point-config:save')")
@PreAuthorize("@ss.hasPermission('point:config:save')")
public CommonResult<Boolean> updateConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) {
memberPointConfigService.saveConfig(saveReqVO);
return success(true);
@ -36,7 +36,7 @@ public class MemberPointConfigController {
@GetMapping("/get")
@Operation(summary = "获得会员积分配置")
@PreAuthorize("@ss.hasPermission('member:point-config:query')")
@PreAuthorize("@ss.hasPermission('point:config:query')")
public CommonResult<MemberPointConfigRespVO> getConfig() {
MemberPointConfigDO config = memberPointConfigService.getConfig();
return success(MemberPointConfigConvert.INSTANCE.convert(config));

View File

@ -0,0 +1,58 @@
package cn.iocoder.yudao.module.member.controller.admin.point;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordRespVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO;
import cn.iocoder.yudao.module.member.convert.point.MemberPointRecordConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import cn.iocoder.yudao.module.member.service.point.MemberPointRecordService;
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("/point/record")
@Validated
public class MemberPointRecordController {
@Resource
private MemberPointRecordService recordService;
// TODO @xiaqing积分应该没有更新操作呀可以删除哈
@PutMapping("/update")
@Operation(summary = "更新用户积分记录")
@PreAuthorize("@ss.hasPermission('point:record:update')")
public CommonResult<Boolean> updateRecord(@Valid @RequestBody MemberPointRecordUpdateReqVO updateReqVO) {
recordService.updateRecord(updateReqVO);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得用户积分记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('point:record:query')")
public CommonResult<MemberPointRecordRespVO> getRecord(@RequestParam("id") Long id) {
MemberPointRecordDO record = recordService.getRecord(id);
return success(MemberPointRecordConvert.INSTANCE.convert(record));
}
@GetMapping("/page")
@Operation(summary = "获得用户积分记录分页")
@PreAuthorize("@ss.hasPermission('point:record:query')")
public CommonResult<PageResult<MemberPointRecordRespVO>> getRecordPage(@Valid MemberPointRecordPageReqVO pageVO) {
PageResult<MemberPointRecordDO> pageResult = recordService.getRecordPage(pageVO);
return success(MemberPointRecordConvert.INSTANCE.convertPage(pageResult));
}
}

View File

@ -12,6 +12,8 @@ import java.math.BigDecimal;
@Data
public class MemberPointConfigBaseVO {
private Long id;
@Schema(description = "积分抵扣开关", required = true, example = "true")
private Boolean tradeDeductEnable;

View File

@ -1,11 +1,8 @@
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
@ -17,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class PointRecordBaseVO {
public class MemberPointRecordBaseVO {
@Schema(description = "业务编码", example = "22706")
@NotNull(message = "业务编码不能为空")

View File

@ -1,14 +1,12 @@
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 用户积分记录创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PointRecordCreateReqVO extends PointRecordBaseVO {
public class MemberPointRecordCreateReqVO extends MemberPointRecordBaseVO {
}

View File

@ -1,13 +1,11 @@
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
@Schema(description = "管理后台 - 用户积分记录 Excel 导出 Request VO参数和 PointRecordPageReqVO 是一致的")
@Data
public class PointRecordExportReqVO {
public class MemberPointRecordExportReqVO {
@Schema(description = "业务编码", example = "22706")
private String bizId;

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
@ -9,7 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PointRecordPageReqVO extends PageParam {
public class MemberPointRecordPageReqVO extends PageParam {
@Schema(description = "业务编码", example = "22706")
private String bizId;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -8,7 +8,7 @@ import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PointRecordRespVO extends PointRecordBaseVO {
public class MemberPointRecordRespVO extends MemberPointRecordBaseVO {
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457")
private Long id;

View File

@ -1,15 +1,15 @@
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 用户积分记录更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PointRecordUpdateReqVO extends PointRecordBaseVO {
public class MemberPointRecordUpdateReqVO extends MemberPointRecordBaseVO {
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457")
@NotNull(message = "自增主键不能为空")

View File

@ -1 +0,0 @@
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.member.controller.admin.signin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigRespVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
import cn.iocoder.yudao.module.member.service.signin.MemberSignInConfigService;
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("/point/sign-in-config")
@Validated
public class MemberSignInConfigController {
@Resource
private MemberSignInConfigService memberSignInConfigService;
@PostMapping("/create")
@Operation(summary = "创建积分签到规则")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:create')")
public CommonResult<Integer> createSignInConfig(@Valid @RequestBody MemberSignInConfigCreateReqVO createReqVO) {
return success(memberSignInConfigService.createSignInConfig(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新积分签到规则")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:update')")
public CommonResult<Boolean> updateSignInConfig(@Valid @RequestBody MemberSignInConfigUpdateReqVO updateReqVO) {
memberSignInConfigService.updateSignInConfig(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除积分签到规则")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('point:sign-in-config:delete')")
public CommonResult<Boolean> deleteSignInConfig(@RequestParam("id") Integer id) {
memberSignInConfigService.deleteSignInConfig(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得积分签到规则")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
public CommonResult<MemberSignInConfigRespVO> getSignInConfig(@RequestParam("id") Integer id) {
MemberSignInConfigDO signInConfig = memberSignInConfigService.getSignInConfig(id);
return success(MemberSignInConfigConvert.INSTANCE.convert(signInConfig));
}
@GetMapping("/page")
@Operation(summary = "获得积分签到规则分页")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
public CommonResult<PageResult<MemberSignInConfigRespVO>> getSignInConfigPage(@Valid MemberSignInConfigPageReqVO pageVO) {
PageResult<MemberSignInConfigDO> pageResult = memberSignInConfigService.getSignInConfigPage(pageVO);
return success(MemberSignInConfigConvert.INSTANCE.convertPage(pageResult));
}
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.member.controller.admin.signin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordRespVO;
import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
import cn.iocoder.yudao.module.member.service.signin.MemberSignInRecordService;
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("/point/sign-in-record")
@Validated
public class MemberSignInRecordController {
@Resource
private MemberSignInRecordService memberSignInRecordService;
// TODO @xiaqing签到是不是不用删除
@DeleteMapping("/delete")
@Operation(summary = "删除用户签到积分")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('point:sign-in-record:delete')")
public CommonResult<Boolean> deleteSignInRecord(@RequestParam("id") Long id) {
memberSignInRecordService.deleteSignInRecord(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得用户签到积分")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('point:sign-in-record:query')")
public CommonResult<MemberSignInRecordRespVO> getSignInRecord(@RequestParam("id") Long id) {
MemberSignInRecordDO signInRecord = memberSignInRecordService.getSignInRecord(id);
return success(MemberSignInRecordConvert.INSTANCE.convert(signInRecord));
}
@GetMapping("/page")
@Operation(summary = "获得用户签到积分分页")
@PreAuthorize("@ss.hasPermission('point:sign-in-record:query')")
public CommonResult<PageResult<MemberSignInRecordRespVO>> getSignInRecordPage(@Valid MemberSignInRecordPageReqVO pageVO) {
PageResult<MemberSignInRecordDO> pageResult = memberSignInRecordService.getSignInRecordPage(pageVO);
return success(MemberSignInRecordConvert.INSTANCE.convertPage(pageResult));
}
}

View File

@ -1,20 +1,16 @@
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* 积分签到规则 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class SignInConfigBaseVO {
public class MemberSignInConfigBaseVO {
@Schema(description = "签到第x天", example = "7")
@Schema(description = "签到第 x ", example = "7")
private Integer day;
@Schema(description = "签到天数对应分数", example = "10")

View File

@ -1,14 +1,12 @@
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 积分签到规则创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInConfigCreateReqVO extends SignInConfigBaseVO {
public class MemberSignInConfigCreateReqVO extends MemberSignInConfigBaseVO {
}

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
@ -9,7 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInConfigPageReqVO extends PageParam {
public class MemberSignInConfigPageReqVO extends PageParam {
@Schema(description = "签到第x天", example = "7")
private Integer day;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -8,7 +8,7 @@ import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInConfigRespVO extends SignInConfigBaseVO {
public class MemberSignInConfigRespVO extends MemberSignInConfigBaseVO {
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20937")
private Integer id;

View File

@ -1,15 +1,15 @@
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 积分签到规则更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInConfigUpdateReqVO extends SignInConfigBaseVO {
public class MemberSignInConfigUpdateReqVO extends MemberSignInConfigBaseVO {
@Schema(description = "规则自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13653")
@NotNull(message = "规则自增主键不能为空")

View File

@ -1,18 +1,14 @@
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import lombok.Data;
/**
* 用户签到积分 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class SignInRecordBaseVO {
public class MemberSignInRecordBaseVO {
@Schema(description = "签到用户", example = "6507")
private Integer userId;

View File

@ -0,0 +1,14 @@
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
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 MemberSignInRecordCreateReqVO extends MemberSignInRecordBaseVO {
}

View File

@ -1,10 +1,12 @@
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -13,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInRecordPageReqVO extends PageParam {
public class MemberSignInRecordPageReqVO extends PageParam {
@Schema(description = "签到用户", example = "6507")
private Integer userId;

View File

@ -1,14 +1,17 @@
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 用户签到积分 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInRecordRespVO extends SignInRecordBaseVO {
public class MemberSignInRecordRespVO extends MemberSignInRecordBaseVO {
@Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903")
private Long id;

View File

@ -1,15 +1,17 @@
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 用户签到积分更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInRecordUpdateReqVO extends SignInRecordBaseVO {
public class MemberSignInRecordUpdateReqVO extends MemberSignInRecordBaseVO {
@Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903")
@NotNull(message = "签到自增id不能为空")

View File

@ -1,7 +1,10 @@
package cn.iocoder.yudao.module.member.convert.point;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigRespVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@ -17,4 +20,7 @@ public interface MemberPointConfigConvert {
MemberPointConfigRespVO convert(MemberPointConfigDO bean);
MemberPointConfigDO convert(MemberPointConfigSaveReqVO bean);
}

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.member.convert.point;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordRespVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* 用户积分记录 Convert
*
* @author QingX
*/
@Mapper
public interface MemberPointRecordConvert {
MemberPointRecordConvert INSTANCE = Mappers.getMapper(MemberPointRecordConvert.class);
MemberPointRecordDO convert(MemberPointRecordCreateReqVO bean);
MemberPointRecordDO convert(MemberPointRecordUpdateReqVO bean);
MemberPointRecordRespVO convert(MemberPointRecordDO bean);
PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> page);
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.member.convert.signin;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigRespVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 积分签到规则 Convert
*
* @author QingX
*/
@Mapper
public interface MemberSignInConfigConvert {
MemberSignInConfigConvert INSTANCE = Mappers.getMapper(MemberSignInConfigConvert.class);
MemberSignInConfigDO convert(MemberSignInConfigCreateReqVO bean);
MemberSignInConfigDO convert(MemberSignInConfigUpdateReqVO bean);
MemberSignInConfigRespVO convert(MemberSignInConfigDO bean);
List<MemberSignInConfigRespVO> convertList(List<MemberSignInConfigDO> list);
PageResult<MemberSignInConfigRespVO> convertPage(PageResult<MemberSignInConfigDO> page);
}

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.member.convert.signin;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordRespVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* 用户签到积分 Convert
*
* @author 芋道源码
*/
@Mapper
public interface MemberSignInRecordConvert {
MemberSignInRecordConvert INSTANCE = Mappers.getMapper(MemberSignInRecordConvert.class);
MemberSignInRecordDO convert(MemberSignInRecordCreateReqVO bean);
MemberSignInRecordDO convert(MemberSignInRecordUpdateReqVO bean);
MemberSignInRecordRespVO convert(MemberSignInRecordDO bean);
PageResult<MemberSignInRecordRespVO> convertPage(PageResult<MemberSignInRecordDO> page);
}

View File

@ -1,13 +1,12 @@
package cn.iocoder.yudao.module.point.dal.dataobject.pointrecord;
package cn.iocoder.yudao.module.member.dal.dataobject.point;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import java.time.LocalDateTime;
/**
* 用户积分记录 DO
@ -22,7 +21,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PointRecordDO extends BaseDO {
public class MemberPointRecordDO extends BaseDO {
/**
* 自增主键
@ -36,12 +35,13 @@ public class PointRecordDO extends BaseDO {
/**
* 业务类型
*
* 枚举 {@link TODO biz_type 对应的类}
* 枚举 {@link TODO biz_type 对应枚举然后改成 int 类型哈}
*/
private String bizType;
/**
* 1增加 0扣减
*/
// TODO @xiaqing要不把 type 合并到 point 增加 point 是正数减少 point 是负数
private String type;
/**
* 积分标题
@ -61,7 +61,6 @@ public class PointRecordDO extends BaseDO {
private Integer totalPoint;
/**
* 状态1-订单创建2-冻结期3-完成4-失效订单退款
*
* 枚举 {@link TODO point_status 对应的类}
*/

View File

@ -1,11 +1,10 @@
package cn.iocoder.yudao.module.point.dal.dataobject.signinconfig;
package cn.iocoder.yudao.module.member.dal.dataobject.signin;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
/**
* 积分签到规则 DO
@ -20,7 +19,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SignInConfigDO extends BaseDO {
public class MemberSignInConfigDO extends BaseDO {
/**
* 规则自增主键

View File

@ -1,11 +1,10 @@
package cn.iocoder.yudao.module.point.dal.dataobject.signinrecord;
package cn.iocoder.yudao.module.member.dal.dataobject.signin;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
/**
* 用户签到积分 DO
@ -20,7 +19,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SignInRecordDO extends BaseDO {
public class MemberSignInRecordDO extends BaseDO {
/**
* 签到自增id

View File

@ -0,0 +1,28 @@
package cn.iocoder.yudao.module.member.dal.mysql.point;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户积分记录 Mapper
*
* @author QingX
*/
@Mapper
public interface MemberPointRecordMapper extends BaseMapperX<MemberPointRecordDO> {
default PageResult<MemberPointRecordDO> selectPage(MemberPointRecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MemberPointRecordDO>()
.eqIfPresent(MemberPointRecordDO::getBizId, reqVO.getBizId())
.eqIfPresent(MemberPointRecordDO::getBizType, reqVO.getBizType())
.eqIfPresent(MemberPointRecordDO::getType, reqVO.getType())
.eqIfPresent(MemberPointRecordDO::getTitle, reqVO.getTitle())
.eqIfPresent(MemberPointRecordDO::getStatus, reqVO.getStatus())
.orderByDesc(MemberPointRecordDO::getId));
}
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.member.dal.mysql.signin;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 积分签到规则 Mapper
*
* @author QingX
*/
@Mapper
public interface MemberSignInConfigMapper extends BaseMapperX<MemberSignInConfigDO> {
default PageResult<MemberSignInConfigDO> selectPage(MemberSignInConfigPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInConfigDO>()
.eqIfPresent(MemberSignInConfigDO::getDay, reqVO.getDay())
.orderByAsc(MemberSignInConfigDO::getDay));
}
//
default long selectSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO){
return selectCount(new LambdaQueryWrapperX <MemberSignInConfigDO>()
.ne(MemberSignInConfigDO::getId, reqVO.getId())
.eq(MemberSignInConfigDO::getDay,reqVO.getDay())
);
}
}

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.member.dal.mysql.signin;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户签到积分 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface MemberSignInRecordMapper extends BaseMapperX<MemberSignInRecordDO> {
default PageResult<MemberSignInRecordDO> selectPage(MemberSignInRecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInRecordDO>()
.eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId())
.eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay())
.betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MemberSignInRecordDO::getId));
}
}

View File

@ -1,12 +1,14 @@
package cn.iocoder.yudao.module.member.service.point;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO;
import cn.iocoder.yudao.module.member.convert.point.MemberPointConfigConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO;
import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointConfigMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
/**
* 会员积分配置 Service 实现类
@ -18,16 +20,26 @@ import javax.annotation.Resource;
public class MemberPointConfigServiceImpl implements MemberPointConfigService {
@Resource
private MemberPointConfigMapper memberPointConfigMapper;
private MemberPointConfigMapper pointConfigMapper;
@Override
public void saveConfig(MemberPointConfigSaveReqVO saveReqVO) {
// TODO qingx配置存在 update不存在则 insert
// TODO @xiaqing直接 getConfig() 查询如果不存在则插入存在则进行更新
long total = pointConfigMapper.selectCount();
MemberPointConfigDO pointConfigDO = MemberPointConfigConvert.INSTANCE.convert(saveReqVO);
//大于0存在记录则更新否则插入
if (total > 0) {
pointConfigMapper.updateById(pointConfigDO);
} else {
pointConfigMapper.insert(pointConfigDO);
}
}
@Override
public MemberPointConfigDO getConfig() {
// TODO qingx直接查询到一条
return null;
List <MemberPointConfigDO> list = pointConfigMapper.selectList();
// TODO @xiaqing可以使用 CollUtil.getFirst()
return list == null ? null : list.get(0);
}
}

View File

@ -0,0 +1,42 @@
package cn.iocoder.yudao.module.member.service.point;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import javax.validation.Valid;
/**
* 用户积分记录 Service 接口
*
* @author QingX
*/
public interface MemberPointRecordService {
// TODO @xiaqing方法和方法之间是空一行哈
/**
* 更新用户积分记录
*
* @param updateReqVO 更新信息
*/
void updateRecord(@Valid MemberPointRecordUpdateReqVO updateReqVO);
/**
* 获得用户积分记录
*
* @param id 编号
* @return 用户积分记录
*/
MemberPointRecordDO getRecord(Long id);
/**
* 获得用户积分记录分页
*
* @param pageReqVO 分页查询
* @return 用户积分记录分页
*/
PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO);
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.member.service.point;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO;
import cn.iocoder.yudao.module.member.convert.point.MemberPointRecordConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointRecordMapper;
import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 用户积分记录 Service 实现类
*
* @author QingX
*/
@Service
@Validated
public class MemberPointRecordServiceImpl implements MemberPointRecordService {
@Resource
private MemberPointRecordMapper recordMapper;
@Override
public void updateRecord(MemberPointRecordUpdateReqVO updateReqVO) {
// 校验存在
validateRecordExists(updateReqVO.getId());
// 更新
MemberPointRecordDO updateObj = MemberPointRecordConvert.INSTANCE.convert(updateReqVO);
recordMapper.updateById(updateObj);
}
private void validateRecordExists(Long id) {
if (recordMapper.selectById(id) == null) {
throw exception(ErrorCodeConstants.RECORD_NOT_EXISTS);
}
}
@Override
public MemberPointRecordDO getRecord(Long id) {
return recordMapper.selectById(id);
}
@Override
public PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO) {
return recordMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.member.service.signin;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
import javax.validation.Valid;
/**
* 积分签到规则 Service 接口
*
* @author QingX
*/
public interface MemberSignInConfigService {
/**
* 创建积分签到规则
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createSignInConfig(@Valid MemberSignInConfigCreateReqVO createReqVO);
/**
* 更新积分签到规则
*
* @param updateReqVO 更新信息
*/
void updateSignInConfig(@Valid MemberSignInConfigUpdateReqVO updateReqVO);
/**
* 删除积分签到规则
*
* @param id 编号
*/
void deleteSignInConfig(Integer id);
/**
* 获得积分签到规则
*
* @param id 编号
* @return 积分签到规则
*/
MemberSignInConfigDO getSignInConfig(Integer id);
/**
* 获得积分签到规则分页
*
* @param pageReqVO 分页查询
* @return 积分签到规则分页
*/
PageResult<MemberSignInConfigDO> getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO);
}

View File

@ -0,0 +1,97 @@
package cn.iocoder.yudao.module.member.service.signin;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInConfigMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_CONFIG_EXISTS;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_CONFIG_NOT_EXISTS;
/**
* 积分签到规则 Service 实现类
*
* @author QingX
*/
@Service
@Validated
public class MemberSignInConfigServiceImpl implements MemberSignInConfigService {
@Resource
private MemberSignInConfigMapper memberSignInConfigMapper;
// TODO @xiaqing这种写的逻辑最好按照 校验 - 更新这样的顺序写类似这里37 要放到 34 前面updateSignInConfig 也是一样的思路
@Override
public Integer createSignInConfig(MemberSignInConfigCreateReqVO createReqVO) {
// 插入
MemberSignInConfigDO signInConfig = MemberSignInConfigConvert.INSTANCE.convert(createReqVO);
// 判断是否重复插入签到天数
validateSignInConfigExistsDay(signInConfig.getDay());
memberSignInConfigMapper.insert(signInConfig);
// 返回
return signInConfig.getId();
}
// TODO @xiaqing这个逻辑的空行要注意52 53 是没必要的空行 49 50 之间有个空行会好点可以区分出是 校验 - 更新这样的逻辑间隔
@Override
public void updateSignInConfig(MemberSignInConfigUpdateReqVO updateReqVO) {
// 校验存在
validateSignInConfigExists(updateReqVO.getId());
//判断是否重复插入签到天数
validateSignInConfigSameDayNotSelf(updateReqVO);
// 判断更新的
MemberSignInConfigDO updateObj = MemberSignInConfigConvert.INSTANCE.convert(updateReqVO);
memberSignInConfigMapper.updateById(updateObj);
}
@Override
public void deleteSignInConfig(Integer id) {
// 校验存在
validateSignInConfigExists(id);
// 删除
memberSignInConfigMapper.deleteById(id);
}
private void validateSignInConfigExists(Integer id) {
if (memberSignInConfigMapper.selectById(id) == null) {
throw exception(SIGN_IN_CONFIG_NOT_EXISTS);
}
}
// TODO @xiaqing这个唯一判断也可以参考下别的模块哈
//根据签到天数判断是否存在一个相同的天数
private void validateSignInConfigExistsDay(Integer day) {
if (memberSignInConfigMapper.selectCount(MemberSignInConfigDO::getDay,day)>0) {
throw exception(SIGN_IN_CONFIG_EXISTS);
}
}
// TODO @xiaqing参考下别的模块判断唯一排除自己怎么写的哈
// 更新天数时判断是否有重复的天数需要去除自己
private void validateSignInConfigSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO) {
if (memberSignInConfigMapper.selectSameDayNotSelf(reqVO)>0) {
throw exception(SIGN_IN_CONFIG_EXISTS);
}
}
@Override
public MemberSignInConfigDO getSignInConfig(Integer id) {
return memberSignInConfigMapper.selectById(id);
}
@Override
public PageResult<MemberSignInConfigDO> getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO) {
return memberSignInConfigMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.member.service.signin;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
/**
* 用户签到积分 Service 接口
*
* @author 芋道源码
*/
public interface MemberSignInRecordService {
/**
* 删除用户签到积分
*
* @param id 编号
*/
void deleteSignInRecord(Long id);
/**
* 获得用户签到积分
*
* @param id 编号
* @return 用户签到积分
*/
MemberSignInRecordDO getSignInRecord(Long id);
/**
* 获得用户签到积分分页
*
* @param pageReqVO 分页查询
* @return 用户签到积分分页
*/
PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO);
}

View File

@ -0,0 +1,51 @@
package cn.iocoder.yudao.module.member.service.signin;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_RECORD_NOT_EXISTS;
/**
* 用户签到积分 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class MemberSignInRecordServiceImpl implements MemberSignInRecordService {
@Resource
private MemberSignInRecordMapper memberSignInRecordMapper;
@Override
public void deleteSignInRecord(Long id) {
// 校验存在
validateSignInRecordExists(id);
// 删除
memberSignInRecordMapper.deleteById(id);
}
private void validateSignInRecordExists(Long id) {
if (memberSignInRecordMapper.selectById(id) == null) {
throw exception(SIGN_IN_RECORD_NOT_EXISTS);
}
}
@Override
public MemberSignInRecordDO getSignInRecord(Long id) {
return memberSignInRecordMapper.selectById(id);
}
@Override
public PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO) {
return memberSignInRecordMapper.selectPage(pageReqVO);
}
}

View File

@ -52,6 +52,14 @@ public class MpTagController {
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取公众号标签详情")
@PreAuthorize("@ss.hasPermission('mp:tag:query')")
public CommonResult<MpTagRespVO> get(@RequestParam("id") Long id) {
MpTagDO mpTagDO = mpTagService.get(id);
return success(MpTagConvert.INSTANCE.convert(mpTagDO));
}
@GetMapping("/page")
@Operation(summary = "获取公众号标签分页")
@PreAuthorize("@ss.hasPermission('mp:tag:query')")

View File

@ -37,6 +37,8 @@ public interface MpTagConvert {
})
MpTagDO convert(WxUserTag tag, MpAccountDO account);
MpTagRespVO convert(MpTagDO mpTagDO);
List<MpTagSimpleRespVO> convertList02(List<MpTagDO> list);
}

View File

@ -46,6 +46,13 @@ public interface MpTagService {
*/
PageResult<MpTagDO> getTagPage(MpTagPageReqVO pageReqVO);
/**
* 获得公众号标签详情
* @param id id查询
* @return 公众号标签详情
*/
MpTagDO get(Long id);
List<MpTagDO> getTagList();
/**

View File

@ -116,6 +116,11 @@ public class MpTagServiceImpl implements MpTagService {
return mpTagMapper.selectPage(pageReqVO);
}
@Override
public MpTagDO get(Long id) {
return mpTagMapper.selectById(id);
}
@Override
public List<MpTagDO> getTagList() {
return mpTagMapper.selectList();

View File

@ -7,6 +7,8 @@ package cn.iocoder.yudao.module.pay.enums;
*/
public interface DictTypeConstants {
String CHANNEL_CODE_TYPE = "pay_channel_code_type"; // 支付-渠道名
String ORDER_STATUS = "pay_order_status"; // 支付-订单-订单状态
String ORDER_NOTIFY_STATUS = "pay_order_notify_status"; // 支付-订单-订单回调商户状态

View File

@ -6,8 +6,6 @@ import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory;
import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayNotifyReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayOrderNotifyRespDTO;
import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayRefundNotifyRespDTO;
import cn.iocoder.yudao.module.pay.dal.dataobject.merchant.PayChannelDO;
import cn.iocoder.yudao.module.pay.service.merchant.PayChannelService;
import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
import cn.iocoder.yudao.module.pay.service.refund.PayRefundService;
import io.swagger.v3.oas.annotations.Operation;
@ -39,23 +37,6 @@ public class PayNotifyController {
@Resource
private PayClientFactory payClientFactory;
/**
* 统一的跳转页面支付宝跳转参数说明
*
* <a href="https://opendocs.alipay.com/open/203/105285#前台回跳参数说明">支付宝 - 前台回跳参数说明</a>
*
* @param channelId 渠道编号
* @return 返回跳转页面
*/
@GetMapping(value = "/return/{channelId}")
@Operation(summary = "渠道统一的支付成功返回地址")
@Deprecated // TODO yunai如果是 way 的情况应该是跳转回前端地址
public String returnCallback(@PathVariable("channelId") Long channelId,
@RequestParam Map<String, String> params) {
log.info("[returnCallback][app_id({}) 跳转]", params.get("app_id"));
return String.format("渠道[%s]支付成功", channelId);
}
/**
* 统一的渠道支付回调支付宝的退款回调
*

View File

@ -2,11 +2,10 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.URL;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.awt.*;
import java.util.Map;
@Schema(description = "管理后台 - 支付订单提交 Request VO")
@ -26,4 +25,9 @@ public class PayOrderSubmitReqVO {
@Schema(description = "展示模式", example = "url") // 参见 {@link PayDisplayModeEnum} 枚举如果不传递则每个支付渠道使用默认的方式
private String displayMode;
@Schema(description = "回跳地址")
@URL(message = "回跳地址的格式必须是 URL")
private String returnUrl;
}

View File

@ -5,6 +5,6 @@ Authorization: Bearer {{appToken}}
tenant-id: {{appTenentId}}
{
"id": 125,
"channelCode": "alipay_qr"
"id": 174,
"channelCode": "alipay_pc"
}

View File

@ -6,8 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
// TODO @jason修改 MemberWalletDO PayWalletDO
/**
* 支付-会员钱包 DO
* 支付 - 会员钱包 DO
*
* @author jason
*/
@ -22,10 +23,12 @@ public class MemberWalletDO extends BaseDO {
@TableId
private Long id;
// TODO @jaosn增加 userType 字段
/**
* 用户 id
*
* 关联 MemberUserDO id 编号
* 关联 AdminUserDO id 编号
*/
private Long userId;

View File

@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.pay.config.PayProperties;
import cn.iocoder.yudao.framework.pay.core.client.PayClient;
import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory;
@ -44,7 +43,7 @@ import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.*;
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
/**
* 支付订单 Service 实现类
@ -147,7 +146,7 @@ public class PayOrderServiceImpl implements PayOrderService {
.setMerchantOrderId(orderExtension.getNo()) // 注意此处使用的是 PayOrderExtensionDO.no 属性
.setSubject(order.getSubject()).setBody(order.getBody())
.setNotifyUrl(genChannelPayNotifyUrl(channel))
.setReturnUrl(genChannelReturnUrl(channel))
.setReturnUrl(reqVO.getReturnUrl())
// 订单相关字段
.setAmount(order.getAmount()).setExpireTime(order.getExpireTime());
PayOrderUnifiedRespDTO unifiedOrderRespDTO = client.unifiedOrder(unifiedOrderReqDTO);
@ -183,15 +182,6 @@ public class PayOrderServiceImpl implements PayOrderService {
return channel;
}
/**
* 根据支付渠道的编码生成支付渠道的返回地址
* @param channel 支付渠道
* @return 支付成功返回的地址 配置地址 + "/" + channel id
*/
private String genChannelReturnUrl(PayChannelDO channel) {
return payProperties.getReturnUrl() + "/" + channel.getId();
}
/**
* 根据支付渠道的编码生成支付渠道的回调地址
*

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao</artifactId>
<version>${revision}</version>
</parent>
<artifactId>yudao-module-point</artifactId>
<packaging>pom</packaging>
<modules>
<module>yudao-module-point-api</module>
</modules>
</project>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-point</artifactId>
<version>${revision}</version>
</parent>
<artifactId>yudao-module-point-api</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-common</artifactId>
</dependency>
<!-- 参数校验 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@ -1,27 +0,0 @@
package cn.iocoder.yudao.module.point.enums;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
/**
* Pay 错误码 Core 枚举类
*
* pay 系统使用 1-007-000-000
*/
public interface ErrorCodeConstants {
ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(499, "积分设置不存在");
ErrorCode CONFIG_EXISTS = new ErrorCode(499, "积分设置已存在,只允配置一条记录");
ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(499, "签到天数规则不存在");
ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(499, "签到天数规则已存在");
ErrorCode RECORD_NOT_EXISTS = new ErrorCode( 499, "用户积分记录不存在");
ErrorCode SIGN_IN_RECORD_NOT_EXISTS = new ErrorCode(499, "用户签到积分不存在");
}

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-point</artifactId>
<version>${revision}</version>
</parent>
<artifactId>yudao-module-point-biz</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-point-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- 业务组件 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-security</artifactId>
</dependency>
<!-- DB 相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
</dependency>
<!-- Test 测试相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-test</artifactId>
</dependency>
<!-- 工具类相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,102 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointrecord;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
import cn.iocoder.yudao.module.point.convert.pointrecord.PointRecordConvert;
import cn.iocoder.yudao.module.point.service.pointrecord.PointRecordService;
@Tag(name = "管理后台 - 用户积分记录")
@RestController
@RequestMapping("/point/record")
@Validated
public class PointRecordController {
@Resource
private PointRecordService recordService;
@PostMapping("/create")
@Operation(summary = "创建用户积分记录")
@PreAuthorize("@ss.hasPermission('point:record:create')")
public CommonResult<Long> createRecord(@Valid @RequestBody PointRecordCreateReqVO createReqVO) {
return success(recordService.createRecord(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新用户积分记录")
@PreAuthorize("@ss.hasPermission('point:record:update')")
public CommonResult<Boolean> updateRecord(@Valid @RequestBody PointRecordUpdateReqVO updateReqVO) {
recordService.updateRecord(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除用户积分记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('point:record:delete')")
public CommonResult<Boolean> deleteRecord(@RequestParam("id") Long id) {
recordService.deleteRecord(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得用户积分记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('point:record:query')")
public CommonResult<PointRecordRespVO> getRecord(@RequestParam("id") Long id) {
PointRecordDO record = recordService.getRecord(id);
return success(PointRecordConvert.INSTANCE.convert(record));
}
@GetMapping("/list")
@Operation(summary = "获得用户积分记录列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('point:record:query')")
public CommonResult<List<PointRecordRespVO>> getRecordList(@RequestParam("ids") Collection<Long> ids) {
List<PointRecordDO> list = recordService.getRecordList(ids);
return success(PointRecordConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得用户积分记录分页")
@PreAuthorize("@ss.hasPermission('point:record:query')")
public CommonResult<PageResult<PointRecordRespVO>> getRecordPage(@Valid PointRecordPageReqVO pageVO) {
PageResult<PointRecordDO> pageResult = recordService.getRecordPage(pageVO);
return success(PointRecordConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出用户积分记录 Excel")
@PreAuthorize("@ss.hasPermission('point:record:export')")
@OperateLog(type = EXPORT)
public void exportRecordExcel(@Valid PointRecordExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<PointRecordDO> list = recordService.getRecordList(exportReqVO);
// 导出 Excel
List<PointRecordExcelVO> datas = PointRecordConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "用户积分记录.xls", "数据", PointRecordExcelVO.class, datas);
}
}

View File

@ -1,65 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
/**
* 用户积分记录 Excel VO
*
* @author QingX
*/
@Data
public class PointRecordExcelVO {
@ExcelProperty("自增主键")
private Long id;
@ExcelProperty("业务编码")
private String bizId;
@ExcelProperty(value = "业务类型", converter = DictConvert.class)
@DictFormat("biz_type") // TODO 代码优化建议设置到对应的 XXXDictTypeConstants 枚举类中
private String bizType;
@ExcelProperty("1增加 0扣减")
private String type;
@ExcelProperty("积分标题")
private String title;
@ExcelProperty("积分描述")
private String description;
@ExcelProperty("积分")
private Integer point;
@ExcelProperty("变动后的积分")
private Integer totalPoint;
@ExcelProperty(value = "状态1-订单创建2-冻结期3-完成4-失效(订单退款) ", converter = DictConvert.class)
@DictFormat("point_status") // TODO 代码优化建议设置到对应的 XXXDictTypeConstants 枚举类中
private Integer status;
@ExcelProperty("用户id")
private Integer userId;
@ExcelProperty("冻结时间")
private LocalDateTime freezingTime;
@ExcelProperty("解冻时间")
private LocalDateTime thawingTime;
@ExcelProperty("发生时间")
private LocalDateTime createTime;
}

View File

@ -1,102 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.signinconfig;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
import cn.iocoder.yudao.module.point.convert.signinconfig.SignInConfigConvert;
import cn.iocoder.yudao.module.point.service.signinconfig.SignInConfigService;
@Tag(name = "管理后台 - 积分签到规则")
@RestController
@RequestMapping("/point/sign-in-config")
@Validated
public class SignInConfigController {
@Resource
private SignInConfigService signInConfigService;
@PostMapping("/create")
@Operation(summary = "创建积分签到规则")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:create')")
public CommonResult<Integer> createSignInConfig(@Valid @RequestBody SignInConfigCreateReqVO createReqVO) {
return success(signInConfigService.createSignInConfig(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新积分签到规则")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:update')")
public CommonResult<Boolean> updateSignInConfig(@Valid @RequestBody SignInConfigUpdateReqVO updateReqVO) {
signInConfigService.updateSignInConfig(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除积分签到规则")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('point:sign-in-config:delete')")
public CommonResult<Boolean> deleteSignInConfig(@RequestParam("id") Integer id) {
signInConfigService.deleteSignInConfig(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得积分签到规则")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
public CommonResult<SignInConfigRespVO> getSignInConfig(@RequestParam("id") Integer id) {
SignInConfigDO signInConfig = signInConfigService.getSignInConfig(id);
return success(SignInConfigConvert.INSTANCE.convert(signInConfig));
}
@GetMapping("/list")
@Operation(summary = "获得积分签到规则列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
public CommonResult<List<SignInConfigRespVO>> getSignInConfigList(@RequestParam("ids") Collection<Integer> ids) {
List<SignInConfigDO> list = signInConfigService.getSignInConfigList(ids);
return success(SignInConfigConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得积分签到规则分页")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
public CommonResult<PageResult<SignInConfigRespVO>> getSignInConfigPage(@Valid SignInConfigPageReqVO pageVO) {
PageResult<SignInConfigDO> pageResult = signInConfigService.getSignInConfigPage(pageVO);
return success(SignInConfigConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出积分签到规则 Excel")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:export')")
@OperateLog(type = EXPORT)
public void exportSignInConfigExcel(@Valid SignInConfigExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<SignInConfigDO> list = signInConfigService.getSignInConfigList(exportReqVO);
// 导出 Excel
List<SignInConfigExcelVO> datas = SignInConfigConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "积分签到规则.xls", "数据", SignInConfigExcelVO.class, datas);
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 积分签到规则 Excel VO
*
* @author QingX
*/
@Data
public class SignInConfigExcelVO {
@ExcelProperty("签到第x天")
private Integer day;
@ExcelProperty("签到天数对应分数")
private Integer point;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -1,15 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
@Schema(description = "管理后台 - 积分签到规则 Excel 导出 Request VO参数和 SignInConfigPageReqVO 是一致的")
@Data
public class SignInConfigExportReqVO {
@Schema(description = "签到第x天", example = "7")
private Integer day;
}

View File

@ -1,102 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.signinrecord;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO;
import cn.iocoder.yudao.module.point.convert.signinrecord.SignInRecordConvert;
import cn.iocoder.yudao.module.point.service.signinrecord.SignInRecordService;
@Tag(name = "管理后台 - 用户签到积分")
@RestController
@RequestMapping("/point/sign-in-record")
@Validated
public class SignInRecordController {
@Resource
private SignInRecordService signInRecordService;
@PostMapping("/create")
@Operation(summary = "创建用户签到积分")
@PreAuthorize("@ss.hasPermission('point:sign-in-record:create')")
public CommonResult<Long> createSignInRecord(@Valid @RequestBody SignInRecordCreateReqVO createReqVO) {
return success(signInRecordService.createSignInRecord(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新用户签到积分")
@PreAuthorize("@ss.hasPermission('point:sign-in-record:update')")
public CommonResult<Boolean> updateSignInRecord(@Valid @RequestBody SignInRecordUpdateReqVO updateReqVO) {
signInRecordService.updateSignInRecord(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除用户签到积分")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('point:sign-in-record:delete')")
public CommonResult<Boolean> deleteSignInRecord(@RequestParam("id") Long id) {
signInRecordService.deleteSignInRecord(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得用户签到积分")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('point:sign-in-record:query')")
public CommonResult<SignInRecordRespVO> getSignInRecord(@RequestParam("id") Long id) {
SignInRecordDO signInRecord = signInRecordService.getSignInRecord(id);
return success(SignInRecordConvert.INSTANCE.convert(signInRecord));
}
@GetMapping("/list")
@Operation(summary = "获得用户签到积分列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('point:sign-in-record:query')")
public CommonResult<List<SignInRecordRespVO>> getSignInRecordList(@RequestParam("ids") Collection<Long> ids) {
List<SignInRecordDO> list = signInRecordService.getSignInRecordList(ids);
return success(SignInRecordConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得用户签到积分分页")
@PreAuthorize("@ss.hasPermission('point:sign-in-record:query')")
public CommonResult<PageResult<SignInRecordRespVO>> getSignInRecordPage(@Valid SignInRecordPageReqVO pageVO) {
PageResult<SignInRecordDO> pageResult = signInRecordService.getSignInRecordPage(pageVO);
return success(SignInRecordConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出用户签到积分 Excel")
@PreAuthorize("@ss.hasPermission('point:sign-in-record:export')")
@OperateLog(type = EXPORT)
public void exportSignInRecordExcel(@Valid SignInRecordExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<SignInRecordDO> list = signInRecordService.getSignInRecordList(exportReqVO);
// 导出 Excel
List<SignInRecordExcelVO> datas = SignInRecordConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "用户签到积分.xls", "数据", SignInRecordExcelVO.class, datas);
}
}

View File

@ -1,14 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 用户签到积分创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInRecordCreateReqVO extends SignInRecordBaseVO {
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 用户签到积分 Excel VO
*
* @author 芋道源码
*/
@Data
public class SignInRecordExcelVO {
@ExcelProperty("签到自增id")
private Long id;
@ExcelProperty("签到用户")
private Integer userId;
@ExcelProperty("第几天签到")
private Integer day;
@ExcelProperty("签到的分数")
private Integer point;
@ExcelProperty("签到时间")
private LocalDateTime createTime;
}

View File

@ -1,26 +0,0 @@
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 用户签到积分 Excel 导出 Request VO参数和 SignInRecordPageReqVO 是一致的")
@Data
public class SignInRecordExportReqVO {
@Schema(description = "签到用户", example = "6507")
private Integer userId;
@Schema(description = "第几天签到")
private Integer day;
@Schema(description = "签到时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.point.convert.pointrecord;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
/**
* 用户积分记录 Convert
*
* @author QingX
*/
@Mapper
public interface PointRecordConvert {
PointRecordConvert INSTANCE = Mappers.getMapper(PointRecordConvert.class);
PointRecordDO convert(PointRecordCreateReqVO bean);
PointRecordDO convert(PointRecordUpdateReqVO bean);
PointRecordRespVO convert(PointRecordDO bean);
List<PointRecordRespVO> convertList(List<PointRecordDO> list);
PageResult<PointRecordRespVO> convertPage(PageResult<PointRecordDO> page);
List<PointRecordExcelVO> convertList02(List<PointRecordDO> list);
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.point.convert.signinconfig;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
/**
* 积分签到规则 Convert
*
* @author QingX
*/
@Mapper
public interface SignInConfigConvert {
SignInConfigConvert INSTANCE = Mappers.getMapper(SignInConfigConvert.class);
SignInConfigDO convert(SignInConfigCreateReqVO bean);
SignInConfigDO convert(SignInConfigUpdateReqVO bean);
SignInConfigRespVO convert(SignInConfigDO bean);
List<SignInConfigRespVO> convertList(List<SignInConfigDO> list);
PageResult<SignInConfigRespVO> convertPage(PageResult<SignInConfigDO> page);
List<SignInConfigExcelVO> convertList02(List<SignInConfigDO> list);
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.point.convert.signinrecord;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO;
/**
* 用户签到积分 Convert
*
* @author 芋道源码
*/
@Mapper
public interface SignInRecordConvert {
SignInRecordConvert INSTANCE = Mappers.getMapper(SignInRecordConvert.class);
SignInRecordDO convert(SignInRecordCreateReqVO bean);
SignInRecordDO convert(SignInRecordUpdateReqVO bean);
SignInRecordRespVO convert(SignInRecordDO bean);
List<SignInRecordRespVO> convertList(List<SignInRecordDO> list);
PageResult<SignInRecordRespVO> convertPage(PageResult<SignInRecordDO> page);
List<SignInRecordExcelVO> convertList02(List<SignInRecordDO> list);
}

View File

@ -1,40 +0,0 @@
package cn.iocoder.yudao.module.point.dal.mysql.pointrecord;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
/**
* 用户积分记录 Mapper
*
* @author QingX
*/
@Mapper
public interface PointRecordMapper extends BaseMapperX<PointRecordDO> {
default PageResult<PointRecordDO> selectPage(PointRecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PointRecordDO>()
.eqIfPresent(PointRecordDO::getBizId, reqVO.getBizId())
.eqIfPresent(PointRecordDO::getBizType, reqVO.getBizType())
.eqIfPresent(PointRecordDO::getType, reqVO.getType())
.eqIfPresent(PointRecordDO::getTitle, reqVO.getTitle())
.eqIfPresent(PointRecordDO::getStatus, reqVO.getStatus())
.orderByDesc(PointRecordDO::getId));
}
default List<PointRecordDO> selectList(PointRecordExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PointRecordDO>()
.eqIfPresent(PointRecordDO::getBizId, reqVO.getBizId())
.eqIfPresent(PointRecordDO::getBizType, reqVO.getBizType())
.eqIfPresent(PointRecordDO::getType, reqVO.getType())
.eqIfPresent(PointRecordDO::getTitle, reqVO.getTitle())
.eqIfPresent(PointRecordDO::getStatus, reqVO.getStatus())
.orderByDesc(PointRecordDO::getId));
}
}

View File

@ -1,41 +0,0 @@
package cn.iocoder.yudao.module.point.dal.mysql.signinconfig;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
/**
* 积分签到规则 Mapper
*
* @author QingX
*/
@Mapper
public interface SignInConfigMapper extends BaseMapperX<SignInConfigDO> {
default PageResult<SignInConfigDO> selectPage(SignInConfigPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SignInConfigDO>()
.eqIfPresent(SignInConfigDO::getDay, reqVO.getDay())
.orderByAsc(SignInConfigDO::getDay));
}
default List<SignInConfigDO> selectList(SignInConfigExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<SignInConfigDO>()
.eqIfPresent(SignInConfigDO::getDay, reqVO.getDay())
.orderByDesc(SignInConfigDO::getId));
}
//
default long selectSameDayNotSelf(SignInConfigUpdateReqVO reqVO){
return selectCount(new LambdaQueryWrapperX <SignInConfigDO>()
.ne(SignInConfigDO::getId, reqVO.getId())
.eq(SignInConfigDO::getDay,reqVO.getDay())
);
}
}

View File

@ -1,36 +0,0 @@
package cn.iocoder.yudao.module.point.dal.mysql.signinrecord;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*;
/**
* 用户签到积分 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface SignInRecordMapper extends BaseMapperX<SignInRecordDO> {
default PageResult<SignInRecordDO> selectPage(SignInRecordPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SignInRecordDO>()
.eqIfPresent(SignInRecordDO::getUserId, reqVO.getUserId())
.eqIfPresent(SignInRecordDO::getDay, reqVO.getDay())
.betweenIfPresent(SignInRecordDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(SignInRecordDO::getId));
}
default List<SignInRecordDO> selectList(SignInRecordExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<SignInRecordDO>()
.eqIfPresent(SignInRecordDO::getUserId, reqVO.getUserId())
.eqIfPresent(SignInRecordDO::getDay, reqVO.getDay())
.betweenIfPresent(SignInRecordDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(SignInRecordDO::getId));
}
}

View File

@ -1,70 +0,0 @@
package cn.iocoder.yudao.module.point.service.pointrecord;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 用户积分记录 Service 接口
*
* @author QingX
*/
public interface PointRecordService {
/**
* 创建用户积分记录
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createRecord(@Valid PointRecordCreateReqVO createReqVO);
/**
* 更新用户积分记录
*
* @param updateReqVO 更新信息
*/
void updateRecord(@Valid PointRecordUpdateReqVO updateReqVO);
/**
* 删除用户积分记录
*
* @param id 编号
*/
void deleteRecord(Long id);
/**
* 获得用户积分记录
*
* @param id 编号
* @return 用户积分记录
*/
PointRecordDO getRecord(Long id);
/**
* 获得用户积分记录列表
*
* @param ids 编号
* @return 用户积分记录列表
*/
List<PointRecordDO> getRecordList(Collection<Long> ids);
/**
* 获得用户积分记录分页
*
* @param pageReqVO 分页查询
* @return 用户积分记录分页
*/
PageResult<PointRecordDO> getRecordPage(PointRecordPageReqVO pageReqVO);
/**
* 获得用户积分记录列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 用户积分记录列表
*/
List<PointRecordDO> getRecordList(PointRecordExportReqVO exportReqVO);
}

View File

@ -1,82 +0,0 @@
package cn.iocoder.yudao.module.point.service.pointrecord;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.point.convert.pointrecord.PointRecordConvert;
import cn.iocoder.yudao.module.point.dal.mysql.pointrecord.PointRecordMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*;
/**
* 用户积分记录 Service 实现类
*
* @author QingX
*/
@Service
@Validated
public class PointRecordServiceImpl implements PointRecordService {
@Resource
private PointRecordMapper recordMapper;
@Override
public Long createRecord(PointRecordCreateReqVO createReqVO) {
// 插入
PointRecordDO record = PointRecordConvert.INSTANCE.convert(createReqVO);
recordMapper.insert(record);
// 返回
return record.getId();
}
@Override
public void updateRecord(PointRecordUpdateReqVO updateReqVO) {
// 校验存在
validateRecordExists(updateReqVO.getId());
// 更新
PointRecordDO updateObj = PointRecordConvert.INSTANCE.convert(updateReqVO);
recordMapper.updateById(updateObj);
}
@Override
public void deleteRecord(Long id) {
// 校验存在
validateRecordExists(id);
// 删除
recordMapper.deleteById(id);
}
private void validateRecordExists(Long id) {
if (recordMapper.selectById(id) == null) {
throw exception(RECORD_NOT_EXISTS);
}
}
@Override
public PointRecordDO getRecord(Long id) {
return recordMapper.selectById(id);
}
@Override
public List<PointRecordDO> getRecordList(Collection<Long> ids) {
return recordMapper.selectBatchIds(ids);
}
@Override
public PageResult<PointRecordDO> getRecordPage(PointRecordPageReqVO pageReqVO) {
return recordMapper.selectPage(pageReqVO);
}
@Override
public List<PointRecordDO> getRecordList(PointRecordExportReqVO exportReqVO) {
return recordMapper.selectList(exportReqVO);
}
}

View File

@ -1,70 +0,0 @@
package cn.iocoder.yudao.module.point.service.signinconfig;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 积分签到规则 Service 接口
*
* @author QingX
*/
public interface SignInConfigService {
/**
* 创建积分签到规则
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createSignInConfig(@Valid SignInConfigCreateReqVO createReqVO);
/**
* 更新积分签到规则
*
* @param updateReqVO 更新信息
*/
void updateSignInConfig(@Valid SignInConfigUpdateReqVO updateReqVO);
/**
* 删除积分签到规则
*
* @param id 编号
*/
void deleteSignInConfig(Integer id);
/**
* 获得积分签到规则
*
* @param id 编号
* @return 积分签到规则
*/
SignInConfigDO getSignInConfig(Integer id);
/**
* 获得积分签到规则列表
*
* @param ids 编号
* @return 积分签到规则列表
*/
List<SignInConfigDO> getSignInConfigList(Collection<Integer> ids);
/**
* 获得积分签到规则分页
*
* @param pageReqVO 分页查询
* @return 积分签到规则分页
*/
PageResult<SignInConfigDO> getSignInConfigPage(SignInConfigPageReqVO pageReqVO);
/**
* 获得积分签到规则列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 积分签到规则列表
*/
List<SignInConfigDO> getSignInConfigList(SignInConfigExportReqVO exportReqVO);
}

View File

@ -1,102 +0,0 @@
package cn.iocoder.yudao.module.point.service.signinconfig;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.point.convert.signinconfig.SignInConfigConvert;
import cn.iocoder.yudao.module.point.dal.mysql.signinconfig.SignInConfigMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*;
/**
* 积分签到规则 Service 实现类
*
* @author QingX
*/
@Service
@Validated
public class SignInConfigServiceImpl implements SignInConfigService {
@Resource
private SignInConfigMapper signInConfigMapper;
@Override
public Integer createSignInConfig(SignInConfigCreateReqVO createReqVO) {
// 插入
SignInConfigDO signInConfig = SignInConfigConvert.INSTANCE.convert(createReqVO);
//判断是否重复插入签到天数
validateSignInConfigExistsDay(signInConfig.getDay());
signInConfigMapper.insert(signInConfig);
// 返回
return signInConfig.getId();
}
@Override
public void updateSignInConfig(SignInConfigUpdateReqVO updateReqVO) {
// 校验存在
validateSignInConfigExists(updateReqVO.getId());
//判断是否重复插入签到天数
validateSignInConfigSameDayNotSelf(updateReqVO);
// 判断更新的
SignInConfigDO updateObj = SignInConfigConvert.INSTANCE.convert(updateReqVO);
signInConfigMapper.updateById(updateObj);
}
@Override
public void deleteSignInConfig(Integer id) {
// 校验存在
validateSignInConfigExists(id);
// 删除
signInConfigMapper.deleteById(id);
}
private void validateSignInConfigExists(Integer id) {
if (signInConfigMapper.selectById(id) == null) {
throw exception(SIGN_IN_CONFIG_NOT_EXISTS);
}
}
//根据签到天数判断是否存在一个相同的天数
private void validateSignInConfigExistsDay(Integer day) {
if (signInConfigMapper.selectCount(SignInConfigDO::getDay,day)>0) {
throw exception(SIGN_IN_CONFIG_EXISTS);
}
}
//更新天数时判断是否有重复的天数需要去除自己
private void validateSignInConfigSameDayNotSelf(SignInConfigUpdateReqVO reqVO) {
if (signInConfigMapper.selectSameDayNotSelf(reqVO)>0) {
throw exception(SIGN_IN_CONFIG_EXISTS);
}
}
@Override
public SignInConfigDO getSignInConfig(Integer id) {
return signInConfigMapper.selectById(id);
}
@Override
public List<SignInConfigDO> getSignInConfigList(Collection<Integer> ids) {
return signInConfigMapper.selectBatchIds(ids);
}
@Override
public PageResult<SignInConfigDO> getSignInConfigPage(SignInConfigPageReqVO pageReqVO) {
return signInConfigMapper.selectPage(pageReqVO);
}
@Override
public List<SignInConfigDO> getSignInConfigList(SignInConfigExportReqVO exportReqVO) {
return signInConfigMapper.selectList(exportReqVO);
}
}

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