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; + } }