|
|
@@ -620,7 +620,8 @@ public class CollectionService {
|
|
|
@Cacheable(value = "subscribeCollectionList", key = "#now.hashCode()")
|
|
|
public List<SubscribeListDTO> subscribeAll(LocalDate now) {
|
|
|
List<SubscribeListDTO> subscribeListDTOS = new ArrayList<>();
|
|
|
- Map<LocalDateTime,List<CollectionDTO>> map = new HashMap<>();
|
|
|
+ List<SubscribeMapDto> subscribeMapDtoList = new ArrayList<>();
|
|
|
+// Map<LocalDateTime,List<CollectionDTO>> map = new HashMap<>();
|
|
|
// Map<String, Object> resultMap = new HashMap<>();
|
|
|
// resultMap.put("subList", subscribeListDTOS);
|
|
|
// resultMap.put("notSubscribedIds", dtoPage.getContent().stream().filter(dto -> !dto.isSubscribed())
|
|
|
@@ -666,20 +667,28 @@ public class CollectionService {
|
|
|
}else if (dateTime.equals(collectionDTO.getStartTime())){
|
|
|
collectionDtoList.add(collectionDTO);
|
|
|
}else {
|
|
|
- map.put(dateTime,new ArrayList<>(collectionDtoList));
|
|
|
+ subscribeMapDtoList.add(SubscribeMapDto.builder()
|
|
|
+ .localTime(dateTime.toLocalTime())
|
|
|
+ .collectionDTOS(new ArrayList<>(collectionDtoList))
|
|
|
+ .build());
|
|
|
+// map.put(dateTime,new ArrayList<>(collectionDtoList));
|
|
|
dateTime = collectionDTO.getStartTime();
|
|
|
collectionDtoList.clear();
|
|
|
collectionDtoList.add(collectionDTO);
|
|
|
}
|
|
|
}
|
|
|
- map.put(dateTime,new ArrayList<>(collectionDtoList));
|
|
|
+ subscribeMapDtoList.add(SubscribeMapDto.builder()
|
|
|
+ .localTime(dateTime.toLocalTime())
|
|
|
+ .collectionDTOS(new ArrayList<>(collectionDtoList))
|
|
|
+ .build());
|
|
|
+// map.put(dateTime,new ArrayList<>(collectionDtoList));
|
|
|
subscribeListDTOS.add(SubscribeListDTO.builder()
|
|
|
.dateTime(pageNew.getContent().get(0).getStartTime())
|
|
|
- .collectionDTOS(new HashMap<>(map))
|
|
|
+ .subscribeMapDto(new ArrayList<>(subscribeMapDtoList))
|
|
|
.build());
|
|
|
}
|
|
|
- if (!map.isEmpty()){
|
|
|
- map.clear();
|
|
|
+ if (CollectionUtils.isNotEmpty(subscribeMapDtoList)){
|
|
|
+ subscribeMapDtoList.clear();
|
|
|
}
|
|
|
});
|
|
|
return subscribeListDTOS;
|