Fix calculating flag 5000; Set package status to Error if some errors occures

This commit is contained in:
Mikhail Trofimov 2025-06-26 09:25:07 +03:00
parent 16bb8eb723
commit deac68b9ae
2 changed files with 2 additions and 1 deletions

View file

@ -237,6 +237,7 @@ public class SignalFacade {
}
}
} catch (Exception e) {
signalService.setPackageStatus(packageId, Status.ERROR);
log.error("Ошибка при поиске фидов или расчете флагов просрочек. Package_id {}", packageId, e);
}
});

View file

@ -45,7 +45,7 @@ public class FlagsService {
.map(Optional::get)
.toList();
if (!dataList.isEmpty() && dataList.stream().anyMatch(item -> item != null && item.getAmountPastDue().compareTo(BigDecimal.valueOf(5000)) > 0)) {
if (!dataList.isEmpty() && dataList.stream().anyMatch(item -> item != null && item.getAmountPastDue() != null && item.getAmountPastDue().compareTo(BigDecimal.valueOf(5000)) > 0)) {
return 1;
} else {
return 0;