This commit is contained in:
root
2025-10-05 02:56:21 +05:00
parent 3caf1cce28
commit 9c37f7b6cf
@@ -171,21 +171,22 @@ public class ReportGenerationService {
persistReport(req, rb);
// Отправляем PDF на email, если указан email и формат PDF
if (req.getRecipientEmail() != null && !req.getRecipientEmail().trim().isEmpty()
&& "PDF".equalsIgnoreCase(req.getFormat())) {
try {
emailService.sendReportByEmail(
req.getRecipientEmail(),
req.getReportTitle(),
req.getAuthorName(),
req.getCompanyName(),
rb.getBytes(),
rb.getFilename());
} catch (Exception e) {
System.err.println("Ошибка при отправке email: " + e.getMessage());
// Не прерываем выполнение, если email не отправился
}
}
// if (req.getRecipientEmail() != null &&
// !req.getRecipientEmail().trim().isEmpty()
// && "PDF".equalsIgnoreCase(req.getFormat())) {
// try {
// emailService.sendReportByEmail(
// req.getRecipientEmail(),
// req.getReportTitle(),
// req.getAuthorName(),
// req.getCompanyName(),
// rb.getBytes(),
// rb.getFilename());
// } catch (Exception e) {
// System.err.println("Ошибка при отправке email: " + e.getMessage());
// // Не прерываем выполнение, если email не отправился
// }
// }
return rb;
}