http://jira.mfd.msk:8088/browse/CLS-585 уточнение получено
This commit is contained in:
parent
943ec5f762
commit
c8336ce8a4
1 changed files with 2 additions and 48 deletions
|
|
@ -322,48 +322,6 @@ public class ClearingAccountService extends QueueConsumer implements Initializin
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Логика похожа на SDF01
|
||||
* @param accountValue account
|
||||
* @param companyId
|
||||
* @param userRequestId для лога
|
||||
* @return
|
||||
*/
|
||||
private Account createSdf52Account(String accountValue, Long companyId, Long userRequestId) {
|
||||
Instant now = Instant.now();
|
||||
Account account = new Account();
|
||||
account.setAccount(accountValue);
|
||||
account.setAccountType(AccountType.Clrn.getKey());
|
||||
account.setStatus(ServiceStatus.Active.getKey());
|
||||
account.setCompanyId(companyId);
|
||||
account.setCreated(now);
|
||||
account.setUpdated(now);
|
||||
RequestInfoUpdate requestInfoUpdate = accountService.fillAccountFromRelation(account, userRequestId, true);
|
||||
if (requestInfoUpdate != null) {
|
||||
log.warn("Error fill new account from relation. {}", /*account.getId(),*/ requestInfoUpdate.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
if (accountImdg.getFirstObjectBySQL("account = '%s'".formatted(accountValue)) != null) {
|
||||
log.debug("Account {} already exists", accountValue);
|
||||
return null;
|
||||
}
|
||||
|
||||
Long clearingAccountId = -1L;
|
||||
Long accountId = -1L;
|
||||
ClearingAccount clearingAccount = null;
|
||||
accountId = accountImdg.insert(account);
|
||||
|
||||
clearingAccount = new ClearingAccount();
|
||||
clearingAccount.setCompanyId(companyId);
|
||||
clearingAccount.setAccountId(accountId);
|
||||
// !!!! clearingAccount.setClearingAccountType(ClearingAccountType.?);//todo на уточнении ТЗ...
|
||||
clearingAccountId = clearingAccountImdg.insert(clearingAccount);
|
||||
log.debug("New account {}, clearingAccount {} was created.", accountId, clearingAccountId);
|
||||
|
||||
return account;
|
||||
}
|
||||
|
||||
public RequestInfoUpdate accountUpdateSdf52(BaseRequest<StatementRequest> systemRequest) {
|
||||
log.debug("accountUpdateSdf52 StatementRequest received, id={}", systemRequest.getId());
|
||||
|
||||
|
|
@ -407,12 +365,8 @@ public class ClearingAccountService extends QueueConsumer implements Initializin
|
|||
Account account = sDf52.getAccount() == null ? null : accountImdg.getFirstObjectByFieldValues(accountQuery);
|
||||
if (account == null) {
|
||||
if (SDFProcessService.SDF52_STATUS_3Open.equals(sDf52.getStatus())) {
|
||||
account = createSdf52Account(sDf52.getAccount(), company.getId(), systemRequest.getId());
|
||||
if (account == null) {
|
||||
log.trace("Can not create account: \"{}\", companyId={}. Ignore SDF52.id={}",
|
||||
sDf52.getAccount(), company.getId(), sDf52.getId());
|
||||
continue;
|
||||
}
|
||||
log.debug("By generationId={} s_df52[{}].status={}, but account not found (query: {}). COntinuse with result OK for status 3",
|
||||
groupId, sDf52.getId(), sDf52.getStatus(), accountQuery);
|
||||
} else {
|
||||
String msg = messageResolver.resolve(new EnumMessage(AccountError.AccountNotFound, sDf52.getAccount()));
|
||||
log.warn("By generationId={} s_df52[{}] (query: {}) error: {}", groupId, sDf52.getId(), accountQuery, msg);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue