nuovi servizi crm
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:
@@ -280,7 +280,9 @@ public class CrmService {
|
|||||||
"WHERE wdtb_ordt.gestione = %s\n" +
|
"WHERE wdtb_ordt.gestione = %s\n" +
|
||||||
" AND wdtb_ordt.data_ord = %s\n" +
|
" AND wdtb_ordt.data_ord = %s\n" +
|
||||||
" AND wdtb_ordt.num_ord = %s\n" +
|
" AND wdtb_ordt.num_ord = %s\n" +
|
||||||
" AND wdtb_ordt.serie = %s"
|
" AND wdtb_ordt.serie = %s",
|
||||||
|
completeOrder.getGestione(), completeOrder.getDataOrd(), completeOrder.getNumOrd(), completeOrder.getSerie()
|
||||||
|
|
||||||
);
|
);
|
||||||
HashMap<String, Object> ordineImportato = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
HashMap<String, Object> ordineImportato = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
||||||
|
|
||||||
@@ -424,7 +426,7 @@ public class CrmService {
|
|||||||
|
|
||||||
// Cancellazione eventuali spese associate all'ordine
|
// Cancellazione eventuali spese associate all'ordine
|
||||||
sql = Query.format(
|
sql = Query.format(
|
||||||
"DELETE\n" +
|
"SELECT * \n" +
|
||||||
"FROM wdtb_ords\n" +
|
"FROM wdtb_ords\n" +
|
||||||
"WHERE gestione = %s\n" +
|
"WHERE gestione = %s\n" +
|
||||||
" AND data_ord = %s\n" +
|
" AND data_ord = %s\n" +
|
||||||
@@ -435,16 +437,15 @@ public class CrmService {
|
|||||||
);
|
);
|
||||||
List<WdtbOrds> wdtbOrdsToDelate = UtilityDB.executeSimpleQueryDTO(conn, sql, WdtbOrds.class);
|
List<WdtbOrds> wdtbOrdsToDelate = UtilityDB.executeSimpleQueryDTO(conn, sql, WdtbOrds.class);
|
||||||
|
|
||||||
if (wdtbOrdsToDelate != null && !wdtbOrdsToDelate.isEmpty()) {
|
|
||||||
wdtbOrdsToDelate.forEach(x -> x.setOperation(OperationType.DELETE));
|
|
||||||
|
|
||||||
entityProcessor.processEntityList(wdtbOrdsToDelate, multiDBTransactionManager, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ordine web da aggiornare
|
// ordine web da aggiornare
|
||||||
WdtbOrdt wdtbOrdt = CRMUtility.buildWdtbOrdt(completeOrder);
|
WdtbOrdt wdtbOrdt = CRMUtility.buildWdtbOrdt(completeOrder);
|
||||||
wdtbOrdt.setOperation(OperationType.UPDATE);
|
wdtbOrdt.setOperation(OperationType.UPDATE);
|
||||||
|
|
||||||
|
if (wdtbOrdsToDelate != null && !wdtbOrdsToDelate.isEmpty()) {
|
||||||
|
wdtbOrdsToDelate.forEach(x -> x.setOperation(OperationType.DELETE));
|
||||||
|
|
||||||
|
wdtbOrdt.getWdtbOrds().addAll(wdtbOrdsToDelate);
|
||||||
|
}
|
||||||
// Aggiornamento spese ordine WEB
|
// Aggiornamento spese ordine WEB
|
||||||
for (CRMSpeseDTO spese : completeOrder.getSpese()) {
|
for (CRMSpeseDTO spese : completeOrder.getSpese()) {
|
||||||
WdtbOrds wdtbOrds = new WdtbOrds()
|
WdtbOrds wdtbOrds = new WdtbOrds()
|
||||||
@@ -452,7 +453,7 @@ public class CrmService {
|
|||||||
.setImporto(spese.getImporto())
|
.setImporto(spese.getImporto())
|
||||||
.setDescrizione(spese.getDescrizione())
|
.setDescrizione(spese.getDescrizione())
|
||||||
.setCodAliq(spese.getCodAliq());
|
.setCodAliq(spese.getCodAliq());
|
||||||
wdtbOrdt.setOperation(OperationType.INSERT);
|
wdtbOrds.setOperation(OperationType.INSERT);
|
||||||
|
|
||||||
wdtbOrdt.getWdtbOrds().add(wdtbOrds);
|
wdtbOrdt.getWdtbOrds().add(wdtbOrds);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user