|
@@ -10,6 +10,9 @@ import java.util.Random;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import net.sf.json.JSONArray;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
+
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -17,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -25,15 +29,15 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
|
-import com.google.common.collect.Lists;
|
|
|
-
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkerDTO;
|
|
|
import cn.com.qmth.stmms.biz.exam.query.MarkerSearchQuery;
|
|
|
+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.MarkGroupService;
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkerClassService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.MarkerService;
|
|
|
import cn.com.qmth.stmms.biz.lock.LockService;
|
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkService;
|
|
@@ -45,8 +49,8 @@ import cn.com.qmth.stmms.common.enums.Role;
|
|
|
import cn.com.qmth.stmms.common.utils.ExportExcel;
|
|
|
import cn.com.qmth.stmms.common.utils.ImportExcel;
|
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
|
-import net.sf.json.JSONArray;
|
|
|
-import net.sf.json.JSONObject;
|
|
|
+
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
|
|
@Controller("examMarkerController")
|
|
|
@RequestMapping("/admin/exam/marker")
|
|
@@ -70,6 +74,12 @@ public class MarkerController extends BaseExamController {
|
|
|
|
|
|
@Autowired
|
|
|
private LockService lockService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MarkerClassService classService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ExamStudentService studentService;
|
|
|
|
|
|
@Value("${marker.showBtnImportAndBtnUpdateImport}")
|
|
|
private String showBtnImport;
|
|
@@ -509,4 +519,34 @@ public class MarkerController extends BaseExamController {
|
|
|
return MarkerExcelError.MARKERNOTINFO;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "/class/{markerId}", method = RequestMethod.GET)
|
|
|
+ @RoleRequire(Role.SCHOOL_ADMIN)
|
|
|
+ public String classAdd(@PathVariable Integer markerId, Model model,RedirectAttributes redirectAttributes) {
|
|
|
+ Marker marker = markerService.findById(markerId);
|
|
|
+ if (marker != null) {
|
|
|
+ model.addAttribute("marker", marker);
|
|
|
+ List<String> classList = studentService.findDistinctClassName(marker.getExamId(),marker.getSubjectCode());
|
|
|
+ List<String> classes = classService.findClassNameByMarkerId(markerId);
|
|
|
+ classList.removeAll(classes);
|
|
|
+ model.addAttribute("classList", classList);
|
|
|
+ model.addAttribute("classes", classes);
|
|
|
+ return "modules/exam/markerClass";
|
|
|
+ }
|
|
|
+ addMessage(redirectAttributes, "评卷员不存在");
|
|
|
+ return "redirect:/admin/exam/marker";
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/class/{markerId}", method = RequestMethod.POST)
|
|
|
+ @RoleRequire(Role.SCHOOL_ADMIN)
|
|
|
+ public String classSave(@PathVariable Integer markerId,@RequestParam String[] classes,Model model,RedirectAttributes redirectAttributes) {
|
|
|
+ Marker marker = markerService.findById(markerId);
|
|
|
+ if (marker != null) {
|
|
|
+ classService.save(marker,classes);
|
|
|
+ addMessage(redirectAttributes, "保存'" + marker.getLoginName() + "'成功");
|
|
|
+ return "redirect:/admin/exam/marker";
|
|
|
+ }
|
|
|
+ addMessage(redirectAttributes, "评卷员不存在");
|
|
|
+ return "redirect:/admin/exam/marker";
|
|
|
+ }
|
|
|
}
|