瀏覽代碼

下载图片轨迹还原接口新增参数,补齐裁切图配置

ting.yin 1 年之前
父節點
當前提交
cc8db8004a

+ 1 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/ExamStudentService.java

@@ -122,7 +122,7 @@ public interface ExamStudentService {
 
 
     List<PictureTag> buildSheetTags(ExamStudent student, int index, boolean withGroupScore);
     List<PictureTag> buildSheetTags(ExamStudent student, int index, boolean withGroupScore);
 
 
-    Map<Integer, List<PictureTag>> buildSheetTags(ExamStudent student, boolean withGroupScore);
+    Map<Integer, List<PictureTag>> buildSheetTags(ExamStudent student, boolean withGroupScore, boolean sliceConfigFix);
 
 
     Map<MarkGroup, List<OriginTag>> getSliceTags(ExamStudent student, boolean withGroupScore,
     Map<MarkGroup, List<OriginTag>> getSliceTags(ExamStudent student, boolean withGroupScore,
             List<PictureConfigItem> sliceConfig);
             List<PictureConfigItem> sliceConfig);

+ 9 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/impl/ExamStudentServiceImpl.java

@@ -884,7 +884,8 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
      * 根据考生获得所有原图上的评卷标记和分数明细
      * 根据考生获得所有原图上的评卷标记和分数明细
      */
      */
     @Override
     @Override
-    public Map<Integer, List<PictureTag>> buildSheetTags(ExamStudent student, boolean withGroupScore) {
+    public Map<Integer, List<PictureTag>> buildSheetTags(ExamStudent student, boolean withGroupScore,
+            boolean sliceConfigFix) {
         Map<MarkGroup, List<OriginTag>> tagMap = new HashMap<MarkGroup, List<OriginTag>>();
         Map<MarkGroup, List<OriginTag>> tagMap = new HashMap<MarkGroup, List<OriginTag>>();
         Exam exam = examService.findById(student.getExamId());
         Exam exam = examService.findById(student.getExamId());
         ExamSubject subject = subjectService.find(student.getExamId(), student.getSubjectCode());
         ExamSubject subject = subjectService.find(student.getExamId(), student.getSubjectCode());
@@ -901,6 +902,13 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
         if (sliceConfig.isEmpty()) {
         if (sliceConfig.isEmpty()) {
             sliceConfig = exam.getSliceConfigList();
             sliceConfig = exam.getSliceConfigList();
         }
         }
+        if (sliceConfigFix && student.getSliceCount() > sliceConfig.size()) {
+            int picCount = student.getSliceCount() - sliceConfig.size();
+            for (int i = 1; i <= picCount; i++) {
+                PictureConfigItem e = new PictureConfigItem(sliceConfig.size() + i);
+                sliceConfig.add(e);
+            }
+        }
         if (!sliceConfig.isEmpty()) {
         if (!sliceConfig.isEmpty()) {
             // 有裁切图配置时才需要获取原始评卷标记信息
             // 有裁切图配置时才需要获取原始评卷标记信息
             tagMap = getSliceTags(student, withGroupScore, sliceConfig);
             tagMap = getSliceTags(student, withGroupScore, sliceConfig);

+ 8 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/model/PictureConfigItem.java

@@ -38,6 +38,14 @@ public class PictureConfigItem {
 
 
     }
     }
 
 
+    public PictureConfigItem(int i) {
+        this.i = i;
+        this.w = 0;
+        this.h = 0;
+        this.x = 0;
+        this.y = 0;
+    }
+
     public PictureConfigItem(String text) {
     public PictureConfigItem(String text) {
         text = StringUtils.trimToEmpty(text);
         text = StringUtils.trimToEmpty(text);
         String[] values = StringUtils.split(text, DB_FIELD_JOINER);
         String[] values = StringUtils.split(text, DB_FIELD_JOINER);

+ 1 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/StudentController.java

@@ -358,7 +358,7 @@ public class StudentController extends BaseExamController {
     public Object getSheetTag(HttpServletRequest request, @RequestParam Integer id) {
     public Object getSheetTag(HttpServletRequest request, @RequestParam Integer id) {
         ExamStudent student = studentService.findById(id);
         ExamStudent student = studentService.findById(id);
         if (student != null) {
         if (student != null) {
-            return studentService.buildSheetTags(student, false);
+            return studentService.buildSheetTags(student, false, false);
         } else {
         } else {
             return new HashMap<>();
             return new HashMap<>();
         }
         }

+ 1 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/api/controller/CoreController.java

@@ -441,7 +441,7 @@ public class CoreController extends BaseApiController {
             obj.accumulate("subjectiveScoreDetail", subjective);
             obj.accumulate("subjectiveScoreDetail", subjective);
             // 构造给分轨迹
             // 构造给分轨迹
             if (withMarkTrack != null && withMarkTrack.booleanValue()) {
             if (withMarkTrack != null && withMarkTrack.booleanValue()) {
-                obj.accumulate("markTags", studentService.buildSheetTags(student, false));
+                obj.accumulate("markTags", studentService.buildSheetTags(student, false, false));
             }
             }
             // 构造原图下载地址
             // 构造原图下载地址
             if (student.isUpload()) {
             if (student.isUpload()) {

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

@@ -123,7 +123,7 @@ public class ExamStudentController extends BaseApiController {
             @RequestParam(required = false) Boolean withScoreDetail,
             @RequestParam(required = false) Boolean withScoreDetail,
             @RequestParam(required = false) Boolean withMarkTrack,
             @RequestParam(required = false) Boolean withMarkTrack,
             @RequestParam(required = false) Boolean withGroupScoreTrack,
             @RequestParam(required = false) Boolean withGroupScoreTrack,
-            @RequestParam(required = false) Boolean withSheetUrl) {
+            @RequestParam(required = false) Boolean withSheetUrl, @RequestParam(required = false) Boolean sliceConfigFix) {
         ApiUser user = RequestUtils.getApiUser(request);
         ApiUser user = RequestUtils.getApiUser(request);
         JSONArray array = new JSONArray();
         JSONArray array = new JSONArray();
         if (query.getExamId() == null) {
         if (query.getExamId() == null) {
@@ -231,7 +231,7 @@ public class ExamStudentController extends BaseApiController {
                         obj.accumulate(
                         obj.accumulate(
                                 "tags",
                                 "tags",
                                 studentService.buildSheetTags(student, withGroupScoreTrack != null
                                 studentService.buildSheetTags(student, withGroupScoreTrack != null
-                                        && withGroupScoreTrack.booleanValue()));
+                                        && withGroupScoreTrack.booleanValue(), sliceConfigFix));
                     }
                     }
                     // 返回原图下载地址
                     // 返回原图下载地址
                     if (withSheetUrl != null && withSheetUrl.booleanValue()) {
                     if (withSheetUrl != null && withSheetUrl.booleanValue()) {