|
@@ -1687,11 +1687,16 @@ public class KmtExerciseServiceImpl implements KmtExerciseService {
|
|
|
private List<ExerciseBookEditDto> sortByBookName (List<ExerciseBookEditDto> list){
|
|
|
if (list != null){
|
|
|
Map<String, List<ExerciseBookEditDto>> temp = new HashMap<>();
|
|
|
+ List<ExerciseBookEditDto> tmpList = null;
|
|
|
for (ExerciseBookEditDto item : list){
|
|
|
if (temp.containsKey(item.getExerciseBookName())){
|
|
|
- temp.get(item.getExerciseBookName()).add(item);
|
|
|
+ tmpList = temp.get(item.getExerciseBookName());
|
|
|
+ tmpList.add(item);
|
|
|
+ temp.put(item.getExerciseBookName(), tmpList);
|
|
|
} else {
|
|
|
- temp.put(item.getExerciseBookName(), Collections.singletonList(item));
|
|
|
+ tmpList = new ArrayList<>();
|
|
|
+ tmpList.add(item);
|
|
|
+ temp.put(item.getExerciseBookName(), tmpList);
|
|
|
}
|
|
|
}
|
|
|
ArrayList tempList = new ArrayList(temp.keySet());
|