|
@@ -41,6 +41,8 @@ import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
|
+import org.springframework.beans.factory.BeanFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -1069,11 +1071,16 @@ public class KmtExerciseMapperServiceImpl implements KmtExerciseMapperService {
|
|
private List<ExerciseBookDto> sortByBookName (List<ExerciseBookDto> list){
|
|
private List<ExerciseBookDto> sortByBookName (List<ExerciseBookDto> list){
|
|
if (list != null){
|
|
if (list != null){
|
|
Map<String, List<ExerciseBookDto>> temp = new HashMap<>();
|
|
Map<String, List<ExerciseBookDto>> temp = new HashMap<>();
|
|
|
|
+ List<ExerciseBookDto> tempMapList;
|
|
for (ExerciseBookDto item : list){
|
|
for (ExerciseBookDto item : list){
|
|
if (temp.containsKey(item.getName())){
|
|
if (temp.containsKey(item.getName())){
|
|
- temp.get(item.getName()).add(item);
|
|
|
|
|
|
+ tempMapList = temp.get(item.getName());
|
|
|
|
+ tempMapList.add(item);
|
|
|
|
+ temp.put(item.getName(), tempMapList);
|
|
} else {
|
|
} else {
|
|
- temp.put(item.getName(), Collections.singletonList(item));
|
|
|
|
|
|
+ tempMapList = new ArrayList<>();
|
|
|
|
+ tempMapList.add(item);
|
|
|
|
+ temp.put(item.getName(), tempMapList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ArrayList tempList = new ArrayList(temp.keySet());
|
|
ArrayList tempList = new ArrayList(temp.keySet());
|
|
@@ -1479,10 +1486,13 @@ public class KmtExerciseMapperServiceImpl implements KmtExerciseMapperService {
|
|
List<Map> tmpList = exerciseQuestionSearchService.findAllExerciseQuestionsByQuestionIds(questionIds);
|
|
List<Map> tmpList = exerciseQuestionSearchService.findAllExerciseQuestionsByQuestionIds(questionIds);
|
|
List<ExerciseQuetionDto> temps = this.parseMapToExerciseQuestionList(tmpList);
|
|
List<ExerciseQuetionDto> temps = this.parseMapToExerciseQuestionList(tmpList);
|
|
List<ExerciseQuetionDto> questions = new ArrayList<>();
|
|
List<ExerciseQuetionDto> questions = new ArrayList<>();
|
|
|
|
+ ExerciseQuetionDto qTmp = null;
|
|
for (String questionId : questionIds){
|
|
for (String questionId : questionIds){
|
|
for (ExerciseQuetionDto temp : temps){
|
|
for (ExerciseQuetionDto temp : temps){
|
|
if (questionId.equals(temp.getQuestionId())){
|
|
if (questionId.equals(temp.getQuestionId())){
|
|
- questions.add(temp);
|
|
|
|
|
|
+ qTmp = new ExerciseQuetionDto();
|
|
|
|
+ BeanUtils.copyProperties(temp, qTmp);
|
|
|
|
+ questions.add(qTmp);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|