|
@@ -13,6 +13,7 @@ import com.xhkjedu.sexam.service.exam.EBaseService;
|
13
|
13
|
import com.xhkjedu.sexam.service.notice.NoticeService;
|
14
|
14
|
import com.xhkjedu.sexam.vo.exam.EBaseVo;
|
15
|
15
|
import com.xhkjedu.sexam.vo.exam.ExamVo;
|
|
16
|
+import com.xhkjedu.sexam.vo.system.UserVo;
|
16
|
17
|
import com.xhkjedu.utils.N_Utils;
|
17
|
18
|
import com.xhkjedu.utils.PageUtil;
|
18
|
19
|
import com.xhkjedu.vo.PageResult;
|
|
@@ -178,7 +179,7 @@ public class EBaseController {
|
178
|
179
|
if (exam.getWwcnum() != 0) return new ResultVo(1, "还有考试试卷未设置完成");
|
179
|
180
|
if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
|
180
|
181
|
|
181
|
|
- List<Map> students = eBaseService.listStuByExamId(examid);//获取考生
|
|
182
|
+ List<UserVo> students = eBaseService.listStuByExamId(examid);//获取考生
|
182
|
183
|
eBaseService.updateExamStateStart(examid, examcomm, students);//发布考试
|
183
|
184
|
|
184
|
185
|
if (notice == 2 && msg == 2) return new ResultVo(0, "发布成功");
|
|
@@ -190,7 +191,7 @@ public class EBaseController {
|
190
|
191
|
String noticetitle = examname + "-考试公告";
|
191
|
192
|
List<Map> classes = eBaseService.listClass(examid);
|
192
|
193
|
String classids = classList.stream().map(c -> c.getClassid().toString()).collect(Collectors.joining(","));
|
193
|
|
- List<Map> teachers = eBaseService.listTeacherByClassIds(classids);//获取考试班级任教老师
|
|
194
|
+ List<UserVo> teachers = eBaseService.listTeacherByClassIds(classids);//获取考试班级任教老师
|
194
|
195
|
if (notice == 1) {
|
195
|
196
|
for (Map s : classes) {
|
196
|
197
|
TNoticeClass nt = new TNoticeClass();
|
|
@@ -204,9 +205,9 @@ public class EBaseController {
|
204
|
205
|
n.setClasses(classList);
|
205
|
206
|
noticeList.add(n);
|
206
|
207
|
|
207
|
|
- for (Map t : teachers) {
|
|
208
|
+ for (UserVo t : teachers) {
|
208
|
209
|
TNoticeTeacher nt = new TNoticeTeacher();
|
209
|
|
- nt.setTeacherid((Integer) t.get("teacherid"));
|
|
210
|
+ nt.setTeacherid(t.getUserid());
|
210
|
211
|
teacherList.add(nt);
|
211
|
212
|
}
|
212
|
213
|
TNotice n2 = new TNotice();
|
|
@@ -218,16 +219,16 @@ public class EBaseController {
|
218
|
219
|
}
|
219
|
220
|
if (msg == 1) {
|
220
|
221
|
String msgtxt = noticetitle + "\n" + examcomm;
|
221
|
|
- List<String> userphones = students.stream().filter(s -> N_Utils.isNotEmpty(s.get("userphone")))
|
222
|
|
- .map(s -> s.get("userphone").toString()).collect(Collectors.toList());
|
|
222
|
+ List<String> userphones = students.stream().filter(s -> N_Utils.isNotEmpty(s.getUserphone()))
|
|
223
|
+ .map(s -> s.getUserphone()).collect(Collectors.toList());
|
223
|
224
|
for (String userphone : userphones) {
|
224
|
225
|
TMsg m = new TMsg();
|
225
|
226
|
m.setMsgtxt(msgtxt);
|
226
|
227
|
m.setUserphone(userphone);
|
227
|
228
|
msgList.add(m);
|
228
|
229
|
}
|
229
|
|
- userphones = teachers.stream().filter(s -> N_Utils.isNotEmpty(s.get("userphone")))
|
230
|
|
- .map(s -> s.get("userphone").toString()).collect(Collectors.toList());
|
|
230
|
+ userphones = teachers.stream().filter(s -> N_Utils.isNotEmpty(s.getUserphone()))
|
|
231
|
+ .map(s -> s.getUserphone()).collect(Collectors.toList());
|
231
|
232
|
for (String userphone : userphones) {
|
232
|
233
|
TMsg m = new TMsg();
|
233
|
234
|
m.setMsgtxt(msgtxt);
|
|
@@ -354,4 +355,20 @@ public class EBaseController {
|
354
|
355
|
eBaseService.setSubjectTeacher(subject);
|
355
|
356
|
return new ResultVo(0, "设置成功");
|
356
|
357
|
}
|
|
358
|
+
|
|
359
|
+ /**
|
|
360
|
+ * 考试设置状态
|
|
361
|
+ *
|
|
362
|
+ * @return com.xhkjedu.vo.ResultVo
|
|
363
|
+ * @Param [eBase]
|
|
364
|
+ * @Author ywx
|
|
365
|
+ * @Date 2022/7/28 9:37
|
|
366
|
+ **/
|
|
367
|
+ @PostMapping("/get_set")
|
|
368
|
+ public ResultVo getSetState(@RequestBody EBase eBase) {
|
|
369
|
+ Integer examid = eBase.getExamid();
|
|
370
|
+ N_Utils.validation(new Object[]{examid, "考试id", 1});
|
|
371
|
+ Map map = eBaseService.getSetState(examid);
|
|
372
|
+ return new ResultVo(0, "获取考试设置状态成功", map);
|
|
373
|
+ }
|
357
|
374
|
}
|