Skip to content

Commit

Permalink
Migliorata la ricerca delle variazioni sul documentale
Browse files Browse the repository at this point in the history
  • Loading branch information
mspasiano committed Nov 7, 2024
1 parent cd0521b commit 55e3ae7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,9 @@ else if(tiSigned.compareTo(ArchiviaStampaPdgVariazioneBulk.VIEW_ALL) ==0){
variazionePdg = ((Pdg_variazioneBulk)bulk).getPg_variazione_pdg();
}
List<Integer> variazioniPresentiSulDocumentale = variazioniPresentiSulDocumentale(userContext, tiSigned, cdsBulk, uo, variazionePdg);
if (tiSigned != null) {
sql.addClause(FindClause.AND, "dt_firma", tiSigned.equals(ArchiviaStampaPdgVariazioneBulk.VIEW_SIGNED) ? SQLBuilder.ISNOTNULL : SQLBuilder.ISNULL, null);
}
if (clausolaIn && variazioniPresentiSulDocumentale.isEmpty())
sql.addClause(FindClause.AND, "pg_variazione_pdg", SQLBuilder.EQUALS, -1);
sql.openParenthesis(FindClause.AND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,25 @@ public List<Integer> findVariazioniSigned(Integer esercizio, Unita_organizzativa
}
final Optional<StorageObject> storageObjectByPath = Optional.ofNullable(getStorageObjectByPath(basePath));
if (storageObjectByPath.isPresent() && Optional.ofNullable(cds).isPresent() && !showAll) {
return getChildren(storageObjectByPath.get().getKey(), -1).stream()
.filter(storageObject -> storageObject.getPropertyValue(StoragePropertyNames.OBJECT_TYPE_ID.value()).equals(SIGLAStoragePropertyNames.VARPIANOGEST_DOCUMENT.value()))
.filter(storageObject -> hasAspect(storageObject, SIGLAStoragePropertyNames.CNR_SIGNEDDOCUMENT.value()))
return getChildren(storageObjectByPath.get().getKey()).stream()
.filter(storageObject -> {
if (Optional.ofNullable(uo).isPresent()) {
return storageObject.getPropertyValue(SIGLAStoragePropertyNames.STRORGUO_CODICE.value()).equals(uo);
return storageObject.<String>getPropertyValue(StoragePropertyNames.NAME.value()).contains(uo);
} else {
return true;
}
})
.filter(storageObject -> {
if (Optional.ofNullable(variazionePdg).isPresent()) {
return storageObject.getPropertyValue(SIGLAStoragePropertyNames.VARPIANOGEST_NUMEROVARIAZIONE.value()).equals(variazionePdg);
return storageObject.<String>getPropertyValue(StoragePropertyNames.NAME.value()).contains(String.valueOf(variazionePdg));
} else {
return true;
}
})
.map(storageObject -> storageObject.<BigInteger>getPropertyValue(SIGLAStoragePropertyNames.VARPIANOGEST_NUMEROVARIAZIONE.value()))
.map(storageObject -> {
String name = storageObject.<String>getPropertyValue(StoragePropertyNames.NAME.value());
return new BigInteger(name.substring(name.length() - 5));
})
.map(BigInteger::intValue)
.collect(Collectors.toList());
} else {
Expand Down Expand Up @@ -218,39 +219,26 @@ public List<Integer> findVariazioniPresenti(Integer esercizio, String tiSigned,
}
final Optional<StorageObject> storageObjectByPath = Optional.ofNullable(getStorageObjectByPath(basePath));
if (storageObjectByPath.isPresent() && Optional.ofNullable(cds).isPresent() && !showAll) {
return getChildren(storageObjectByPath.get().getKey(), -1).stream()
.filter(storageObject -> storageObject.getPropertyValue(StoragePropertyNames.OBJECT_TYPE_ID.value()).equals(SIGLAStoragePropertyNames.VARPIANOGEST_DOCUMENT.value()))
return getChildren(storageObjectByPath.get().getKey()).stream()
.filter(storageObject -> {
if (Optional.ofNullable(variazionePdg).isPresent()) {
return storageObject.getPropertyValue(SIGLAStoragePropertyNames.VARPIANOGEST_NUMEROVARIAZIONE.value()).equals(BigInteger.valueOf(variazionePdg));
if (Optional.ofNullable(uo).isPresent()) {
return storageObject.<String>getPropertyValue(StoragePropertyNames.NAME.value()).contains(uo);
} else {
return true;
}
})
.filter(storageObject -> {
if (Optional.ofNullable(tiSigned)
.filter(s -> s.equals(ArchiviaStampaPdgVariazioneBulk.VIEW_SIGNED)).isPresent())
return hasAspect(storageObject, SIGLAStoragePropertyNames.CNR_SIGNEDDOCUMENT.value());
else if (Optional.ofNullable(tiSigned)
.filter(s -> s.equals(ArchiviaStampaPdgVariazioneBulk.VIEW_NOT_SIGNED)).isPresent())
return !hasAspect(storageObject, SIGLAStoragePropertyNames.CNR_SIGNEDDOCUMENT.value());
else
return true;
})
.filter(storageObject -> {
if (Optional.ofNullable(uo).isPresent()) {
return storageObject.getPropertyValue(SIGLAStoragePropertyNames.STRORGUO_CODICE.value()).equals(uo);
if (Optional.ofNullable(variazionePdg).isPresent()) {
return storageObject.<String>getPropertyValue(StoragePropertyNames.NAME.value()).contains(String.valueOf(variazionePdg));
} else {
return true;
}
})
.map(storageObject -> storageObject.getPropertyValue(SIGLAStoragePropertyNames.VARPIANOGEST_NUMEROVARIAZIONE.value()))
.map(o -> {
if (o instanceof BigInteger) {
return ((BigInteger)o).intValue();
}
return new BigInteger(String.valueOf(o)).intValue();
.map(storageObject -> {
String name = storageObject.<String>getPropertyValue(StoragePropertyNames.NAME.value());
return new BigInteger(name.substring(name.length() - 5));
})
.map(BigInteger::intValue)
.collect(Collectors.toList());
} else {
StringBuffer query = new StringBuffer("select var.cmis:objectId, ");
Expand Down

0 comments on commit 55e3ae7

Please sign in to comment.