This commit is contained in:
parent
d4767d5937
commit
d28b12f68e
3 changed files with 10 additions and 6 deletions
|
|
@ -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.balance.StatementRequest;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.clearing.Sdf04Request;
|
import ru.spcex.clearing.platform.messaging.domain.cud.clearing.Sdf04Request;
|
||||||
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
||||||
|
import ru.spcex.platform.enumeration.SdfTable;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -43,6 +44,7 @@ public class DbfImportKafkaMessenger implements InitializingBean {
|
||||||
private void messageDf01(Long groupId) {
|
private void messageDf01(Long groupId) {
|
||||||
StatementRequest statementRequest = new StatementRequest();
|
StatementRequest statementRequest = new StatementRequest();
|
||||||
statementRequest.setGroupId(groupId);
|
statementRequest.setGroupId(groupId);
|
||||||
|
statementRequest.setTable(SdfTable.SDF_01);
|
||||||
kafka.get().sendRequestToQueue(Consts.STATEMENT_PROCESS, statementRequest);
|
kafka.get().sendRequestToQueue(Consts.STATEMENT_PROCESS, statementRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,12 @@ public class DBFImporterService {
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
log.info("checking new files... {}", specificTable != null ? specificTable.name() : "");
|
log.info("checking new files... {}", specificTable != null ? specificTable.name() : "");
|
||||||
Map<ETable, List<File>> newFiles = fileChecker.checkNewFiles(specificTable);
|
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));
|
log.debug("following files will be processed {}", forLogging(newFiles));
|
||||||
} else {
|
} else if (newFiles.size() > 0) {
|
||||||
log.info("following files will be processed {}", forLoggingSizeOnly(newFiles));
|
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()) {
|
for (Map.Entry<ETable, List<File>> newFilesEntry : newFiles.entrySet()) {
|
||||||
ETable currTable = newFilesEntry.getKey();
|
ETable currTable = newFilesEntry.getKey();
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@ public class ImdgHazelcast<T extends SpcexObjectBase> implements Imdg<T> {
|
||||||
predicates[i[0]] = Predicates.equal(key, value);
|
predicates[i[0]] = Predicates.equal(key, value);
|
||||||
i[0]++;
|
i[0]++;
|
||||||
});
|
});
|
||||||
Predicate<Long, T> or = Predicates.or(predicates);
|
Predicate<Long, T> and = Predicates.and(predicates);
|
||||||
Set<Map.Entry<Long, T>> found = map.entrySet(or);
|
Set<Map.Entry<Long, T>> found = map.entrySet(and);
|
||||||
Iterator<Map.Entry<Long, T>> allFoundByCondition = found.iterator();
|
Iterator<Map.Entry<Long, T>> allFoundByCondition = found.iterator();
|
||||||
if (allFoundByCondition.hasNext()) {
|
if (allFoundByCondition.hasNext()) {
|
||||||
return allFoundByCondition.next().getValue();
|
return allFoundByCondition.next().getValue();
|
||||||
|
|
@ -122,8 +122,8 @@ public class ImdgHazelcast<T extends SpcexObjectBase> implements Imdg<T> {
|
||||||
predicates[i[0]] = Predicates.equal(key, value);
|
predicates[i[0]] = Predicates.equal(key, value);
|
||||||
i[0]++;
|
i[0]++;
|
||||||
});
|
});
|
||||||
Predicate<Long, T> or = Predicates.or(predicates);
|
Predicate<Long, T> and = Predicates.and(predicates);
|
||||||
Set<Long> ids = map.keySet(or);
|
Set<Long> ids = map.keySet(and);
|
||||||
Iterator<Long> idIterator = ids.iterator();
|
Iterator<Long> idIterator = ids.iterator();
|
||||||
Collection<T> searchResult = new ArrayList<>();
|
Collection<T> searchResult = new ArrayList<>();
|
||||||
while (idIterator.hasNext()) {
|
while (idIterator.hasNext()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue