Skip to content

Commit

Permalink
feat(monitoraggio-caricamenti): aggiornamento endpoint /ente/progetti…
Browse files Browse the repository at this point in the history
…/dropdown 20241004
  • Loading branch information
lcucuzzella committed Oct 4, 2024
1 parent c7d6e93 commit deaeb4d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public List<Map<String, String>> findAllProgrammiFiltrati(
+" AND ( COALESCE(:idsProgetti) IS NULL OR prgt.ID IN (:idsProgetti) )"
+" ) AS progetti "
+" WHERE 1=1 "
+" AND ( :policy IS NULL OR progetti.POLICY = :policy ) "
+" AND ( COALESCE(:policies) IS NULL OR progetti.POLICY IN (:policies) ) "
+" AND ( :criterioRicerca IS NULL "
+" OR CONVERT( progetti.ID_ENTE, CHAR ) = :criterioRicerca "
+" OR UPPER( progetti.NOME_ENTE ) LIKE UPPER( :criterioRicercaLike ) "
Expand All @@ -278,7 +278,7 @@ public List<Map<String, String>> findAllProgettiFiltrati(
@Param("idsProgrammi") List<String> idsProgrammi,
@Param("idsProgetti") List<String> idsProgetti,
@Param("profiliEnte") List<String> profiliEnte,
@Param("policy") String policy
@Param("policies") List<String> policies
);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ public class FiltroRequest implements Serializable {

@JsonProperty(value = "idsProgetti")
private List<String> idsProgetti;

@JsonProperty(value = "filtroPolicies")
private List<String> policies;
}
19 changes: 9 additions & 10 deletions ms-ente/src/main/java/it/pa/repdgt/ente/service/EnteService.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,7 @@ public List<Map<String, String>> getAllProgettiFiltrati(FiltroRequest filtro) {
.map(profilo -> profilo.toUpperCase())
.collect(Collectors.toList());
}
String policy = null;
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policy);
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, filtro.getPolicies());
}

private List<AllEntiProjection> getAllEntiPerDSCUFiltrati(FiltroRequest filtro) {
Expand Down Expand Up @@ -426,8 +425,8 @@ public List<Map<String, String>> getAllProgettiPerDSCUFiltrati(FiltroRequest fil
.map(profilo -> profilo.toUpperCase())
.collect(Collectors.toList());
}
String policy = PolicyEnum.SCD.toString();
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policy);
List<String> policies = Arrays.asList(PolicyEnum.SCD.toString());
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policies);
}

@LogMethod
Expand Down Expand Up @@ -460,8 +459,8 @@ private List<Map<String, String>> getAllProgettiGestoreProgrammaByIdProgrammaFil
.map(profilo -> profilo.toUpperCase())
.collect(Collectors.toList());
}
String policy = null;
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policy);
List<String> policies = null;
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policies);
}

private List<AllEntiProjection> getAllEntiGestoreProgetto(EntiPaginatiParam entiPaginatiParam) {
Expand Down Expand Up @@ -492,8 +491,8 @@ private List<Map<String, String>> getAllProgettiGestoreProgetto(EntiPaginatiPara
.map(profilo -> profilo.toUpperCase())
.collect(Collectors.toList());
}
String policy = null;
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policy);
List<String> policies = null;
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policies);
}

private List<AllEntiProjection> getAllEntiPartnerProgetto(EntiPaginatiParam entiPaginatiParam) {
Expand Down Expand Up @@ -526,8 +525,8 @@ private List<Map<String, String>> getAllProgettiPartnerProgetto(EntiPaginatiPara
.map(profilo -> profilo.toUpperCase())
.collect(Collectors.toList());
}
String policy = null;
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policy);
List<String> policies = null;
return this.enteRepository.findAllProgettiFiltrati(criterioRicerca, "%" + criterioRicerca + "%", idsProgrammi, idsProgetti, profiliEnteUpperCase, policies);
}

private List<Map<String, String>> getProgrammaById(Long idProgramma) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public void getAllProgettiDropdownDSCUTest() {
filtro.getIdsProgrammi(),
filtro.getIdsProgetti(),
filtro.getProfili(),
PolicyEnum.SCD.toString());
filtro.getPolicies());
}

@Test
Expand Down

0 comments on commit deaeb4d

Please sign in to comment.