Kaynağa Gözat

发起考试完善

tags/正式版本
雍文秀 2 yıl önce
ebeveyn
işleme
521e3bc532

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java Dosyayı Görüntüle

@@ -54,7 +54,7 @@ public class EBaseController {
54 54
     @PostMapping("/add")
55 55
     public ResultVo add(@RequestBody EBase eBase) {
56 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 58
         return eBaseService.save(eBase);
59 59
     }
60 60
 

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/model/exam/EBase.java Dosyayı Görüntüle

@@ -56,8 +56,8 @@ public class EBase extends BaseBean {
56 56
     private List<Integer> classids;
57 57
 
58 58
     @Transient
59
-    //科目ids
60
-    private List<String> subjectids;
59
+    //科目
60
+    private List<ESubject> subjects;
61 61
 
62 62
     @Transient
63 63
     //开始时间

+ 2
- 7
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java Dosyayı Görüntüle

@@ -91,14 +91,9 @@ public class EBaseService {
91 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 96
             s.setExamid(examid);
100
-            s.setSubjectid(subjectid);
101
-            s.setSdate(examdate);
102 97
             s.setEsstate(0);
103 98
             subjects.add(s);
104 99
         }

Loading…
İptal
Kaydet