Fix build JDK11
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:
parent
60f4f4e85e
commit
e1fbcf0170
@ -16,7 +16,7 @@ public enum FlagEvaso implements IBaseEnum<FlagEvaso> {
|
||||
|
||||
if (value instanceof Character)
|
||||
castValue = (Character) value;
|
||||
else if (value instanceof String)
|
||||
else if (value instanceof String && !((String) value).isEmpty())
|
||||
castValue = ((String) value).charAt(0);
|
||||
|
||||
for (FlagEvaso b : FlagEvaso.values()) {
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
package it.integry.ems_model.entity.key;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
public class DtbDoctKey {
|
||||
|
||||
private final String codAnag;
|
||||
private final String codDtip;
|
||||
private final Date dataDoc;
|
||||
private final Integer numDoc;
|
||||
private final String serDoc;
|
||||
|
||||
public DtbDoctKey(String codAnag, String codDtip, Date dataDoc, Integer numDoc, String serDoc) {
|
||||
this.codAnag = codAnag;
|
||||
this.codDtip = codDtip;
|
||||
this.dataDoc = dataDoc;
|
||||
this.numDoc = numDoc;
|
||||
this.serDoc = serDoc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
DtbDoctKey that = (DtbDoctKey) o;
|
||||
return Objects.equals(codAnag, that.codAnag) &&
|
||||
Objects.equals(codDtip, that.codDtip) &&
|
||||
Objects.equals(dataDoc, that.dataDoc) &&
|
||||
Objects.equals(numDoc, that.numDoc) &&
|
||||
Objects.equals(serDoc, that.serDoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(codAnag, codDtip, dataDoc, numDoc, serDoc);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package it.integry.ems_model.entity.key;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
public class MtbColtKey {
|
||||
|
||||
private final String gestione;
|
||||
private final String serCollo;
|
||||
private final LocalDate dataCollo;
|
||||
private final Integer numCollo;
|
||||
|
||||
public MtbColtKey(String gestione, String serCollo, LocalDate dataCollo, Integer numCollo) {
|
||||
this.gestione = gestione;
|
||||
this.serCollo = serCollo;
|
||||
this.dataCollo = dataCollo;
|
||||
this.numCollo = numCollo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
MtbColtKey that = (MtbColtKey) o;
|
||||
return Objects.equals(dataCollo, that.dataCollo) &&
|
||||
Objects.equals(gestione, that.gestione) &&
|
||||
Objects.equals(numCollo, that.numCollo) &&
|
||||
Objects.equals(serCollo, that.serCollo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(dataCollo, gestione, numCollo, serCollo);
|
||||
}
|
||||
}
|
||||
@ -13,6 +13,7 @@ import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.entity.DtbDoct;
|
||||
import it.integry.ems_model.entity.MtbColr;
|
||||
import it.integry.ems_model.entity.MtbColt;
|
||||
import it.integry.ems_model.entity.key.MtbColtKey;
|
||||
import it.integry.ems_model.exception.EntityException;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
@ -27,10 +28,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -265,17 +263,15 @@ public class ExchangeColliImportService {
|
||||
final List<MtbColr> mtbColrLav = exchangeImportDataManagerService.retrieveDataFromExchange(connection, MtbColr.class,
|
||||
mtbColrLavTableName, Query.format("data_collo BETWEEN {} AND {}", minDate, maxDate), retrieveAlreadyImported);
|
||||
|
||||
Map<MtbColtKey, List<MtbColr>> mapRighe = mtbColrLav.stream()
|
||||
.collect(Collectors.groupingBy(x -> new MtbColtKey(x.getGestione(), x.getSerCollo(), x.getDataCollo(), x.getNumCollo())));
|
||||
|
||||
|
||||
mtbColtLav
|
||||
.parallelStream()
|
||||
.forEach(x -> {
|
||||
x.setMtbColr(mtbColrLav.parallelStream()
|
||||
.filter(y -> Objects.hash(x.getGestione(), x.getNumCollo(), x.getDataCollo(), x.getSerCollo()) ==
|
||||
Objects.hash(y.getGestione(), y.getNumCollo(), y.getDataCollo(), y.getSerCollo()) &&
|
||||
|
||||
(Objects.equals(x.getGestione(), y.getGestione()) && Objects.equals(x.getDataCollo(), y.getDataCollo()) &&
|
||||
Objects.equals(x.getNumCollo(), y.getNumCollo()) && Objects.equals(x.getSerCollo(), y.getSerCollo())))
|
||||
.collect(Collectors.toList()));
|
||||
MtbColtKey key = new MtbColtKey(x.getGestione(), x.getSerCollo(), x.getDataCollo(), x.getNumCollo());
|
||||
x.setMtbColr(mapRighe.getOrDefault(key, Collections.emptyList()));
|
||||
});
|
||||
|
||||
return mtbColtLav;
|
||||
|
||||
@ -9,6 +9,7 @@ import it.integry.ems.system.exchange.service.structure.ExchangeImportSchemaMana
|
||||
import it.integry.ems_model.base.EquatableEntityInterface;
|
||||
import it.integry.ems_model.entity.DtbDocr;
|
||||
import it.integry.ems_model.entity.DtbDoct;
|
||||
import it.integry.ems_model.entity.key.DtbDoctKey;
|
||||
import it.integry.ems_model.exception.EntityException;
|
||||
import it.integry.ems_model.exception.MergeEntityDBToObjectException;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
@ -21,10 +22,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -205,19 +203,29 @@ public class ExchangeDocumentImportService {
|
||||
final List<DtbDocr> righe = exchangeImportDataManagerService.retrieveDataFromExchange(connection, DtbDocr.class,
|
||||
righeTableName, Query.format("data_doc BETWEEN {} AND {}", minDate, maxDate), retrieveAlreadyImported);
|
||||
|
||||
Set<DtbDoctKey> testateKeys = testate.stream()
|
||||
.map(testata -> new DtbDoctKey(
|
||||
testata.getCodAnag(),
|
||||
testata.getCodDtip(),
|
||||
testata.getDataDoc(),
|
||||
testata.getNumDoc(),
|
||||
testata.getSerDoc()))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Map<DtbDoctKey, List<DtbDocr>> mapRighe = righe.stream()
|
||||
.collect(Collectors.groupingBy(x -> new DtbDoctKey(x.getCodAnag(), x.getCodDtip(), x.getDataDoc(), x.getNumDoc(), x.getSerDoc())));
|
||||
|
||||
final List<DtbDoct> orphanTestateToAdd = righe.parallelStream()
|
||||
.filter(riga ->
|
||||
testate.parallelStream()
|
||||
.noneMatch(testata ->
|
||||
Objects.hash(riga.getDataDoc(), riga.getNumDoc(), riga.getSerDoc(), riga.getCodAnag(), riga.getCodDtip()) ==
|
||||
Objects.hash(testata.getDataDoc(), testata.getNumDoc(), testata.getSerDoc(), testata.getCodAnag(), testata.getCodDtip()) &&
|
||||
|
||||
(Objects.equals(riga.getCodAnag(), testata.getCodAnag()) &&
|
||||
Objects.equals(riga.getCodDtip(), testata.getCodDtip()) &&
|
||||
Objects.equals(riga.getDataDoc(), testata.getDataDoc()) &&
|
||||
Objects.equals(riga.getNumDoc(), testata.getNumDoc()) &&
|
||||
Objects.equals(riga.getSerDoc(), testata.getSerDoc()))))
|
||||
.filter(riga -> {
|
||||
DtbDoctKey key = new DtbDoctKey(
|
||||
riga.getCodAnag(),
|
||||
riga.getCodDtip(),
|
||||
riga.getDataDoc(),
|
||||
riga.getNumDoc(),
|
||||
riga.getSerDoc()
|
||||
);
|
||||
return !testateKeys.contains(key);
|
||||
})
|
||||
.map(riga -> {
|
||||
DtbDoct testata = new DtbDoct()
|
||||
.setSerDoc(riga.getSerDoc())
|
||||
@ -241,17 +249,8 @@ public class ExchangeDocumentImportService {
|
||||
testata.setUsername(EXCHANGE_USER);
|
||||
//testata.setUpdProgMaga(false);
|
||||
|
||||
testata.setDtbDocr(righe.parallelStream()
|
||||
.filter(riga ->
|
||||
Objects.hash(testata.getDataDoc(), testata.getNumDoc(), testata.getSerDoc(), testata.getCodAnag(), testata.getCodDtip()) ==
|
||||
Objects.hash(riga.getDataDoc(), riga.getNumDoc(), riga.getSerDoc(), riga.getCodAnag(), riga.getCodDtip()) &&
|
||||
|
||||
(Objects.equals(testata.getCodAnag(), riga.getCodAnag()) &&
|
||||
Objects.equals(testata.getCodDtip(), riga.getCodDtip()) &&
|
||||
Objects.equals(testata.getDataDoc(), riga.getDataDoc()) &&
|
||||
Objects.equals(testata.getNumDoc(), riga.getNumDoc()) &&
|
||||
Objects.equals(testata.getSerDoc(), riga.getSerDoc())))
|
||||
.collect(Collectors.toList()));
|
||||
DtbDoctKey key = new DtbDoctKey(testata.getCodAnag(), testata.getCodDtip(), testata.getDataDoc(), testata.getNumDoc(), testata.getSerDoc());
|
||||
testata.setDtbDocr(mapRighe.getOrDefault(key, Collections.emptyList()));
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ import it.integry.ems_model.base.EquatableEntityInterface;
|
||||
import it.integry.ems_model.entity.DtbOrdSteps;
|
||||
import it.integry.ems_model.entity.DtbOrdr;
|
||||
import it.integry.ems_model.entity.DtbOrdt;
|
||||
import it.integry.ems_model.entity.key.DtbOrdtKey;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
@ -26,10 +27,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -216,17 +214,15 @@ public class ExchangeOrdiniImportService {
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Map<DtbOrdtKey, List<DtbOrdr>> mapRighe = dtbOrdrLav.stream()
|
||||
.collect(Collectors.groupingBy(x -> new DtbOrdtKey(x.getGestione(), x.getDataOrd(), x.getNumOrd())));
|
||||
|
||||
dtbOrdtLav
|
||||
.forEach(x -> {
|
||||
x.setGeneraOrdLavDaProd(false);
|
||||
|
||||
x.setDtbOrdr(dtbOrdrLav.stream()
|
||||
.filter(y ->
|
||||
Objects.hash(x.getDataOrd(), x.getGestione(), x.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()));
|
||||
DtbOrdtKey key = new DtbOrdtKey(x.getGestione(), x.getDataOrd(), x.getNumOrd());
|
||||
x.setDtbOrdr(mapRighe.getOrDefault(key, Collections.emptyList()));
|
||||
});
|
||||
|
||||
return dtbOrdtLav;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user