Skip to content

Commit

Permalink
#120 Portati miglioramenti di prestazione nella ricerca della pendenz…
Browse files Browse the repository at this point in the history
…e nella versione 3.1.x
  • Loading branch information
pintorig committed Jan 10, 2020
1 parent 3aa8d00 commit 55b0fcd
Show file tree
Hide file tree
Showing 82 changed files with 1,485 additions and 1,080 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@
"dataValidita": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"dataScadenza": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"tassonomiaAvviso": "#ignore",
"iuvAvviso":"#ignore",
"importoPagato":"#? isImportoConDueDecimali(_)",
"importoIncassato":"#? isImportoConDueDecimali(_)",
"dataPagamento": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"iuvPagamento":"#notnull",
"idA2A":"#notnull",
"idPendenza":"#notnull",
"dominio": "#notnull",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@
"dataCaricamento":"#regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"dataValidita": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"dataScadenza": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"tassonomiaAvviso":"#ignore",
"tassonomiaAvviso": "#ignore",
"iuvAvviso":"#ignore",
"importoPagato":"#? isImportoConDueDecimali(_)",
"importoIncassato":"#? isImportoConDueDecimali(_)",
"idA2A":"#notnull",
"idPendenza":"#notnull",
"dominio": "#notnull",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@
"dataValidita": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"dataScadenza": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"tassonomiaAvviso": "#ignore",
"iuvAvviso":"#ignore",
"importoPagato":"#? isImportoConDueDecimali(_)",
"importoIncassato":"#? isImportoConDueDecimali(_)",
"idA2A":"#notnull",
"idPendenza":"#notnull",
"dominio": "#notnull",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
"dataValidita": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"dataScadenza": "##regex \\d\\d\\d\\d-\\d\\d-\\d\\d",
"tassonomiaAvviso": "#ignore",
"iuvAvviso":"#ignore",
"importoPagato":"#? isImportoConDueDecimali(_)",
"importoIncassato":"#? isImportoConDueDecimali(_)",
"idA2A":"#notnull",
"idPendenza":"#notnull",
"dominio": "#notnull",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Examples:
| Anno di due cifre | '%(y)' | "[0-9]{3}" + currentYear2 + "[0-9]{13}" |
| Anno di quattro cifre | '%(Y)' | "[0-9]{3}" + currentYear4 + "[0-9]{11}" |
| Applicazione | '%(a)' | "[0-9]{3}34[0-9]{13}" |
| Applicazione, Anno e Entrata | '%(a)%(y)%(t)' | "[0-9]{3}341989[0-9]{9}" |
| Applicazione, Anno e Entrata | '%(a)%(y)%(t)' | "[0-9]{3}34"+ currentYear2 +"89[0-9]{9}" |



Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Examples:
| Anno di due cifre | '%(y)' | "[0-9]{3}" + currentYear2 + "[0-9]{13}" |
| Anno di quattro cifre | '%(Y)' | "[0-9]{3}" + currentYear4 + "[0-9]{11}" |
| Applicazione | '%(a)' | "[0-9]{3}34[0-9]{13}" |
| Applicazione, Anno e Entrata | '%(a)%(y)%(t)' | "[0-9]{3}341989[0-9]{9}" |
| Applicazione, Anno e Entrata | '%(a)%(y)%(t)' | "[0-9]{3}34"+ currentYear2 +"89[0-9]{9}" |



Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Examples:
| Anno di due cifre | '%(y)' | "[0-9]{3}" + currentYear2 + "[0-9]{13}" |
| Anno di quattro cifre | '%(Y)' | "[0-9]{3}" + currentYear4 + "[0-9]{11}" |
| Applicazione | '%(a)' | "[0-9]{3}34[0-9]{13}" |
| Applicazione, Anno e Entrata | '%(a)%(y)%(t)' | "[0-9]{3}341989[0-9]{9}" |
| Applicazione, Anno e Entrata | '%(a)%(y)%(t)' | "[0-9]{3}34"+ currentYear2 +"89[0-9]{9}" |



3 changes: 2 additions & 1 deletion jars/core/src/main/java/it/govpay/core/business/Incassi.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ public RichiestaIncassoDTOResponse richiestaIncasso(RichiestaIncassoDTO richiest
ctx.getApplicationLogger().log("incasso.sintassi", "importo");
throw new IncassiException(FaultType.DUPLICATO, "Incasso gia' registrato con importo diverso");
}

richiestaIncassoResponse.setIncasso(incasso);
richiestaIncassoResponse.setCreated(false);
return richiestaIncassoResponse;
Expand Down Expand Up @@ -393,10 +392,12 @@ public RichiestaIncassoDTOResponse richiestaIncasso(RichiestaIncassoDTO richiest
incassiBD.insertIncasso(incasso);

PagamentiBD pagamentiBD = new PagamentiBD(this);
VersamentiBD versamentiBD = new VersamentiBD(this);
for(it.govpay.bd.model.Pagamento pagamento : pagamenti) {
pagamento.setStato(Stato.INCASSATO);
pagamento.setIncasso(incasso);
pagamentiBD.updatePagamento(pagamento);
versamentiBD.aggiornaIncassoVersamento(pagamento);
}

// se e' un incasso cumulativo collego il flusso all'incasso
Expand Down
4 changes: 2 additions & 2 deletions jars/core/src/main/java/it/govpay/core/business/Rpt.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ public List<it.govpay.bd.model.Rpt> avviaTransazione(List<Versamento> versamenti
clientInviaCarrelloRPT.getEventoCtx().setCodDominio(rpt.getCodDominio());
clientInviaCarrelloRPT.getEventoCtx().setIuv(rpt.getIuv());
clientInviaCarrelloRPT.getEventoCtx().setCcp(rpt.getCcp());
clientInviaCarrelloRPT.getEventoCtx().setIdA2A(rpt.getVersamentoIncasso(this).getApplicazione(this).getCodApplicazione());
clientInviaCarrelloRPT.getEventoCtx().setIdPendenza(rpt.getVersamentoIncasso(this).getCodVersamentoEnte());
clientInviaCarrelloRPT.getEventoCtx().setIdA2A(rpt.getVersamento(this).getApplicazione(this).getCodApplicazione());
clientInviaCarrelloRPT.getEventoCtx().setIdPendenza(rpt.getVersamento(this).getCodVersamentoEnte());
try {
if(rpt.getPagamentoPortale(this) != null)
clientInviaCarrelloRPT.getEventoCtx().setIdPagamento(rpt.getPagamentoPortale(this).getIdSessione());
Expand Down
12 changes: 12 additions & 0 deletions jars/core/src/main/java/it/govpay/core/business/Versamento.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/
package it.govpay.core.business;

import java.math.BigDecimal;

import org.openspcoop2.generic_project.exception.NotFoundException;
import org.openspcoop2.generic_project.exception.ServiceException;
import org.openspcoop2.utils.LoggerWrapperFactory;
Expand Down Expand Up @@ -57,6 +59,7 @@
import it.govpay.model.Iuv.TipoIUV;
import it.govpay.model.Versamento.AvvisaturaOperazione;
import it.govpay.model.Versamento.ModoAvvisatura;
import it.govpay.model.Versamento.StatoPagamento;
import it.govpay.model.Versamento.StatoVersamento;

public class Versamento extends BasicBD {
Expand Down Expand Up @@ -120,6 +123,9 @@ public it.govpay.model.Iuv caricaVersamento(it.govpay.bd.model.Versamento versam
versamento.setAck(versamentoLetto.isAck());
versamento.setDataCreazione(versamentoLetto.getDataCreazione());
versamento.setIdTracciatoAvvisatura(versamentoLetto.getIdTracciatoAvvisatura());
versamento.setStatoPagamento(versamentoLetto.getStatoPagamento());
versamento.setImportoPagato(versamentoLetto.getImportoPagato());
versamento.setImportoIncassato(versamentoLetto.getImportoIncassato());

// riporto iuv e numero avviso che sono gia' stati assegnati
if(versamento.getIuvVersamento() == null) {
Expand Down Expand Up @@ -183,6 +189,12 @@ public it.govpay.model.Iuv caricaVersamento(it.govpay.bd.model.Versamento versam
log.debug("Creazione promemoria completata: "+ msg);
}

if(versamento.getStatoPagamento() == null) {
versamento.setStatoPagamento(StatoPagamento.NON_PAGATO);
versamento.setImportoIncassato(BigDecimal.ZERO);
versamento.setImportoPagato(BigDecimal.ZERO);
}

versamentiBD.insertVersamento(versamento, promemoria);
ctx.getApplicationLogger().log("versamento.inserimentoOk", versamento.getApplicazione(this).getCodApplicazione(), versamento.getCodVersamentoEnte());
log.info("Versamento (" + versamento.getCodVersamentoEnte() + ") dell'applicazione (" + versamento.getApplicazione(this).getCodApplicazione() + ") inserito");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public void addSortField(String key, IField value) {
this.fieldMap.put(key, value);
}

public void clearFieldMap() {
this.fieldMap.clear();
}

public int getOffset() {
return offset;
}
Expand All @@ -62,6 +66,8 @@ public int getLimit() {
}
public void setLimit(Integer limit) {
this.limit = limit != null ? limit : DEFAULT_LIMIT;
if(this.limit < 0)
this.limit = 0;
}

public String getSimpleSearch() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package it.govpay.core.dao.anagrafica.dto;

import it.govpay.bd.model.Dominio;
import it.govpay.bd.viste.model.VersamentoIncasso;
import it.govpay.bd.model.Versamento;

public class GetAvvisoDTOResponse {

private byte[] avvisoPdf;
private String filenameAvviso;
private VersamentoIncasso versamento;
private Versamento versamento;
private Dominio dominio;
private String barCode;
private String qrCode;
Expand All @@ -31,11 +31,11 @@ public void setFilenameAvviso(String filenameAvviso) {
this.filenameAvviso = filenameAvviso;
}

public VersamentoIncasso getVersamento() {
public Versamento getVersamento() {
return versamento;
}

public void setVersamento(VersamentoIncasso versamento) {
public void setVersamento(Versamento versamento) {
this.versamento = versamento;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import it.govpay.bd.model.Dominio;
import it.govpay.bd.model.Versamento;
import it.govpay.bd.pagamento.VersamentiBD;
import it.govpay.bd.viste.model.converter.VersamentoIncassoConverter;
import it.govpay.bd.pagamento.filters.VersamentoFilter;
import it.govpay.core.autorizzazione.AuthorizationManager;
import it.govpay.core.autorizzazione.beans.GovpayLdapUserDetails;
import it.govpay.core.autorizzazione.utils.AutorizzazioneUtils;
Expand Down Expand Up @@ -93,7 +93,7 @@ else if(getAvvisoDTO.getIuv() != null)
default:
it.govpay.core.business.model.Iuv iuvGenerato = IuvUtils.toIuv(versamento, versamento.getApplicazione(bd), dominio);

response.setVersamento(VersamentoIncassoConverter.fromVersamento(versamento));
response.setVersamento(versamento);
response.setDominio(dominio);
response.setBarCode(new String(iuvGenerato.getBarCode()));
response.setQrCode(new String(iuvGenerato.getQrCode()));
Expand All @@ -110,4 +110,4 @@ else if(getAvvisoDTO.getIuv() != null)
}
}

}
}

0 comments on commit 55b0fcd

Please sign in to comment.