Merge branch 'master' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -10,6 +10,8 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import it.integry.ems_model.annotation.FK;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -78,6 +80,8 @@ public class VtbRiba extends EntityBase {
|
||||
@SqlField(value = "tipo_anag", maxLength = 1, nullable = false)
|
||||
private String tipoAnag;
|
||||
|
||||
private int segno;
|
||||
|
||||
public VtbRiba() {
|
||||
super(logger);
|
||||
}
|
||||
@@ -86,135 +90,174 @@ public class VtbRiba extends EntityBase {
|
||||
return dataDist;
|
||||
}
|
||||
|
||||
public void setDataDist(Date dataDist) {
|
||||
public VtbRiba setDataDist(Date dataDist) {
|
||||
this.dataDist = dataDist;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getRifDist() {
|
||||
return rifDist;
|
||||
}
|
||||
|
||||
public void setRifDist(Integer rifDist) {
|
||||
public VtbRiba setRifDist(Integer rifDist) {
|
||||
this.rifDist = rifDist;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getRiga() {
|
||||
return riga;
|
||||
}
|
||||
|
||||
public void setRiga(Integer riga) {
|
||||
public VtbRiba setRiga(Integer riga) {
|
||||
this.riga = riga;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getCambioDiviCont() {
|
||||
return cambioDiviCont;
|
||||
}
|
||||
|
||||
public void setCambioDiviCont(BigDecimal cambioDiviCont) {
|
||||
public VtbRiba setCambioDiviCont(BigDecimal cambioDiviCont) {
|
||||
this.cambioDiviCont = cambioDiviCont;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public void setCodAnag(String codAnag) {
|
||||
public VtbRiba setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodDiviCont() {
|
||||
return codDiviCont;
|
||||
}
|
||||
|
||||
public void setCodDiviCont(String codDiviCont) {
|
||||
public VtbRiba setCodDiviCont(String codDiviCont) {
|
||||
this.codDiviCont = codDiviCont;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public void setDataDoc(Date dataDoc) {
|
||||
public VtbRiba setDataDoc(Date dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataRientroCast() {
|
||||
return dataRientroCast;
|
||||
}
|
||||
|
||||
public void setDataRientroCast(Date dataRientroCast) {
|
||||
public VtbRiba setDataRientroCast(Date dataRientroCast) {
|
||||
this.dataRientroCast = dataRientroCast;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public void setDataScad(Date dataScad) {
|
||||
public VtbRiba setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataValuta() {
|
||||
return dataValuta;
|
||||
}
|
||||
|
||||
public void setDataValuta(Date dataValuta) {
|
||||
public VtbRiba setDataValuta(Date dataValuta) {
|
||||
this.dataValuta = dataValuta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIdGruppo() {
|
||||
return idGruppo;
|
||||
}
|
||||
|
||||
public void setIdGruppo(Integer idGruppo) {
|
||||
public VtbRiba setIdGruppo(Integer idGruppo) {
|
||||
this.idGruppo = idGruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getImpScad() {
|
||||
return impScad;
|
||||
}
|
||||
|
||||
public void setImpScad(BigDecimal impScad) {
|
||||
public VtbRiba setImpScad(BigDecimal impScad) {
|
||||
this.impScad = impScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public void setNumDoc(Integer numDoc) {
|
||||
public VtbRiba setNumDoc(Integer numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumScad() {
|
||||
return numScad;
|
||||
}
|
||||
|
||||
public void setNumScad(Integer numScad) {
|
||||
public VtbRiba setNumScad(Integer numScad) {
|
||||
this.numScad = numScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRifDebito() {
|
||||
return rifDebito;
|
||||
}
|
||||
|
||||
public void setRifDebito(String rifDebito) {
|
||||
public VtbRiba setRifDebito(String rifDebito) {
|
||||
this.rifDebito = rifDebito;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerDoc() {
|
||||
return serDoc;
|
||||
}
|
||||
|
||||
public void setSerDoc(String serDoc) {
|
||||
public VtbRiba setSerDoc(String serDoc) {
|
||||
this.serDoc = serDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTipoAnag() {
|
||||
return tipoAnag;
|
||||
}
|
||||
|
||||
public void setTipoAnag(String tipoAnag) {
|
||||
public VtbRiba setTipoAnag(String tipoAnag) {
|
||||
this.tipoAnag = tipoAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getSegno() {
|
||||
return segno;
|
||||
}
|
||||
|
||||
public VtbRiba setSegno(int segno) {
|
||||
this.segno = segno;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof VtbRiba)) return false;
|
||||
VtbRiba vtbRiba = (VtbRiba) o;
|
||||
return getSegno() == vtbRiba.getSegno() && Objects.equals(getDataDist(), vtbRiba.getDataDist()) && Objects.equals(getRifDist(), vtbRiba.getRifDist()) && Objects.equals(getRiga(), vtbRiba.getRiga()) && Objects.equals(getCambioDiviCont(), vtbRiba.getCambioDiviCont()) && Objects.equals(getCodAnag(), vtbRiba.getCodAnag()) && Objects.equals(getCodDiviCont(), vtbRiba.getCodDiviCont()) && Objects.equals(getDataDoc(), vtbRiba.getDataDoc()) && Objects.equals(getDataRientroCast(), vtbRiba.getDataRientroCast()) && Objects.equals(getDataScad(), vtbRiba.getDataScad()) && Objects.equals(getDataValuta(), vtbRiba.getDataValuta()) && Objects.equals(getIdGruppo(), vtbRiba.getIdGruppo()) && Objects.equals(getImpScad(), vtbRiba.getImpScad()) && Objects.equals(getNumDoc(), vtbRiba.getNumDoc()) && Objects.equals(getNumScad(), vtbRiba.getNumScad()) && Objects.equals(getRifDebito(), vtbRiba.getRifDebito()) && Objects.equals(getSerDoc(), vtbRiba.getSerDoc()) && Objects.equals(getTipoAnag(), vtbRiba.getTipoAnag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getDataDist(), getRifDist(), getRiga(), getCambioDiviCont(), getCodAnag(), getCodDiviCont(), getDataDoc(), getDataRientroCast(), getDataScad(), getDataValuta(), getIdGruppo(), getImpScad(), getNumDoc(), getNumScad(), getRifDebito(), getSerDoc(), getTipoAnag(), getSegno());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Scope("request")
|
||||
@@ -956,16 +957,27 @@ public class ContabilService {
|
||||
|
||||
ctbMovt.setOperation(OperationType.INSERT);
|
||||
|
||||
List<VtbRiba> listGruppoRiba = Stream.of(listVtbRiba)
|
||||
.distinctBy(r -> r.getIdGruppo() + r.getTipoAnag() + r.getCodAnag())
|
||||
.toList();
|
||||
|
||||
for (VtbRiba gruppoRiba : listGruppoRiba) {
|
||||
List<Map.Entry<VtbRiba, List<VtbRiba>>> listGruppoRiba = Stream.of(listVtbRiba)
|
||||
.groupBy(r -> {
|
||||
return new VtbRiba()
|
||||
.setIdGruppo(r.getIdGruppo())
|
||||
.setTipoAnag(r.getTipoAnag())
|
||||
.setCodAnag(r.getCodAnag())
|
||||
.setSegno(r.getImpScad().signum());
|
||||
}).toList();
|
||||
|
||||
/*
|
||||
List<VtbRiba> listGruppoRiba =Stream.of(listVtbRiba)
|
||||
.distinctBy(r -> r.getIdGruppo() + r.getTipoAnag() + r.getCodAnag() + r.getImpScad().signum())
|
||||
.toList(); */
|
||||
|
||||
for (Map.Entry<VtbRiba, List<VtbRiba>> r : listGruppoRiba) {
|
||||
BigDecimal impDare, impAvere;
|
||||
String desAgg;
|
||||
Integer gruppo = gruppoRiba.getIdGruppo();
|
||||
String tipoAnag = gruppoRiba.getTipoAnag();
|
||||
String codAnag = gruppoRiba.getCodAnag();
|
||||
Integer gruppo = r.getKey().getIdGruppo();
|
||||
String tipoAnag = r.getKey().getTipoAnag();
|
||||
String codAnag = r.getKey().getCodAnag();
|
||||
|
||||
logger.trace("Elaborazione Cliente : " + codAnag);
|
||||
|
||||
@@ -988,12 +1000,12 @@ public class ContabilService {
|
||||
query = "SELECT rag_soc FROM gtb_anag WHERE cod_anag = " + UtilityDB.valueToString(codAnag);
|
||||
String ragSoc = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), query);
|
||||
|
||||
if ("A".equals(distinta.getFlagEffetti())) {
|
||||
desAgg = UtilityString.left("PART.N. " + gruppoRiba.getNumDoc() +
|
||||
' ' + gruppoRiba.getSerDoc() +
|
||||
' ' + UtilityString.streNull(ragSoc), 40);
|
||||
if ("A".equalsIgnoreCase(distinta.getFlagEffetti())) {
|
||||
desAgg = UtilityString.left("PART.N. " + r.getValue().get(0).getNumDoc() +
|
||||
' ' + r.getValue().get(0).getSerDoc() +
|
||||
' ' + UtilityString.streNull(ragSoc), 255);
|
||||
} else {
|
||||
desAgg = UtilityString.left(gruppoRiba.getRifDebito(), 40);
|
||||
desAgg = UtilityString.left(r.getValue().get(0).getRifDebito(), 255);
|
||||
}
|
||||
|
||||
// CTB_MOVR RIGA PARTITE
|
||||
@@ -1011,19 +1023,19 @@ public class ContabilService {
|
||||
|
||||
if (chiudiPartita ) {
|
||||
ctbMovr
|
||||
.setAnnoPart(UtilityDate.getYear(gruppoRiba.getDataDoc()))
|
||||
.setSerDoc(gruppoRiba.getSerDoc())
|
||||
.setNumDoc(gruppoRiba.getNumDoc());
|
||||
.setAnnoPart(UtilityDate.getYear(r.getValue().get(0).getDataDoc()))
|
||||
.setSerDoc(r.getValue().get(0).getSerDoc())
|
||||
.setNumDoc(r.getValue().get(0).getNumDoc());
|
||||
}
|
||||
|
||||
ctbMovt.getCtbMovr().add(ctbMovr);
|
||||
|
||||
List<VtbRiba> listRiba = Stream.of(listVtbRiba).filter(r -> r.getIdGruppo().equals(gruppo) &&
|
||||
/* List<VtbRiba> listRiba = Stream.of(listVtbRiba).filter(r -> r.getIdGruppo().equals(gruppo) &&
|
||||
r.getTipoAnag().equals(tipoAnag) && r.getCodAnag().equals(codAnag))
|
||||
.toList();
|
||||
.toList(); */
|
||||
|
||||
BigDecimal importoCP = BigDecimal.ZERO;
|
||||
for (VtbRiba riga : listRiba) {
|
||||
for (VtbRiba riga : r.getValue()) {
|
||||
query =
|
||||
Query.format(
|
||||
"SELECT cambio\n" +
|
||||
|
||||
Reference in New Issue
Block a user