From 494928ed888a3bbbc14e720b76528a6cb60da3d7 Mon Sep 17 00:00:00 2001 From: wfm Date: Fri, 12 May 2023 17:23:21 +0800 Subject: [PATCH 01/42] =?UTF-8?q?feat:=E9=87=8D=E6=94=BE=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mq/job/RedisPendingMessageResendJob.java | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java index f4ba050c0..ad0ae833d 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java @@ -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 之后的消费者未消费完的消息 @@ -33,6 +30,8 @@ public class RedisPendingMessageResendJob { private final String groupName; private final RedissonClient redissonClient; + private final long expireTime = 1000 * 60; + /** * 一分钟执行一次,这里选择每分钟的35秒执行,是为了避免整点任务过多的问题 */ @@ -54,25 +53,28 @@ public class RedisPendingMessageResendJob { private void execute() { StreamOperations 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 pendingMessagesPerConsumer = pendingMessagesSummary.getPendingMessagesPerConsumer(); pendingMessagesPerConsumer.forEach((consumerName, pendingMessageCount) -> { log.info("[processPendingMessage][消费者({}) 消息数量({})]", consumerName, pendingMessageCount); - // 从消费者的 pending 队列中读取消息 - List> records = ops.read(Consumer.from(groupName, consumerName), StreamOffset.create(listener.getStreamKey(), ReadOffset.from("0"))); - if (CollUtil.isEmpty(records)) { + PendingMessages pendingMessages = ops.pending(listener.getStreamKey(), Consumer.from(groupName, consumerName), Range.unbounded(), pendingMessageCount); + if(pendingMessages.isEmpty()){ return; } - for (MapRecord record : records) { - // 重新投递消息 - redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord() - .ofObject(record.getValue()) // 设置内容 - .withStreamKey(listener.getStreamKey())); - - // ack 消息消费完成 - redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, record); + for (PendingMessage pendingMessage : pendingMessages) { + if(pendingMessage.getElapsedTimeSinceLastDelivery().toMillis() - expireTime >= 0){ + List> records = ops.range(listener.getStreamKey(), Range.of(Range.Bound.inclusive(pendingMessage.getIdAsString()), Range.Bound.inclusive(pendingMessage.getIdAsString()))); + if(!CollUtil.isEmpty(records)){ + // 重新投递消息 + redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord() + .ofObject(records.get(0).getValue()) // 设置内容 + .withStreamKey(listener.getStreamKey())); + // ack 消息消费完成 + redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, records.get(0)); + } + } } }); }); From 86be0bdf800209ea79086145b0e26be2bac03bf0 Mon Sep 17 00:00:00 2001 From: wfm Date: Tue, 16 May 2023 09:58:58 +0800 Subject: [PATCH 02/42] fix PR --- .../mq/job/RedisPendingMessageResendJob.java | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java index ad0ae833d..4a0fbdfb2 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java @@ -29,8 +29,13 @@ public class RedisPendingMessageResendJob { private final RedisMQTemplate redisTemplate; private final String groupName; private final RedissonClient redissonClient; - - private final long expireTime = 1000 * 60; + /** + * 消息超时时间,默认5分钟 + *

超时的消息才会被重新投递

+ *

由于定时任务1分钟一次,消息超时后不会被立即重投, + * 极端情况下消息5分钟过期后,再等1分钟才会被扫瞄到

+ */ + private final long expireTime = 5 * 60; /** * 一分钟执行一次,这里选择每分钟的35秒执行,是为了避免整点任务过多的问题 @@ -58,23 +63,28 @@ public class RedisPendingMessageResendJob { Map pendingMessagesPerConsumer = pendingMessagesSummary.getPendingMessagesPerConsumer(); pendingMessagesPerConsumer.forEach((consumerName, pendingMessageCount) -> { log.info("[processPendingMessage][消费者({}) 消息数量({})]", consumerName, pendingMessageCount); - + // 每个消费者的 pending消息的详情信息 PendingMessages pendingMessages = ops.pending(listener.getStreamKey(), Consumer.from(groupName, consumerName), Range.unbounded(), pendingMessageCount); if(pendingMessages.isEmpty()){ return; } for (PendingMessage pendingMessage : pendingMessages) { - if(pendingMessage.getElapsedTimeSinceLastDelivery().toMillis() - expireTime >= 0){ - List> records = ops.range(listener.getStreamKey(), Range.of(Range.Bound.inclusive(pendingMessage.getIdAsString()), Range.Bound.inclusive(pendingMessage.getIdAsString()))); - if(!CollUtil.isEmpty(records)){ - // 重新投递消息 - redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord() - .ofObject(records.get(0).getValue()) // 设置内容 - .withStreamKey(listener.getStreamKey())); - // ack 消息消费完成 - redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, records.get(0)); - } + // 获取消息上一次传递到 consumer 的时间, + long lastDelivery = pendingMessage.getElapsedTimeSinceLastDelivery().getSeconds(); + if(lastDelivery < expireTime){ + continue; } + // 获取指定id的消息体 + List> records = ops.range(listener.getStreamKey(), Range.of(Range.Bound.inclusive(pendingMessage.getIdAsString()), Range.Bound.inclusive(pendingMessage.getIdAsString()))); + if(CollUtil.isEmpty(records)){ + continue; + } + // 重新投递消息 + redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord() + .ofObject(records.get(0).getValue()) // 设置内容 + .withStreamKey(listener.getStreamKey())); + // ack 消息消费完成 + redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, records.get(0)); } }); }); From 4faf61a4750997bff2a08e8dd135de377d99c3d2 Mon Sep 17 00:00:00 2001 From: wfm Date: Tue, 16 May 2023 10:22:46 +0800 Subject: [PATCH 03/42] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/framework/mq/job/RedisPendingMessageResendJob.java | 1 + 1 file changed, 1 insertion(+) diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java index 4a0fbdfb2..689fd2931 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java @@ -85,6 +85,7 @@ public class RedisPendingMessageResendJob { .withStreamKey(listener.getStreamKey())); // ack 消息消费完成 redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, records.get(0)); + log.info("[processPendingMessage][消息({})重新投递成功]", records.get(0).getId()); } }); }); From 87670265b2a0e7c22014d5ac29643594f8e31ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E7=A0=81=E6=BB=B4=E6=B1=89=E5=AD=90?= <1024@cong.zone> Date: Sun, 4 Jun 2023 15:15:19 +0000 Subject: [PATCH 04/42] =?UTF-8?q?update=20sql/postgresql/ruoyi-vue-pro.sql?= =?UTF-8?q?.=20read=5Fstatus=20=E7=B1=BB=E5=9E=8B=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BAbool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 御码滴汉子 <1024@cong.zone> --- sql/postgresql/ruoyi-vue-pro.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index c9cafc642..bcd39c8d8 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -4239,7 +4239,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, "read_time" timestamp(6), "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, From 9af0aa5f7d4e809d23b74a7ee4a44257841e598f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E7=A0=81=E6=BB=B4=E6=B1=89=E5=AD=90?= <1024@cong.zone> Date: Sun, 4 Jun 2023 15:51:19 +0000 Subject: [PATCH 05/42] =?UTF-8?q?pg=E6=95=B0=E6=8D=AE=E5=BA=93=E8=84=9A?= =?UTF-8?q?=E6=9C=ACsystem=5Fmenu=E8=A1=A8always=5Fshow=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=BC=96=E8=BE=91=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 御码滴汉子 <1024@cong.zone> --- sql/postgresql/ruoyi-vue-pro.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index bcd39c8d8..9a3ae8f60 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -2607,7 +2607,7 @@ CREATE TABLE "system_menu" ( "update_time" timestamp(6) NOT NULL, "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 NULL ) ; COMMENT ON COLUMN "system_menu"."id" IS '菜单ID'; From 87d4f9b71abfc2eeefe0c598b14541761b4c6ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E7=A0=81=E6=BB=B4=E6=B1=89=E5=AD=90?= <1024@cong.zone> Date: Sun, 4 Jun 2023 15:57:02 +0000 Subject: [PATCH 06/42] =?UTF-8?q?=E5=B0=86=E8=8F=9C=E5=8D=95=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=9F=AD=E4=BF=A1=E9=A2=84=E7=BD=AE=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E6=9B=B4=E6=94=B9=E4=B8=BA=E6=9C=80=E6=96=B0=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 御码滴汉子 <1024@cong.zone> --- sql/postgresql/ruoyi-vue-pro.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index 9a3ae8f60..3160f2021 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -2738,19 +2738,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'); From 3e350151bcc567d2e245b0874ce9f2e34a819081 Mon Sep 17 00:00:00 2001 From: shizhong <124974919@qq.com> Date: Mon, 5 Jun 2023 14:03:06 +0800 Subject: [PATCH 07/42] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20Set=20access=20token?= =?UTF-8?q?=20expire=20time=20to=200=20=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java index 517b0aa11..d57beb881 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java @@ -37,7 +37,9 @@ public class OAuth2AccessTokenRedisDAO { // 清理多余字段,避免缓存 accessTokenDO.setUpdater(null).setUpdateTime(null).setCreateTime(null).setCreator(null).setDeleted(null); long time = LocalDateTimeUtil.between(LocalDateTime.now(), accessTokenDO.getExpiresTime(), ChronoUnit.SECONDS); - stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(accessTokenDO), time, TimeUnit.SECONDS); + if (time > 0) { + stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(accessTokenDO), time, TimeUnit.SECONDS); + } } public void delete(String accessToken) { From 6ca09af97eec54f3fffd5bbe494bced96940e7bd Mon Sep 17 00:00:00 2001 From: shizhong <124974919@qq.com> Date: Mon, 5 Jun 2023 14:09:49 +0800 Subject: [PATCH 08/42] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E5=8F=91=E9=80=81=E7=94=A8=E6=88=B7=E7=BC=96=E5=8F=B7=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/admin/mail/MailTemplateController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java index 87b338815..a2037d8c5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java @@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.system.controller.admin.mail; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; @@ -81,7 +83,8 @@ public class MailTemplateController { @Operation(summary = "发送短信") @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") public CommonResult sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { - return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), null, + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), loginUser != null ? loginUser.getId() : null, sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); } From 143bff909a5dc642201a95e9bf46588fc036f60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B5=E5=91=B5=E5=A4=A7?= <2222671+geekrim@user.noreply.gitee.com> Date: Sat, 10 Jun 2023 03:57:47 +0000 Subject: [PATCH 09/42] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8PG?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=97=B6,=E7=AB=99=E5=86=85?= =?UTF-8?q?=E4=BF=A1=E8=A1=A8=E3=80=81=E8=8F=9C=E5=8D=95=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=A1=A8=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E9=97=AE=E9=A2=98=20=E5=9C=A8`NotifyMessageDO`?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=E4=B8=AD`read=5Fstatus`=E6=98=AF?= =?UTF-8?q?=E5=B8=83=E5=B0=94=E7=B1=BB=E5=9E=8B=EF=BC=8C=E5=9B=A0=E6=AD=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E4=B8=AD=E4=B9=9F=E8=A6=81=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E4=B8=BA=20`bool`=20=E7=B1=BB=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E5=90=A6=E5=88=99=E6=9F=A5=E8=AF=A2=E6=8A=A5=E9=94=99=E3=80=82?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=9D=83=E9=99=90=E8=A1=A8`system=5Fmenu`?= =?UTF-8?q?=E8=A1=A8=E5=90=8C=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/postgresql/ruoyi-vue-pro.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index c9cafc642..d66d6fcb5 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -2607,7 +2607,7 @@ CREATE TABLE "system_menu" ( "update_time" timestamp(6) NOT NULL, "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'; @@ -4239,7 +4239,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, From 70b48ca232cd36e55b8d7179e7120ac78c041758 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Mon, 12 Jun 2023 08:32:26 +0000 Subject: [PATCH 10/42] =?UTF-8?q?=E4=BD=BF=E7=94=A8docker=20compose=20-T?= =?UTF-8?q?=E6=9D=A5=E6=89=A7=E8=A1=8C=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dhb52 --- Docker-HOWTO.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Docker-HOWTO.md b/Docker-HOWTO.md index 87b4a4a02..404f5fa4d 100644 --- a/Docker-HOWTO.md +++ b/Docker-HOWTO.md @@ -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 From df6d63068d9671903908920cc7ffd4d3089ce29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Syriana=E9=92=9F=E4=BA=A8?= <4916681+sairupe@user.noreply.gitee.com> Date: Tue, 13 Jun 2023 08:36:20 +0000 Subject: [PATCH 11/42] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E7=AC=AC1?= =?UTF-8?q?=E7=82=B9=E6=8F=8F=E8=BF=B0=E9=94=99=E8=AF=AF=EF=BC=8C=20?= =?UTF-8?q?=E3=80=90=E7=94=A8=E6=88=B7=E7=9C=8B=E5=88=B0=20=E3=80=91?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20=E3=80=90=E7=94=A8=E6=88=B7=E7=9C=8B?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Syriana钟亨 <4916681+sairupe@user.noreply.gitee.com> --- .../datapermission/core/rule/dept/DeptDataPermissionRule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java index ae73963c4..41f03fbe6 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java @@ -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 = ? From ae8397422a0f194c3516670980aa08d69976c7d2 Mon Sep 17 00:00:00 2001 From: Zhe Date: Wed, 14 Jun 2023 16:16:56 +0800 Subject: [PATCH 12/42] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPG=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E9=83=A8=E5=88=86=E5=AD=97=E5=85=B8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=EF=BC=9B=E4=BF=AE=E5=A4=8D=E5=9B=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=97=A0=E9=BB=98=E8=AE=A4=E5=80=BC=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=BF=90=E8=A1=8C=E7=94=9F=E6=88=90SQL?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/postgresql/ruoyi-vue-pro.sql | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index c9cafc642..a88550144 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -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,12 +2604,12 @@ 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" From 4953d5ec62ed5b82c1453497c1a615d1f9ded869 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 14 Jun 2023 16:24:10 +0800 Subject: [PATCH 13/42] fix: vben codegen radio type --- .../src/main/resources/codegen/vue3_vben/views/data.ts.vm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm index 0724d5c57..6f0c01d80 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm @@ -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') From cd33f68e2badbf3149577f8a4317a55bec2fea26 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 14 Jun 2023 16:50:46 +0800 Subject: [PATCH 14/42] chore: up springboot 2.10.12 --- README.md | 2 +- pom.xml | 2 +- yudao-dependencies/pom.xml | 2 +- yudao-example/yudao-sso-demo-by-code/pom.xml | 2 +- .../yudao-sso-demo-by-password/pom.xml | 2 +- yudao-server/pom.xml | 2 +- .../src/main/resources/application-local.yaml | 22 +++++++++---------- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4feb387d2..e2eb27acd 100644 --- a/README.md +++ b/README.md @@ -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) | diff --git a/pom.xml b/pom.xml index dcaa35c12..4f1350a10 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 3.8.1 1.18.26 - 2.7.11 + 2.7.12 1.5.5.Final UTF-8 diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index b34b01f63..46020dc58 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -16,7 +16,7 @@ 1.7.3-snapshot - 2.7.11 + 2.7.12 1.6.15 4.1.0 diff --git a/yudao-example/yudao-sso-demo-by-code/pom.xml b/yudao-example/yudao-sso-demo-by-code/pom.xml index e49b573a2..d3f745dba 100644 --- a/yudao-example/yudao-sso-demo-by-code/pom.xml +++ b/yudao-example/yudao-sso-demo-by-code/pom.xml @@ -21,7 +21,7 @@ 8 UTF-8 - 2.7.11 + 2.7.12 diff --git a/yudao-example/yudao-sso-demo-by-password/pom.xml b/yudao-example/yudao-sso-demo-by-password/pom.xml index 556d2b6c3..d6e73916d 100644 --- a/yudao-example/yudao-sso-demo-by-password/pom.xml +++ b/yudao-example/yudao-sso-demo-by-password/pom.xml @@ -21,7 +21,7 @@ 8 UTF-8 - 2.7.11 + 2.7.12 diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 143642226..fdfa88415 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -111,7 +111,7 @@ org.springframework.boot spring-boot-maven-plugin - 2.7.11 + 2.7.12 true diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index cdc1d3fde..a06bcdd6c 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -44,34 +44,34 @@ spring: primary: master datasource: master: - name: ruoyi-vue-pro - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + name: ruoyi-vue-pro-dev + url: jdbc:mysql://192.168.0.11:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例 - username: root - password: 123456 + username: dev + password: Dev@sd123 # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W slave: # 模拟从库,可根据自己需要修改 - name: ruoyi-vue-pro - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + name: ruoyi-vue-pro-dev + url: jdbc:mysql://192.168.0.11:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例 - username: root - password: 123456 + username: dev + password: Dev@sd123 # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 redis: - host: 127.0.0.1 # 地址 + host: 192.168.0.11 # 地址 port: 6379 # 端口 - database: 0 # 数据库索引 -# password: dev # 密码,建议生产环境开启 + database: 9 # 数据库索引 +# password: MyNewPass@123 # 密码,建议生产环境开启 --- #################### 定时任务相关配置 #################### From 66f09ed54bc4d53071d6b1d7ca3d6d292c216110 Mon Sep 17 00:00:00 2001 From: sunyuqiang <1129921824@qq.com> Date: Wed, 14 Jun 2023 17:19:50 +0800 Subject: [PATCH 15/42] =?UTF-8?q?=E4=BF=AE=E5=A4=8D-=E5=85=AC=E4=BC=97?= =?UTF-8?q?=E5=8F=B7=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E2=80=9C[=E5=BE=AE=E4=BF=A1=E5=85=AC?= =?UTF-8?q?=E4=BC=97=E5=8F=B7=20yudao-module-mp=20-=20=E5=B7=B2=E7=A6=81?= =?UTF-8?q?=E7=94=A8][=E5=8F=82=E8=80=83=20https://doc.iocoder.cn/mp/build?= =?UTF-8?q?/=20=E5=BC=80=E5=90=AF]=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/mp/controller/admin/tag/MpTagController.java | 8 ++++++++ .../iocoder/yudao/module/mp/service/tag/MpTagService.java | 7 +++++++ .../yudao/module/mp/service/tag/MpTagServiceImpl.java | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java index d7237d282..7b84e59eb 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java @@ -52,6 +52,14 @@ public class MpTagController { return success(true); } + @GetMapping("/get") + @Operation(summary = "获取公众号标签详情") + @PreAuthorize("@ss.hasPermission('mp:tag:query')") + public CommonResult get(@RequestParam("id") Long id) { + MpTagDO mpTagDO = mpTagService.get(id); + return success(mpTagDO); + } + @GetMapping("/page") @Operation(summary = "获取公众号标签分页") @PreAuthorize("@ss.hasPermission('mp:tag:query')") diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java index 44dcfb0a9..77dbf338f 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java @@ -46,6 +46,13 @@ public interface MpTagService { */ PageResult getTagPage(MpTagPageReqVO pageReqVO); + /** + * 获得公众号标签详情 + * @param id id查询 + * @return 公众号标签详情 + */ + MpTagDO get(Long id); + List getTagList(); /** diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java index e3b0074d9..a4fa50923 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java @@ -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 getTagList() { return mpTagMapper.selectList(); From 296256a55a2c97510f7c719b523e806592e0a6b5 Mon Sep 17 00:00:00 2001 From: sunyuqiang <1129921824@qq.com> Date: Wed, 14 Jun 2023 17:30:15 +0800 Subject: [PATCH 16/42] =?UTF-8?q?=E4=BF=AE=E5=A4=8D-=E5=85=AC=E4=BC=97?= =?UTF-8?q?=E5=8F=B7=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E2=80=9C[=E5=BE=AE=E4=BF=A1=E5=85=AC?= =?UTF-8?q?=E4=BC=97=E5=8F=B7=20yudao-module-mp=20-=20=E5=B7=B2=E7=A6=81?= =?UTF-8?q?=E7=94=A8][=E5=8F=82=E8=80=83=20https://doc.iocoder.cn/mp/build?= =?UTF-8?q?/=20=E5=BC=80=E5=90=AF]=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/mp/controller/admin/tag/MpTagController.java | 4 ++-- .../cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java index 7b84e59eb..96af036dc 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java @@ -55,9 +55,9 @@ public class MpTagController { @GetMapping("/get") @Operation(summary = "获取公众号标签详情") @PreAuthorize("@ss.hasPermission('mp:tag:query')") - public CommonResult get(@RequestParam("id") Long id) { + public CommonResult get(@RequestParam("id") Long id) { MpTagDO mpTagDO = mpTagService.get(id); - return success(mpTagDO); + return success(MpTagConvert.INSTANCE.convert(mpTagDO)); } @GetMapping("/page") diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java index 726291fac..727ccd314 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java @@ -37,6 +37,8 @@ public interface MpTagConvert { }) MpTagDO convert(WxUserTag tag, MpAccountDO account); + MpTagRespVO convert(MpTagDO mpTagDO); + List convertList02(List list); } From 25df1e2ecd9f55e04eb71a2907f24166580e9a3e Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 14 Jun 2023 17:58:51 +0800 Subject: [PATCH 17/42] revert: config --- .../src/main/resources/application-local.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index a06bcdd6c..cdc1d3fde 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -44,34 +44,34 @@ spring: primary: master datasource: master: - name: ruoyi-vue-pro-dev - url: jdbc:mysql://192.168.0.11:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + name: ruoyi-vue-pro + url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例 - username: dev - password: Dev@sd123 + username: root + password: 123456 # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W slave: # 模拟从库,可根据自己需要修改 - name: ruoyi-vue-pro-dev - url: jdbc:mysql://192.168.0.11:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + name: ruoyi-vue-pro + url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例 - username: dev - password: Dev@sd123 + username: root + password: 123456 # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 redis: - host: 192.168.0.11 # 地址 + host: 127.0.0.1 # 地址 port: 6379 # 端口 - database: 9 # 数据库索引 -# password: MyNewPass@123 # 密码,建议生产环境开启 + database: 0 # 数据库索引 +# password: dev # 密码,建议生产环境开启 --- #################### 定时任务相关配置 #################### From b892a6d2bd21fbd54863880b557922e445202ab7 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 14 Jun 2023 18:00:14 +0800 Subject: [PATCH 18/42] feat: captcha-plus 1.0.4 --- yudao-dependencies/pom.xml | 4 ++-- .../config/YudaoCaptchaConfiguration.java | 16 ++++++++++++++-- .../core/service/RedisCaptchaServiceImpl.java | 4 ++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 46020dc58..dad575867 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -43,7 +43,7 @@ 6.8.0 - 1.0.2 + 1.0.4 1.15.4 1.18.26 1.5.5.Final @@ -67,7 +67,7 @@ 8.5.2 4.6.3 2.2.1 - 3.1.715 + 3.1.758 1.4.0 1.5.6 2.12.2 diff --git a/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java b/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java index 2a690d800..32d2b4b87 100644 --- a/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java @@ -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; } } diff --git a/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/core/service/RedisCaptchaServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/core/service/RedisCaptchaServiceImpl.java index 1429c47c2..95c9ec4af 100644 --- a/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/core/service/RedisCaptchaServiceImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/core/service/RedisCaptchaServiceImpl.java @@ -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); From 749fe9d515c321b643c66feb8bac852e282bc1a5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 17 Jun 2023 12:19:46 +0800 Subject: [PATCH 19/42] =?UTF-8?q?=E5=9B=9E=E9=80=80=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E5=88=B0=201.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-dependencies/pom.xml | 2 +- .../framework/captcha/config/YudaoCaptchaConfiguration.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index dad575867..d89daaa2a 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -43,7 +43,7 @@ 6.8.0 - 1.0.4 + 1.0.2 1.15.4 1.18.26 1.5.5.Final diff --git a/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java b/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java index 32d2b4b87..a73c82bf0 100644 --- a/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java @@ -26,9 +26,9 @@ public class YudaoCaptchaConfiguration { @Bean public CaptchaCacheService captchaCacheService(AjCaptchaProperties config) { - //缓存类型redis/local/.... + // 缓存类型 redis/local/.... CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name()); - if(ret instanceof RedisCaptchaServiceImpl){ + if (ret instanceof RedisCaptchaServiceImpl) { ((RedisCaptchaServiceImpl)ret).setStringRedisTemplate(stringRedisTemplate); } return ret; From 16dd86a8db0f44a149b8b36b2784d1b28fcd3463 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 17 Jun 2023 12:36:13 +0800 Subject: [PATCH 20/42] =?UTF-8?q?498=20=E8=A7=A3=E5=86=B3=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=20Set=20access=20token=20expire=20time=20to=200=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=E5=92=8C=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E5=8F=91=E9=80=81=E7=94=A8=E6=88=B7=E7=BC=96=E5=8F=B7=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/captcha/config/YudaoCaptchaConfiguration.java | 2 +- .../controller/admin/mail/MailTemplateController.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java b/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java index a73c82bf0..057445519 100644 --- a/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java @@ -29,7 +29,7 @@ public class YudaoCaptchaConfiguration { // 缓存类型 redis/local/.... CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name()); if (ret instanceof RedisCaptchaServiceImpl) { - ((RedisCaptchaServiceImpl)ret).setStringRedisTemplate(stringRedisTemplate); + ((RedisCaptchaServiceImpl) ret).setStringRedisTemplate(stringRedisTemplate); } return ret; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java index a2037d8c5..d41732278 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java @@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.system.controller.admin.mail; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.security.core.LoginUser; -import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; @@ -20,6 +18,7 @@ import javax.validation.Valid; import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; @Tag(name = "管理后台 - 邮件模版") @RestController @@ -83,8 +82,7 @@ public class MailTemplateController { @Operation(summary = "发送短信") @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") public CommonResult sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { - LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); - return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), loginUser != null ? loginUser.getId() : null, + return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), getLoginUserId(), sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); } From ecfe0b864b19671c15a384c3085e095e563cb874 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 17 Jun 2023 12:41:56 +0800 Subject: [PATCH 21/42] =?UTF-8?q?=E4=BC=98=E5=8C=96=20RedisPendingMessageR?= =?UTF-8?q?esendJob=20=E4=BB=A3=E7=A0=81=E6=8E=92=E7=89=88=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mq/job/RedisPendingMessageResendJob.java | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java index 689fd2931..ea0f53d19 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java @@ -25,17 +25,18 @@ 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> listeners; private final RedisMQTemplate redisTemplate; private final String groupName; private final RedissonClient redissonClient; - /** - * 消息超时时间,默认5分钟 - *

超时的消息才会被重新投递

- *

由于定时任务1分钟一次,消息超时后不会被立即重投, - * 极端情况下消息5分钟过期后,再等1分钟才会被扫瞄到

- */ - private final long expireTime = 5 * 60; /** * 一分钟执行一次,这里选择每分钟的35秒执行,是为了避免整点任务过多的问题 @@ -55,6 +56,11 @@ public class RedisPendingMessageResendJob { } } + /** + * 执行清理逻辑 + * + * @see 讨论 + */ private void execute() { StreamOperations ops = redisTemplate.getRedisTemplate().opsForStream(); listeners.forEach(listener -> { @@ -65,28 +71,29 @@ public class RedisPendingMessageResendJob { log.info("[processPendingMessage][消费者({}) 消息数量({})]", consumerName, pendingMessageCount); // 每个消费者的 pending消息的详情信息 PendingMessages pendingMessages = ops.pending(listener.getStreamKey(), Consumer.from(groupName, consumerName), Range.unbounded(), pendingMessageCount); - if(pendingMessages.isEmpty()){ + if (pendingMessages.isEmpty()) { return; } - for (PendingMessage pendingMessage : pendingMessages) { + pendingMessages.forEach(pendingMessage -> { // 获取消息上一次传递到 consumer 的时间, long lastDelivery = pendingMessage.getElapsedTimeSinceLastDelivery().getSeconds(); - if(lastDelivery < expireTime){ - continue; + if (lastDelivery < EXPIRE_TIME){ + return; } - // 获取指定id的消息体 - List> records = ops.range(listener.getStreamKey(), Range.of(Range.Bound.inclusive(pendingMessage.getIdAsString()), Range.Bound.inclusive(pendingMessage.getIdAsString()))); - if(CollUtil.isEmpty(records)){ - continue; + // 获取指定 id 的消息体 + List> records = ops.range(listener.getStreamKey(), + Range.of(Range.Bound.inclusive(pendingMessage.getIdAsString()), Range.Bound.inclusive(pendingMessage.getIdAsString()))); + if (CollUtil.isEmpty(records)) { + return; } // 重新投递消息 redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord() - .ofObject(records.get(0).getValue()) // 设置内容 - .withStreamKey(listener.getStreamKey())); + .ofObject(records.get(0).getValue()) // 设置内容 + .withStreamKey(listener.getStreamKey())); // ack 消息消费完成 redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, records.get(0)); log.info("[processPendingMessage][消息({})重新投递成功]", records.get(0).getId()); - } + }); }); }); } From c7e3a8c126a5077943f1edf5c1497f442e65373b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 17 Jun 2023 13:58:55 +0800 Subject: [PATCH 22/42] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Vue=202=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E7=8E=AF=E5=A2=83=E6=89=93=E5=8C=85=E5=8E=8B=E7=BC=A9?= =?UTF-8?q?=E7=AD=89=E9=85=8D=E7=BD=AE=E6=9C=AA=E7=94=9F=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin/.env.prod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-ui-admin/.env.prod b/yudao-ui-admin/.env.prod index a1415ed39..511b91ba9 100644 --- a/yudao-ui-admin/.env.prod +++ b/yudao-ui-admin/.env.prod @@ -1,5 +1,5 @@ # 生产环境配置 -ENV = 'production' +NODE_ENV = 'production' # 页面标题 VUE_APP_TITLE = 芋道管理系统 From a4c11b890c1ec456be4673e1669342cad5db7d4a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 17 Jun 2023 14:17:24 +0800 Subject: [PATCH 23/42] fix(sec): upgrade commons-net:commons-net to #98 --- yudao-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index d89daaa2a..b6851a2a3 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -55,7 +55,7 @@ 31.1-jre 5.1.0 2.14.2 - 3.8.0 + 3.9.0 0.1.55 2.7.0 4.1.90.Final From 8d58b1e862ef789e2cfe830bc06196531bd1e028 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 17 Jun 2023 14:19:26 +0800 Subject: [PATCH 24/42] Bump guava from 31.1-jre to 32.0.0-jre in /yudao-dependencies #96 --- yudao-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index b6851a2a3..0ca928387 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -52,7 +52,7 @@ 2.3 1.0.5 1.2.83 - 31.1-jre + 32.0.0-jre 5.1.0 2.14.2 3.9.0 From 8e3a65d84c64c7e679c0b618c971ba5f2cd38f69 Mon Sep 17 00:00:00 2001 From: xiaqing Date: Sat, 17 Jun 2023 16:39:28 +0800 Subject: [PATCH 25/42] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-local.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index cdc1d3fde..c748e9455 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -44,31 +44,31 @@ spring: primary: master datasource: master: - name: ruoyi-vue-pro - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + name: mall + url: jdbc:mysql://10.211.55.5:3308/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例 username: root - password: 123456 + password: 1qaz!QAZ # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W slave: # 模拟从库,可根据自己需要修改 - name: ruoyi-vue-pro - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + name: mall + url: jdbc:mysql://10.211.55.5:3308/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例 username: root - password: 123456 + password: 1qaz!QAZ # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 redis: - host: 127.0.0.1 # 地址 + host: 10.211.55.5 # 地址 port: 6379 # 端口 database: 0 # 数据库索引 # password: dev # 密码,建议生产环境开启 @@ -159,6 +159,7 @@ logging: cn.iocoder.yudao.module.member.dal.mysql: debug cn.iocoder.yudao.module.trade.dal.mysql: debug cn.iocoder.yudao.module.promotion.dal.mysql: debug + cn.iocoder.yudao.module.point.dal.mysql: debug debug: false From 850d028ec76c22604dce3838b6ef45264680a636 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 19 Jun 2023 09:47:01 +0800 Subject: [PATCH 26/42] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E5=8D=8E?= =?UTF-8?q?=E4=B8=BA=E4=BA=91maven=20aliyun=E5=90=8C=E6=AD=A5=E9=80=9F?= =?UTF-8?q?=E5=BA=A6=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4f1350a10..932c206d0 100644 --- a/pom.xml +++ b/pom.xml @@ -96,8 +96,13 @@ - + + + huaweicloud + huawei + https://mirrors.huaweicloud.com/repository/maven/ + aliyunmaven aliyun From 7fc1016e903a68637981db4a3b109771aed95132 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 19 Jun 2023 09:47:18 +0800 Subject: [PATCH 27/42] chore: up captcha-plus 1.0.4 --- yudao-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 0ca928387..ebbe54574 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -43,7 +43,7 @@ 6.8.0 - 1.0.2 + 1.0.4 1.15.4 1.18.26 1.5.5.Final From bdb18b4cedd11daa84c4a2db9c8c93f28b2917e8 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 16:26:38 +0800 Subject: [PATCH 28/42] chore: up springboot 2.7.13 --- pom.xml | 2 +- yudao-dependencies/pom.xml | 2 +- yudao-example/yudao-sso-demo-by-code/pom.xml | 2 +- yudao-example/yudao-sso-demo-by-password/pom.xml | 2 +- yudao-server/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 932c206d0..ac9d96dc0 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 3.8.1 1.18.26 - 2.7.12 + 2.7.13 1.5.5.Final UTF-8 diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index ebbe54574..62e86a0d1 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -16,7 +16,7 @@ 1.7.3-snapshot - 2.7.12 + 2.7.13 1.6.15 4.1.0 diff --git a/yudao-example/yudao-sso-demo-by-code/pom.xml b/yudao-example/yudao-sso-demo-by-code/pom.xml index d3f745dba..bde80276b 100644 --- a/yudao-example/yudao-sso-demo-by-code/pom.xml +++ b/yudao-example/yudao-sso-demo-by-code/pom.xml @@ -21,7 +21,7 @@ 8 UTF-8 - 2.7.12 + 2.7.13 diff --git a/yudao-example/yudao-sso-demo-by-password/pom.xml b/yudao-example/yudao-sso-demo-by-password/pom.xml index d6e73916d..8b81b87d6 100644 --- a/yudao-example/yudao-sso-demo-by-password/pom.xml +++ b/yudao-example/yudao-sso-demo-by-password/pom.xml @@ -21,7 +21,7 @@ 8 UTF-8 - 2.7.12 + 2.7.13 diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index fdfa88415..25539cb63 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -111,7 +111,7 @@ org.springframework.boot spring-boot-maven-plugin - 2.7.12 + 2.7.13 true From 0899f5fd29819962b5d57f66c9c0eaf0ea35c443 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 16:27:06 +0800 Subject: [PATCH 29/42] docs: up springboot 2.10.12 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e2eb27acd..36e5bfc39 100644 --- a/README.md +++ b/README.md @@ -249,7 +249,7 @@ ps:核心功能已经实现,正在对接微信小程序中... | 框架 | 说明 | 版本 | 学习指南 | |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------| -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.12 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.13 | [文档](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) | From 02fe0329e41461869ed35c4312d5a2bf25201a99 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 16:29:26 +0800 Subject: [PATCH 30/42] chore: up druid 1.2.18 --- yudao-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 62e86a0d1..dae6b252a 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -22,7 +22,7 @@ 4.1.0 2.5 - 1.2.16 + 1.2.18 3.5.3.1 3.5.3.1 3.6.1 From 4393c5da1cfcc941210fe1fee61b79465920edf3 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 16:30:00 +0800 Subject: [PATCH 31/42] docs: up Druid 1.2.18 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36e5bfc39..7a061e8ac 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ ps:核心功能已经实现,正在对接微信小程序中... |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------| | [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.13 | [文档](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) | +| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.18 | [文档](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) | | [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.6.1 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | [Redis](https://redis.io/) | key-value 数据库 | 5.0 / 6.0 | | From d44c29296d3060d6226965c907ae11cd0e4ac15c Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 16:49:33 +0800 Subject: [PATCH 32/42] chore: up hutool 5.8.20 Lombok 1.18.28 --- pom.xml | 2 +- yudao-dependencies/pom.xml | 6 +++--- yudao-example/yudao-sso-demo-by-code/pom.xml | 2 +- yudao-example/yudao-sso-demo-by-password/pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index ac9d96dc0..d221cb4f4 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 3.0.0-M5 3.8.1 - 1.18.26 + 1.18.28 2.7.13 1.5.5.Final UTF-8 diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index dae6b252a..0b75bd74c 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -45,10 +45,10 @@ 1.0.4 1.15.4 - 1.18.26 + 1.18.28 1.5.5.Final - 5.8.18 - 3.3.1 + 5.8.20 + 3.3.2 2.3 1.0.5 1.2.83 diff --git a/yudao-example/yudao-sso-demo-by-code/pom.xml b/yudao-example/yudao-sso-demo-by-code/pom.xml index bde80276b..dc0c0241e 100644 --- a/yudao-example/yudao-sso-demo-by-code/pom.xml +++ b/yudao-example/yudao-sso-demo-by-code/pom.xml @@ -52,7 +52,7 @@ cn.hutool hutool-all - 5.8.18 + 5.8.20 diff --git a/yudao-example/yudao-sso-demo-by-password/pom.xml b/yudao-example/yudao-sso-demo-by-password/pom.xml index 8b81b87d6..ee5d05390 100644 --- a/yudao-example/yudao-sso-demo-by-password/pom.xml +++ b/yudao-example/yudao-sso-demo-by-password/pom.xml @@ -52,7 +52,7 @@ cn.hutool hutool-all - 5.8.18 + 5.8.20 From c1782c432fbbd9720adeba2fd73886040db273fb Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 16:50:20 +0800 Subject: [PATCH 33/42] chore: up deps version --- yudao-dependencies/pom.xml | 10 +++++----- .../yudao-spring-boot-starter-biz-pay/pom.xml | 2 +- .../yudao-spring-boot-starter-biz-weixin/pom.xml | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 0b75bd74c..48deffc03 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -26,7 +26,7 @@ 3.5.3.1 3.5.3.1 3.6.1 - 1.4.3.2 + 1.4.5 3.18.0 8.1.2.141 @@ -52,7 +52,7 @@ 2.3 1.0.5 1.2.83 - 32.0.0-jre + 32.0.1-jre 5.1.0 2.14.2 3.9.0 @@ -64,14 +64,14 @@ 3.0.0 4.10.0 2.11.0 - 8.5.2 + 8.5.4 4.6.3 2.2.1 3.1.758 1.4.0 - 1.5.6 + 1.5.8 2.12.2 - 4.3.0 + 4.5.0 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml index 2ccbc7ba2..3effb1952 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml @@ -63,7 +63,7 @@ com.github.binarywang weixin-java-pay - 4.4.0 + 4.5.0 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml index 2dc37c376..e242819ef 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml @@ -34,14 +34,13 @@ com.github.binarywang - wx-java-mp-spring-boot-starter - 4.4.0 + 4.5.0 com.github.binarywang wx-java-miniapp-spring-boot-starter - 4.4.0 + 4.5.0 From 9826bd614baf4f12283c75acbe528678d1af3a28 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 16:50:41 +0800 Subject: [PATCH 34/42] docs: up Lombok 1.18.28 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a061e8ac..445e50014 100644 --- a/README.md +++ b/README.md @@ -267,7 +267,7 @@ ps:核心功能已经实现,正在对接微信小程序中... | [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.7.10 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | | [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | | | [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.5.5.Final | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) | -| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.26 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | +| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.28 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | | [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - | | [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.8.0 | - | From 8ea46b8fc21b6ffa9c4ab973e2cd6a6b03ec8624 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 16:53:08 +0800 Subject: [PATCH 35/42] =?UTF-8?q?fix:=20getNewPhoneNoInfo=20=E5=B7=B2?= =?UTF-8?q?=E8=BF=87=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/member/service/auth/MemberAuthServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java index d8c59ad37..58b637c6d 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java @@ -127,7 +127,7 @@ public class MemberAuthServiceImpl implements MemberAuthService { // 获得对应的手机号信息 WxMaPhoneNumberInfo phoneNumberInfo; try { - phoneNumberInfo = wxMaService.getUserService().getNewPhoneNoInfo(reqVO.getPhoneCode()); + phoneNumberInfo = wxMaService.getUserService().getPhoneNoInfo(reqVO.getPhoneCode()); } catch (Exception exception) { throw exception(AUTH_WEIXIN_MINI_APP_PHONE_CODE_ERROR); } From 7ad3b6ad2b1745ec3f6b1a01bcd2a6cf6b307442 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 21:08:56 +0800 Subject: [PATCH 36/42] chore: use com.xingyuv.justauth --- yudao-dependencies/pom.xml | 6 +++--- .../pom.xml | 4 ++-- .../config/YudaoSocialAutoConfiguration.java | 4 ++-- .../social/core/YudaoAuthRequestFactory.java | 12 +++++------ .../social/core/enums/AuthExtendSource.java | 10 ++++++++-- .../request/AuthWeChatMiniAppRequest.java | 20 +++++++++---------- .../service/social/SocialUserServiceImpl.java | 10 +++++----- .../social/SocialUserServiceImplTest.java | 12 +++++------ 8 files changed, 42 insertions(+), 36 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 48deffc03..a5ba9332b 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -68,7 +68,7 @@ 4.6.3 2.2.1 3.1.758 - 1.4.0 + 1.0.0 1.5.8 2.12.2 4.5.0 @@ -589,8 +589,8 @@ - com.xkcoding.justauth - justauth-spring-boot-starter + com.xingyuv + spring-boot-starter-justauth ${justauth.version} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-social/pom.xml index 0e0ac6dc4..e39107918 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/pom.xml @@ -36,8 +36,8 @@ - com.xkcoding.justauth - justauth-spring-boot-starter + com.xingyuv + spring-boot-starter-justauth cn.hutool diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java index 5c2f7f8bb..1812efeb9 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.framework.social.config; import cn.iocoder.yudao.framework.social.core.YudaoAuthRequestFactory; +import com.xingyuv.jushauth.cache.AuthStateCache; +import com.xingyuv.justauth.autoconfigure.JustAuthProperties; import com.xkcoding.http.HttpUtil; import com.xkcoding.http.support.hutool.HutoolImpl; -import com.xkcoding.justauth.autoconfigure.JustAuthProperties; import lombok.extern.slf4j.Slf4j; -import me.zhyd.oauth.cache.AuthStateCache; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java index 22be344d9..5d5475e84 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java @@ -4,12 +4,12 @@ import cn.hutool.core.util.EnumUtil; import cn.hutool.core.util.ReflectUtil; import cn.iocoder.yudao.framework.social.core.enums.AuthExtendSource; import cn.iocoder.yudao.framework.social.core.request.AuthWeChatMiniAppRequest; -import com.xkcoding.justauth.AuthRequestFactory; -import com.xkcoding.justauth.autoconfigure.JustAuthProperties; -import me.zhyd.oauth.cache.AuthStateCache; -import me.zhyd.oauth.config.AuthConfig; -import me.zhyd.oauth.config.AuthSource; -import me.zhyd.oauth.request.AuthRequest; +import com.xingyuv.jushauth.cache.AuthStateCache; +import com.xingyuv.jushauth.config.AuthConfig; +import com.xingyuv.jushauth.config.AuthSource; +import com.xingyuv.jushauth.request.AuthRequest; +import com.xingyuv.justauth.AuthRequestFactory; +import com.xingyuv.justauth.autoconfigure.JustAuthProperties; import java.lang.reflect.Method; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java index f51c81e02..fd0fff709 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java @@ -1,11 +1,12 @@ package cn.iocoder.yudao.framework.social.core.enums; -import me.zhyd.oauth.config.AuthSource; +import com.xingyuv.jushauth.config.AuthSource; +import com.xingyuv.jushauth.request.AuthDefaultRequest; /** * 拓展 JustAuth 各 api 需要的 url, 用枚举类分平台类型管理 * - * 默认配置 {@link me.zhyd.oauth.config.AuthDefaultSource} + * 默认配置 {@link com.xingyuv.jushauth.config.AuthDefaultSource} * * @author timfruit */ @@ -34,6 +35,11 @@ public enum AuthExtendSource implements AuthSource { // 参见 https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html 文档 throw new UnsupportedOperationException("不支持获取用户信息 url,请使用小程序内置函数 wx.getUserProfile() 获取用户信息"); } + + @Override + public Class getTargetClass() { + return null; + } } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java index 5ff5b8578..2e98ac989 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java @@ -3,16 +3,16 @@ package cn.iocoder.yudao.framework.social.core.request; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.social.core.enums.AuthExtendSource; import com.fasterxml.jackson.annotation.JsonProperty; +import com.xingyuv.jushauth.cache.AuthStateCache; +import com.xingyuv.jushauth.config.AuthConfig; +import com.xingyuv.jushauth.exception.AuthException; +import com.xingyuv.jushauth.model.AuthCallback; +import com.xingyuv.jushauth.model.AuthToken; +import com.xingyuv.jushauth.model.AuthUser; +import com.xingyuv.jushauth.request.AuthDefaultRequest; +import com.xingyuv.jushauth.utils.HttpUtils; +import com.xingyuv.jushauth.utils.UrlBuilder; import lombok.Data; -import me.zhyd.oauth.cache.AuthStateCache; -import me.zhyd.oauth.config.AuthConfig; -import me.zhyd.oauth.exception.AuthException; -import me.zhyd.oauth.model.AuthCallback; -import me.zhyd.oauth.model.AuthToken; -import me.zhyd.oauth.model.AuthUser; -import me.zhyd.oauth.request.AuthDefaultRequest; -import me.zhyd.oauth.utils.HttpUtils; -import me.zhyd.oauth.utils.UrlBuilder; /** * 微信小程序登陆 Request 请求 @@ -32,7 +32,7 @@ public class AuthWeChatMiniAppRequest extends AuthDefaultRequest { protected AuthToken getAccessToken(AuthCallback authCallback) { // 参见 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html 文档 // 使用 code 获取对应的 openId、unionId 等字段 - String response = new HttpUtils(config.getHttpConfig()).get(accessTokenUrl(authCallback.getCode())); + String response = new HttpUtils(config.getHttpConfig()).get(accessTokenUrl(authCallback.getCode())).getBody(); JSCode2SessionResponse accessTokenObject = JsonUtils.parseObject(response, JSCode2SessionResponse.class); assert accessTokenObject != null; checkResponse(accessTokenObject); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java index 411d749b0..b6999bd01 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java @@ -10,12 +10,12 @@ import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserBindMapper; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; +import com.xingyuv.jushauth.model.AuthCallback; +import com.xingyuv.jushauth.model.AuthResponse; +import com.xingyuv.jushauth.model.AuthUser; +import com.xingyuv.jushauth.request.AuthRequest; +import com.xingyuv.jushauth.utils.AuthStateUtils; import lombok.extern.slf4j.Slf4j; -import me.zhyd.oauth.model.AuthCallback; -import me.zhyd.oauth.model.AuthResponse; -import me.zhyd.oauth.model.AuthUser; -import me.zhyd.oauth.request.AuthRequest; -import me.zhyd.oauth.utils.AuthStateUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java index 48f914a1a..c4f0442a2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java @@ -9,12 +9,12 @@ import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserBindMapper; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import me.zhyd.oauth.enums.AuthResponseStatus; -import me.zhyd.oauth.model.AuthCallback; -import me.zhyd.oauth.model.AuthResponse; -import me.zhyd.oauth.model.AuthUser; -import me.zhyd.oauth.request.AuthRequest; -import me.zhyd.oauth.utils.AuthStateUtils; +import com.xingyuv.jushauth.enums.AuthResponseStatus; +import com.xingyuv.jushauth.model.AuthCallback; +import com.xingyuv.jushauth.model.AuthResponse; +import com.xingyuv.jushauth.model.AuthUser; +import com.xingyuv.jushauth.request.AuthRequest; +import com.xingyuv.jushauth.utils.AuthStateUtils; import org.junit.jupiter.api.Test; import org.mockito.MockedStatic; import org.springframework.boot.test.mock.mockito.MockBean; From 3e9768374b82063112a2b33a1dd11ce2ff1048e1 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 26 Jun 2023 22:19:20 +0800 Subject: [PATCH 37/42] chore: up justauth 1.0.1 captcha-plus 1.0.5 --- yudao-dependencies/pom.xml | 4 ++-- .../framework/social/config/YudaoSocialAutoConfiguration.java | 4 ++-- .../social/core/request/AuthWeChatMiniAppRequest.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index a5ba9332b..1b9f8301a 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -43,7 +43,7 @@ 6.8.0 - 1.0.4 + 1.0.5 1.15.4 1.18.28 1.5.5.Final @@ -68,7 +68,7 @@ 4.6.3 2.2.1 3.1.758 - 1.0.0 + 1.0.1 1.5.8 2.12.2 4.5.0 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java index 1812efeb9..3dc6b6a9a 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java @@ -1,10 +1,10 @@ package cn.iocoder.yudao.framework.social.config; import cn.iocoder.yudao.framework.social.core.YudaoAuthRequestFactory; +import com.xingyuv.http.HttpUtil; +import com.xingyuv.http.support.hutool.HutoolImpl; import com.xingyuv.jushauth.cache.AuthStateCache; import com.xingyuv.justauth.autoconfigure.JustAuthProperties; -import com.xkcoding.http.HttpUtil; -import com.xkcoding.http.support.hutool.HutoolImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java index 2e98ac989..964eb31cd 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java @@ -73,7 +73,7 @@ public class AuthWeChatMiniAppRequest extends AuthDefaultRequest { return UrlBuilder.fromBaseUrl(source.accessToken()) .queryParam("appid", config.getClientId()) .queryParam("secret", config.getClientSecret()) - .queryParam("js_code", code) // 和父类不同,所以需要重写该方法 + .queryParam("js_code", code) .queryParam("grant_type", "authorization_code") .build(); } From c7ced55a6cda1e780f6d32bf31954c914ece30f2 Mon Sep 17 00:00:00 2001 From: xiaqing Date: Wed, 28 Jun 2023 22:49:19 +0800 Subject: [PATCH 38/42] =?UTF-8?q?=E4=BC=9A=E5=91=98=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E3=80=81sql=E8=84=9A=E6=9C=AC=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=201.=E5=90=88=E5=B9=B6=E7=A7=AF=E5=88=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=8F=AAmember=20module=202.=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96sql=E6=94=BE=E5=85=A5mysql/member=5Fpoint.sql=203.?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=9A=E5=91=98=E4=B8=AD/=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E7=A7=AF=E5=88=86=E3=80=81=E4=BC=9A=E5=91=98=E7=AD=BE?= =?UTF-8?q?=E5=88=B0/xxx=E5=B1=82=E7=BA=A7=E7=9B=AE=E5=BD=95=204.=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84=E6=8E=A5=E5=8F=A3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/mysql/optional/member_point.sql | 174 +++++++++++++++++ sql/mysql/point.sql | 152 --------------- .../member/enums/ErrorCodeConstants.java | 13 ++ .../yudao-module-member-biz/pom.xml | 5 + .../point/MemberPointConfigController.java | 6 +- .../point/MemberPointRecordController.java | 83 ++++++++ .../vo/config/MemberPointConfigBaseVO.java | 2 + .../vo/recrod/MemberPointRecordBaseVO.java | 9 +- .../recrod/MemberPointRecordCreateReqVO.java | 6 +- .../vo/recrod/MemberPointRecordExcelVO.java | 10 +- .../recrod/MemberPointRecordExportReqVO.java | 6 +- .../vo/recrod/MemberPointRecordPageReqVO.java | 5 +- .../vo/recrod/MemberPointRecordRespVO.java | 4 +- .../recrod/MemberPointRecordUpdateReqVO.java | 6 +- .../admin/point/vo/recrod/package-info.java | 1 - .../signin/MemberSignInConfigController.java | 85 ++++---- .../signin/MemberSignInRecordController.java | 84 ++++++++ .../signin/vo/MemberSignInConfigBaseVO.java | 8 +- .../vo/MemberSignInConfigCreateReqVO.java | 6 +- .../signin/vo/MemberSignInConfigExcelVO.java | 8 +- .../vo/MemberSignInConfigExportReqVO.java | 6 +- .../vo/MemberSignInConfigPageReqVO.java | 5 +- .../signin/vo/MemberSignInConfigRespVO.java | 4 +- .../vo/MemberSignInConfigUpdateReqVO.java | 6 +- .../signin/vo/MemberSignInRecordBaseVO.java | 10 +- .../vo/MemberSignInRecordCreateReqVO.java | 14 ++ .../signin/vo/MemberSignInRecordExcelVO.java | 13 +- .../vo/MemberSignInRecordExportReqVO.java | 11 +- .../vo/MemberSignInRecordPageReqVO.java | 12 +- .../signin/vo/MemberSignInRecordRespVO.java | 9 +- .../vo/MemberSignInRecordUpdateReqVO.java | 12 +- .../point/MemberPointConfigConvert.java | 6 + .../point/MemberPointRecordConvert.java | 37 ++++ .../signin/MemberSignInConfigConvert.java | 34 ++++ .../signin/MemberSignInRecordConvert.java | 37 ++++ .../dataobject/point/MemberPointRecordDO.java | 17 +- .../signin/MemberSignInConfigDO.java | 13 +- .../signin/MemberSignInRecordDO.java | 13 +- .../mysql/point/MemberPointRecordMapper.java | 41 ++++ .../signin/MemberSignInConfigMapper.java | 42 ++++ .../signin/MemberSignInRecordMapper.java | 37 ++++ .../point/MemberPointConfigServiceImpl.java | 18 +- .../point/MemberPointRecordService.java | 63 ++++++ .../point/MemberPointRecordServiceImpl.java | 70 +++++++ .../signin/MemberSignInConfigService.java | 24 ++- .../signin/MemberSignInConfigServiceImpl.java | 103 ++++++++++ .../signin/MemberSignInRecordService.java | 57 ++++++ .../signin/MemberSignInRecordServiceImpl.java | 67 +++++++ yudao-module-point/pom.xml | 19 -- .../yudao-module-point-api/pom.xml | 28 --- .../point/enums/ErrorCodeConstants.java | 27 --- .../yudao-module-point-biz/pom.xml | 57 ------ .../pointrecord/PointRecordController.java | 102 ---------- .../signinrecord/SignInRecordController.java | 102 ---------- .../vo/SignInRecordCreateReqVO.java | 14 -- .../pointrecord/PointRecordConvert.java | 34 ---- .../signinconfig/SignInConfigConvert.java | 34 ---- .../signinrecord/SignInRecordConvert.java | 34 ---- .../mysql/pointrecord/PointRecordMapper.java | 40 ---- .../signinconfig/SignInConfigMapper.java | 41 ---- .../signinrecord/SignInRecordMapper.java | 36 ---- .../pointrecord/PointRecordService.java | 70 ------- .../pointrecord/PointRecordServiceImpl.java | 82 -------- .../signinconfig/SignInConfigServiceImpl.java | 102 ---------- .../signinrecord/SignInRecordService.java | 70 ------- .../signinrecord/SignInRecordServiceImpl.java | 82 -------- .../PointConfigServiceImplTest.java | 152 --------------- .../PointRecordServiceImplTest.java | 183 ------------------ .../SignInConfigServiceImplTest.java | 152 --------------- .../SignInRecordServiceImplTest.java | 167 ---------------- 70 files changed, 1127 insertions(+), 1955 deletions(-) create mode 100644 sql/mysql/optional/member_point.sql delete mode 100644 sql/mysql/point.sql create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordBaseVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordBaseVO.java (90%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordCreateReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordCreateReqVO.java (53%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExcelVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.java (84%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExportReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExportReqVO.java (78%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordPageReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordPageReqVO.java (83%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordRespVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordRespVO.java (76%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordUpdateReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordUpdateReqVO.java (73%) delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/package-info.java rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/SignInConfigController.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java (55%) create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigBaseVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java (66%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigCreateReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigCreateReqVO.java (52%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExcelVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.java (64%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExportReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.java (60%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigPageReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigPageReqVO.java (71%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigRespVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigRespVO.java (76%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigUpdateReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigUpdateReqVO.java (74%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordBaseVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordBaseVO.java (66%) create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordCreateReqVO.java rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExcelVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java (68%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExportReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.java (77%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordPageReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordPageReqVO.java (79%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordRespVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordRespVO.java (66%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordUpdateReqVO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordUpdateReqVO.java (59%) create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/pointrecord/PointRecordDO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java (84%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinconfig/SignInConfigDO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInConfigDO.java (71%) rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinrecord/SignInRecordDO.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInRecordDO.java (72%) create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java rename yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigService.java => yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java (50%) create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java delete mode 100644 yudao-module-point/pom.xml delete mode 100644 yudao-module-point/yudao-module-point-api/pom.xml delete mode 100644 yudao-module-point/yudao-module-point-api/src/main/java/cn/iocoder/yudao/module/point/enums/ErrorCodeConstants.java delete mode 100644 yudao-module-point/yudao-module-point-biz/pom.xml delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/PointRecordController.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/SignInRecordController.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordCreateReqVO.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/pointrecord/PointRecordConvert.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinconfig/SignInConfigConvert.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinrecord/SignInRecordConvert.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/pointrecord/PointRecordMapper.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinconfig/SignInConfigMapper.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinrecord/SignInRecordMapper.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordService.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImpl.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImpl.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordService.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImpl.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointconfig/PointConfigServiceImplTest.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImplTest.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImplTest.java delete mode 100644 yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImplTest.java diff --git a/sql/mysql/optional/member_point.sql b/sql/mysql/optional/member_point.sql new file mode 100644 index 000000000..08702cb8a --- /dev/null +++ b/sql/mysql/optional/member_point.sql @@ -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; diff --git a/sql/mysql/point.sql b/sql/mysql/point.sql deleted file mode 100644 index dfa625940..000000000 --- a/sql/mysql/point.sql +++ /dev/null @@ -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'); diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java index 1e77db1c8..8a4cd7f63 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java @@ -23,4 +23,17 @@ public interface ErrorCodeConstants { // ========== 用户收件地址 1004004000 ========== ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1004004000, "用户收件地址不存在"); + //========== 用户积分 1004005000 ========== + ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(1004005001, "积分设置不存在"); + + ErrorCode CONFIG_EXISTS = new ErrorCode(1004005002, "积分设置已存在,只允配置一条记录"); + + + 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, "用户签到积分不存在"); + } diff --git a/yudao-module-member/yudao-module-member-biz/pom.xml b/yudao-module-member/yudao-module-member-biz/pom.xml index 839ac3a88..7b50822d0 100644 --- a/yudao-module-member/yudao-module-member-biz/pom.xml +++ b/yudao-module-member/yudao-module-member-biz/pom.xml @@ -84,6 +84,11 @@ + + cn.iocoder.boot + yudao-spring-boot-starter-excel + + diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointConfigController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointConfigController.java index f0e6d0ee2..3cebd62c9 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointConfigController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointConfigController.java @@ -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 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 getConfig() { MemberPointConfigDO config = memberPointConfigService.getConfig(); return success(MemberPointConfigConvert.INSTANCE.convert(config)); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java new file mode 100644 index 000000000..70c7b9f09 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java @@ -0,0 +1,83 @@ +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.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.*; +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.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - 用户积分记录") +@RestController +@RequestMapping("/point/record") +@Validated +public class MemberPointRecordController { + + @Resource + private MemberPointRecordService recordService; + + @PutMapping("/update") + @Operation(summary = "更新用户积分记录") + @PreAuthorize("@ss.hasPermission('point:record:update')") + public CommonResult 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 getRecord(@RequestParam("id") Long id) { + MemberPointRecordDO record = recordService.getRecord(id); + return success(MemberPointRecordConvert.INSTANCE.convert(record)); + } + + @GetMapping("/list") + @Operation(summary = "获得用户积分记录列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('point:record:query')") + public CommonResult> getRecordList(@RequestParam("ids") Collection ids) { + List list = recordService.getRecordList(ids); + return success(MemberPointRecordConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得用户积分记录分页") + @PreAuthorize("@ss.hasPermission('point:record:query')") + public CommonResult> getRecordPage(@Valid MemberPointRecordPageReqVO pageVO) { + PageResult pageResult = recordService.getRecordPage(pageVO); + return success(MemberPointRecordConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出用户积分记录 Excel") + @PreAuthorize("@ss.hasPermission('point:record:export')") + @OperateLog(type = EXPORT) + public void exportRecordExcel(@Valid MemberPointRecordExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = recordService.getRecordList(exportReqVO); + // 导出 Excel + List datas = MemberPointRecordConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "用户积分记录.xls", "数据", MemberPointRecordExcelVO.class, datas); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/config/MemberPointConfigBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/config/MemberPointConfigBaseVO.java index 46ad58321..4d7de8d42 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/config/MemberPointConfigBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/config/MemberPointConfigBaseVO.java @@ -12,6 +12,8 @@ import java.math.BigDecimal; @Data public class MemberPointConfigBaseVO { + private Long id; + @Schema(description = "积分抵扣开关", required = true, example = "true") private Boolean tradeDeductEnable; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordBaseVO.java similarity index 90% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordBaseVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordBaseVO.java index 0337aac8e..9d0c2604a 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordBaseVO.java @@ -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 = "业务编码不能为空") diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordCreateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordCreateReqVO.java similarity index 53% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordCreateReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordCreateReqVO.java index 7062109d2..d0214c2cc 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordCreateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordCreateReqVO.java @@ -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 { } diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExcelVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.java similarity index 84% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExcelVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.java index 3db1573fc..e093c58fa 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExcelVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.java @@ -1,11 +1,7 @@ -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 com.alibaba.excel.annotation.ExcelProperty; @@ -19,7 +15,7 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; * @author QingX */ @Data -public class PointRecordExcelVO { +public class MemberPointRecordExcelVO { @ExcelProperty("自增主键") private Long id; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExportReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExportReqVO.java similarity index 78% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExportReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExportReqVO.java index d57ade55a..0858bbd4f 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExportReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExportReqVO.java @@ -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; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordPageReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordPageReqVO.java similarity index 83% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordPageReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordPageReqVO.java index b4570c618..7275314cd 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordPageReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordPageReqVO.java @@ -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; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordRespVO.java similarity index 76% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordRespVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordRespVO.java index d40dee6ee..d48cf6de8 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordRespVO.java @@ -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; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordUpdateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordUpdateReqVO.java similarity index 73% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordUpdateReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordUpdateReqVO.java index d053e0a0e..6da3e7688 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordUpdateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordUpdateReqVO.java @@ -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 = "自增主键不能为空") diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/package-info.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/package-info.java deleted file mode 100644 index 284e2178b..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/SignInConfigController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java similarity index 55% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/SignInConfigController.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java index 2ca25dd5a..39c885bc6 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/SignInConfigController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java @@ -1,54 +1,51 @@ -package cn.iocoder.yudao.module.point.controller.admin.signinconfig; +package cn.iocoder.yudao.module.member.controller.admin.signin; -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.common.pojo.PageResult; 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.member.controller.admin.signin.vo.*; +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 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; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; @Tag(name = "管理后台 - 积分签到规则") @RestController @RequestMapping("/point/sign-in-config") @Validated -public class SignInConfigController { +public class MemberSignInConfigController { @Resource - private SignInConfigService signInConfigService; + private MemberSignInConfigService memberSignInConfigService; @PostMapping("/create") @Operation(summary = "创建积分签到规则") @PreAuthorize("@ss.hasPermission('point:sign-in-config:create')") - public CommonResult createSignInConfig(@Valid @RequestBody SignInConfigCreateReqVO createReqVO) { - return success(signInConfigService.createSignInConfig(createReqVO)); + public CommonResult createSignInConfig(@Valid @RequestBody MemberSignInConfigCreateReqVO createReqVO) { + return success(memberSignInConfigService.createSignInConfig(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新积分签到规则") @PreAuthorize("@ss.hasPermission('point:sign-in-config:update')") - public CommonResult updateSignInConfig(@Valid @RequestBody SignInConfigUpdateReqVO updateReqVO) { - signInConfigService.updateSignInConfig(updateReqVO); + public CommonResult updateSignInConfig(@Valid @RequestBody MemberSignInConfigUpdateReqVO updateReqVO) { + memberSignInConfigService.updateSignInConfig(updateReqVO); return success(true); } @@ -57,7 +54,7 @@ public class SignInConfigController { @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('point:sign-in-config:delete')") public CommonResult deleteSignInConfig(@RequestParam("id") Integer id) { - signInConfigService.deleteSignInConfig(id); + memberSignInConfigService.deleteSignInConfig(id); return success(true); } @@ -65,38 +62,38 @@ public class SignInConfigController { @Operation(summary = "获得积分签到规则") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") - public CommonResult getSignInConfig(@RequestParam("id") Integer id) { - SignInConfigDO signInConfig = signInConfigService.getSignInConfig(id); - return success(SignInConfigConvert.INSTANCE.convert(signInConfig)); + public CommonResult getSignInConfig(@RequestParam("id") Integer id) { + MemberSignInConfigDO signInConfig = memberSignInConfigService.getSignInConfig(id); + return success(MemberSignInConfigConvert.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> getSignInConfigList(@RequestParam("ids") Collection ids) { - List list = signInConfigService.getSignInConfigList(ids); - return success(SignInConfigConvert.INSTANCE.convertList(list)); + public CommonResult> getSignInConfigList(@RequestParam("ids") Collection ids) { + List list = memberSignInConfigService.getSignInConfigList(ids); + return success(MemberSignInConfigConvert.INSTANCE.convertList(list)); } @GetMapping("/page") @Operation(summary = "获得积分签到规则分页") @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") - public CommonResult> getSignInConfigPage(@Valid SignInConfigPageReqVO pageVO) { - PageResult pageResult = signInConfigService.getSignInConfigPage(pageVO); - return success(SignInConfigConvert.INSTANCE.convertPage(pageResult)); + public CommonResult> getSignInConfigPage(@Valid MemberSignInConfigPageReqVO pageVO) { + PageResult pageResult = memberSignInConfigService.getSignInConfigPage(pageVO); + return success(MemberSignInConfigConvert.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, + public void exportSignInConfigExcel(@Valid MemberSignInConfigExportReqVO exportReqVO, HttpServletResponse response) throws IOException { - List list = signInConfigService.getSignInConfigList(exportReqVO); + List list = memberSignInConfigService.getSignInConfigList(exportReqVO); // 导出 Excel - List datas = SignInConfigConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "积分签到规则.xls", "数据", SignInConfigExcelVO.class, datas); + List datas = MemberSignInConfigConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "积分签到规则.xls", "数据", MemberSignInConfigExcelVO.class, datas); } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java new file mode 100644 index 000000000..fcb9f71e7 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java @@ -0,0 +1,84 @@ +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.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; +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.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - 用户签到积分") +@RestController +@RequestMapping("/point/sign-in-record") +@Validated +public class MemberSignInRecordController { + + @Resource + private MemberSignInRecordService memberSignInRecordService; + + @DeleteMapping("/delete") + @Operation(summary = "删除用户签到积分") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('point:sign-in-record:delete')") + public CommonResult 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 getSignInRecord(@RequestParam("id") Long id) { + MemberSignInRecordDO signInRecord = memberSignInRecordService.getSignInRecord(id); + return success(MemberSignInRecordConvert.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> getSignInRecordList(@RequestParam("ids") Collection ids) { + List list = memberSignInRecordService.getSignInRecordList(ids); + return success(MemberSignInRecordConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得用户签到积分分页") + @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") + public CommonResult> getSignInRecordPage(@Valid MemberSignInRecordPageReqVO pageVO) { + PageResult pageResult = memberSignInRecordService.getSignInRecordPage(pageVO); + return success(MemberSignInRecordConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出用户签到积分 Excel") + @PreAuthorize("@ss.hasPermission('point:sign-in-record:export')") + @OperateLog(type = EXPORT) + public void exportSignInRecordExcel(@Valid MemberSignInRecordExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = memberSignInRecordService.getSignInRecordList(exportReqVO); + // 导出 Excel + List datas = MemberSignInRecordConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "用户签到积分.xls", "数据", MemberSignInRecordExcelVO.class, datas); + } + +} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java similarity index 66% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigBaseVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java index 4c2160dde..5410ccde7 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java @@ -1,18 +1,14 @@ -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") private Integer day; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigCreateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigCreateReqVO.java similarity index 52% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigCreateReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigCreateReqVO.java index 39098c192..34e921377 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigCreateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigCreateReqVO.java @@ -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 { } diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExcelVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.java similarity index 64% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExcelVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.java index 8d066f2ae..c50c7a291 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExcelVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.java @@ -1,9 +1,7 @@ -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 com.alibaba.excel.annotation.ExcelProperty; @@ -14,7 +12,7 @@ import com.alibaba.excel.annotation.ExcelProperty; * @author QingX */ @Data -public class SignInConfigExcelVO { +public class MemberSignInConfigExcelVO { @ExcelProperty("签到第x天") private Integer day; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExportReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.java similarity index 60% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExportReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.java index 473fe1153..f714786f6 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExportReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.java @@ -1,13 +1,11 @@ -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; @Schema(description = "管理后台 - 积分签到规则 Excel 导出 Request VO,参数和 SignInConfigPageReqVO 是一致的") @Data -public class SignInConfigExportReqVO { +public class MemberSignInConfigExportReqVO { @Schema(description = "签到第x天", example = "7") private Integer day; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigPageReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigPageReqVO.java similarity index 71% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigPageReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigPageReqVO.java index 892d1f2e8..7ffd3827a 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigPageReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigPageReqVO.java @@ -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; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigRespVO.java similarity index 76% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigRespVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigRespVO.java index a78816c3f..a5bfcfa18 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigRespVO.java @@ -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; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigUpdateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigUpdateReqVO.java similarity index 74% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigUpdateReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigUpdateReqVO.java index cf6c788e1..74361d5a9 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigUpdateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigUpdateReqVO.java @@ -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 = "规则自增主键不能为空") diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordBaseVO.java similarity index 66% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordBaseVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordBaseVO.java index 9cefa4a18..f593d0d35 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordBaseVO.java @@ -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; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordCreateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordCreateReqVO.java new file mode 100644 index 000000000..f56e240a4 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordCreateReqVO.java @@ -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 { + +} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExcelVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java similarity index 68% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExcelVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java index de9ebf605..9deec36e1 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExcelVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java @@ -1,12 +1,9 @@ -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; +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.time.LocalDateTime; /** * 用户签到积分 Excel VO @@ -14,7 +11,7 @@ import com.alibaba.excel.annotation.ExcelProperty; * @author 芋道源码 */ @Data -public class SignInRecordExcelVO { +public class MemberSignInRecordExcelVO { @ExcelProperty("签到自增id") private Long id; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExportReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.java similarity index 77% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExportReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.java index 673042306..df919be76 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExportReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.java @@ -1,17 +1,16 @@ -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 java.time.LocalDateTime; +import lombok.Data; 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; @Schema(description = "管理后台 - 用户签到积分 Excel 导出 Request VO,参数和 SignInRecordPageReqVO 是一致的") @Data -public class SignInRecordExportReqVO { +public class MemberSignInRecordExportReqVO { @Schema(description = "签到用户", example = "6507") private Integer userId; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordPageReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordPageReqVO.java similarity index 79% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordPageReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordPageReqVO.java index 49218aafa..d3808a831 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordPageReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordPageReqVO.java @@ -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; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordRespVO.java similarity index 66% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordRespVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordRespVO.java index d4180d1b1..a5b784412 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordRespVO.java @@ -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; diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordUpdateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordUpdateReqVO.java similarity index 59% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordUpdateReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordUpdateReqVO.java index 81392d088..7fce60861 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordUpdateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordUpdateReqVO.java @@ -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不能为空") diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointConfigConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointConfigConvert.java index cf49d2951..d1cdd1d49 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointConfigConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointConfigConvert.java @@ -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); + + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java new file mode 100644 index 000000000..8d94843cd --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.member.convert.point; + +import java.util.*; + +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.MemberPointRecordExcelVO; +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); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java new file mode 100644 index 000000000..1068e089e --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.member.convert.signin; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; + +/** + * 积分签到规则 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 convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java new file mode 100644 index 000000000..bc8d1ca62 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.member.convert.signin; + +import java.util.*; + +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.MemberSignInRecordExcelVO; +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); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/pointrecord/PointRecordDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java similarity index 84% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/pointrecord/PointRecordDO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java index 74197e70d..59b55d314 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/pointrecord/PointRecordDO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java @@ -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 { /** * 自增主键 diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinconfig/SignInConfigDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInConfigDO.java similarity index 71% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinconfig/SignInConfigDO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInConfigDO.java index 9eb07c929..1c7bcd853 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinconfig/SignInConfigDO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInConfigDO.java @@ -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 { /** * 规则自增主键 diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinrecord/SignInRecordDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInRecordDO.java similarity index 72% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinrecord/SignInRecordDO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInRecordDO.java index d75a852d3..8cf89cc43 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinrecord/SignInRecordDO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInRecordDO.java @@ -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 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java new file mode 100644 index 000000000..67cca615e --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java @@ -0,0 +1,41 @@ +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.MemberPointRecordExportReqVO; +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; + +import java.util.List; + +/** + * 用户积分记录 Mapper + * + * @author QingX + */ +@Mapper +public interface MemberPointRecordMapper extends BaseMapperX { + + default PageResult selectPage(MemberPointRecordPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + + default List selectList(MemberPointRecordExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .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)); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java new file mode 100644 index 000000000..5b6a9a7cc --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java @@ -0,0 +1,42 @@ +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.MemberSignInConfigExportReqVO; +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; + +import java.util.List; + +/** + * 积分签到规则 Mapper + * + * @author QingX + */ +@Mapper +public interface MemberSignInConfigMapper extends BaseMapperX { + + default PageResult selectPage(MemberSignInConfigPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MemberSignInConfigDO::getDay, reqVO.getDay()) + .orderByAsc(MemberSignInConfigDO::getDay)); + } + + default List selectList(MemberSignInConfigExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(MemberSignInConfigDO::getDay, reqVO.getDay()) + .orderByDesc(MemberSignInConfigDO::getId)); + } + + // + default long selectSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO){ + return selectCount(new LambdaQueryWrapperX () + .ne(MemberSignInConfigDO::getId, reqVO.getId()) + .eq(MemberSignInConfigDO::getDay,reqVO.getDay()) + ); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java new file mode 100644 index 000000000..e7d45569e --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java @@ -0,0 +1,37 @@ +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.MemberSignInRecordExportReqVO; +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; + +import java.util.List; + +/** + * 用户签到积分 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface MemberSignInRecordMapper extends BaseMapperX { + + default PageResult selectPage(MemberSignInRecordPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId()) + .eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay()) + .betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MemberSignInRecordDO::getId)); + } + + default List selectList(MemberSignInRecordExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId()) + .eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay()) + .betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MemberSignInRecordDO::getId)); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java index 181537d55..103dc20b9 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java @@ -1,12 +1,15 @@ 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.dataobject.point.MemberPointRecordDO; 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 +21,23 @@ 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 + 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 list = pointConfigMapper.selectList(); + return list == null ? null : list.get(0); } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java new file mode 100644 index 000000000..1191ef86b --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java @@ -0,0 +1,63 @@ +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.MemberPointRecordCreateReqVO; +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordExportReqVO; +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; +import java.util.Collection; +import java.util.List; + +/** + * 用户积分记录 Service 接口 + * + * @author QingX + */ +public interface MemberPointRecordService { + + + /** + * 更新用户积分记录 + * + * @param updateReqVO 更新信息 + */ + void updateRecord(@Valid MemberPointRecordUpdateReqVO updateReqVO); + + + + /** + * 获得用户积分记录 + * + * @param id 编号 + * @return 用户积分记录 + */ + MemberPointRecordDO getRecord(Long id); + + /** + * 获得用户积分记录列表 + * + * @param ids 编号 + * @return 用户积分记录列表 + */ + List getRecordList(Collection ids); + + /** + * 获得用户积分记录分页 + * + * @param pageReqVO 分页查询 + * @return 用户积分记录分页 + */ + PageResult getRecordPage(MemberPointRecordPageReqVO pageReqVO); + + /** + * 获得用户积分记录列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 用户积分记录列表 + */ + List getRecordList(MemberPointRecordExportReqVO exportReqVO); + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java new file mode 100644 index 000000000..4199d2997 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java @@ -0,0 +1,70 @@ +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.MemberPointRecordCreateReqVO; +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordExportReqVO; +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 List getRecordList(Collection ids) { + return recordMapper.selectBatchIds(ids); + } + + @Override + public PageResult getRecordPage(MemberPointRecordPageReqVO pageReqVO) { + return recordMapper.selectPage(pageReqVO); + } + + @Override + public List getRecordList(MemberPointRecordExportReqVO exportReqVO) { + return recordMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java similarity index 50% rename from yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigService.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java index 486f08f49..28b993632 100644 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java @@ -1,9 +1,13 @@ -package cn.iocoder.yudao.module.point.service.signinconfig; +package cn.iocoder.yudao.module.member.service.signin; 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.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO; +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigExportReqVO; +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 cn.iocoder.yudao.framework.common.pojo.PageResult; /** @@ -11,7 +15,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; * * @author QingX */ -public interface SignInConfigService { +public interface MemberSignInConfigService { /** * 创建积分签到规则 @@ -19,14 +23,14 @@ public interface SignInConfigService { * @param createReqVO 创建信息 * @return 编号 */ - Integer createSignInConfig(@Valid SignInConfigCreateReqVO createReqVO); + Integer createSignInConfig(@Valid MemberSignInConfigCreateReqVO createReqVO); /** * 更新积分签到规则 * * @param updateReqVO 更新信息 */ - void updateSignInConfig(@Valid SignInConfigUpdateReqVO updateReqVO); + void updateSignInConfig(@Valid MemberSignInConfigUpdateReqVO updateReqVO); /** * 删除积分签到规则 @@ -41,7 +45,7 @@ public interface SignInConfigService { * @param id 编号 * @return 积分签到规则 */ - SignInConfigDO getSignInConfig(Integer id); + MemberSignInConfigDO getSignInConfig(Integer id); /** * 获得积分签到规则列表 @@ -49,7 +53,7 @@ public interface SignInConfigService { * @param ids 编号 * @return 积分签到规则列表 */ - List getSignInConfigList(Collection ids); + List getSignInConfigList(Collection ids); /** * 获得积分签到规则分页 @@ -57,7 +61,7 @@ public interface SignInConfigService { * @param pageReqVO 分页查询 * @return 积分签到规则分页 */ - PageResult getSignInConfigPage(SignInConfigPageReqVO pageReqVO); + PageResult getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO); /** * 获得积分签到规则列表, 用于 Excel 导出 @@ -65,6 +69,6 @@ public interface SignInConfigService { * @param exportReqVO 查询条件 * @return 积分签到规则列表 */ - List getSignInConfigList(SignInConfigExportReqVO exportReqVO); + List getSignInConfigList(MemberSignInConfigExportReqVO exportReqVO); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java new file mode 100644 index 000000000..8fdf8a54f --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java @@ -0,0 +1,103 @@ +package cn.iocoder.yudao.module.member.service.signin; + +import cn.iocoder.yudao.module.member.service.signin.MemberSignInConfigService; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert; +import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInConfigMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; + +/** + * 积分签到规则 Service 实现类 + * + * @author QingX + */ +@Service +@Validated +public class MemberSignInConfigServiceImpl implements MemberSignInConfigService { + + @Resource + private MemberSignInConfigMapper memberSignInConfigMapper; + + @Override + public Integer createSignInConfig(MemberSignInConfigCreateReqVO createReqVO) { + // 插入 + MemberSignInConfigDO signInConfig = MemberSignInConfigConvert.INSTANCE.convert(createReqVO); + //判断是否重复插入签到天数 + validateSignInConfigExistsDay(signInConfig.getDay()); + memberSignInConfigMapper.insert(signInConfig); + // 返回 + return signInConfig.getId(); + } + + @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); + } + } + //根据签到天数判断是否存在一个相同的天数 + private void validateSignInConfigExistsDay(Integer day) { + if (memberSignInConfigMapper.selectCount(MemberSignInConfigDO::getDay,day)>0) { + throw exception(SIGN_IN_CONFIG_EXISTS); + } + } + + //更新天数时判断是否有重复的天数,需要去除自己 + 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 List getSignInConfigList(Collection ids) { + return memberSignInConfigMapper.selectBatchIds(ids); + } + + @Override + public PageResult getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO) { + return memberSignInConfigMapper.selectPage(pageReqVO); + } + + @Override + public List getSignInConfigList(MemberSignInConfigExportReqVO exportReqVO) { + return memberSignInConfigMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java new file mode 100644 index 000000000..b5bda4720 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java @@ -0,0 +1,57 @@ +package cn.iocoder.yudao.module.member.service.signin; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 用户签到积分 Service 接口 + * + * @author 芋道源码 + */ +public interface MemberSignInRecordService { + + + + /** + * 删除用户签到积分 + * + * @param id 编号 + */ + void deleteSignInRecord(Long id); + + /** + * 获得用户签到积分 + * + * @param id 编号 + * @return 用户签到积分 + */ + MemberSignInRecordDO getSignInRecord(Long id); + + /** + * 获得用户签到积分列表 + * + * @param ids 编号 + * @return 用户签到积分列表 + */ + List getSignInRecordList(Collection ids); + + /** + * 获得用户签到积分分页 + * + * @param pageReqVO 分页查询 + * @return 用户签到积分分页 + */ + PageResult getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO); + + /** + * 获得用户签到积分列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 用户签到积分列表 + */ + List getSignInRecordList(MemberSignInRecordExportReqVO exportReqVO); + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java new file mode 100644 index 000000000..3476dfa57 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java @@ -0,0 +1,67 @@ +package cn.iocoder.yudao.module.member.service.signin; + +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordCreateReqVO; +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordExportReqVO; +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordUpdateReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert; +import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; + +/** + * 用户签到积分 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 List getSignInRecordList(Collection ids) { + return memberSignInRecordMapper.selectBatchIds(ids); + } + + @Override + public PageResult getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO) { + return memberSignInRecordMapper.selectPage(pageReqVO); + } + + @Override + public List getSignInRecordList(MemberSignInRecordExportReqVO exportReqVO) { + return memberSignInRecordMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-point/pom.xml b/yudao-module-point/pom.xml deleted file mode 100644 index f0361dd60..000000000 --- a/yudao-module-point/pom.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - 4.0.0 - - cn.iocoder.boot - yudao - ${revision} - - - yudao-module-point - pom - - yudao-module-point-api - - - - \ No newline at end of file diff --git a/yudao-module-point/yudao-module-point-api/pom.xml b/yudao-module-point/yudao-module-point-api/pom.xml deleted file mode 100644 index 83898557f..000000000 --- a/yudao-module-point/yudao-module-point-api/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - 4.0.0 - - cn.iocoder.boot - yudao-module-point - ${revision} - - - yudao-module-point-api - jar - - - - cn.iocoder.boot - yudao-common - - - - - org.springframework.boot - spring-boot-starter-validation - true - - - \ No newline at end of file diff --git a/yudao-module-point/yudao-module-point-api/src/main/java/cn/iocoder/yudao/module/point/enums/ErrorCodeConstants.java b/yudao-module-point/yudao-module-point-api/src/main/java/cn/iocoder/yudao/module/point/enums/ErrorCodeConstants.java deleted file mode 100644 index 8d4daf0fc..000000000 --- a/yudao-module-point/yudao-module-point-api/src/main/java/cn/iocoder/yudao/module/point/enums/ErrorCodeConstants.java +++ /dev/null @@ -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, "用户签到积分不存在"); - - - -} diff --git a/yudao-module-point/yudao-module-point-biz/pom.xml b/yudao-module-point/yudao-module-point-biz/pom.xml deleted file mode 100644 index fc4561441..000000000 --- a/yudao-module-point/yudao-module-point-biz/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - - cn.iocoder.boot - yudao-module-point - ${revision} - - - yudao-module-point-biz - jar - - - - cn.iocoder.boot - yudao-module-point-api - ${revision} - - - - - cn.iocoder.boot - yudao-spring-boot-starter-biz-operatelog - - - - - cn.iocoder.boot - yudao-spring-boot-starter-web - - - - cn.iocoder.boot - yudao-spring-boot-starter-security - - - - - cn.iocoder.boot - yudao-spring-boot-starter-mybatis - - - - - cn.iocoder.boot - yudao-spring-boot-starter-test - - - - - cn.iocoder.boot - yudao-spring-boot-starter-excel - - - \ No newline at end of file diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/PointRecordController.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/PointRecordController.java deleted file mode 100644 index 14c115a35..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/PointRecordController.java +++ /dev/null @@ -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 createRecord(@Valid @RequestBody PointRecordCreateReqVO createReqVO) { - return success(recordService.createRecord(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新用户积分记录") - @PreAuthorize("@ss.hasPermission('point:record:update')") - public CommonResult 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 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 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> getRecordList(@RequestParam("ids") Collection ids) { - List list = recordService.getRecordList(ids); - return success(PointRecordConvert.INSTANCE.convertList(list)); - } - - @GetMapping("/page") - @Operation(summary = "获得用户积分记录分页") - @PreAuthorize("@ss.hasPermission('point:record:query')") - public CommonResult> getRecordPage(@Valid PointRecordPageReqVO pageVO) { - PageResult 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 list = recordService.getRecordList(exportReqVO); - // 导出 Excel - List datas = PointRecordConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "用户积分记录.xls", "数据", PointRecordExcelVO.class, datas); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/SignInRecordController.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/SignInRecordController.java deleted file mode 100644 index a2a639c5d..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/SignInRecordController.java +++ /dev/null @@ -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 createSignInRecord(@Valid @RequestBody SignInRecordCreateReqVO createReqVO) { - return success(signInRecordService.createSignInRecord(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新用户签到积分") - @PreAuthorize("@ss.hasPermission('point:sign-in-record:update')") - public CommonResult 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 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 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> getSignInRecordList(@RequestParam("ids") Collection ids) { - List list = signInRecordService.getSignInRecordList(ids); - return success(SignInRecordConvert.INSTANCE.convertList(list)); - } - - @GetMapping("/page") - @Operation(summary = "获得用户签到积分分页") - @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") - public CommonResult> getSignInRecordPage(@Valid SignInRecordPageReqVO pageVO) { - PageResult 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 list = signInRecordService.getSignInRecordList(exportReqVO); - // 导出 Excel - List datas = SignInRecordConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "用户签到积分.xls", "数据", SignInRecordExcelVO.class, datas); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordCreateReqVO.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordCreateReqVO.java deleted file mode 100644 index 9635b3076..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordCreateReqVO.java +++ /dev/null @@ -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 { - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/pointrecord/PointRecordConvert.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/pointrecord/PointRecordConvert.java deleted file mode 100644 index 556c154f8..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/pointrecord/PointRecordConvert.java +++ /dev/null @@ -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 convertList(List list); - - PageResult convertPage(PageResult page); - - List convertList02(List list); - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinconfig/SignInConfigConvert.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinconfig/SignInConfigConvert.java deleted file mode 100644 index a602fd399..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinconfig/SignInConfigConvert.java +++ /dev/null @@ -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 convertList(List list); - - PageResult convertPage(PageResult page); - - List convertList02(List list); - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinrecord/SignInRecordConvert.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinrecord/SignInRecordConvert.java deleted file mode 100644 index 6c3b434cb..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinrecord/SignInRecordConvert.java +++ /dev/null @@ -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 convertList(List list); - - PageResult convertPage(PageResult page); - - List convertList02(List list); - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/pointrecord/PointRecordMapper.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/pointrecord/PointRecordMapper.java deleted file mode 100644 index 005056a30..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/pointrecord/PointRecordMapper.java +++ /dev/null @@ -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 { - - default PageResult selectPage(PointRecordPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .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 selectList(PointRecordExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .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)); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinconfig/SignInConfigMapper.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinconfig/SignInConfigMapper.java deleted file mode 100644 index 6188d3fef..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinconfig/SignInConfigMapper.java +++ /dev/null @@ -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 { - - default PageResult selectPage(SignInConfigPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(SignInConfigDO::getDay, reqVO.getDay()) - .orderByAsc(SignInConfigDO::getDay)); - } - - default List selectList(SignInConfigExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(SignInConfigDO::getDay, reqVO.getDay()) - .orderByDesc(SignInConfigDO::getId)); - } - - // - default long selectSameDayNotSelf(SignInConfigUpdateReqVO reqVO){ - return selectCount(new LambdaQueryWrapperX () - .ne(SignInConfigDO::getId, reqVO.getId()) - .eq(SignInConfigDO::getDay,reqVO.getDay()) - ); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinrecord/SignInRecordMapper.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinrecord/SignInRecordMapper.java deleted file mode 100644 index 9d0c1c6eb..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinrecord/SignInRecordMapper.java +++ /dev/null @@ -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 { - - default PageResult selectPage(SignInRecordPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(SignInRecordDO::getUserId, reqVO.getUserId()) - .eqIfPresent(SignInRecordDO::getDay, reqVO.getDay()) - .betweenIfPresent(SignInRecordDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(SignInRecordDO::getId)); - } - - default List selectList(SignInRecordExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(SignInRecordDO::getUserId, reqVO.getUserId()) - .eqIfPresent(SignInRecordDO::getDay, reqVO.getDay()) - .betweenIfPresent(SignInRecordDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(SignInRecordDO::getId)); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordService.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordService.java deleted file mode 100644 index 99833ff8d..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordService.java +++ /dev/null @@ -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 getRecordList(Collection ids); - - /** - * 获得用户积分记录分页 - * - * @param pageReqVO 分页查询 - * @return 用户积分记录分页 - */ - PageResult getRecordPage(PointRecordPageReqVO pageReqVO); - - /** - * 获得用户积分记录列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 用户积分记录列表 - */ - List getRecordList(PointRecordExportReqVO exportReqVO); - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImpl.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImpl.java deleted file mode 100644 index a2c0d1ab9..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImpl.java +++ /dev/null @@ -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 getRecordList(Collection ids) { - return recordMapper.selectBatchIds(ids); - } - - @Override - public PageResult getRecordPage(PointRecordPageReqVO pageReqVO) { - return recordMapper.selectPage(pageReqVO); - } - - @Override - public List getRecordList(PointRecordExportReqVO exportReqVO) { - return recordMapper.selectList(exportReqVO); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImpl.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImpl.java deleted file mode 100644 index ac4947ddc..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImpl.java +++ /dev/null @@ -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 getSignInConfigList(Collection ids) { - return signInConfigMapper.selectBatchIds(ids); - } - - @Override - public PageResult getSignInConfigPage(SignInConfigPageReqVO pageReqVO) { - return signInConfigMapper.selectPage(pageReqVO); - } - - @Override - public List getSignInConfigList(SignInConfigExportReqVO exportReqVO) { - return signInConfigMapper.selectList(exportReqVO); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordService.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordService.java deleted file mode 100644 index 8910eec7f..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordService.java +++ /dev/null @@ -1,70 +0,0 @@ -package cn.iocoder.yudao.module.point.service.signinrecord; - -import java.util.*; -import javax.validation.*; -import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*; -import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -/** - * 用户签到积分 Service 接口 - * - * @author 芋道源码 - */ -public interface SignInRecordService { - - /** - * 创建用户签到积分 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createSignInRecord(@Valid SignInRecordCreateReqVO createReqVO); - - /** - * 更新用户签到积分 - * - * @param updateReqVO 更新信息 - */ - void updateSignInRecord(@Valid SignInRecordUpdateReqVO updateReqVO); - - /** - * 删除用户签到积分 - * - * @param id 编号 - */ - void deleteSignInRecord(Long id); - - /** - * 获得用户签到积分 - * - * @param id 编号 - * @return 用户签到积分 - */ - SignInRecordDO getSignInRecord(Long id); - - /** - * 获得用户签到积分列表 - * - * @param ids 编号 - * @return 用户签到积分列表 - */ - List getSignInRecordList(Collection ids); - - /** - * 获得用户签到积分分页 - * - * @param pageReqVO 分页查询 - * @return 用户签到积分分页 - */ - PageResult getSignInRecordPage(SignInRecordPageReqVO pageReqVO); - - /** - * 获得用户签到积分列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 用户签到积分列表 - */ - List getSignInRecordList(SignInRecordExportReqVO exportReqVO); - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImpl.java b/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImpl.java deleted file mode 100644 index 00ff4967e..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -package cn.iocoder.yudao.module.point.service.signinrecord; - -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.signinrecord.vo.*; -import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import cn.iocoder.yudao.module.point.convert.signinrecord.SignInRecordConvert; -import cn.iocoder.yudao.module.point.dal.mysql.signinrecord.SignInRecordMapper; - -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; - -/** - * 用户签到积分 Service 实现类 - * - * @author 芋道源码 - */ -@Service -@Validated -public class SignInRecordServiceImpl implements SignInRecordService { - - @Resource - private SignInRecordMapper signInRecordMapper; - - @Override - public Long createSignInRecord(SignInRecordCreateReqVO createReqVO) { - // 插入 - SignInRecordDO signInRecord = SignInRecordConvert.INSTANCE.convert(createReqVO); - signInRecordMapper.insert(signInRecord); - // 返回 - return signInRecord.getId(); - } - - @Override - public void updateSignInRecord(SignInRecordUpdateReqVO updateReqVO) { - // 校验存在 - validateSignInRecordExists(updateReqVO.getId()); - // 更新 - SignInRecordDO updateObj = SignInRecordConvert.INSTANCE.convert(updateReqVO); - signInRecordMapper.updateById(updateObj); - } - - @Override - public void deleteSignInRecord(Long id) { - // 校验存在 - validateSignInRecordExists(id); - // 删除 - signInRecordMapper.deleteById(id); - } - - private void validateSignInRecordExists(Long id) { - if (signInRecordMapper.selectById(id) == null) { - throw exception(SIGN_IN_RECORD_NOT_EXISTS); - } - } - - @Override - public SignInRecordDO getSignInRecord(Long id) { - return signInRecordMapper.selectById(id); - } - - @Override - public List getSignInRecordList(Collection ids) { - return signInRecordMapper.selectBatchIds(ids); - } - - @Override - public PageResult getSignInRecordPage(SignInRecordPageReqVO pageReqVO) { - return signInRecordMapper.selectPage(pageReqVO); - } - - @Override - public List getSignInRecordList(SignInRecordExportReqVO exportReqVO) { - return signInRecordMapper.selectList(exportReqVO); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointconfig/PointConfigServiceImplTest.java b/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointconfig/PointConfigServiceImplTest.java deleted file mode 100644 index d012d03fe..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointconfig/PointConfigServiceImplTest.java +++ /dev/null @@ -1,152 +0,0 @@ -package cn.iocoder.yudao.module.point.service.pointconfig; - -import cn.iocoder.yudao.framework.test.core.util.RandomUtils; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.mock.mockito.MockBean; - -import javax.annotation.Resource; - -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; - -import cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo.*; -import cn.iocoder.yudao.module.point.dal.dataobject.pointconfig.PointConfigDO; -import cn.iocoder.yudao.module.point.dal.mysql.pointconfig.PointConfigMapper; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import javax.annotation.Resource; -import org.springframework.context.annotation.Import; -import java.util.*; -import java.time.LocalDateTime; - -import static cn.hutool.core.util.RandomUtil.*; -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; - -/** - * {@link PointConfigServiceImpl} 的单元测试类 - * - * @author QingX - */ -@Import(PointConfigServiceImpl.class) -public class PointConfigServiceImplTest extends BaseDbUnitTest { - - @Resource - private PointConfigServiceImpl configService; - - @Resource - private PointConfigMapper configMapper; - - @Test - public void testCreateConfig_success() { - // 准备参数 - PointConfigCreateReqVO reqVO = randomPojo(PointConfigCreateReqVO.class); - - // 调用 - Integer configId = configService.createConfig(reqVO); - // 断言 - assertNotNull(configId); - // 校验记录的属性是否正确 - PointConfigDO config = configMapper.selectById(configId); - assertPojoEquals(reqVO, config); - } - - @Test - public void testUpdateConfig_success() { - // mock 数据 - PointConfigDO dbConfig = randomPojo(PointConfigDO.class); - configMapper.insert(dbConfig);// @Sql: 先插入出一条存在的数据 - // 准备参数 - PointConfigUpdateReqVO reqVO = randomPojo(PointConfigUpdateReqVO.class, o -> { - o.setId(dbConfig.getId()); // 设置更新的 ID - }); - - // 调用 - configService.updateConfig(reqVO); - // 校验是否更新正确 - PointConfigDO config = configMapper.selectById(reqVO.getId()); // 获取最新的 - assertPojoEquals(reqVO, config); - } - - @Test - public void testUpdateConfig_notExists() { - // 准备参数 - PointConfigUpdateReqVO reqVO = randomPojo(PointConfigUpdateReqVO.class); - - // 调用, 并断言异常 - assertServiceException(() -> configService.updateConfig(reqVO), CONFIG_NOT_EXISTS); - } - - @Test - public void testDeleteConfig_success() { - // mock 数据 - PointConfigDO dbConfig = randomPojo(PointConfigDO.class); - configMapper.insert(dbConfig);// @Sql: 先插入出一条存在的数据 - // 准备参数 - Integer id = dbConfig.getId(); - - // 调用 - configService.deleteConfig(id); - // 校验数据不存在了 - assertNull(configMapper.selectById(id)); - } - - @Test - public void testDeleteConfig_notExists() { - // 准备参数 - Integer id = RandomUtils.randomInteger(); - - // 调用, 并断言异常 - assertServiceException(() -> configService.deleteConfig(id), CONFIG_NOT_EXISTS); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetConfigPage() { - // mock 数据 - PointConfigDO dbConfig = randomPojo(PointConfigDO.class, o -> { // 等会查询到 - o.setTradeDeductEnable(null); - }); - configMapper.insert(dbConfig); - // 测试 tradeDeductEnable 不匹配 - configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setTradeDeductEnable(null))); - // 准备参数 - PointConfigPageReqVO reqVO = new PointConfigPageReqVO(); - reqVO.setTradeDeductEnable(null); - - // 调用 - PageResult pageResult = configService.getConfigPage(reqVO); - // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbConfig, pageResult.getList().get(0)); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetConfigList() { - // mock 数据 - PointConfigDO dbConfig = randomPojo(PointConfigDO.class, o -> { // 等会查询到 - o.setTradeDeductEnable(null); - }); - configMapper.insert(dbConfig); - // 测试 tradeDeductEnable 不匹配 - configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setTradeDeductEnable(null))); - // 准备参数 - PointConfigExportReqVO reqVO = new PointConfigExportReqVO(); - reqVO.setTradeDeductEnable(null); - - // 调用 - List list = configService.getConfigList(reqVO); - // 断言 - assertEquals(1, list.size()); - assertPojoEquals(dbConfig, list.get(0)); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImplTest.java b/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImplTest.java deleted file mode 100644 index 32a7740f0..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImplTest.java +++ /dev/null @@ -1,183 +0,0 @@ -package cn.iocoder.yudao.module.point.service.pointrecord; - -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.mock.mockito.MockBean; - -import javax.annotation.Resource; - -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; - -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.dal.mysql.pointrecord.PointRecordMapper; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import javax.annotation.Resource; -import org.springframework.context.annotation.Import; -import java.util.*; -import java.time.LocalDateTime; - -import static cn.hutool.core.util.RandomUtil.*; -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; - -/** - * {@link PointRecordServiceImpl} 的单元测试类 - * - * @author QingX - */ -@Import(PointRecordServiceImpl.class) -public class PointRecordServiceImplTest extends BaseDbUnitTest { - - @Resource - private PointRecordServiceImpl recordService; - - @Resource - private PointRecordMapper recordMapper; - - @Test - public void testCreateRecord_success() { - // 准备参数 - PointRecordCreateReqVO reqVO = randomPojo(PointRecordCreateReqVO.class); - - // 调用 - Long recordId = recordService.createRecord(reqVO); - // 断言 - assertNotNull(recordId); - // 校验记录的属性是否正确 - PointRecordDO record = recordMapper.selectById(recordId); - assertPojoEquals(reqVO, record); - } - - @Test - public void testUpdateRecord_success() { - // mock 数据 - PointRecordDO dbRecord = randomPojo(PointRecordDO.class); - recordMapper.insert(dbRecord);// @Sql: 先插入出一条存在的数据 - // 准备参数 - PointRecordUpdateReqVO reqVO = randomPojo(PointRecordUpdateReqVO.class, o -> { - o.setId(dbRecord.getId()); // 设置更新的 ID - }); - - // 调用 - recordService.updateRecord(reqVO); - // 校验是否更新正确 - PointRecordDO record = recordMapper.selectById(reqVO.getId()); // 获取最新的 - assertPojoEquals(reqVO, record); - } - - @Test - public void testUpdateRecord_notExists() { - // 准备参数 - PointRecordUpdateReqVO reqVO = randomPojo(PointRecordUpdateReqVO.class); - - // 调用, 并断言异常 - assertServiceException(() -> recordService.updateRecord(reqVO), RECORD_NOT_EXISTS); - } - - @Test - public void testDeleteRecord_success() { - // mock 数据 - PointRecordDO dbRecord = randomPojo(PointRecordDO.class); - recordMapper.insert(dbRecord);// @Sql: 先插入出一条存在的数据 - // 准备参数 - Long id = dbRecord.getId(); - - // 调用 - recordService.deleteRecord(id); - // 校验数据不存在了 - assertNull(recordMapper.selectById(id)); - } - - @Test - public void testDeleteRecord_notExists() { - // 准备参数 - Long id = randomLongId(); - - // 调用, 并断言异常 - assertServiceException(() -> recordService.deleteRecord(id), RECORD_NOT_EXISTS); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetRecordPage() { - // mock 数据 - PointRecordDO dbRecord = randomPojo(PointRecordDO.class, o -> { // 等会查询到 - o.setBizId(null); - o.setBizType(null); - o.setType(null); - o.setTitle(null); - o.setStatus(null); - }); - recordMapper.insert(dbRecord); - // 测试 bizId 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setBizId(null))); - // 测试 bizType 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setBizType(null))); - // 测试 type 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setType(null))); - // 测试 title 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setTitle(null))); - // 测试 status 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setStatus(null))); - // 准备参数 - PointRecordPageReqVO reqVO = new PointRecordPageReqVO(); - reqVO.setBizId(null); - reqVO.setBizType(null); - reqVO.setType(null); - reqVO.setTitle(null); - reqVO.setStatus(null); - - // 调用 - PageResult pageResult = recordService.getRecordPage(reqVO); - // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbRecord, pageResult.getList().get(0)); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetRecordList() { - // mock 数据 - PointRecordDO dbRecord = randomPojo(PointRecordDO.class, o -> { // 等会查询到 - o.setBizId(null); - o.setBizType(null); - o.setType(null); - o.setTitle(null); - o.setStatus(null); - }); - recordMapper.insert(dbRecord); - // 测试 bizId 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setBizId(null))); - // 测试 bizType 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setBizType(null))); - // 测试 type 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setType(null))); - // 测试 title 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setTitle(null))); - // 测试 status 不匹配 - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setStatus(null))); - // 准备参数 - PointRecordExportReqVO reqVO = new PointRecordExportReqVO(); - reqVO.setBizId(null); - reqVO.setBizType(null); - reqVO.setType(null); - reqVO.setTitle(null); - reqVO.setStatus(null); - - // 调用 - List list = recordService.getRecordList(reqVO); - // 断言 - assertEquals(1, list.size()); - assertPojoEquals(dbRecord, list.get(0)); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImplTest.java b/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImplTest.java deleted file mode 100644 index e0bd5a2b2..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImplTest.java +++ /dev/null @@ -1,152 +0,0 @@ -package cn.iocoder.yudao.module.point.service.signinconfig; - -import cn.iocoder.yudao.framework.test.core.util.RandomUtils; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.mock.mockito.MockBean; - -import javax.annotation.Resource; - -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; - -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.dal.mysql.signinconfig.SignInConfigMapper; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import javax.annotation.Resource; -import org.springframework.context.annotation.Import; -import java.util.*; -import java.time.LocalDateTime; - -import static cn.hutool.core.util.RandomUtil.*; -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; - -/** - * {@link SignInConfigServiceImpl} 的单元测试类 - * - * @author QingX - */ -@Import(SignInConfigServiceImpl.class) -public class SignInConfigServiceImplTest extends BaseDbUnitTest { - - @Resource - private SignInConfigServiceImpl signInConfigService; - - @Resource - private SignInConfigMapper signInConfigMapper; - - @Test - public void testCreateSignInConfig_success() { - // 准备参数 - SignInConfigCreateReqVO reqVO = randomPojo(SignInConfigCreateReqVO.class); - - // 调用 - Integer signInConfigId = signInConfigService.createSignInConfig(reqVO); - // 断言 - assertNotNull(signInConfigId); - // 校验记录的属性是否正确 - SignInConfigDO signInConfig = signInConfigMapper.selectById(signInConfigId); - assertPojoEquals(reqVO, signInConfig); - } - - @Test - public void testUpdateSignInConfig_success() { - // mock 数据 - SignInConfigDO dbSignInConfig = randomPojo(SignInConfigDO.class); - signInConfigMapper.insert(dbSignInConfig);// @Sql: 先插入出一条存在的数据 - // 准备参数 - SignInConfigUpdateReqVO reqVO = randomPojo(SignInConfigUpdateReqVO.class, o -> { - o.setId(dbSignInConfig.getId()); // 设置更新的 ID - }); - - // 调用 - signInConfigService.updateSignInConfig(reqVO); - // 校验是否更新正确 - SignInConfigDO signInConfig = signInConfigMapper.selectById(reqVO.getId()); // 获取最新的 - assertPojoEquals(reqVO, signInConfig); - } - - @Test - public void testUpdateSignInConfig_notExists() { - // 准备参数 - SignInConfigUpdateReqVO reqVO = randomPojo(SignInConfigUpdateReqVO.class); - - // 调用, 并断言异常 - assertServiceException(() -> signInConfigService.updateSignInConfig(reqVO), SIGN_IN_CONFIG_NOT_EXISTS); - } - - @Test - public void testDeleteSignInConfig_success() { - // mock 数据 - SignInConfigDO dbSignInConfig = randomPojo(SignInConfigDO.class); - signInConfigMapper.insert(dbSignInConfig);// @Sql: 先插入出一条存在的数据 - // 准备参数 - Integer id = dbSignInConfig.getId(); - - // 调用 - signInConfigService.deleteSignInConfig(id); - // 校验数据不存在了 - assertNull(signInConfigMapper.selectById(id)); - } - - @Test - public void testDeleteSignInConfig_notExists() { - // 准备参数 - Integer id = RandomUtils.randomInteger(); - - // 调用, 并断言异常 - assertServiceException(() -> signInConfigService.deleteSignInConfig(id), SIGN_IN_CONFIG_NOT_EXISTS); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetSignInConfigPage() { - // mock 数据 - SignInConfigDO dbSignInConfig = randomPojo(SignInConfigDO.class, o -> { // 等会查询到 - o.setDay(null); - }); - signInConfigMapper.insert(dbSignInConfig); - // 测试 day 不匹配 - signInConfigMapper.insert(cloneIgnoreId(dbSignInConfig, o -> o.setDay(null))); - // 准备参数 - SignInConfigPageReqVO reqVO = new SignInConfigPageReqVO(); - reqVO.setDay(null); - - // 调用 - PageResult pageResult = signInConfigService.getSignInConfigPage(reqVO); - // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbSignInConfig, pageResult.getList().get(0)); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetSignInConfigList() { - // mock 数据 - SignInConfigDO dbSignInConfig = randomPojo(SignInConfigDO.class, o -> { // 等会查询到 - o.setDay(null); - }); - signInConfigMapper.insert(dbSignInConfig); - // 测试 day 不匹配 - signInConfigMapper.insert(cloneIgnoreId(dbSignInConfig, o -> o.setDay(null))); - // 准备参数 - SignInConfigExportReqVO reqVO = new SignInConfigExportReqVO(); - reqVO.setDay(null); - - // 调用 - List list = signInConfigService.getSignInConfigList(reqVO); - // 断言 - assertEquals(1, list.size()); - assertPojoEquals(dbSignInConfig, list.get(0)); - } - -} diff --git a/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImplTest.java b/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImplTest.java deleted file mode 100644 index 267bfcd40..000000000 --- a/yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImplTest.java +++ /dev/null @@ -1,167 +0,0 @@ -package cn.iocoder.yudao.module.point.service.signinrecord; - -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.mock.mockito.MockBean; - -import javax.annotation.Resource; - -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; - -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.dal.mysql.signinrecord.SignInRecordMapper; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import javax.annotation.Resource; -import org.springframework.context.annotation.Import; -import java.util.*; -import java.time.LocalDateTime; - -import static cn.hutool.core.util.RandomUtil.*; -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; - -/** - * {@link SignInRecordServiceImpl} 的单元测试类 - * - * @author 芋道源码 - */ -@Import(SignInRecordServiceImpl.class) -public class SignInRecordServiceImplTest extends BaseDbUnitTest { - - @Resource - private SignInRecordServiceImpl signInRecordService; - - @Resource - private SignInRecordMapper signInRecordMapper; - - @Test - public void testCreateSignInRecord_success() { - // 准备参数 - SignInRecordCreateReqVO reqVO = randomPojo(SignInRecordCreateReqVO.class); - - // 调用 - Long signInRecordId = signInRecordService.createSignInRecord(reqVO); - // 断言 - assertNotNull(signInRecordId); - // 校验记录的属性是否正确 - SignInRecordDO signInRecord = signInRecordMapper.selectById(signInRecordId); - assertPojoEquals(reqVO, signInRecord); - } - - @Test - public void testUpdateSignInRecord_success() { - // mock 数据 - SignInRecordDO dbSignInRecord = randomPojo(SignInRecordDO.class); - signInRecordMapper.insert(dbSignInRecord);// @Sql: 先插入出一条存在的数据 - // 准备参数 - SignInRecordUpdateReqVO reqVO = randomPojo(SignInRecordUpdateReqVO.class, o -> { - o.setId(dbSignInRecord.getId()); // 设置更新的 ID - }); - - // 调用 - signInRecordService.updateSignInRecord(reqVO); - // 校验是否更新正确 - SignInRecordDO signInRecord = signInRecordMapper.selectById(reqVO.getId()); // 获取最新的 - assertPojoEquals(reqVO, signInRecord); - } - - @Test - public void testUpdateSignInRecord_notExists() { - // 准备参数 - SignInRecordUpdateReqVO reqVO = randomPojo(SignInRecordUpdateReqVO.class); - - // 调用, 并断言异常 - assertServiceException(() -> signInRecordService.updateSignInRecord(reqVO), SIGN_IN_RECORD_NOT_EXISTS); - } - - @Test - public void testDeleteSignInRecord_success() { - // mock 数据 - SignInRecordDO dbSignInRecord = randomPojo(SignInRecordDO.class); - signInRecordMapper.insert(dbSignInRecord);// @Sql: 先插入出一条存在的数据 - // 准备参数 - Long id = dbSignInRecord.getId(); - - // 调用 - signInRecordService.deleteSignInRecord(id); - // 校验数据不存在了 - assertNull(signInRecordMapper.selectById(id)); - } - - @Test - public void testDeleteSignInRecord_notExists() { - // 准备参数 - Long id = randomLongId(); - - // 调用, 并断言异常 - assertServiceException(() -> signInRecordService.deleteSignInRecord(id), SIGN_IN_RECORD_NOT_EXISTS); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetSignInRecordPage() { - // mock 数据 - SignInRecordDO dbSignInRecord = randomPojo(SignInRecordDO.class, o -> { // 等会查询到 - o.setUserId(null); - o.setDay(null); - o.setCreateTime(null); - }); - signInRecordMapper.insert(dbSignInRecord); - // 测试 userId 不匹配 - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setUserId(null))); - // 测试 day 不匹配 - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setDay(null))); - // 测试 createTime 不匹配 - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setCreateTime(null))); - // 准备参数 - SignInRecordPageReqVO reqVO = new SignInRecordPageReqVO(); - reqVO.setUserId(null); - reqVO.setDay(null); - reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - - // 调用 - PageResult pageResult = signInRecordService.getSignInRecordPage(reqVO); - // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbSignInRecord, pageResult.getList().get(0)); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetSignInRecordList() { - // mock 数据 - SignInRecordDO dbSignInRecord = randomPojo(SignInRecordDO.class, o -> { // 等会查询到 - o.setUserId(null); - o.setDay(null); - o.setCreateTime(null); - }); - signInRecordMapper.insert(dbSignInRecord); - // 测试 userId 不匹配 - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setUserId(null))); - // 测试 day 不匹配 - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setDay(null))); - // 测试 createTime 不匹配 - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setCreateTime(null))); - // 准备参数 - SignInRecordExportReqVO reqVO = new SignInRecordExportReqVO(); - reqVO.setUserId(null); - reqVO.setDay(null); - reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - - // 调用 - List list = signInRecordService.getSignInRecordList(reqVO); - // 断言 - assertEquals(1, list.size()); - assertPojoEquals(dbSignInRecord, list.get(0)); - } - -} From 9b90320985a781ab17cae38fac583ccb420e64a5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 2 Jul 2023 12:55:15 +0800 Subject: [PATCH 39/42] =?UTF-8?q?mall=20+=20trade=EF=BC=9A=201=E3=80=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E9=80=81=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductCommentServiceImplTest.java | 1 - .../enums/delivery/DeliveryTypeEnum.java | 1 + .../AppDeliverPickUpStoreController.java | 26 ++++++++++++++++--- .../app/order/AppTradeOrderController.java | 8 ++++++ .../order/vo/AppTradeOrderDetailRespVO.java | 3 +++ .../vo/AppTradeOrderSettlementReqVO.java | 2 +- .../dal/dataobject/order/TradeOrderDO.java | 16 ++++++------ .../service/order/TradeOrderServiceTest.java | 13 +++++----- 8 files changed, 50 insertions(+), 20 deletions(-) diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImplTest.java index 7684def99..8d3a3d5b8 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImplTest.java +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImplTest.java @@ -151,7 +151,6 @@ public class ProductCommentServiceImplTest extends BaseDbUnitTest { // 测试分页 tab count AppCommentStatisticsRespVO tabsCount = productCommentService.getCommentStatistics(spuId, Boolean.TRUE); - assertEquals(6, tabsCount.getAllCount()); assertEquals(4, tabsCount.getGoodCount()); assertEquals(2, tabsCount.getMediocreCount()); assertEquals(0, tabsCount.getNegativeCount()); diff --git a/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/delivery/DeliveryTypeEnum.java b/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/delivery/DeliveryTypeEnum.java index 210f5c307..7754f115d 100644 --- a/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/delivery/DeliveryTypeEnum.java +++ b/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/delivery/DeliveryTypeEnum.java @@ -15,6 +15,7 @@ import java.util.Arrays; @AllArgsConstructor public enum DeliveryTypeEnum implements IntArrayValuable { + NULL(0, "无需物流"), EXPRESS(1, "快递发货"), PICK_UP(2, "用户自提"),; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverPickUpStoreController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverPickUpStoreController.java index 4803b17c4..275eacde8 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverPickUpStoreController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverPickUpStoreController.java @@ -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 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); + } + } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java index 908850d76..6567e3169 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java @@ -127,6 +127,14 @@ public class AppTradeOrderController { return success(orderCount); } + @PutMapping("/take") + @Operation(summary = "确认交易订单收货") + @Parameter(name = "id", description = "交易订单编号") + public CommonResult takeOrder(@RequestParam("id") Long id) { + // TODO @芋艿:未实现,mock 用 + return success(true); + } + @DeleteMapping("/cancel") @Operation(summary = "取消交易订单") @Parameter(name = "id", description = "交易订单编号") diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java index f0915e27e..f9e6a6864 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java @@ -102,6 +102,9 @@ public class AppTradeOrderDetailRespVO { @Schema(description = "收件人详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "中关村大街 1 号") private String receiverDetailAddress; + @Schema(description = "自提门店编号", example = "1088") + private Long pickUpStoreId; + // ========== 售后基本信息 ========== // ========== 营销基本信息 ========== diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java index 9c0623fed..f3a7d9120 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java @@ -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") // 选择门店自提时,该字段为联系人手机 diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java index 0a4d2c25c..011e8546f 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java @@ -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; + // ========== 售后基本信息 ========== /** * 售后状态 diff --git a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java index 184d1c178..9401f4caf 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java @@ -115,7 +115,7 @@ 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 方法(价格计算) PriceCalculateRespDTO.OrderItem priceOrderItem01 = new PriceCalculateRespDTO.OrderItem() @@ -150,12 +150,12 @@ public class TradeOrderServiceTest extends BaseDbUnitTest { }))).thenReturn(1000L); // 调用方法 - Long tradeOrderId = tradeOrderService.createOrder(userId, userIp, reqVO); + TradeOrderDO order = tradeOrderService.createOrder(userId, userIp, reqVO); // 断言 TradeOrderDO 订单 List tradeOrderDOs = tradeOrderMapper.selectList(); assertEquals(tradeOrderDOs.size(), 1); TradeOrderDO tradeOrderDO = tradeOrderDOs.get(0); - assertEquals(tradeOrderDO.getId(), tradeOrderId); + assertEquals(tradeOrderDO.getId(), order.getId()); assertNotNull(tradeOrderDO.getNo()); assertEquals(tradeOrderDO.getType(), TradeOrderTypeEnum.NORMAL.getType()); assertEquals(tradeOrderDO.getTerminal(), TerminalEnum.H5.getTerminal()); @@ -176,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()); @@ -195,7 +194,7 @@ public class TradeOrderServiceTest extends BaseDbUnitTest { TradeOrderItemDO tradeOrderItemDO01 = tradeOrderItemDOs.get(0); assertNotNull(tradeOrderItemDO01.getId()); assertEquals(tradeOrderItemDO01.getUserId(), userId); - assertEquals(tradeOrderItemDO01.getOrderId(), tradeOrderId); + assertEquals(tradeOrderItemDO01.getOrderId(), order.getId()); assertEquals(tradeOrderItemDO01.getSpuId(), 11L); assertEquals(tradeOrderItemDO01.getSkuId(), 1L); assertEquals(tradeOrderItemDO01.getProperties().size(), 1); @@ -213,7 +212,7 @@ public class TradeOrderServiceTest extends BaseDbUnitTest { TradeOrderItemDO tradeOrderItemDO02 = tradeOrderItemDOs.get(1); assertNotNull(tradeOrderItemDO02.getId()); assertEquals(tradeOrderItemDO02.getUserId(), userId); - assertEquals(tradeOrderItemDO02.getOrderId(), tradeOrderId); + assertEquals(tradeOrderItemDO02.getOrderId(), order.getId()); assertEquals(tradeOrderItemDO02.getSpuId(), 21L); assertEquals(tradeOrderItemDO02.getSkuId(), 2L); assertEquals(tradeOrderItemDO02.getProperties().size(), 1); @@ -239,7 +238,7 @@ public class TradeOrderServiceTest extends BaseDbUnitTest { verify(couponApi).useCoupon(argThat(reqDTO -> { assertEquals(reqDTO.getId(), reqVO.getCouponId()); assertEquals(reqDTO.getUserId(), userId); - assertEquals(reqDTO.getOrderId(), tradeOrderId); + assertEquals(reqDTO.getOrderId(), order.getId()); return true; })); } From 040a66965c67ca07f52c7d2e057df2ea6a33f2f7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 2 Jul 2023 23:19:13 +0800 Subject: [PATCH 40/42] =?UTF-8?q?mall=20+=20member=EF=BC=9A=201=E3=80=81re?= =?UTF-8?q?view=20=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/enums/ErrorCodeConstants.java | 4 +- .../point/MemberPointRecordController.java | 33 ++-------- .../vo/recrod/MemberPointRecordExcelVO.java | 61 ------------------- .../signin/MemberSignInConfigController.java | 33 ++-------- .../signin/MemberSignInRecordController.java | 33 +--------- .../signin/vo/MemberSignInConfigBaseVO.java | 2 +- .../signin/vo/MemberSignInConfigExcelVO.java | 26 -------- .../vo/MemberSignInConfigExportReqVO.java | 13 ---- .../signin/vo/MemberSignInRecordExcelVO.java | 31 ---------- .../vo/MemberSignInRecordExportReqVO.java | 25 -------- .../point/MemberPointRecordConvert.java | 8 --- .../signin/MemberSignInConfigConvert.java | 11 ++-- .../signin/MemberSignInRecordConvert.java | 8 --- .../dataobject/point/MemberPointRecordDO.java | 4 +- .../mysql/point/MemberPointRecordMapper.java | 13 ---- .../signin/MemberSignInConfigMapper.java | 9 --- .../signin/MemberSignInRecordMapper.java | 11 ---- .../point/MemberPointConfigServiceImpl.java | 4 +- .../point/MemberPointRecordService.java | 23 +------ .../point/MemberPointRecordServiceImpl.java | 13 ---- .../signin/MemberSignInConfigService.java | 24 +------- .../signin/MemberSignInConfigServiceImpl.java | 40 ++++++------ .../signin/MemberSignInRecordService.java | 24 +------- .../signin/MemberSignInRecordServiceImpl.java | 24 ++------ .../dal/dataobject/member/MemberWalletDO.java | 7 ++- .../src/main/resources/application-local.yaml | 15 +++-- 26 files changed, 62 insertions(+), 437 deletions(-) delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.java delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.java delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.java delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.java diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java index 8a4cd7f63..25fcdc874 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java @@ -24,10 +24,8 @@ public interface ErrorCodeConstants { ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1004004000, "用户收件地址不存在"); //========== 用户积分 1004005000 ========== - ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(1004005001, "积分设置不存在"); - - ErrorCode CONFIG_EXISTS = new ErrorCode(1004005002, "积分设置已存在,只允配置一条记录"); + // TODO @xiaqing:错误码要分段;例如说这里,积分配置、积分记录、签到配置、签到记录;分成 4 段; ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(1004005003, "签到天数规则不存在"); ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(1004005004, "签到天数规则已存在"); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java index 70c7b9f09..ef207075c 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java @@ -2,9 +2,9 @@ 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.framework.excel.core.util.ExcelUtils; -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.*; +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; @@ -16,14 +16,9 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.io.IOException; -import java.util.Collection; -import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; @Tag(name = "管理后台 - 用户积分记录") @RestController @@ -34,6 +29,7 @@ public class MemberPointRecordController { @Resource private MemberPointRecordService recordService; + // TODO @xiaqing:积分应该没有更新操作呀?可以删除哈; @PutMapping("/update") @Operation(summary = "更新用户积分记录") @PreAuthorize("@ss.hasPermission('point:record:update')") @@ -51,15 +47,6 @@ public class MemberPointRecordController { return success(MemberPointRecordConvert.INSTANCE.convert(record)); } - @GetMapping("/list") - @Operation(summary = "获得用户积分记录列表") - @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") - @PreAuthorize("@ss.hasPermission('point:record:query')") - public CommonResult> getRecordList(@RequestParam("ids") Collection ids) { - List list = recordService.getRecordList(ids); - return success(MemberPointRecordConvert.INSTANCE.convertList(list)); - } - @GetMapping("/page") @Operation(summary = "获得用户积分记录分页") @PreAuthorize("@ss.hasPermission('point:record:query')") @@ -68,16 +55,4 @@ public class MemberPointRecordController { return success(MemberPointRecordConvert.INSTANCE.convertPage(pageResult)); } - @GetMapping("/export-excel") - @Operation(summary = "导出用户积分记录 Excel") - @PreAuthorize("@ss.hasPermission('point:record:export')") - @OperateLog(type = EXPORT) - public void exportRecordExcel(@Valid MemberPointRecordExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = recordService.getRecordList(exportReqVO); - // 导出 Excel - List datas = MemberPointRecordConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "用户积分记录.xls", "数据", MemberPointRecordExcelVO.class, datas); - } - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.java deleted file mode 100644 index e093c58fa..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.java +++ /dev/null @@ -1,61 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; - -import lombok.*; - -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 MemberPointRecordExcelVO { - - @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; - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java index 39c885bc6..ea208b6c6 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java @@ -2,9 +2,10 @@ 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.framework.excel.core.util.ExcelUtils; -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; +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; @@ -16,14 +17,9 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.io.IOException; -import java.util.Collection; -import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; @Tag(name = "管理后台 - 积分签到规则") @RestController @@ -67,15 +63,6 @@ public class MemberSignInConfigController { return success(MemberSignInConfigConvert.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> getSignInConfigList(@RequestParam("ids") Collection ids) { - List list = memberSignInConfigService.getSignInConfigList(ids); - return success(MemberSignInConfigConvert.INSTANCE.convertList(list)); - } - @GetMapping("/page") @Operation(summary = "获得积分签到规则分页") @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") @@ -84,16 +71,4 @@ public class MemberSignInConfigController { return success(MemberSignInConfigConvert.INSTANCE.convertPage(pageResult)); } - @GetMapping("/export-excel") - @Operation(summary = "导出积分签到规则 Excel") - @PreAuthorize("@ss.hasPermission('point:sign-in-config:export')") - @OperateLog(type = EXPORT) - public void exportSignInConfigExcel(@Valid MemberSignInConfigExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = memberSignInConfigService.getSignInConfigList(exportReqVO); - // 导出 Excel - List datas = MemberSignInConfigConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "积分签到规则.xls", "数据", MemberSignInConfigExcelVO.class, datas); - } - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java index fcb9f71e7..fae6ebdab 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java @@ -2,9 +2,8 @@ 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.framework.excel.core.util.ExcelUtils; -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; +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; @@ -16,14 +15,9 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.io.IOException; -import java.util.Collection; -import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; @Tag(name = "管理后台 - 用户签到积分") @RestController @@ -34,6 +28,7 @@ public class MemberSignInRecordController { @Resource private MemberSignInRecordService memberSignInRecordService; + // TODO @xiaqing:签到是不是不用删除? @DeleteMapping("/delete") @Operation(summary = "删除用户签到积分") @Parameter(name = "id", description = "编号", required = true) @@ -52,15 +47,6 @@ public class MemberSignInRecordController { return success(MemberSignInRecordConvert.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> getSignInRecordList(@RequestParam("ids") Collection ids) { - List list = memberSignInRecordService.getSignInRecordList(ids); - return success(MemberSignInRecordConvert.INSTANCE.convertList(list)); - } - @GetMapping("/page") @Operation(summary = "获得用户签到积分分页") @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") @@ -68,17 +54,4 @@ public class MemberSignInRecordController { PageResult pageResult = memberSignInRecordService.getSignInRecordPage(pageVO); return success(MemberSignInRecordConvert.INSTANCE.convertPage(pageResult)); } - - @GetMapping("/export-excel") - @Operation(summary = "导出用户签到积分 Excel") - @PreAuthorize("@ss.hasPermission('point:sign-in-record:export')") - @OperateLog(type = EXPORT) - public void exportSignInRecordExcel(@Valid MemberSignInRecordExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = memberSignInRecordService.getSignInRecordList(exportReqVO); - // 导出 Excel - List datas = MemberSignInRecordConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "用户签到积分.xls", "数据", MemberSignInRecordExcelVO.class, datas); - } - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java index 5410ccde7..334d98ad2 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java @@ -10,7 +10,7 @@ import lombok.*; @Data public class MemberSignInConfigBaseVO { - @Schema(description = "签到第x天", example = "7") + @Schema(description = "签到第 x 天", example = "7") private Integer day; @Schema(description = "签到天数对应分数", example = "10") diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.java deleted file mode 100644 index c50c7a291..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.admin.signin.vo; - -import lombok.*; - -import java.time.LocalDateTime; - -import com.alibaba.excel.annotation.ExcelProperty; - -/** - * 积分签到规则 Excel VO - * - * @author QingX - */ -@Data -public class MemberSignInConfigExcelVO { - - @ExcelProperty("签到第x天") - private Integer day; - - @ExcelProperty("签到天数对应分数") - private Integer point; - - @ExcelProperty("创建时间") - private LocalDateTime createTime; - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.java deleted file mode 100644 index f714786f6..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.java +++ /dev/null @@ -1,13 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.admin.signin.vo; - -import lombok.*; -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema(description = "管理后台 - 积分签到规则 Excel 导出 Request VO,参数和 SignInConfigPageReqVO 是一致的") -@Data -public class MemberSignInConfigExportReqVO { - - @Schema(description = "签到第x天", example = "7") - private Integer day; - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java deleted file mode 100644 index 9deec36e1..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.admin.signin.vo; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * 用户签到积分 Excel VO - * - * @author 芋道源码 - */ -@Data -public class MemberSignInRecordExcelVO { - - @ExcelProperty("签到自增id") - private Long id; - - @ExcelProperty("签到用户") - private Integer userId; - - @ExcelProperty("第几天签到") - private Integer day; - - @ExcelProperty("签到的分数") - private Integer point; - - @ExcelProperty("签到时间") - private LocalDateTime createTime; - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.java deleted file mode 100644 index df919be76..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.admin.signin.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -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; - -@Schema(description = "管理后台 - 用户签到积分 Excel 导出 Request VO,参数和 SignInRecordPageReqVO 是一致的") -@Data -public class MemberSignInRecordExportReqVO { - - @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; - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java index 8d94843cd..4a771884b 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java @@ -1,11 +1,7 @@ package cn.iocoder.yudao.module.member.convert.point; -import java.util.*; - 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.MemberPointRecordExcelVO; 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; @@ -28,10 +24,6 @@ public interface MemberPointRecordConvert { MemberPointRecordRespVO convert(MemberPointRecordDO bean); - List convertList(List list); - PageResult convertPage(PageResult page); - List convertList02(List list); - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java index 1068e089e..dcfcc932a 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java @@ -1,13 +1,14 @@ package cn.iocoder.yudao.module.member.convert.signin; -import java.util.*; - 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 cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; + +import java.util.List; /** * 积分签到规则 Convert @@ -29,6 +30,4 @@ public interface MemberSignInConfigConvert { PageResult convertPage(PageResult page); - List convertList02(List list); - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java index bc8d1ca62..0af4e6178 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java @@ -1,11 +1,7 @@ package cn.iocoder.yudao.module.member.convert.signin; -import java.util.*; - 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.MemberSignInRecordExcelVO; 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; @@ -28,10 +24,6 @@ public interface MemberSignInRecordConvert { MemberSignInRecordRespVO convert(MemberSignInRecordDO bean); - List convertList(List list); - PageResult convertPage(PageResult page); - List convertList02(List list); - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java index 59b55d314..895aea458 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java @@ -35,12 +35,13 @@ public class MemberPointRecordDO 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; /** * 积分标题 @@ -60,7 +61,6 @@ public class MemberPointRecordDO extends BaseDO { private Integer totalPoint; /** * 状态:1-订单创建,2-冻结期,3-完成,4-失效(订单退款) - * * 枚举 {@link TODO point_status 对应的类} */ diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java index 67cca615e..095aa37f7 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java @@ -3,13 +3,10 @@ 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.MemberPointRecordExportReqVO; 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; -import java.util.List; - /** * 用户积分记录 Mapper * @@ -28,14 +25,4 @@ public interface MemberPointRecordMapper extends BaseMapperX selectList(MemberPointRecordExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .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)); - } - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java index 5b6a9a7cc..6f14d0d5d 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java @@ -3,14 +3,11 @@ 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.MemberSignInConfigExportReqVO; 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; -import java.util.List; - /** * 积分签到规则 Mapper * @@ -25,12 +22,6 @@ public interface MemberSignInConfigMapper extends BaseMapperX selectList(MemberSignInConfigExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(MemberSignInConfigDO::getDay, reqVO.getDay()) - .orderByDesc(MemberSignInConfigDO::getId)); - } - // default long selectSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO){ return selectCount(new LambdaQueryWrapperX () diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java index e7d45569e..532efa362 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java @@ -3,13 +3,10 @@ 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.MemberSignInRecordExportReqVO; 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; -import java.util.List; - /** * 用户签到积分 Mapper * @@ -26,12 +23,4 @@ public interface MemberSignInRecordMapper extends BaseMapperX selectList(MemberSignInRecordExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId()) - .eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay()) - .betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(MemberSignInRecordDO::getId)); - } - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java index 103dc20b9..ebec0b579 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java @@ -3,7 +3,6 @@ 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.dataobject.point.MemberPointRecordDO; import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointConfigMapper; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -25,6 +24,7 @@ public class MemberPointConfigServiceImpl implements MemberPointConfigService { @Override public void saveConfig(MemberPointConfigSaveReqVO saveReqVO) { + // TODO @xiaqing:直接 getConfig() 查询,如果不存在,则插入;存在,则进行更新; long total = pointConfigMapper.selectCount(); MemberPointConfigDO pointConfigDO = MemberPointConfigConvert.INSTANCE.convert(saveReqVO); //大于0存在记录,则更新,否则插入 @@ -38,6 +38,8 @@ public class MemberPointConfigServiceImpl implements MemberPointConfigService { @Override public MemberPointConfigDO getConfig() { List list = pointConfigMapper.selectList(); + // TODO @xiaqing:可以使用 CollUtil.getFirst() return list == null ? null : list.get(0); } + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java index 1191ef86b..37ac5ea2d 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java @@ -1,15 +1,11 @@ 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.MemberPointRecordCreateReqVO; -import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordExportReqVO; 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; -import java.util.Collection; -import java.util.List; /** * 用户积分记录 Service 接口 @@ -17,7 +13,7 @@ import java.util.List; * @author QingX */ public interface MemberPointRecordService { - + // TODO @xiaqing:方法和方法之间,是空一行哈; /** * 更新用户积分记录 @@ -27,7 +23,6 @@ public interface MemberPointRecordService { void updateRecord(@Valid MemberPointRecordUpdateReqVO updateReqVO); - /** * 获得用户积分记录 * @@ -36,14 +31,6 @@ public interface MemberPointRecordService { */ MemberPointRecordDO getRecord(Long id); - /** - * 获得用户积分记录列表 - * - * @param ids 编号 - * @return 用户积分记录列表 - */ - List getRecordList(Collection ids); - /** * 获得用户积分记录分页 * @@ -52,12 +39,4 @@ public interface MemberPointRecordService { */ PageResult getRecordPage(MemberPointRecordPageReqVO pageReqVO); - /** - * 获得用户积分记录列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 用户积分记录列表 - */ - List getRecordList(MemberPointRecordExportReqVO exportReqVO); - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java index 4199d2997..e1d675723 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java @@ -1,8 +1,6 @@ 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.MemberPointRecordCreateReqVO; -import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordExportReqVO; 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; @@ -40,7 +38,6 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService { recordMapper.updateById(updateObj); } - private void validateRecordExists(Long id) { if (recordMapper.selectById(id) == null) { throw exception(ErrorCodeConstants.RECORD_NOT_EXISTS); @@ -52,19 +49,9 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService { return recordMapper.selectById(id); } - @Override - public List getRecordList(Collection ids) { - return recordMapper.selectBatchIds(ids); - } - @Override public PageResult getRecordPage(MemberPointRecordPageReqVO pageReqVO) { return recordMapper.selectPage(pageReqVO); } - @Override - public List getRecordList(MemberPointRecordExportReqVO exportReqVO) { - return recordMapper.selectList(exportReqVO); - } - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java index 28b993632..f58870507 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java @@ -1,14 +1,12 @@ package cn.iocoder.yudao.module.member.service.signin; -import java.util.*; -import javax.validation.*; - +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.MemberSignInConfigExportReqVO; 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 cn.iocoder.yudao.framework.common.pojo.PageResult; + +import javax.validation.Valid; /** * 积分签到规则 Service 接口 @@ -47,14 +45,6 @@ public interface MemberSignInConfigService { */ MemberSignInConfigDO getSignInConfig(Integer id); - /** - * 获得积分签到规则列表 - * - * @param ids 编号 - * @return 积分签到规则列表 - */ - List getSignInConfigList(Collection ids); - /** * 获得积分签到规则分页 * @@ -63,12 +53,4 @@ public interface MemberSignInConfigService { */ PageResult getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO); - /** - * 获得积分签到规则列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 积分签到规则列表 - */ - List getSignInConfigList(MemberSignInConfigExportReqVO exportReqVO); - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java index 8fdf8a54f..a1cc2e321 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java @@ -1,20 +1,20 @@ package cn.iocoder.yudao.module.member.service.signin; -import cn.iocoder.yudao.module.member.service.signin.MemberSignInConfigService; +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 javax.annotation.Resource; import org.springframework.validation.annotation.Validated; -import java.util.*; -import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; -import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert; -import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInConfigMapper; +import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; +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 实现类 @@ -28,17 +28,19 @@ 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) { // 校验存在 @@ -65,6 +67,8 @@ public class MemberSignInConfigServiceImpl implements MemberSignInConfigService throw exception(SIGN_IN_CONFIG_NOT_EXISTS); } } + + // TODO @xiaqing:这个唯一判断,也可以参考下别的模块哈; //根据签到天数判断是否存在一个相同的天数 private void validateSignInConfigExistsDay(Integer day) { if (memberSignInConfigMapper.selectCount(MemberSignInConfigDO::getDay,day)>0) { @@ -72,32 +76,22 @@ public class MemberSignInConfigServiceImpl implements MemberSignInConfigService } } - //更新天数时判断是否有重复的天数,需要去除自己 + // 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 List getSignInConfigList(Collection ids) { - return memberSignInConfigMapper.selectBatchIds(ids); - } - @Override public PageResult getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO) { return memberSignInConfigMapper.selectPage(pageReqVO); } - @Override - public List getSignInConfigList(MemberSignInConfigExportReqVO exportReqVO) { - return memberSignInConfigMapper.selectList(exportReqVO); - } - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java index b5bda4720..0faf2c1a9 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java @@ -1,10 +1,8 @@ package cn.iocoder.yudao.module.member.service.signin; -import java.util.*; -import javax.validation.*; -import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; -import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; 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 接口 @@ -13,8 +11,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; */ public interface MemberSignInRecordService { - - /** * 删除用户签到积分 * @@ -30,14 +26,6 @@ public interface MemberSignInRecordService { */ MemberSignInRecordDO getSignInRecord(Long id); - /** - * 获得用户签到积分列表 - * - * @param ids 编号 - * @return 用户签到积分列表 - */ - List getSignInRecordList(Collection ids); - /** * 获得用户签到积分分页 * @@ -46,12 +34,4 @@ public interface MemberSignInRecordService { */ PageResult getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO); - /** - * 获得用户签到积分列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 用户签到积分列表 - */ - List getSignInRecordList(MemberSignInRecordExportReqVO exportReqVO); - } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java index 3476dfa57..23698b5e8 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java @@ -1,22 +1,16 @@ package cn.iocoder.yudao.module.member.service.signin; -import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordCreateReqVO; -import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordExportReqVO; +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.MemberSignInRecordUpdateReqVO; 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 javax.annotation.Resource; import org.springframework.validation.annotation.Validated; -import java.util.*; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert; -import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper; +import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_RECORD_NOT_EXISTS; /** * 用户签到积分 Service 实现类 @@ -49,19 +43,9 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService return memberSignInRecordMapper.selectById(id); } - @Override - public List getSignInRecordList(Collection ids) { - return memberSignInRecordMapper.selectBatchIds(ids); - } - @Override public PageResult getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO) { return memberSignInRecordMapper.selectPage(pageReqVO); } - @Override - public List getSignInRecordList(MemberSignInRecordExportReqVO exportReqVO) { - return memberSignInRecordMapper.selectList(exportReqVO); - } - } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletDO.java index 043481103..e6e92bf82 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletDO.java @@ -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; @@ -43,4 +46,4 @@ public class MemberWalletDO extends BaseDO { * 累计充值, 单位分 */ private Integer totalTopUp; -} \ No newline at end of file +} diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index c748e9455..cdc1d3fde 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -44,31 +44,31 @@ spring: primary: master datasource: master: - name: mall - url: jdbc:mysql://10.211.55.5:3308/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + name: ruoyi-vue-pro + url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例 username: root - password: 1qaz!QAZ + password: 123456 # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W slave: # 模拟从库,可根据自己需要修改 - name: mall - url: jdbc:mysql://10.211.55.5:3308/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + name: ruoyi-vue-pro + url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例 username: root - password: 1qaz!QAZ + password: 123456 # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 redis: - host: 10.211.55.5 # 地址 + host: 127.0.0.1 # 地址 port: 6379 # 端口 database: 0 # 数据库索引 # password: dev # 密码,建议生产环境开启 @@ -159,7 +159,6 @@ logging: cn.iocoder.yudao.module.member.dal.mysql: debug cn.iocoder.yudao.module.trade.dal.mysql: debug cn.iocoder.yudao.module.promotion.dal.mysql: debug - cn.iocoder.yudao.module.point.dal.mysql: debug debug: false From 11c4c950b746fdabd4d2e4f751e1499cf838ac6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=8B=E9=81=93=E6=BA=90=E7=A0=81?= Date: Sun, 2 Jul 2023 15:41:26 +0000 Subject: [PATCH 41/42] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!5?= =?UTF-8?q?18=20:=20=E6=B7=BB=E5=8A=A0=E5=8D=8E=E4=B8=BA=E4=BA=91=20maven?= =?UTF-8?q?=20=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++-- pom.xml | 11 ++------ yudao-dependencies/pom.xml | 28 +++++++++---------- yudao-example/yudao-sso-demo-by-code/pom.xml | 4 +-- .../yudao-sso-demo-by-password/pom.xml | 4 +-- .../yudao-spring-boot-starter-biz-pay/pom.xml | 2 +- .../pom.xml | 4 +-- .../config/YudaoSocialAutoConfiguration.java | 8 +++--- .../social/core/YudaoAuthRequestFactory.java | 12 ++++---- .../social/core/enums/AuthExtendSource.java | 10 ++----- .../request/AuthWeChatMiniAppRequest.java | 22 +++++++-------- .../pom.xml | 5 ++-- .../service/auth/MemberAuthServiceImpl.java | 2 +- .../service/social/SocialUserServiceImpl.java | 10 +++---- .../social/SocialUserServiceImplTest.java | 12 ++++---- yudao-server/pom.xml | 2 +- 16 files changed, 66 insertions(+), 76 deletions(-) diff --git a/README.md b/README.md index 445e50014..e2eb27acd 100644 --- a/README.md +++ b/README.md @@ -249,9 +249,9 @@ ps:核心功能已经实现,正在对接微信小程序中... | 框架 | 说明 | 版本 | 学习指南 | |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------| -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.13 | [文档](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.18 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | +| [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) | | [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.6.1 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | [Redis](https://redis.io/) | key-value 数据库 | 5.0 / 6.0 | | @@ -267,7 +267,7 @@ ps:核心功能已经实现,正在对接微信小程序中... | [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.7.10 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | | [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | | | [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.5.5.Final | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) | -| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.28 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | +| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.26 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | | [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - | | [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.8.0 | - | diff --git a/pom.xml b/pom.xml index d221cb4f4..4f1350a10 100644 --- a/pom.xml +++ b/pom.xml @@ -38,8 +38,8 @@ 3.0.0-M5 3.8.1 - 1.18.28 - 2.7.13 + 1.18.26 + 2.7.12 1.5.5.Final UTF-8 @@ -96,13 +96,8 @@ - + - - huaweicloud - huawei - https://mirrors.huaweicloud.com/repository/maven/ - aliyunmaven aliyun diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 1b9f8301a..0ca928387 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -16,17 +16,17 @@ 1.7.3-snapshot - 2.7.13 + 2.7.12 1.6.15 4.1.0 2.5 - 1.2.18 + 1.2.16 3.5.3.1 3.5.3.1 3.6.1 - 1.4.5 + 1.4.3.2 3.18.0 8.1.2.141 @@ -43,16 +43,16 @@ 6.8.0 - 1.0.5 + 1.0.2 1.15.4 - 1.18.28 + 1.18.26 1.5.5.Final - 5.8.20 - 3.3.2 + 5.8.18 + 3.3.1 2.3 1.0.5 1.2.83 - 32.0.1-jre + 32.0.0-jre 5.1.0 2.14.2 3.9.0 @@ -64,14 +64,14 @@ 3.0.0 4.10.0 2.11.0 - 8.5.4 + 8.5.2 4.6.3 2.2.1 3.1.758 - 1.0.1 - 1.5.8 + 1.4.0 + 1.5.6 2.12.2 - 4.5.0 + 4.3.0 @@ -589,8 +589,8 @@ - com.xingyuv - spring-boot-starter-justauth + com.xkcoding.justauth + justauth-spring-boot-starter ${justauth.version} diff --git a/yudao-example/yudao-sso-demo-by-code/pom.xml b/yudao-example/yudao-sso-demo-by-code/pom.xml index dc0c0241e..d3f745dba 100644 --- a/yudao-example/yudao-sso-demo-by-code/pom.xml +++ b/yudao-example/yudao-sso-demo-by-code/pom.xml @@ -21,7 +21,7 @@ 8 UTF-8 - 2.7.13 + 2.7.12 @@ -52,7 +52,7 @@ cn.hutool hutool-all - 5.8.20 + 5.8.18 diff --git a/yudao-example/yudao-sso-demo-by-password/pom.xml b/yudao-example/yudao-sso-demo-by-password/pom.xml index ee5d05390..d6e73916d 100644 --- a/yudao-example/yudao-sso-demo-by-password/pom.xml +++ b/yudao-example/yudao-sso-demo-by-password/pom.xml @@ -21,7 +21,7 @@ 8 UTF-8 - 2.7.13 + 2.7.12 @@ -52,7 +52,7 @@ cn.hutool hutool-all - 5.8.20 + 5.8.18 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml index 3effb1952..2ccbc7ba2 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/pom.xml @@ -63,7 +63,7 @@ com.github.binarywang weixin-java-pay - 4.5.0 + 4.4.0 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-social/pom.xml index e39107918..0e0ac6dc4 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/pom.xml @@ -36,8 +36,8 @@ - com.xingyuv - spring-boot-starter-justauth + com.xkcoding.justauth + justauth-spring-boot-starter cn.hutool diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java index 3dc6b6a9a..5c2f7f8bb 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.framework.social.config; import cn.iocoder.yudao.framework.social.core.YudaoAuthRequestFactory; -import com.xingyuv.http.HttpUtil; -import com.xingyuv.http.support.hutool.HutoolImpl; -import com.xingyuv.jushauth.cache.AuthStateCache; -import com.xingyuv.justauth.autoconfigure.JustAuthProperties; +import com.xkcoding.http.HttpUtil; +import com.xkcoding.http.support.hutool.HutoolImpl; +import com.xkcoding.justauth.autoconfigure.JustAuthProperties; import lombok.extern.slf4j.Slf4j; +import me.zhyd.oauth.cache.AuthStateCache; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java index 5d5475e84..22be344d9 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/YudaoAuthRequestFactory.java @@ -4,12 +4,12 @@ import cn.hutool.core.util.EnumUtil; import cn.hutool.core.util.ReflectUtil; import cn.iocoder.yudao.framework.social.core.enums.AuthExtendSource; import cn.iocoder.yudao.framework.social.core.request.AuthWeChatMiniAppRequest; -import com.xingyuv.jushauth.cache.AuthStateCache; -import com.xingyuv.jushauth.config.AuthConfig; -import com.xingyuv.jushauth.config.AuthSource; -import com.xingyuv.jushauth.request.AuthRequest; -import com.xingyuv.justauth.AuthRequestFactory; -import com.xingyuv.justauth.autoconfigure.JustAuthProperties; +import com.xkcoding.justauth.AuthRequestFactory; +import com.xkcoding.justauth.autoconfigure.JustAuthProperties; +import me.zhyd.oauth.cache.AuthStateCache; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.config.AuthSource; +import me.zhyd.oauth.request.AuthRequest; import java.lang.reflect.Method; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java index fd0fff709..f51c81e02 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/enums/AuthExtendSource.java @@ -1,12 +1,11 @@ package cn.iocoder.yudao.framework.social.core.enums; -import com.xingyuv.jushauth.config.AuthSource; -import com.xingyuv.jushauth.request.AuthDefaultRequest; +import me.zhyd.oauth.config.AuthSource; /** * 拓展 JustAuth 各 api 需要的 url, 用枚举类分平台类型管理 * - * 默认配置 {@link com.xingyuv.jushauth.config.AuthDefaultSource} + * 默认配置 {@link me.zhyd.oauth.config.AuthDefaultSource} * * @author timfruit */ @@ -35,11 +34,6 @@ public enum AuthExtendSource implements AuthSource { // 参见 https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html 文档 throw new UnsupportedOperationException("不支持获取用户信息 url,请使用小程序内置函数 wx.getUserProfile() 获取用户信息"); } - - @Override - public Class getTargetClass() { - return null; - } } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java index 964eb31cd..5ff5b8578 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/core/request/AuthWeChatMiniAppRequest.java @@ -3,16 +3,16 @@ package cn.iocoder.yudao.framework.social.core.request; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.social.core.enums.AuthExtendSource; import com.fasterxml.jackson.annotation.JsonProperty; -import com.xingyuv.jushauth.cache.AuthStateCache; -import com.xingyuv.jushauth.config.AuthConfig; -import com.xingyuv.jushauth.exception.AuthException; -import com.xingyuv.jushauth.model.AuthCallback; -import com.xingyuv.jushauth.model.AuthToken; -import com.xingyuv.jushauth.model.AuthUser; -import com.xingyuv.jushauth.request.AuthDefaultRequest; -import com.xingyuv.jushauth.utils.HttpUtils; -import com.xingyuv.jushauth.utils.UrlBuilder; import lombok.Data; +import me.zhyd.oauth.cache.AuthStateCache; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthToken; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.utils.HttpUtils; +import me.zhyd.oauth.utils.UrlBuilder; /** * 微信小程序登陆 Request 请求 @@ -32,7 +32,7 @@ public class AuthWeChatMiniAppRequest extends AuthDefaultRequest { protected AuthToken getAccessToken(AuthCallback authCallback) { // 参见 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html 文档 // 使用 code 获取对应的 openId、unionId 等字段 - String response = new HttpUtils(config.getHttpConfig()).get(accessTokenUrl(authCallback.getCode())).getBody(); + String response = new HttpUtils(config.getHttpConfig()).get(accessTokenUrl(authCallback.getCode())); JSCode2SessionResponse accessTokenObject = JsonUtils.parseObject(response, JSCode2SessionResponse.class); assert accessTokenObject != null; checkResponse(accessTokenObject); @@ -73,7 +73,7 @@ public class AuthWeChatMiniAppRequest extends AuthDefaultRequest { return UrlBuilder.fromBaseUrl(source.accessToken()) .queryParam("appid", config.getClientId()) .queryParam("secret", config.getClientSecret()) - .queryParam("js_code", code) + .queryParam("js_code", code) // 和父类不同,所以需要重写该方法 .queryParam("grant_type", "authorization_code") .build(); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml index e242819ef..2dc37c376 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-weixin/pom.xml @@ -34,13 +34,14 @@ com.github.binarywang + wx-java-mp-spring-boot-starter - 4.5.0 + 4.4.0 com.github.binarywang wx-java-miniapp-spring-boot-starter - 4.5.0 + 4.4.0 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java index 58b637c6d..d8c59ad37 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java @@ -127,7 +127,7 @@ public class MemberAuthServiceImpl implements MemberAuthService { // 获得对应的手机号信息 WxMaPhoneNumberInfo phoneNumberInfo; try { - phoneNumberInfo = wxMaService.getUserService().getPhoneNoInfo(reqVO.getPhoneCode()); + phoneNumberInfo = wxMaService.getUserService().getNewPhoneNoInfo(reqVO.getPhoneCode()); } catch (Exception exception) { throw exception(AUTH_WEIXIN_MINI_APP_PHONE_CODE_ERROR); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java index b6999bd01..411d749b0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java @@ -10,12 +10,12 @@ import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserBindMapper; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import com.xingyuv.jushauth.model.AuthCallback; -import com.xingyuv.jushauth.model.AuthResponse; -import com.xingyuv.jushauth.model.AuthUser; -import com.xingyuv.jushauth.request.AuthRequest; -import com.xingyuv.jushauth.utils.AuthStateUtils; import lombok.extern.slf4j.Slf4j; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthRequest; +import me.zhyd.oauth.utils.AuthStateUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java index c4f0442a2..48f914a1a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java @@ -9,12 +9,12 @@ import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserBindMapper; import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import com.xingyuv.jushauth.enums.AuthResponseStatus; -import com.xingyuv.jushauth.model.AuthCallback; -import com.xingyuv.jushauth.model.AuthResponse; -import com.xingyuv.jushauth.model.AuthUser; -import com.xingyuv.jushauth.request.AuthRequest; -import com.xingyuv.jushauth.utils.AuthStateUtils; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthRequest; +import me.zhyd.oauth.utils.AuthStateUtils; import org.junit.jupiter.api.Test; import org.mockito.MockedStatic; import org.springframework.boot.test.mock.mockito.MockBean; diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 25539cb63..fdfa88415 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -111,7 +111,7 @@ org.springframework.boot spring-boot-maven-plugin - 2.7.13 + 2.7.12 true From 20eb0a2a888ad7aa654108a595a863371c4ab3ab Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 4 Jul 2023 23:43:16 +0800 Subject: [PATCH 42/42] =?UTF-8?q?mall=20+=20pay=EF=BC=9A=201=E3=80=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4=20returnUrl=20=E7=9A=84=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/pay/config/PayProperties.java | 9 ----- .../client/impl/alipay/AlipayPcPayClient.java | 34 ++++--------------- .../impl/alipay/AlipayWapPayClient.java | 6 ++-- .../yudao-module-trade-biz/pom.xml | 4 +++ .../order/vo/AppTradeOrderDetailRespVO.java | 4 ++- .../convert/order/TradeOrderConvert.java | 6 ++++ .../module/pay/enums/DictTypeConstants.java | 2 ++ .../admin/notify/PayNotifyController.java | 19 ----------- .../admin/order/vo/PayOrderSubmitReqVO.java | 8 +++-- .../app/order/AppPayOrderController.http | 4 +-- .../service/order/PayOrderServiceImpl.java | 14 ++------ .../src/main/resources/application-dev.yaml | 1 - .../src/main/resources/application-local.yaml | 1 - 13 files changed, 33 insertions(+), 79 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/PayProperties.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/PayProperties.java index 1ea788674..4784e926b 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/PayProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/PayProperties.java @@ -23,13 +23,4 @@ public class PayProperties { @URL(message = "回调地址的格式必须是 URL") private String callbackUrl; - /** - * 回跳地址 - * - * 实际上,对应的 PayNotifyController 的 returnCallback 方法的 URL - */ - @URL(message = "回跳地址的格式必须是 URL") - @NotEmpty(message = "回跳地址不能为空") - private String returnUrl; - } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPcPayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPcPayClient.java index f5626a770..591b02dbc 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPcPayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPcPayClient.java @@ -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 支付有两种展示模式:FORM、URL + 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 跳转 - } - } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayWapPayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayWapPayClient.java index 68b91131c..23291a7f3 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayWapPayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayWapPayClient.java @@ -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(); diff --git a/yudao-module-mall/yudao-module-trade-biz/pom.xml b/yudao-module-mall/yudao-module-trade-biz/pom.xml index a6f122a78..810446fa9 100644 --- a/yudao-module-mall/yudao-module-trade-biz/pom.xml +++ b/yudao-module-mall/yudao-module-trade-biz/pom.xml @@ -93,6 +93,10 @@ cn.iocoder.boot yudao-spring-boot-starter-excel + + cn.iocoder.boot + yudao-spring-boot-starter-biz-dict + diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java index f9e6a6864..7a67190fc 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java @@ -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; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java index 9fb449040..88ce02300 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java @@ -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 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 propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId); for (int i = 0; i < orderItems.size(); i++) { diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java index 58eb776d3..717ce09eb 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java @@ -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"; // 支付-订单-订单回调商户状态 diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java index e64ec6a06..3660eddd5 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java @@ -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; - /** - * 统一的跳转页面,支付宝跳转参数说明 - * - * 支付宝 - 前台回跳参数说明 - * - * @param channelId 渠道编号 - * @return 返回跳转页面 - */ - @GetMapping(value = "/return/{channelId}") - @Operation(summary = "渠道统一的支付成功返回地址") - @Deprecated // TODO yunai:如果是 way 的情况,应该是跳转回前端地址 - public String returnCallback(@PathVariable("channelId") Long channelId, - @RequestParam Map params) { - log.info("[returnCallback][app_id({}) 跳转]", params.get("app_id")); - return String.format("渠道[%s]支付成功", channelId); - } - /** * 统一的渠道支付回调,支付宝的退款回调 * diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitReqVO.java index 09ac7381e..ffda105b7 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitReqVO.java @@ -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; + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http index 539d7965d..b2da78127 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http @@ -5,6 +5,6 @@ Authorization: Bearer {{appToken}} tenant-id: {{appTenentId}} { - "id": 125, - "channelCode": "alipay_qr" + "id": 174, + "channelCode": "alipay_pc" } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java index f416c07f3..a653887a9 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java @@ -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(); - } - /** * 根据支付渠道的编码,生成支付渠道的回调地址 * diff --git a/yudao-server/src/main/resources/application-dev.yaml b/yudao-server/src/main/resources/application-dev.yaml index 7cc4801e5..ddacc5485 100644 --- a/yudao-server/src/main/resources/application-dev.yaml +++ b/yudao-server/src/main/resources/application-dev.yaml @@ -168,7 +168,6 @@ yudao: - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 pay: callback-url: http://yunai.natapp1.cc/admin-api/pay/notify/callback - return-url: http://yunai.natapp1.cc/admin-api/pay/notify/return demo: true # 开启演示模式 justauth: diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index cdc1d3fde..2059b107d 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -195,7 +195,6 @@ yudao: - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 pay: callback-url: http://yunai.natapp1.cc/admin-api/pay/notify/callback - return-url: http://yunai.natapp1.cc/admin-api/pay/notify/return access-log: # 访问日志的配置项 enable: false error-code: # 错误码相关配置项