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;
|
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) {
|
public RequestInfoUpdate accountUpdateSdf52(BaseRequest<StatementRequest> systemRequest) {
|
||||||
log.debug("accountUpdateSdf52 StatementRequest received, id={}", systemRequest.getId());
|
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);
|
Account account = sDf52.getAccount() == null ? null : accountImdg.getFirstObjectByFieldValues(accountQuery);
|
||||||
if (account == null) {
|
if (account == null) {
|
||||||
if (SDFProcessService.SDF52_STATUS_3Open.equals(sDf52.getStatus())) {
|
if (SDFProcessService.SDF52_STATUS_3Open.equals(sDf52.getStatus())) {
|
||||||
account = createSdf52Account(sDf52.getAccount(), company.getId(), systemRequest.getId());
|
log.debug("By generationId={} s_df52[{}].status={}, but account not found (query: {}). COntinuse with result OK for status 3",
|
||||||
if (account == null) {
|
groupId, sDf52.getId(), sDf52.getStatus(), accountQuery);
|
||||||
log.trace("Can not create account: \"{}\", companyId={}. Ignore SDF52.id={}",
|
|
||||||
sDf52.getAccount(), company.getId(), sDf52.getId());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
String msg = messageResolver.resolve(new EnumMessage(AccountError.AccountNotFound, sDf52.getAccount()));
|
String msg = messageResolver.resolve(new EnumMessage(AccountError.AccountNotFound, sDf52.getAccount()));
|
||||||
log.warn("By generationId={} s_df52[{}] (query: {}) error: {}", groupId, sDf52.getId(), accountQuery, msg);
|
log.warn("By generationId={} s_df52[{}] (query: {}) error: {}", groupId, sDf52.getId(), accountQuery, msg);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue