etreschenkov 2026-04-10 13:10:57 +03:00
parent ddafc695aa
commit d0a82dce34

View file

@ -1,11 +1,11 @@
package ru.spcex.clearing.imdg.object;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import ru.clearing.classes.statics.data.misc.Notification;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.clearing.imdg.base.TemplateMapStore;
import ru.spcex.platform.utils.log.ExceptionUtils;
import ru.spcex.platform.utils.time.TimeUtil;
import java.sql.ResultSet;
@ -39,7 +39,19 @@ public class NotificationMapStore extends TemplateMapStore<Notification> {
@Override
public Iterable<Long> loadAllKeys() {
return defaultLoadAllKeysOnTodayByField("clearing_date", false);
LocalDate today = LocalDate.now();
log.debug("loadAllKeys from {} on {} {} today", getTableName(), "clearing_date", "=");
List<Long> keys;
try {
keys = jdbcTemplate.query("select id from " + getTableName() + " where clearing_date = ? or " +
"(object_type in ('ACCB', 'ACCA') and notification_status = 'PEND' and priority = 'HIGH')",
(resultSet, i) -> resultSet.getLong("id"),
new Object[]{today});
} catch (Throwable e) {
log.error("At load keys from {} (by field {}): {}", getTableName(), "clearing_date", ExceptionUtils.getStackTrace(e));
throw e;
}
return keys;
}
@Override