Преглед на файлове

河南科目,修改为根据考生类型返回

mingfu преди 1 седмица
родител
ревизия
a1de5453b1

+ 2 - 3
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontPaperController.java

@@ -71,9 +71,8 @@ public class FrontPaperController {
 
     @ApiOperation("02 考试科目")
     @GetMapping(value = "subject")
-    public AjaxResult2<List<DzSubject>> getSubject(@ApiParam("定向") @RequestParam(defaultValue = "false") boolean directed,
-                                                   @ApiParam("类型 0基础1专业2所有") @RequestParam(required = false) Integer subjectType) {
-        return AjaxResult2.success(studentService.getSubjectList(directed, subjectType));
+    public AjaxResult2<List<DzSubject>> getSubject(@ApiParam("定向") @RequestParam(defaultValue = "false") boolean directed) {
+        return AjaxResult2.success(studentService.getSubjectList(directed));
     }
 
     @ApiOperation("03 知识点树")

+ 7 - 10
ie-admin/src/main/java/com/ruoyi/web/service/StudentService.java

@@ -7,6 +7,7 @@ import com.google.common.collect.Sets;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.AjaxResult2;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.enums.ExamType;
 import com.ruoyi.common.enums.SubjectType;
 import com.ruoyi.common.utils.CommonUtils;
 import com.ruoyi.common.utils.NumberUtils;
@@ -52,7 +53,7 @@ public class StudentService {
         this.learnAnswerMapper = learnAnswerMapper;
     }
 
-    public List<DzSubject> getSubjectList(boolean directed, Integer subjectType) {
+    public List<DzSubject> getSubjectList(boolean directed) {
         SysUser sysUser = SecurityUtils.getLoginUser().getUser();
         DzSubject sCond = new DzSubject();
         sCond.setLocations(sysUser.getLocation());
@@ -60,17 +61,13 @@ public class StudentService {
         List<DzSubject> list = dzSubjectService.selectDzSubjectList(sCond);
         Set<Long> subjectIdSet;
         if (!directed) {
-            if(null == subjectType) { // 非普通是返回的所有,还不确定有哪些
+            if(!ExamType.VHS.equals(sysUser.getExamType())){
                 return list;
-            } // 职高对口
+            }
+            subjectIdSet = Sets.newHashSet(1L, 2L, 3L);
             Integer userSubjectId = SecurityUtils.getLoginUser().getUser().getSelectSubject();
-            if(subjectType == 1) {
-                subjectIdSet = null == userSubjectId ? Sets.newHashSet() : Sets.newHashSet(userSubjectId.longValue());
-            } else { // 职高对口所有
-                subjectIdSet = Sets.newHashSet(1L, 2L, 3L);
-                if(subjectType == 2) {
-                    subjectIdSet.add(userSubjectId.longValue());
-                }
+            if(null != userSubjectId) {
+                subjectIdSet.add(userSubjectId.longValue());
             }
         } else {
             LearnStudent learnStudent = learnStudentService.selectLearnStudentByStudentId(SecurityUtils.getUserId());