Merge branch 'master' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-07-11 10:04:59 +02:00

View File

@@ -65,7 +65,7 @@ public class ToscaSalesService {
for (String transactionNumber : ordini.keySet()) {
List<ToscaOrdineVenditaDTO> rows = ordini.get(transactionNumber);
importOrdine(transactionNumber, rows,activityId);
importOrdine(transactionNumber, rows, activityId);
}
clearOldOrders(ordiniDaImportare.stream().map(ToscaOrdineVenditaDTO::getTransactionNumber).collect(Collectors.toList()));
@@ -83,7 +83,7 @@ public class ToscaSalesService {
ToscaOrdineVenditaDTO newDTO = new ToscaOrdineVenditaDTO();
String codMart = null;
Long diacod= Long.valueOf(UtilityExcel.getCellAsString(row, 2));
Long diacod = Long.valueOf(UtilityExcel.getCellAsString(row, 2));
codMart = findCodMartFromDiacod(String.valueOf(diacod));
if (UtilityString.isNullOrEmpty(codMart) && !diacodNotFound.contains(diacod)) {
diacodNotFound.add(diacod);
@@ -122,10 +122,10 @@ public class ToscaSalesService {
if (!diacodNotFound.isEmpty() || !trasportIdNotFound.isEmpty()) {
String message = "Errore durante l'importazione degli ordini di vendita. ";
if ( !diacodNotFound.isEmpty() ) {
if (!diacodNotFound.isEmpty()) {
message += CommonConstants.A_CAPO + "Articoli non trovati: " + String.join(", ", String.valueOf(diacodNotFound));
}
if ( !trasportIdNotFound.isEmpty() ) {
if (!trasportIdNotFound.isEmpty()) {
message += CommonConstants.A_CAPO + "Transporter Id non presente sulle righe: " + String.join(", ", String.valueOf(trasportIdNotFound));
}
throw new Exception(message);
@@ -255,8 +255,8 @@ public class ToscaSalesService {
continue;
String codVvet = (String) (vettoriEsistenti.stream()
.filter(x -> ((String) x.get("diacod")).equalsIgnoreCase(order.getTransporterNumber())).
findFirst()
.filter(x -> ((String) x.get("diacod")).equalsIgnoreCase(order.getTransporterNumber()))
.findFirst()
.orElse(new HashMap<>())
.get("cod_vvet"));
@@ -273,15 +273,17 @@ public class ToscaSalesService {
.setNote(ragSoc)
.setDiacod(order.getTransporterNumber())
.setOperation(OperationType.INSERT_OR_UPDATE);
entityToProcess.add(gtbAnag);
entityProcessor.processEntity(gtbAnag, true, multiDBTransactionManager);
VtbVett vettore = new VtbVett();
vettore.setRagSoc(ragSoc);
vettore.setNote(String.valueOf(order.getTransporterId()));
vettore.setCodAnag(gtbAnag.getCodAnag());
vettore.setOperation(OperationType.INSERT_OR_UPDATE);
entityToProcess.add(vettore);
entityProcessor.processEntityList(entityToProcess, true);
entityProcessor.processEntity(vettore, true, multiDBTransactionManager);
order.setCodVvet(vettore.getCodVvet());
HashMap<String, Object> newAnag = new HashMap<>();
newAnag.put("cod_vvet", vettore.getCodVvet());