|
|
@ -127,4 +127,26 @@ public class StudyMethodServiceImpl extends ServiceImpl |
|
|
studyMethodReadService.save(studyMethodRead); |
|
|
studyMethodReadService.save(studyMethodRead); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Boolean getReadAllMethodStatus(Long userId, Long studyId, Long studySubjectId) { |
|
|
|
|
|
LambdaQueryWrapper<StudyMethodRead> 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<StudyMethod> 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; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |