Commit 261727ff authored by dietricf's avatar dietricf
Browse files

SI-2200 Show closed Meldungen 1 year(configurable) after last status change

parent 9c3f3e4c
......@@ -58,6 +58,7 @@ import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationDto;
import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationLastModDto;
import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationPublicationChannelDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
......@@ -83,6 +84,9 @@ import java.util.stream.Collectors;
@Service
public class FailureInformationService {
@Value("${spring.settings.daysInPastToShowClosedInfos}")
private int daysInPastToShowClosedInfos;
@Autowired
private FailureInformationRepository failureInformationRepository;
......@@ -159,7 +163,7 @@ public class FailureInformationService {
public Page<TblFailureInformation> findFailureInformationsForDisplay(Pageable pageable) {
LocalDateTime now = LocalDateTime.now();
LocalDateTime ldt = LocalDateTime.of(now.getYear(), now.getMonth(), now.getDayOfMonth(), 0, 0, 0);
ldt = ldt.minusWeeks(4);
ldt = ldt.minusDays(daysInPastToShowClosedInfos);
Date nowMinusFourWeeks = Date.from(ldt.atZone(ZoneId.of("UTC")).toInstant());
return failureInformationRepository.findByTblFailureInformationForDisplay(
GfiProcessState.COMPLETED.getStatusValue(),
......
......@@ -47,6 +47,7 @@ spring:
detailMapInitialZoom: 10
overviewMapInitialLatitude: 49.656634
overviewMapInitialLongitude: 8.423207
daysInPastToShowClosedInfos: 365
# Initial emailsubject and content
emailSubjectPublishInit: "Die Störung (Sparte: $Sparte$) mit Beginn: $Störungsbeginn_gemeldet$ wurde in den Status veröffentlicht geändert."
emailContentPublishInit: "Veröffentlicht [TEST]\n
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment