Browse Source

发起考试完善

tags/正式版本
雍文秀 2 years ago
parent
commit
521e3bc532

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

54
     @PostMapping("/add")
54
     @PostMapping("/add")
55
     public ResultVo add(@RequestBody EBase eBase) {
55
     public ResultVo add(@RequestBody EBase eBase) {
56
         if (N_Utils.isListEmpty(eBase.getClassids())) return new ResultVo(1, "考试班级不能为空");
56
         if (N_Utils.isListEmpty(eBase.getClassids())) return new ResultVo(1, "考试班级不能为空");
57
-        if (N_Utils.isListEmpty(eBase.getSubjectids())) return new ResultVo(1, "考试科目不能为空");
57
+        if (N_Utils.isListEmpty(eBase.getSubjects())) return new ResultVo(1, "考试科目不能为空");
58
         return eBaseService.save(eBase);
58
         return eBaseService.save(eBase);
59
     }
59
     }
60
 
60
 

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/model/exam/EBase.java View File

56
     private List<Integer> classids;
56
     private List<Integer> classids;
57
 
57
 
58
     @Transient
58
     @Transient
59
-    //科目ids
60
-    private List<String> subjectids;
59
+    //科目
60
+    private List<ESubject> subjects;
61
 
61
 
62
     @Transient
62
     @Transient
63
     //开始时间
63
     //开始时间

+ 2
- 7
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

91
         eClassStudentMapper.insertList(students);
91
         eClassStudentMapper.insertList(students);
92
 
92
 
93
         //考试科目
93
         //考试科目
94
-        List<String> subjectids = model.getSubjectids();
95
-        List<ESubject> subjects = new ArrayList<>();//考试科目
96
-        String examdate = model.getExamdate();//考试时间
97
-        for (String subjectid : subjectids) {
98
-            ESubject s = new ESubject();
94
+        List<ESubject> subjects = model.getSubjects();//考试科目
95
+        for (ESubject s : subjects) {
99
             s.setExamid(examid);
96
             s.setExamid(examid);
100
-            s.setSubjectid(subjectid);
101
-            s.setSdate(examdate);
102
             s.setEsstate(0);
97
             s.setEsstate(0);
103
             subjects.add(s);
98
             subjects.add(s);
104
         }
99
         }

Loading…
Cancel
Save