Finish Hotfix-1

This commit is contained in:
2024-09-05 10:27:40 +02:00
11 changed files with 151 additions and 52 deletions

View File

@@ -279,6 +279,7 @@ public class OrdiniImportService {
public List<EntityBase> importOrdiniToscaExcel(String type, String format, ImportRequestDTO requestDTO) throws Exception {
Connection conn = multiDBTransactionManager.getPrimaryConnection();
HashMap<String, String> setup = setupGest.getImportSetupSection(conn, type, format);
// requestDTO.get
return new ArrayList<>();
}
}

View File

@@ -56,6 +56,7 @@ public class AgribookFieldService {
.setNazione("IT")
.setLat(dto.getLat())
.setLng(dto.getLng())
.setCodVzon(dto.getCodVzon())
.setPartIva(dto.getPartIva())
.setRagSocLegale(dto.getRagSocLegale())
.setCodFiscLegale(dto.getCodFiscLegale())
@@ -139,6 +140,7 @@ public class AgribookFieldService {
.setCodAnag(dto.getCodAnag())
.setCodMdep(codMdepDest)
.setCodVdes(codVdes)
.setCodVzon(dto.getCodVzon())
.setDataInizProd(UtilityLocalDate.localDateToDate(dto.getDataInizProd()))
.setDtbOrdr(ordrList)
.setOperation(OperationType.INSERT);

View File

@@ -31,6 +31,7 @@ public class AgribookNewFieldRequestDTO {
private String datiCatastali;
private String note;
private String varieta;
private String codVzon;
private LocalDate dataInizProd;
private LocalDate dataOrd;
@@ -285,4 +286,13 @@ public class AgribookNewFieldRequestDTO {
this.provLegale = provLegale;
return this;
}
public String getCodVzon() {
return codVzon;
}
public AgribookNewFieldRequestDTO setCodVzon(String codVzon) {
this.codVzon = codVzon;
return this;
}
}

View File

@@ -10,6 +10,7 @@ public class CreaOrdineProdDTO {
private Integer numOrd;
private String codAnag;
private String codVdes;
private String codVzon;
private String codMdep;
private String codMart;
private String partitaMag;
@@ -146,4 +147,13 @@ public class CreaOrdineProdDTO {
this.qtaOrd = qtaOrd;
return this;
}
public String getCodVzon() {
return codVzon;
}
public CreaOrdineProdDTO setCodVzon(String codVzon) {
this.codVzon = codVzon;
return this;
}
}

View File

@@ -68,6 +68,7 @@ public class AccettazioneOrtoFruttaDTO {
private AccettazioneOrtoFruttaDTO original;
private String lottoProduttore;
private String modalitaRaccolta;
private String codVzon;
public String getGestione() {
@@ -639,4 +640,13 @@ public class AccettazioneOrtoFruttaDTO {
this.modalitaRaccolta = modalitaRaccolta;
return this;
}
public String getCodVzon() {
return codVzon;
}
public AccettazioneOrtoFruttaDTO setCodVzon(String codVzon) {
this.codVzon = codVzon;
return this;
}
}

View File

@@ -236,6 +236,7 @@ public class OrtoFruttaProductionService {
.setTargaRim(dto.getTargaRim())
.setActivityId(activityId)
.setCodVvet(dto.getCodVvet())
.setCodVzon(dto.getCodVzon())
.setOperation(OperationType.INSERT_OR_UPDATE);
entityProcessor.processEntity(docLav, true, multiDBTransactionManager);
@@ -519,6 +520,7 @@ public class OrtoFruttaProductionService {
.setCodAnag(dto.getCodAnag())
.setCodVdes(ordAcq.getCodVdes())
.setSerDoc(dto.getSerDocProvv())
.setCodVzon(dto.getCodVzon())
.setDataOrd(ordAcq.getDataOrd())
.setNumOrd(ordAcq.getNumOrd())
.setCodMdep(ordAcq.getCodMdep())

View File

@@ -999,6 +999,7 @@ public class ProductionService {
.setCodAnag(creaOrdineProdDTO.getCodAnag())
.setCodVdes(creaOrdineProdDTO.getCodVdes())
.setCodMdep(creaOrdineProdDTO.getCodMdep())
.setCodVzon(creaOrdineProdDTO.getCodVzon())
.addDtbOrdr(rigaOrdProd);
testataOrdProd.setOperation(creaOrdineProdDTO.getNumOrd() != null ? OperationType.UPDATE : OperationType.INSERT_OR_UPDATE);
@@ -1014,6 +1015,7 @@ public class ProductionService {
DtbOrdt ordLav = new DtbOrdt();
ordLav.setOperation(OperationType.NO_OP);
ordLav.setGestione("L")
.setCodVzon(creaOrdineProdDTO.getCodVzon())
.setDataOrd(rigaOrdProd.getDataOrdRif())
.setNumOrd(rigaOrdProd.getNumOrdRif());
for (ModificheDistintaDTO mod : creaOrdineProdDTO.getModificheDistinta()) {

View File

@@ -57,6 +57,8 @@ public class CertificatiSinfoOneDTO {
private BigDecimal scartoCq;
@SqlField("cod_vvet")
private String codVvet;
@SqlField("cod_vzon")
private String codVzon;
@SqlField("vettore")
private String vettore;
@@ -293,4 +295,13 @@ public class CertificatiSinfoOneDTO {
this.vettore = vettore;
return this;
}
public String getCodVzon() {
return codVzon;
}
public CertificatiSinfoOneDTO setCodVzon(String codVzon) {
this.codVzon = codVzon;
return this;
}
}

View File

@@ -80,6 +80,8 @@ public class ExchangeCampiRaccoltaDTO implements EquatableEntityInterface<Exchan
private boolean newPartita;
@SqlField("note")
private String note;
@SqlField("codVzon")
private String codVzon;
public String getCodAnag() {
return codAnag;
@@ -321,7 +323,37 @@ public class ExchangeCampiRaccoltaDTO implements EquatableEntityInterface<Exchan
if (this == o) return true;
if (!(o instanceof ExchangeCampiRaccoltaDTO)) return false;
ExchangeCampiRaccoltaDTO that = (ExchangeCampiRaccoltaDTO) o;
return isNewDest() == that.isNewDest() && isNewPartita() == that.isNewPartita() && Objects.equals(getPartitaMag(), that.getPartitaMag()) && Objects.equals(getCodAnag(), that.getCodAnag()) && Objects.equals(getRagSoc(), that.getRagSoc()) && Objects.equals(getCodVdes(), that.getCodVdes()) && Objects.equals(getProduttore(), that.getProduttore()) && Objects.equals(getCooperativa(), that.getCooperativa()) && Objects.equals(getIndirizzoCoop(), that.getIndirizzoCoop()) && Objects.equals(getCittaCoop(), that.getCittaCoop()) && Objects.equals(getCapCoop(), that.getCapCoop()) && Objects.equals(getProvCoop(), that.getProvCoop()) && Objects.equals(getPartIvaCoop(), that.getPartIvaCoop()) && Objects.equals(getOp(), that.getOp()) && Objects.equals(getCodAnagProd(), that.getCodAnagProd()) && Objects.equals(getRagSocProd(), that.getRagSocProd()) && Objects.equals(getIndirizzoProd(), that.getIndirizzoProd()) && Objects.equals(getCittaProd(), that.getCittaProd()) && Objects.equals(getCapProd(), that.getCapProd()) && Objects.equals(getProvProd(), that.getProvProd()) && Objects.equals(getPartIvaProd(), that.getPartIvaProd()) && Objects.equals(getCodMartMp(), that.getCodMartMp()) && Objects.equals(getCodMartMg(), that.getCodMartMg()) && Objects.equals(getVarieta(), that.getVarieta()) && Objects.equals(getLottoFornitore(), that.getLottoFornitore()) && Objects.equals(getValUnt(), that.getValUnt()) && Objects.equals(getUntMis(), that.getUntMis()) && Objects.equals(getQtaAttesa(), that.getQtaAttesa()) && Objects.equals(getDataInizProd(), that.getDataInizProd()) && Objects.equals(getNote(), that.getNote());
return isNewDest() == that.isNewDest() &&
isNewPartita() == that.isNewPartita() &&
Objects.equals(getPartitaMag(), that.getPartitaMag()) &&
Objects.equals(getCodAnag(), that.getCodAnag()) &&
Objects.equals(getRagSoc(), that.getRagSoc()) &&
Objects.equals(getCodVdes(), that.getCodVdes()) &&
Objects.equals(getProduttore(), that.getProduttore()) &&
Objects.equals(getCooperativa(), that.getCooperativa()) &&
Objects.equals(getIndirizzoCoop(), that.getIndirizzoCoop()) &&
Objects.equals(getCittaCoop(), that.getCittaCoop()) &&
Objects.equals(getCapCoop(), that.getCapCoop()) &&
Objects.equals(getProvCoop(), that.getProvCoop()) &&
Objects.equals(getPartIvaCoop(), that.getPartIvaCoop()) &&
Objects.equals(getOp(), that.getOp()) &&
Objects.equals(getCodAnagProd(), that.getCodAnagProd()) &&
Objects.equals(getRagSocProd(), that.getRagSocProd()) &&
Objects.equals(getIndirizzoProd(), that.getIndirizzoProd()) &&
Objects.equals(getCittaProd(), that.getCittaProd()) &&
Objects.equals(getCapProd(), that.getCapProd()) &&
Objects.equals(getProvProd(), that.getProvProd()) &&
Objects.equals(getPartIvaProd(), that.getPartIvaProd()) &&
Objects.equals(getCodMartMp(), that.getCodMartMp()) &&
Objects.equals(getCodMartMg(), that.getCodMartMg()) &&
Objects.equals(getVarieta(), that.getVarieta()) &&
Objects.equals(getLottoFornitore(), that.getLottoFornitore()) &&
Objects.equals(getValUnt(), that.getValUnt()) &&
Objects.equals(getUntMis(), that.getUntMis()) &&
Objects.equals(getQtaAttesa(), that.getQtaAttesa()) &&
Objects.equals(getDataInizProd(), that.getDataInizProd()) &&
Objects.equals(getNote(), that.getNote()) &&
Objects.equals(getCodVzon(), that.getCodVzon()) ;
}
@Override
@@ -606,4 +638,13 @@ public class ExchangeCampiRaccoltaDTO implements EquatableEntityInterface<Exchan
this.newPartita = newPartita;
return this;
}
public String getCodVzon() {
return codVzon;
}
public ExchangeCampiRaccoltaDTO setCodVzon(String codVzon) {
this.codVzon = codVzon;
return this;
}
}

View File

@@ -251,6 +251,7 @@ public class ExchangeColliImportService {
" data_ora_lordo AS dataOraLordo,\n" +
" CONVERT(NUMERIC(15, 3), sconto8) AS sconto8,\n" +
" cod_vettore AS cod_vvet,\n" +
" cod_vzon AS cod_vzon,\n" +
" vettore AS vettore,\n" +
" CONVERT(NUMERIC(15, 3), PMB_SCARTO_CQ) AS scartoCq\n " +
"FROM s1_Certificati\n" +

View File

@@ -182,7 +182,7 @@ public class ExchangeOrdiniImportService {
x.setDtbOrdr(finalDtbOrdrLav.stream()
.filter(y ->
Objects.hash(x.getDataOrd(), x.getGestione(), x.getNumOrd()) ==
Objects.hash(y.getDataOrd(), y.getGestione(), y.getNumOrd()) &&
Objects.hash(y.getDataOrd(), y.getGestione(), y.getNumOrd()) &&
(Objects.equals(x.getDataOrd(), y.getDataOrd()) && Objects.equals(x.getNumOrd(), y.getNumOrd()) &&
Objects.equals(x.getGestione(), y.getGestione())))
.collect(Collectors.toList()));
@@ -220,7 +220,7 @@ public class ExchangeOrdiniImportService {
final List<ExchangeCampiRaccoltaDTO> exchangeCampiRaccOld = retrieveCampiDiRaccolta(
exchangeMultiDb.getPrimaryConnection(),
UtilityLocalDate.getNow().minusMonths(1),
true,false);
true, false);
final List<ExchangeCampiRaccoltaDTO> exchangeCampiRaccNew = retrieveCampiDiRaccolta(
exchangeMultiDb.getPrimaryConnection(),
@@ -234,28 +234,28 @@ public class ExchangeOrdiniImportService {
final AtomicInteger[] importedCounter = {new AtomicInteger()};
for (EquatableEntityInterface dataToSave : allData) {
ExchangeCampiRaccoltaDTO field = (ExchangeCampiRaccoltaDTO)dataToSave;
try {
importField(internalMultiDb,field);
for (EquatableEntityInterface dataToSave : allData) {
ExchangeCampiRaccoltaDTO field = (ExchangeCampiRaccoltaDTO) dataToSave;
try {
importField(internalMultiDb, field);
singleFieldUpdateImported(exchangeMultiDb.getPrimaryConnection(), field, true);
internalMultiDb.commitAll();
exchangeMultiDb.commitAll();
logger.debug("Importati {} campi di {}", importedCounter[0].incrementAndGet(), allData.size());
} catch (Exception ex) {
if (firstExceptionToThrow[0] == null) firstExceptionToThrow[0] = ex;
singleFieldUpdateImported(exchangeMultiDb.getPrimaryConnection(), field, true);
internalMultiDb.commitAll();
exchangeMultiDb.commitAll();
logger.debug("Importati {} campi di {}", importedCounter[0].incrementAndGet(), allData.size());
} catch (Exception ex) {
if (firstExceptionToThrow[0] == null) firstExceptionToThrow[0] = ex;
logger.error("Errore durante l'importazione dell'campo [fornitore: " + field.getCodAnag() + " - "+field.getCodVdes()+"," +
"articolo: " + field.getCodMartMp() + "," +
"partita: " + field.getLottoFornitore() + "]", ex);
internalMultiDb.rollbackAll();
}
logger.error("Errore durante l'importazione dell'campo [fornitore: " + field.getCodAnag() + " - " + field.getCodVdes() + "," +
"articolo: " + field.getCodMartMp() + "," +
"partita: " + field.getLottoFornitore() + "]", ex);
internalMultiDb.rollbackAll();
}
}
if (firstExceptionToThrow[0] != null) throw firstExceptionToThrow[0];
} finally {
@@ -264,41 +264,50 @@ public class ExchangeOrdiniImportService {
}
private void importField(MultiDBTransactionManager multiDb,ExchangeCampiRaccoltaDTO field) throws Exception{
if (UtilityString.isNullOrEmpty(field.getCodAnag())){
private void importField(MultiDBTransactionManager multiDb, ExchangeCampiRaccoltaDTO field) throws Exception {
if (UtilityString.isNullOrEmpty(field.getCodAnag())) {
return;
}
if (field.isNewPartita()){
AgribookNewFieldRequestDTO dto = new AgribookNewFieldRequestDTO();
dto.setCodAnag(field.getCodAnag())
.setCodVdes(field.getCodVdes())
.setNewDes(field.isNewDest())
.setCodMart(field.getCodMartMp())
.setPartitaMag(field.getPartitaMag())
.setQtaAttesa(field.getQtaAttesa())
.setValUnt(field.getValUnt())
.setUntMis(field.getUntMis())
.setDestinatario(field.getProduttore())
.setIndirizzo(field.getIndirizzoProd())
.setCap(field.getCapProd())
.setCitta(field.getCittaProd())
.setProv(field.getProvProd())
.setLat(null)
.setLng(null)
.setRagSocLegale(field.getCooperativa())
.setPartIvaLegale(field.getPartIvaCoop())
.setCodFiscLegale(field.getPartIvaCoop())
.setIndirizzoLegale(field.getIndirizzoCoop())
.setCapLegale(field.getCapCoop())
.setCittaLegale(field.getCittaCoop())
.setProvLegale(field.getProvCoop())
.setPartIva(field.getPartIvaProd())
.setDatiCatastali(null)
.setNote(field.getNote())
.setVarieta(field.getVarieta())
.setDataInizProd(field.getDataInizProd())
.setDataOrd(field.getDataInizProd());
agribookFieldService.createField(multiDb,dto, ROSSOGARGANO_EXCHANGE_USER,new RequestDataDTO());
switch (field.getOperation()) {
case INSERT:
AgribookNewFieldRequestDTO dto = new AgribookNewFieldRequestDTO();
dto.setCodAnag(field.getCodAnag())
.setCodVdes(field.getCodVdes())
.setNewDes(field.isNewDest())
.setCodMart(field.getCodMartMp())
.setPartitaMag(field.getPartitaMag())
.setQtaAttesa(field.getQtaAttesa())
.setValUnt(field.getValUnt())
.setUntMis(field.getUntMis())
.setDestinatario(field.getProduttore())
.setIndirizzo(field.getIndirizzoProd())
.setCap(field.getCapProd())
.setCitta(field.getCittaProd())
.setProv(field.getProvProd())
.setLat(null)
.setLng(null)
.setRagSocLegale(field.getCooperativa())
.setPartIvaLegale(field.getPartIvaCoop())
.setCodFiscLegale(field.getPartIvaCoop())
.setIndirizzoLegale(field.getIndirizzoCoop())
.setCapLegale(field.getCapCoop())
.setCittaLegale(field.getCittaCoop())
.setProvLegale(field.getProvCoop())
.setPartIva(field.getPartIvaProd())
.setDatiCatastali(null)
.setNote(field.getNote())
.setVarieta(field.getVarieta())
.setDataInizProd(field.getDataInizProd())
.setCodVzon(field.getCodVzon())
.setDataOrd(field.getDataInizProd());
agribookFieldService.createField(multiDb, dto, ROSSOGARGANO_EXCHANGE_USER, new RequestDataDTO());
break;
case UPDATE:
break;
case DELETE:
break;
}
}