Done ticket GEPAFINBE-129
This commit is contained in:
@@ -24,7 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -1778,6 +1780,11 @@ public class ApplicationEvaluationDao {
|
||||
existingEntity.setClosingDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));
|
||||
assignedApplicationsEntity.setStatus(AssignedApplicationEnum.CLOSE.getValue());
|
||||
}
|
||||
if (existingEntity.getStartDate() != null && existingEntity.getClosingDate() != null) {
|
||||
long activeDays = ChronoUnit.DAYS.between(existingEntity.getStartDate(), existingEntity.getClosingDate());
|
||||
activeDays -= existingEntity.getSuspendedDays() != null ? existingEntity.getSuspendedDays() : 0;
|
||||
existingEntity.setActiveDays(activeDays);
|
||||
}
|
||||
entity = applicationEvaluationRepository.save(existingEntity);
|
||||
assignedApplicationsRepository.save(assignedApplicationsEntity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user