From 2cd86208f0197cb8d1d106271e12ba23f134ca0e Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Thu, 8 Jan 2026 15:54:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[=E6=9F=A5=E8=AF=A2=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=9C=89=E6=96=B0=E5=A2=9E=E8=A1=A8=E5=8D=95=E7=9A=84=E6=9D=83?= =?UTF-8?q?=E9=99=90]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/business/controller/StudySubjectController.java | 10 ++++++++++ .../java/com/hxhq/business/service/IStudySubjectService.java | 7 +++++++ .../hxhq/business/service/impl/StudySubjectServiceImpl.java | 9 +++++++++ 3 files changed, 26 insertions(+) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudySubjectController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudySubjectController.java index 5f96638..ee48989 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudySubjectController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudySubjectController.java @@ -62,4 +62,14 @@ public class StudySubjectController extends BaseController studySubjectService.saveInfo(form); return AjaxResult.success(); } + + /** + * 查询是否有新增功能(学科下的才能新增+详情的填报) + */ + @GetMapping("/isMatchSubject") + public AjaxResult isMatchSubject(Long studySubjectId) + { + return AjaxResult.success(studySubjectService.isMatchSubject(studySubjectId)); + } + } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudySubjectService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudySubjectService.java index 8cebd4f..b415336 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudySubjectService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudySubjectService.java @@ -33,4 +33,11 @@ public interface IStudySubjectService extends IService */ void saveInfo(StudySubjectSaveForm form); + /** + * 查询是否有新增功能(学科下的才能新增+详情的填报) + * @param studySubjectId + * @return + */ + Boolean isMatchSubject(Long studySubjectId); + } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectServiceImpl.java index 90038f1..567ccd3 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudySubjectServiceImpl.java @@ -9,6 +9,7 @@ import java.util.stream.Collectors; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hxhq.business.domain.Study; +import com.hxhq.business.domain.StudySubjectUser; import com.hxhq.business.dto.study.StudyListDto; import com.hxhq.business.enums.zykgl.JcgjlxEnum; import com.hxhq.business.enums.zykgl.JcmcysEnum; @@ -164,4 +165,12 @@ public class StudySubjectServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_id",SecurityUtils.getUserId()); + queryWrapper.eq("study_subject_id",studySubjectId); + return studySubjectUserService.count(queryWrapper)>0; + } }