This commit is contained in:
ialbert 2022-12-12 17:08:35 +03:00
parent d4767d5937
commit d28b12f68e
3 changed files with 10 additions and 6 deletions

View file

@ -7,6 +7,7 @@ import ru.spcex.clearing.platform.messaging.domain.Consts;
import ru.spcex.clearing.platform.messaging.domain.cud.balance.StatementRequest;
import ru.spcex.clearing.platform.messaging.domain.cud.clearing.Sdf04Request;
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
import ru.spcex.platform.enumeration.SdfTable;
import java.util.HashMap;
import java.util.Map;
@ -43,6 +44,7 @@ public class DbfImportKafkaMessenger implements InitializingBean {
private void messageDf01(Long groupId) {
StatementRequest statementRequest = new StatementRequest();
statementRequest.setGroupId(groupId);
statementRequest.setTable(SdfTable.SDF_01);
kafka.get().sendRequestToQueue(Consts.STATEMENT_PROCESS, statementRequest);
}

View file

@ -45,10 +45,12 @@ public class DBFImporterService {
executorService.execute(() -> {
log.info("checking new files... {}", specificTable != null ? specificTable.name() : "");
Map<ETable, List<File>> newFiles = fileChecker.checkNewFiles(specificTable);
if (log.isDebugEnabled()) {
if (newFiles.size() > 0 && log.isDebugEnabled()) {
log.debug("following files will be processed {}", forLogging(newFiles));
} else {
} else if (newFiles.size() > 0) {
log.info("following files will be processed {}", forLoggingSizeOnly(newFiles));
} else {
log.info("no files were found");
}
for (Map.Entry<ETable, List<File>> newFilesEntry : newFiles.entrySet()) {
ETable currTable = newFilesEntry.getKey();

View file

@ -90,8 +90,8 @@ public class ImdgHazelcast<T extends SpcexObjectBase> implements Imdg<T> {
predicates[i[0]] = Predicates.equal(key, value);
i[0]++;
});
Predicate<Long, T> or = Predicates.or(predicates);
Set<Map.Entry<Long, T>> found = map.entrySet(or);
Predicate<Long, T> and = Predicates.and(predicates);
Set<Map.Entry<Long, T>> found = map.entrySet(and);
Iterator<Map.Entry<Long, T>> allFoundByCondition = found.iterator();
if (allFoundByCondition.hasNext()) {
return allFoundByCondition.next().getValue();
@ -122,8 +122,8 @@ public class ImdgHazelcast<T extends SpcexObjectBase> implements Imdg<T> {
predicates[i[0]] = Predicates.equal(key, value);
i[0]++;
});
Predicate<Long, T> or = Predicates.or(predicates);
Set<Long> ids = map.keySet(or);
Predicate<Long, T> and = Predicates.and(predicates);
Set<Long> ids = map.keySet(and);
Iterator<Long> idIterator = ids.iterator();
Collection<T> searchResult = new ArrayList<>();
while (idIterator.hasNext()) {