|
@@ -1,5 +1,12 @@
|
|
|
package com.ssj.service.kmt.correctsys;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.LinkedHashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
@@ -11,9 +18,6 @@ import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.ssj.api.request.RequestOpenApiUtils;
|
|
|
import com.ssj.bean.sys.homework.domain.HomeworkPicture;
|
|
|
import com.ssj.bean.sys.homework.domain.HomeworkPictureCorrect;
|
|
|
import com.ssj.bean.sys.homework.domain.HomeworkPictureErrorCheck;
|
|
@@ -41,6 +45,7 @@ import com.ssj.service.kmt.correctsys.dto.HomeworkPictureCheckHowDetailDto;
|
|
|
import com.ssj.service.kmt.correctsys.dto.HomeworkPictureDto;
|
|
|
import com.ssj.service.kmt.correctsys.request.CorrectCheckReq;
|
|
|
import com.ssj.service.kmt.correctsys.service.KmtCorrectSysService;
|
|
|
+import com.ssj.service.kmt.dto.ExerciseQuestionAnswer4CorrectDTO;
|
|
|
import com.ssj.service.kmt.dto.ExerciseQuestionAnswerDto;
|
|
|
import com.ssj.service.kmt.dto.ExerciseQuestionDto;
|
|
|
import com.ssj.service.sys.homework.service.HomeworkPictureCorrectService;
|
|
@@ -234,28 +239,23 @@ public class KmtCorrectSysServiceImpl implements KmtCorrectSysService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// Map<String, Map<String, List<ExerciseQuestionDto>>> temp1 =
|
|
|
-// answerTmp.stream().collect(Collectors.groupingBy(ExerciseQuestionDto::getBookCourseId,
|
|
|
-// LinkedHashMap::new,
|
|
|
-// Collectors.groupingBy(ExerciseQuestionDto::getBigQuestionIndex, LinkedHashMap::new,
|
|
|
-// Collectors.toList())));
|
|
|
-// Map<String, List<ExerciseQuestionDto>> temp = exerciseQuestionDtoList.stream().collect(Collectors
|
|
|
-// .groupingBy(ExerciseQuestionDto::getBigQuestionIndex, LinkedHashMap::new, Collectors.toList()));
|
|
|
-// List<ExerciseQuestionAnswer4CorrectDTO> exerciseQuestionAnswer4CorrectDTOList = new ArrayList<>();
|
|
|
-// temp1.forEach((bookCourseId, map) -> {
|
|
|
-// map.forEach((bigQuestionIndex, questionList) -> {
|
|
|
-// ExerciseQuestionAnswer4CorrectDTO exerciseQuestionAnswer4CorrectDTO =
|
|
|
-// new ExerciseQuestionAnswer4CorrectDTO();
|
|
|
-// exerciseQuestionAnswer4CorrectDTO.setBigQuestionIndex(bigQuestionIndex);
|
|
|
-// exerciseQuestionAnswer4CorrectDTO.setQuestionList(questionList);
|
|
|
-// exerciseQuestionAnswer4CorrectDTOList.add(exerciseQuestionAnswer4CorrectDTO);
|
|
|
-// });
|
|
|
-// });
|
|
|
+ Map<String, Map<String, List<ExerciseQuestionDto>>> temp1 =
|
|
|
+ answerTmp.stream().collect(Collectors.groupingBy(ExerciseQuestionDto::getBookCourseId,
|
|
|
+ LinkedHashMap::new,
|
|
|
+ Collectors.groupingBy(ExerciseQuestionDto::getBigQuestionIndex, LinkedHashMap::new,
|
|
|
+ Collectors.toList())));
|
|
|
+ List<ExerciseQuestionAnswer4CorrectDTO> exerciseQuestionAnswer4CorrectDTOList = new ArrayList<>();
|
|
|
+ temp1.forEach((bookCourseId, map) -> {
|
|
|
+ map.forEach((bigQuestionIndex, questionList) -> {
|
|
|
+ ExerciseQuestionAnswer4CorrectDTO exerciseQuestionAnswer4CorrectDTO =
|
|
|
+ new ExerciseQuestionAnswer4CorrectDTO();
|
|
|
+ exerciseQuestionAnswer4CorrectDTO.setBigQuestionIndex(bigQuestionIndex);
|
|
|
+ exerciseQuestionAnswer4CorrectDTO.setQuestionList(questionList);
|
|
|
+ exerciseQuestionAnswer4CorrectDTOList.add(exerciseQuestionAnswer4CorrectDTO);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ homeworkPictureCheckDto.setAnswers(exerciseQuestionAnswer4CorrectDTOList);
|
|
|
|
|
|
- JSONObject json=RequestOpenApiUtils.openApiServiceRecognitionResult(homeworkPicture.getId(), accessToken);
|
|
|
- json.put("homeworkPictureId", homeworkPicture.getId());
|
|
|
- JSONArray jSONArray=RequestOpenApiUtils.openApiServiceAnswerList(json, accessToken);
|
|
|
- homeworkPictureCheckDto.setAnswers(jSONArray);
|
|
|
}
|
|
|
//手动勾选的知识点
|
|
|
List<HomeworkCheckKnowDetailDto> howDetailTmp = null;
|