account-service fix TCR validation; clearing-service swt-importer логи

This commit is contained in:
AKurakin 2023-06-08 19:29:56 +03:00
parent 12f9d024aa
commit 66cf85a688
4 changed files with 14 additions and 4 deletions

View file

@ -62,7 +62,8 @@ public class TradingClearingRegistryValidationConfig {
Imdg<InformationAccount> informationAccountImdg = context.obtainMap( Imdg<InformationAccount> informationAccountImdg = context.obtainMap(
IMDGDistributedNames.Map_InformationAccount, InformationAccount.class IMDGDistributedNames.Map_InformationAccount, InformationAccount.class
); );
InformationAccount infoAccount = informationAccountImdg.getSingleObjectByID(moneyAccountId); InformationAccount infoAccount = informationAccountImdg.getSingleObjectByFieldValues(
Map.of("accountId",moneyAccountId));
if (infoAccount == null) return AccountError.AccountNotFound; if (infoAccount == null) return AccountError.AccountNotFound;
} }
return null; return null;

View file

@ -232,12 +232,13 @@ public class ClearingAccountService extends QueueConsumer implements Initializin
clearingAccount.setAccountId(accountId); clearingAccount.setAccountId(accountId);
clearingAccount.setClearingAccountType(accountReq.getAccountType()); clearingAccount.setClearingAccountType(accountReq.getAccountType());
clearingAccountId = clearingAccountImdg.insert(clearingAccount); clearingAccountId = clearingAccountImdg.insert(clearingAccount);
log.trace("New account {}, clearingAccount {} was created.", accountId, clearingAccountId); log.debug("New account {}, clearingAccount {} was created.", accountId, clearingAccountId);
{ {
TradingClearingRegistryNewRequest request = new TradingClearingRegistryNewRequest(); TradingClearingRegistryNewRequest request = new TradingClearingRegistryNewRequest();
request.setMoneyAccountId(accountId); request.setMoneyAccountId(accountId);
request.setCompanyId(clearingAccount.getCompanyId()); request.setCompanyId(clearingAccount.getCompanyId());
// request.setTradingClearingRegistryType(cl);
toTCRRequests.add(request); toTCRRequests.add(request);
} }
{ {

View file

@ -109,7 +109,9 @@ public class StatementService extends QueueConsumer implements InitializingBean
} }
} }
} }
if (!doSomeone) { if (doSomeone) {
log.debug("For table {} done.", table);
} else {
log.warn("No operation for request.id={}; statementRequest GroupId={}, table={}", log.warn("No operation for request.id={}; statementRequest GroupId={}, table={}",
systemRequest.getId(), statementRequest.getGroupId(), statementRequest.getTable()); systemRequest.getId(), statementRequest.getGroupId(), statementRequest.getTable());
} }

View file

@ -1,5 +1,7 @@
package ru.spcex.clearing.swt.importer.logic.stages; package ru.spcex.clearing.swt.importer.logic.stages;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import ru.spcex.clearing.platform.messaging.domain.Consts; import ru.spcex.clearing.platform.messaging.domain.Consts;
@ -15,6 +17,7 @@ import java.util.function.Supplier;
@Component @Component
public class SWTImportKafkaMessenger implements InitializingBean { public class SWTImportKafkaMessenger implements InitializingBean {
final Logger log = LoggerFactory.getLogger(getClass());
private final Supplier<KafkaSender> kafka; private final Supplier<KafkaSender> kafka;
private final Map<ETable, Consumer<Long>> messengers; private final Map<ETable, Consumer<Long>> messengers;
@ -38,6 +41,8 @@ public class SWTImportKafkaMessenger implements InitializingBean {
Consumer<Long> messenger = messengers.get(table); Consumer<Long> messenger = messengers.get(table);
if (messenger != null) { if (messenger != null) {
messenger.accept(groupId); messenger.accept(groupId);
} else {
log.debug("No message stage for table {}", table);
} }
} }
@ -45,7 +50,8 @@ public class SWTImportKafkaMessenger implements InitializingBean {
StatementRequest statementRequest = new StatementRequest(); StatementRequest statementRequest = new StatementRequest();
statementRequest.setGroupId(groupId); statementRequest.setGroupId(groupId);
statementRequest.setTable(table); statementRequest.setTable(table);
kafka.get().sendRequestToQueue(Consts.STATEMENT_PROCESS, statementRequest); Long rid = kafka.get().sendRequestToQueue(Consts.STATEMENT_PROCESS, statementRequest);
log.debug("Send message id={}; groupId={} to kafka \"{}\"", rid, groupId, Consts.STATEMENT_PROCESS);
} }
} }