Skip to content

Commit

Permalink
Merge pull request #141 from consiglionazionaledellericerche/137-nell…
Browse files Browse the repository at this point in the history
…a-pagina-straordinari-mensili-gruppo-vengono-mostrate-anche-le-persone-non-più-del-gruppo

Corretta lista persone in straordinari mensili gruppo.
  • Loading branch information
darietto1983 authored Feb 21, 2024
2 parents 4dec070 + 6e384f1 commit cf323e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.14.0] - UNRELEASED
### Changed
- Corretta lista persone in Straordinario mensili gruppo, filtrando le persone non più affiliate

## [2.13.0] - 2024-02-13
### Added
- Aggiunta possibilità di inserire residenza ed id anagrafica esterna nella creazione di
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.0
2.14.0
15 changes: 11 additions & 4 deletions app/dao/PersonDao.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Consiglio Nazionale delle Ricerche
* Copyright (C) 2024 Consiglio Nazionale delle Ricerche
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand All @@ -18,7 +18,6 @@
package dao;

import static com.querydsl.core.group.GroupBy.groupBy;

import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
Expand All @@ -30,6 +29,7 @@
import com.querydsl.jpa.JPQLQuery;
import com.querydsl.jpa.JPQLQueryFactory;
import dao.filter.QFilters;
import helpers.JodaConverters;
import helpers.jpa.ModelQuery;
import helpers.jpa.ModelQuery.SimpleResults;
import it.cnr.iit.epas.DateInterval;
Expand Down Expand Up @@ -755,6 +755,14 @@ private JPQLQuery<Person> personQuery(Optional<String> name, Set<Office> offices

final BooleanBuilder condition = new BooleanBuilder();

if (start.isPresent()) {
condition.and(affiliation.beginDate.before(JodaConverters.jodaToJavaLocalDate(start.get())));
}
if (end.isPresent()) {
condition.andAnyOf(
affiliation.endDate.goe(JodaConverters.jodaToJavaLocalDate(end.get())),
affiliation.endDate.isNull());
}
filterOffices(condition, offices);
filterOnlyTechnician(condition, onlyTechnician);
condition.and(new QFilters().filterNameFromPerson(QPerson.person, name));
Expand All @@ -765,7 +773,6 @@ private JPQLQuery<Person> personQuery(Optional<String> name, Set<Office> offices
}
filterPersonInCharge(condition, personInCharge);
filterOnlySynchronized(condition, onlySynchronized);

return query.where(condition);
}

Expand Down Expand Up @@ -886,7 +893,7 @@ private void filterCompetenceCodeEnabled(BooleanBuilder condition,
.andAnyOf(pcc.endDate.goe(date), pcc.endDate.isNull()));
}
}

/**
* Filtro su codice competenza abilitato appartenente a gruppo.
*
Expand Down

0 comments on commit cf323e3

Please sign in to comment.