aggiunto invio dell'errore
This commit is contained in:
@@ -1097,7 +1097,9 @@ public class VariazioniPvService {
|
||||
|
||||
public void exportByTipoReport(String tipoReport, VariazioniPvInputDTO variazioniPvInputDTO) throws Exception {
|
||||
List<String> tipiReport = new ArrayList<>();
|
||||
String emailForLog = setupGest.getExportSetup(multiDBTransactionManager.getPrimaryConnection(), "VARIAZIONE PV", "XML_DIALOGO", "EMAIL_FOR_LOG");
|
||||
|
||||
try {
|
||||
if (!UtilityString.isNullOrEmpty(tipoReport))
|
||||
tipiReport.add(tipoReport);
|
||||
else {
|
||||
@@ -1155,23 +1157,21 @@ public class VariazioniPvService {
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
String emailForLog = setupGest.getExportSetup(multiDBTransactionManager.getPrimaryConnection(), "VARIAZIONE PV", "XML_DIALOGO", "EMAIL_FOR_LOG");
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(emailForLog)) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
for (Triple<String, String, List<VariazioniDettaglioDTO>> completedExport : completedExports) {
|
||||
if(completedExport.getThird().isEmpty())
|
||||
continue;
|
||||
|
||||
sb.append("Esportazione ")
|
||||
.append(completedExport.getSecond())
|
||||
.append(" punto vendita ")
|
||||
.append(completedExport.getFirst())
|
||||
.append(" (").append(completedExport.getThird().size()).append(" variazioni)")
|
||||
.append(" avvenuta con successo\n\r");
|
||||
}
|
||||
// for (Triple<String, String, List<VariazioniDettaglioDTO>> completedExport : completedExports) {
|
||||
// if (completedExport.getThird().isEmpty())
|
||||
// continue;
|
||||
//
|
||||
// sb.append("Esportazione ")
|
||||
// .append(completedExport.getSecond())
|
||||
// .append(" punto vendita ")
|
||||
// .append(completedExport.getFirst())
|
||||
// .append(" (").append(completedExport.getThird().size()).append(" variazioni)")
|
||||
// .append(" avvenuta con successo\n\r");
|
||||
// }
|
||||
|
||||
if (!generatedErrors.isEmpty())
|
||||
sb.append("\n\r\n\rErrori\n\r");
|
||||
@@ -1191,7 +1191,24 @@ public class VariazioniPvService {
|
||||
null, null, null,
|
||||
false, null);
|
||||
}
|
||||
}catch (Exception e ){
|
||||
if (!UtilityString.isNullOrEmpty(emailForLog)) {
|
||||
mailService.sendMailPrimary(multiDBTransactionManager,
|
||||
null, null,
|
||||
emailForLog, null, null,
|
||||
"Errore nella procedura di esportazione variazioni", e.getMessage(), false, false,
|
||||
null, null, null,
|
||||
false, null);
|
||||
} else {
|
||||
mailService.sendSystemErrorLog(
|
||||
"Errore nella procedura di esportazione variazioni " + multiDBTransactionManager.getPrimaryDatasource().getDbName(),
|
||||
"Errore nella procedura di esportazione variazioni ",
|
||||
"Errore nella procedura di esportazione variazioni",
|
||||
e, new Date());
|
||||
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user