account-service http://jira.mfd.msk:8088/browse/CLS-489 SDF52 переделал поиск счетов
This commit is contained in:
parent
4226df3e5c
commit
d95f22662d
1 changed files with 1 additions and 40 deletions
|
|
@ -308,32 +308,6 @@ public class ClearingAccountService extends QueueConsumer implements Initializin
|
|||
return null;
|
||||
}
|
||||
|
||||
String serviceTypeByCMCOfCompany(Long companyId) {
|
||||
Collection<ClearingMemberCategory> cmCategorys = clearingMemberCategoryImdg.getCollectionObjectsByFieldValues(
|
||||
Map.of("companyId", companyId));
|
||||
String serviceType = null;
|
||||
for (ClearingMemberCategory cmc : cmCategorys) {
|
||||
if (IEnumKey.contains(cmc.getClearingMemberCategory(), ClearingCategory.B, ClearingCategory.I, ClearingCategory.V)) {
|
||||
serviceType = ru.spcex.platform.enumeration.Service.MKR.getKey();
|
||||
}
|
||||
if (IEnumKey.contains(cmc.getClearingMemberCategory(), ClearingCategory.F, ClearingCategory.C)) {
|
||||
serviceType = ru.spcex.platform.enumeration.Service.FOND.getKey();
|
||||
}
|
||||
}
|
||||
return serviceType;
|
||||
}
|
||||
|
||||
String selectExpectedCMCOfCompanyForRelation(Long companyId) {
|
||||
Collection<ClearingCategoryDictionary> clearingCategorys = clearingCategoryImdg.getCollectionObjectsByPredicate(
|
||||
clearingCategoryImdg.predicateBuilder().in("code", new String[]{
|
||||
ClearingCategory.B.getKey(), ClearingCategory.I.getKey(), ClearingCategory.V.getKey(),
|
||||
ClearingCategory.F.getKey(), ClearingCategory.C.getKey()
|
||||
})
|
||||
);
|
||||
String toText = clearingCategorys.stream().map(AbstractDictionary::getName).collect(Collectors.joining("/"));
|
||||
return toText;
|
||||
}
|
||||
|
||||
public RequestInfoUpdate accountUpdateSdf52(BaseRequest<StatementRequest> systemRequest) {
|
||||
log.debug("accountUpdateSdf52 StatementRequest received, id={}", systemRequest.getId());
|
||||
|
||||
|
|
@ -369,23 +343,10 @@ public class ClearingAccountService extends QueueConsumer implements Initializin
|
|||
makeSdfErrorText(AccountError.CompanyNotFound, SDFProcessService.SDF_STATUS_ERROR_COMPANY_NOT_FOUND)));
|
||||
continue;
|
||||
}
|
||||
String serviceType = serviceTypeByCMCOfCompany(company.getId());
|
||||
Relation relation = serviceType == null ? null : relationImdg.getSingleObjectByFieldValues(Map.of(
|
||||
"consumerId", company.getId(),
|
||||
"service", serviceType
|
||||
));
|
||||
if (relation == null) {
|
||||
String requiredClearingCategoryToMessage = selectExpectedCMCOfCompanyForRelation(company.getId());
|
||||
String msg = messageResolver.resolve(new EnumMessage(AccountError.ClearingCategoryNotFound, company.getTradingCode(), requiredClearingCategoryToMessage));
|
||||
log.warn("By generationId={} s_df52[{}] error: {}", groupId, sDf52.getId(), msg);
|
||||
toProcessSDF53.add(new MutableTriple<>(sDf52, null,
|
||||
makeSdfErrorText(AccountError.ClearingCategoryNotFound, SDFProcessService.SDF_STATUS_ERROR_COMPANY_NOT_FOUND)));
|
||||
continue;
|
||||
}
|
||||
Account account = sDf52.getAccount() == null ? null : accountImdg.getFirstObjectByFieldValues(Map.of(
|
||||
"accountType", AccountType.Clrn.getKey(),
|
||||
"account", sDf52.getAccount(),
|
||||
"relationId", relation.getId()
|
||||
"companyId", company.getId()
|
||||
));
|
||||
if (account == null) {
|
||||
String msg = messageResolver.resolve(new EnumMessage(AccountError.AccountNotFound, sDf52.getAccount()));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue