stmtService log + swt-importer sdf21 message

This commit is contained in:
ialbert 2023-08-08 16:51:26 +03:00
parent 8c80c30958
commit add4335677
2 changed files with 3 additions and 2 deletions

View file

@ -66,7 +66,7 @@ public class StatementServiceV2 {
private static StatementRequest find(SdfTable table, Collection<StatementRequest> reqs) {
Optional<StatementRequest> first = reqs.stream().filter(r -> r.getTable().equals(table)).findFirst();
if (first.isEmpty()) {
throw new IllegalStateException("couldn't find + " + table + " - this should have happened ");
throw new IllegalStateException("couldn't find + " + table + " - this shouldn't have happened ");
}
return first.get();
}
@ -134,7 +134,7 @@ public class StatementServiceV2 {
for (StatementRequest stmtReqOld : statementRequests) { //проходим с головы (с самых старых)
boolean matchGroup = group.getGroup().contains(stmtReqOld.getTable());
boolean notIncludedThisTableAlready = reqs.stream().map(StatementRequest::getTable).noneMatch(t -> t.equals(stmtReqOld.getTable()));
boolean isNotTheSameAsNewReq = Objects.equals(stmtReqOld.getTable(), stmtReq.getTable());
boolean isNotTheSameAsNewReq = !Objects.equals(stmtReqOld.getTable(), stmtReq.getTable());
if (matchGroup && notIncludedThisTableAlready && isNotTheSameAsNewReq) {
reqs.add(stmtReqOld);
}

View file

@ -31,6 +31,7 @@ public class SWTImportKafkaMessenger implements InitializingBean {
messengers.put(ETable.S_DF_08, groupId -> messageBalance(groupId, SdfTable.SDF_08));
messengers.put(ETable.S_DF_10, groupId -> messageBalance(groupId, SdfTable.SDF_10));
messengers.put(ETable.S_DF_13, groupId -> messageBalance(groupId, SdfTable.SDF_13));
messengers.put(ETable.S_DF_21, groupId -> messageBalance(groupId, SdfTable.SDF_21));
}
/**