This commit is contained in:
parent
ddafc695aa
commit
d0a82dce34
1 changed files with 14 additions and 2 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
package ru.spcex.clearing.imdg.object;
|
package ru.spcex.clearing.imdg.object;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import ru.clearing.classes.statics.data.misc.Notification;
|
import ru.clearing.classes.statics.data.misc.Notification;
|
||||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
import ru.spcex.clearing.imdg.base.TemplateMapStore;
|
import ru.spcex.clearing.imdg.base.TemplateMapStore;
|
||||||
import ru.spcex.platform.utils.log.ExceptionUtils;
|
|
||||||
import ru.spcex.platform.utils.time.TimeUtil;
|
import ru.spcex.platform.utils.time.TimeUtil;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
|
@ -39,7 +39,19 @@ public class NotificationMapStore extends TemplateMapStore<Notification> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<Long> loadAllKeys() {
|
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
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue