|
@@ -3,15 +3,9 @@ package cn.com.qmth.stmms.api.controller;
|
|
|
import cn.com.qmth.stmms.api.dto.MenualAbsentDTO;
|
|
|
import cn.com.qmth.stmms.api.exception.ApiException;
|
|
|
import cn.com.qmth.stmms.api.utils.AESUtil;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.*;
|
|
|
import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.*;
|
|
|
import cn.com.qmth.stmms.biz.file.service.FileService;
|
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
|
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkLibraryService;
|
|
@@ -70,6 +64,9 @@ public class ExamStudentController extends BaseApiController {
|
|
|
@Autowired
|
|
|
private ExamSubjectService examSubjectService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private InspectHistoryService inspectHistoryService;
|
|
|
+
|
|
|
@RoleRequire({ Role.SCHOOL_ADMIN, Role.SCANNER })
|
|
|
@RequestMapping(value = "/student/check", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
@@ -170,7 +167,7 @@ public class ExamStudentController extends BaseApiController {
|
|
|
obj.accumulate("className", StringUtils.trimToEmpty(student.getClassName()));
|
|
|
obj.accumulate("teacher", StringUtils.trimToEmpty(student.getTeacher()));
|
|
|
if (student.getInspectorId() != null) {
|
|
|
- obj.accumulate("inspector", getInspector(student.getInspectorId()));
|
|
|
+ obj.accumulate("inspector", getInspector(student.getId()));
|
|
|
}
|
|
|
|
|
|
try {
|
|
@@ -252,12 +249,19 @@ public class ExamStudentController extends BaseApiController {
|
|
|
return array;
|
|
|
}
|
|
|
|
|
|
- private String getInspector(Integer inspectorId) {
|
|
|
- JSONObject obj = new JSONObject();
|
|
|
- User inspector = userService.findById(inspectorId);
|
|
|
- obj.accumulate("loginName", inspector.getLoginName());
|
|
|
- obj.accumulate("name", inspector.getName());
|
|
|
- return obj.toString();
|
|
|
+ private JSONArray getInspector(Integer studentId) {
|
|
|
+ List<InspectHistory> historyList = inspectHistoryService.findByStudentId(studentId);
|
|
|
+ JSONArray array = new JSONArray();
|
|
|
+ if(!historyList.isEmpty()){
|
|
|
+ List<User> userList = userService.findByIdIn(historyList.stream().map(e->e.getInspectorId()).collect(Collectors.toList()));
|
|
|
+ for (User u: userList) {
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.accumulate("loginName", u.getLoginName());
|
|
|
+ obj.accumulate("name", u.getName());
|
|
|
+ array.add(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return array;
|
|
|
}
|
|
|
|
|
|
private String getMarkerNames(ExamStudent student, Integer groupNumber) {
|
|
@@ -437,7 +441,7 @@ public class ExamStudentController extends BaseApiController {
|
|
|
obj.accumulate("className", StringUtils.trimToEmpty(student.getClassName()));
|
|
|
obj.accumulate("teacher", StringUtils.trimToEmpty(student.getTeacher()));
|
|
|
if (student.getInspectorId() != null) {
|
|
|
- obj.accumulate("inspector", getInspector(student.getInspectorId()));
|
|
|
+ obj.accumulate("inspector", getInspector(student.getId()));
|
|
|
}
|
|
|
|
|
|
try {
|