Modifica import GSE
This commit is contained in:
@@ -186,6 +186,9 @@ public class OrdiniImportService {
|
||||
|
||||
|
||||
for (List<String> record : records) {
|
||||
if (record.size() <=1){
|
||||
continue;
|
||||
}
|
||||
sql =
|
||||
Query.format(
|
||||
"SELECT * FROM getDatiDestPVGSE(%s, %s)",
|
||||
@@ -247,8 +250,14 @@ public class OrdiniImportService {
|
||||
citta
|
||||
);
|
||||
|
||||
boolean existError = false;
|
||||
StringBuilder mailMessage = new StringBuilder();
|
||||
for (DtbOrdt dtbOrdt : dtbOrdtList) {
|
||||
if (dtbOrdt.getException() != null){
|
||||
existError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
String msg;
|
||||
if (dtbOrdt.getDtbOrdr().size() == 1) {
|
||||
msg = String.format("Presente %s articolo", dtbOrdt.getDtbOrdr().size());
|
||||
@@ -264,18 +273,20 @@ public class OrdiniImportService {
|
||||
));
|
||||
}
|
||||
|
||||
if (alreadyExists != null){
|
||||
mailMessage.append(String.format("<p style=\"color: red; font-weight:bold\">%s<br/></p>", alreadyExists));
|
||||
if (!existError){
|
||||
if (alreadyExists != null){
|
||||
mailMessage.append(String.format("<p style=\"color: red; font-weight:bold\">%s<br/></p>", alreadyExists));
|
||||
}
|
||||
|
||||
final MailTemplateDataDTO mailTemplateData = new MailTemplateDataDTO()
|
||||
.setTitle(subject)
|
||||
.setContent(String.valueOf(mailMessage));
|
||||
String htmlMailText = mailTemplateService.getGenericEmailTemplate(MailService.Level.SUCCESS, mailTemplateData);
|
||||
|
||||
mailService.sendMailPrimary(multiDBTransactionManager, null, null, emailDestination, null, null,
|
||||
subject, htmlMailText, true, false, null, null,
|
||||
null, false, null);
|
||||
}
|
||||
|
||||
final MailTemplateDataDTO mailTemplateData = new MailTemplateDataDTO()
|
||||
.setTitle(subject)
|
||||
.setContent(String.valueOf(mailMessage));
|
||||
String htmlMailText = mailTemplateService.getGenericEmailTemplate(MailService.Level.SUCCESS, mailTemplateData);
|
||||
|
||||
mailService.sendMailPrimary(multiDBTransactionManager, null, null, emailDestination, null, null,
|
||||
subject, htmlMailText, true, false, null, null,
|
||||
null, false, null);
|
||||
}
|
||||
|
||||
return entityBases;
|
||||
|
||||
Reference in New Issue
Block a user