|
@@ -586,12 +586,17 @@ public class OnlineMusicGroupServiceImpl implements OnlineMusicGroupService {
|
|
|
tempDates = new ArrayList<>(allTeacherFreeDates);
|
|
|
}
|
|
|
tempDates.sort(Comparator.comparing(Date::getTime));
|
|
|
- Set<String> days = tempDates.stream()
|
|
|
- .map(date -> DateUtil.dateToString(date, "yyyy-MM-dd")).collect(Collectors.toSet());
|
|
|
- List<Date> tempDays = days.stream().map(dateStr -> DateUtil.stringToDate(dateStr, "yyyy-MM-dd")).collect(Collectors.toList());
|
|
|
- tempDays.sort(Comparator.comparing(Date::getTime));
|
|
|
- result.put("teacherFreeDays", tempDays.stream().map(day -> DateUtil.dateToString(day, "yyyy-MM-dd")).collect(Collectors.toList()));
|
|
|
- result.put("teacherFreeDates", tempDates);
|
|
|
+ Map<String, List<String>> rt=new HashMap<>();
|
|
|
+ for (Date tempDate : tempDates) {
|
|
|
+ String dateStr = DateUtil.dateToString(tempDate, "yyyy-MM-dd");
|
|
|
+ String timeStr = DateUtil.dateToString(tempDate, "HH:mm:ss");
|
|
|
+ if(!rt.containsKey(dateStr)){
|
|
|
+ rt.put(dateStr, new ArrayList<>());
|
|
|
+ }
|
|
|
+ rt.get(dateStr).add(timeStr);
|
|
|
+ }
|
|
|
+
|
|
|
+ result.put("teacherFreeDays", rt);
|
|
|
} else {
|
|
|
result.put("teacherFreeDays", new ArrayList<>());
|
|
|
}
|
|
@@ -720,10 +725,6 @@ public class OnlineMusicGroupServiceImpl implements OnlineMusicGroupService {
|
|
|
}
|
|
|
rt.get(dateStr).add(timeStr);
|
|
|
}
|
|
|
- Set<String> days = tempDates.stream()
|
|
|
- .map(date -> DateUtil.dateToString(date, "yyyy-MM-dd")).collect(Collectors.toSet());
|
|
|
- List<Date> tempDays = days.stream().map(dateStr -> DateUtil.stringToDate(dateStr, "yyyy-MM-dd")).collect(Collectors.toList());
|
|
|
- tempDays.sort(Comparator.comparing(Date::getTime));
|
|
|
|
|
|
result.put("teacherFreeDays", rt);
|
|
|
}
|