aggiunta invio email di errore
This commit is contained in:
@@ -58,6 +58,7 @@ public class RossoGarganoSyncService {
|
|||||||
Date startDate = new Date();
|
Date startDate = new Date();
|
||||||
DataSource rgExchange = new DataSource();
|
DataSource rgExchange = new DataSource();
|
||||||
rgExchange.initialize("ROSSOGARGANOEXCHANGE");
|
rgExchange.initialize("ROSSOGARGANOEXCHANGE");
|
||||||
|
try {
|
||||||
saveCtbCaus(rgExchange.getConnection());
|
saveCtbCaus(rgExchange.getConnection());
|
||||||
logger.info("Importazione causali: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
logger.info("Importazione causali: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
||||||
|
|
||||||
@@ -73,8 +74,8 @@ public class RossoGarganoSyncService {
|
|||||||
savePdc(rgExchange.getConnection());
|
savePdc(rgExchange.getConnection());
|
||||||
logger.info("Importazione Conti del piano dei conti: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
logger.info("Importazione Conti del piano dei conti: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
||||||
|
|
||||||
saveFornitori(rgExchange.getConnection());
|
// saveFornitori(rgExchange.getConnection());
|
||||||
logger.info("Importazione Fornitori dei conti: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
// logger.info("Importazione Fornitori dei conti: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
||||||
|
|
||||||
deleteCtbMovt(rgExchange.getConnection());
|
deleteCtbMovt(rgExchange.getConnection());
|
||||||
logger.info("Cancellazione movimenti contabili: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
logger.info("Cancellazione movimenti contabili: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
||||||
@@ -103,17 +104,17 @@ public class RossoGarganoSyncService {
|
|||||||
saveCtbMovt(rgExchange.getConnection(), "(PNOTA.PN_SEZIONALE_IVA <> '' AND PN_CAUSALE_MOVIMENTO <> '998')", dataIniz, dataFine);
|
saveCtbMovt(rgExchange.getConnection(), "(PNOTA.PN_SEZIONALE_IVA <> '' AND PN_CAUSALE_MOVIMENTO <> '998')", dataIniz, dataFine);
|
||||||
logger.info("Importazione fatture attive e passive: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
logger.info("Importazione fatture attive e passive: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
||||||
|
|
||||||
// sql =
|
|
||||||
// "SELECT CAST(FORMAT(DATEPART(YEAR, data_fine), '0000') +\n" +
|
|
||||||
// " FORMAT(DATEPART(MONTH, data_fine), '00') +\n" +
|
|
||||||
// " FORMAT(DATEPART(DAY, data_fine), '00') AS NUMERIC) as data_fine\n" +
|
|
||||||
// "FROM azienda\n" +
|
|
||||||
// " CROSS APPLY dbo.getperiodoannofisc(azienda.anno_contab)";
|
|
||||||
//
|
|
||||||
// dataFine = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
|
||||||
|
|
||||||
saveCtbMovt(rgExchange.getConnection(), "(PN_CAUSALE_MOVIMENTO <> '998')", dataIniz, dataFine);
|
saveCtbMovt(rgExchange.getConnection(), "(PN_CAUSALE_MOVIMENTO <> '998')", dataIniz, dataFine);
|
||||||
logger.info("Importazione altri movimenti contabili: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
logger.info("Importazione altri movimenti contabili: Timing " + ((new Date().getTime() - startDate.getTime()) / 1000) + " secs");
|
||||||
|
} catch (Exception e ){
|
||||||
|
if (!UtilityDebug.isDebugExecution()) {
|
||||||
|
mailService.sendSystemErrorLog("Importazione movimenti contabili " + multiDBTransactionManager.getPrimaryDatasource().getDbName(),
|
||||||
|
"Importazione movimenti contabili ",
|
||||||
|
"Errore durante la procedura di importazione movimenti contabili.",
|
||||||
|
e, new Date());
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteCtbMovt(Connection sourceData) throws Exception {
|
private void deleteCtbMovt(Connection sourceData) throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user