From 13c18f1861e14d32dd791bfbc7864f5722e340e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=91=94=E5=80=92=E7=9A=84=E7=BA=A2=E7=83=A7=E8=82=89?= <927919732@qq.com> Date: Mon, 16 Jun 2025 12:30:24 +0000 Subject: [PATCH] =?UTF-8?q?fix(system):=20=E4=BF=AE=E5=A4=8D=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9C=AA=E8=AF=BB=E5=85=AC=E5=91=8A=E5=92=8C=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/system/controller/NoticeController.java | 15 ++++++++++++++- .../admin/system/service/NoticeService.java | 5 +++++ .../system/service/impl/NoticeServiceImpl.java | 4 ++++ .../src/main/resources/mapper/MessageMapper.xml | 4 ++-- .../src/main/resources/mapper/NoticeMapper.xml | 4 ++-- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/continew-system/src/main/java/top/continew/admin/system/controller/NoticeController.java b/continew-system/src/main/java/top/continew/admin/system/controller/NoticeController.java index bbc21dd9..abc14511 100644 --- a/continew-system/src/main/java/top/continew/admin/system/controller/NoticeController.java +++ b/continew-system/src/main/java/top/continew/admin/system/controller/NoticeController.java @@ -17,8 +17,11 @@ package top.continew.admin.system.controller; import cn.hutool.core.collection.CollUtil; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; import top.continew.admin.common.controller.BaseController; import top.continew.admin.system.enums.NoticeMethodEnum; import top.continew.admin.system.enums.NoticeScopeEnum; @@ -31,6 +34,7 @@ import top.continew.starter.core.validation.ValidationUtils; import top.continew.starter.extension.crud.annotation.CrudApi; import top.continew.starter.extension.crud.annotation.CrudRequestMapping; import top.continew.starter.extension.crud.enums.Api; +import top.continew.starter.extension.crud.validation.CrudValidationGroup; import java.lang.reflect.Method; import java.util.Arrays; @@ -69,4 +73,13 @@ public class NoticeController extends BaseController listDashboard(); + /** + * 删除阅读记录 + * + */ + void deleteReadLog(List ids); } \ No newline at end of file diff --git a/continew-system/src/main/java/top/continew/admin/system/service/impl/NoticeServiceImpl.java b/continew-system/src/main/java/top/continew/admin/system/service/impl/NoticeServiceImpl.java index bf7a7bb6..91d21c02 100644 --- a/continew-system/src/main/java/top/continew/admin/system/service/impl/NoticeServiceImpl.java +++ b/continew-system/src/main/java/top/continew/admin/system/service/impl/NoticeServiceImpl.java @@ -182,4 +182,8 @@ public class NoticeServiceImpl extends BaseServiceImpl ids) { + noticeLogService.deleteByNoticeIds(ids); + } } \ No newline at end of file diff --git a/continew-system/src/main/resources/mapper/MessageMapper.xml b/continew-system/src/main/resources/mapper/MessageMapper.xml index 562e52f4..a3fb582c 100644 --- a/continew-system/src/main/resources/mapper/MessageMapper.xml +++ b/continew-system/src/main/resources/mapper/MessageMapper.xml @@ -53,7 +53,7 @@ SELECT t1.* FROM sys_message AS t1 - LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id + LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id AND t2.user_id = #{userId} WHERE (t1.scope = 1 OR (t1.scope = 2 AND JSON_CONTAINS(t1.users, CONCAT('"', #{userId}, '"')))) AND t2.read_time IS NULL @@ -62,7 +62,7 @@ SELECT COUNT(1) FROM sys_message AS t1 - LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id + LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id AND t2.user_id = #{userId} WHERE (t1.scope = 1 OR (t1.scope = 2 AND JSON_CONTAINS(t1.users, CONCAT('"', #{userId}, '"')))) AND t2.read_time IS NULL diff --git a/continew-system/src/main/resources/mapper/NoticeMapper.xml b/continew-system/src/main/resources/mapper/NoticeMapper.xml index 91acb392..06f1a2bb 100644 --- a/continew-system/src/main/resources/mapper/NoticeMapper.xml +++ b/continew-system/src/main/resources/mapper/NoticeMapper.xml @@ -43,9 +43,9 @@