From f2ec9d9498991a7dab69b9ec7f32284b60ff2cfc Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Fri, 16 Jan 2026 11:24:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E8=AF=95=E9=AA=8C=E7=AE=A1=E7=90=86][?= =?UTF-8?q?=E8=AF=95=E9=AA=8C=E6=96=B9=E6=B3=95]=E5=B7=B2=E8=AF=BB?= =?UTF-8?q?=E6=9C=AA=E8=AF=BB=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/service/IStudyMethodService.java | 9 +++++++++ .../service/impl/StudyMethodServiceImpl.java | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java index ded6d25..dfadc26 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java @@ -31,4 +31,13 @@ public interface IStudyMethodService extends IService /** 阅读 */ void read(StudyMethodReadForm form); + + /** + * 判断用户是否全部已读试验/学科下的试验方法 + * @param userId 用户id + * @param studyId 试验id + * @param studySubjectId 试验科学id + * @return true 表示全部已读 false 表示有未读的 + */ + Boolean getReadAllMethodStatus(Long userId, Long studyId, Long studySubjectId); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java index 1f65091..cf60a19 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java @@ -127,4 +127,26 @@ public class StudyMethodServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(StudyMethodRead::getQmrId, userId) + .eq(StudyMethodRead::getStudyId, studyId); + if(studySubjectId != null) { + queryWrapper.eq(StudyMethodRead::getStudySubjectId, studySubjectId); + } + long readCount = studyMethodReadService.count(queryWrapper); + + LambdaQueryWrapper studyMethodLambdaQueryWrapper = new LambdaQueryWrapper<>(); + studyMethodLambdaQueryWrapper.eq(StudyMethod::getStudyId, studyId); + if(studySubjectId != null) { + studyMethodLambdaQueryWrapper.eq(StudyMethod::getStudySubjectId, studySubjectId); + } + long studyMethodCount = this.count(studyMethodLambdaQueryWrapper); + if(readCount == studyMethodCount) { + return true; + } + return false; + } + }