Переглянути джерело

获取考生API接口中主观题的得分明细中需要增加marker字段

ting.yin 6 роки тому
батько
коміт
9ac18d5fd1

+ 14 - 3
stmms-web/src/main/java/cn/com/qmth/stmms/api/controller/ExamStudentController.java

@@ -6,6 +6,9 @@ import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
 
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -29,6 +32,7 @@ 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.ExamStudentPaper;
 import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
+import cn.com.qmth.stmms.biz.exam.model.Marker;
 import cn.com.qmth.stmms.biz.exam.model.QuestionDetail;
 import cn.com.qmth.stmms.biz.exam.model.QuestionUnit;
 import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
@@ -37,14 +41,13 @@ import cn.com.qmth.stmms.biz.exam.service.ExamService;
 import cn.com.qmth.stmms.biz.exam.service.ExamStudentPaperService;
 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.MarkerService;
 import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
 import cn.com.qmth.stmms.biz.mark.service.MarkLibraryService;
 import cn.com.qmth.stmms.biz.user.model.User;
 import cn.com.qmth.stmms.biz.utils.ScoreItem;
 import cn.com.qmth.stmms.common.enums.LibraryStatus;
 import cn.com.qmth.stmms.common.utils.RequestUtils;
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
 
 @Controller("examStudentApiController")
 @RequestMapping("/api")
@@ -72,6 +75,9 @@ public class ExamStudentController extends BaseApiController {
 
     @Autowired
     private ExamStudentPaperService studentPaperService;
+    
+    @Autowired
+    private MarkerService markerService;
 
     @AuthValidate("adminUser")
     @RequestMapping(value = "/student/manualAbsent/{examId}", method = RequestMethod.POST)
@@ -237,7 +243,11 @@ public class ExamStudentController extends BaseApiController {
                 obj.accumulate("remark", StringUtils.trimToEmpty(student.getRemark()));
                 Campus campus = campusService.findBySchoolAndName(student.getSchoolId(), student.getCampusName());
                 obj.accumulate("campusCode", campus != null ? campus.getId().toString() : "");
-
+                Marker marker = markerService.findByStudentId(student.getId());
+                String markerName = "";
+                if(marker != null){
+                	markerName = marker.getName();
+                }
                 try {
                     if (withScoreDetail != null && withScoreDetail.booleanValue()) {
                         // 构造客观题得分明细
@@ -283,6 +293,7 @@ public class ExamStudentController extends BaseApiController {
                             detail.accumulate("mainNumber", question.getMainNumber());
                             detail.accumulate("subNumber", question.getSubNumber());
                             detail.accumulate("score", item.getScore());
+                            detail.accumulate("markerName", markerName);
                             subjective.add(detail);
                         }
                         obj.accumulate("subjectiveScoreDetail", subjective);