This commit is contained in:
parent
c1db1714ef
commit
3f95a5b3c2
4 changed files with 7 additions and 4 deletions
|
|
@ -166,7 +166,8 @@ public class TradingClearingRegistryValidationConfig {
|
||||||
if (Objects.equals(duplicate.getMoneyAccountId(), validatedObject.getMoneyAccountId())) {
|
if (Objects.equals(duplicate.getMoneyAccountId(), validatedObject.getMoneyAccountId())) {
|
||||||
dubAcc = accountImdg.getSingleObjectByID(validatedObject.getMoneyAccountId());
|
dubAcc = accountImdg.getSingleObjectByID(validatedObject.getMoneyAccountId());
|
||||||
}
|
}
|
||||||
if (Objects.equals(duplicate.getDepoAccountId(), validatedObject.getDepoAccountId())) {
|
if (validatedObject.getDepoAccountId() != null &&
|
||||||
|
validatedObject.getDepoAccountId().equals(duplicate.getDepoAccountId())) {
|
||||||
dubAcc = accountImdg.getSingleObjectByID(validatedObject.getDepoAccountId());
|
dubAcc = accountImdg.getSingleObjectByID(validatedObject.getDepoAccountId());
|
||||||
}
|
}
|
||||||
if (dubAcc != null) {
|
if (dubAcc != null) {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import ru.spcex.clearing.platform.messaging.domain.cud.account.ClientCodeNewRequ
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.registry.TradingClearingRegistryListNewRequest;
|
import ru.spcex.clearing.platform.messaging.domain.cud.registry.TradingClearingRegistryListNewRequest;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.registry.TradingClearingRegistryNewRequest;
|
import ru.spcex.clearing.platform.messaging.domain.cud.registry.TradingClearingRegistryNewRequest;
|
||||||
import ru.spcex.platform.classes.base.interfaces.IClearingFacade;
|
import ru.spcex.platform.classes.base.interfaces.IClearingFacade;
|
||||||
|
import ru.spcex.platform.enumeration.Status;
|
||||||
import ru.spcex.platform.enumeration.TradingClearingRegistryType;
|
import ru.spcex.platform.enumeration.TradingClearingRegistryType;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
import ru.spcex.platform.imdg.api.ImdgId;
|
import ru.spcex.platform.imdg.api.ImdgId;
|
||||||
|
|
@ -78,7 +79,7 @@ public class ClientCodeFacade implements IClearingFacade {
|
||||||
clientCode.setCompanyId(request.getCompanyId());
|
clientCode.setCompanyId(request.getCompanyId());
|
||||||
clientCode.setCode(request.getCode());
|
clientCode.setCode(request.getCode());
|
||||||
clientCode.setTradingClearingRegistryId(tradingClearingRegistry.getId());
|
clientCode.setTradingClearingRegistryId(tradingClearingRegistry.getId());
|
||||||
clientCode.setStatus(request.getStatus());
|
clientCode.setStatus(Status.Active.getKey());
|
||||||
clientCodeImdg.insert(clientCode);
|
clientCodeImdg.insert(clientCode);
|
||||||
log.debug("successfully processed, new clientCode id {}", clientCode.getId());
|
log.debug("successfully processed, new clientCode id {}", clientCode.getId());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -194,11 +194,12 @@ public class ClientCodeMessageListener extends QueueConsumer implements Initiali
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<Long> rubMoneyAcc = accountIds.stream()
|
Optional<Long> rubMoneyAcc = accountIds.stream()
|
||||||
.filter(longStringPair -> CurrencyCode.RUB.equalsByKey(longStringPair.getSecond()))
|
.filter(pair -> CurrencyCode.RUB.equalsByKey(pair.getSecond()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.map(Pair::getFirst);
|
.map(Pair::getFirst);
|
||||||
|
|
||||||
List<Long> accIds = accountIds.stream()
|
List<Long> accIds = accountIds.stream()
|
||||||
|
.filter(pair -> !CurrencyCode.RUB.equalsByKey(pair.getSecond()))
|
||||||
.map(Pair::getFirst)
|
.map(Pair::getFirst)
|
||||||
.toList();
|
.toList();
|
||||||
ClientCodeNewRequest clientCodeNewRequest = new ClientCodeNewRequest();
|
ClientCodeNewRequest clientCodeNewRequest = new ClientCodeNewRequest();
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ public enum GatewayEksClientCodeValidationRule implements IValidationRule<ImdgVa
|
||||||
TradingClearingRegistry.class);
|
TradingClearingRegistry.class);
|
||||||
TradingClearingRegistry tcr = imdg.getFirstObjectByFieldValues(
|
TradingClearingRegistry tcr = imdg.getFirstObjectByFieldValues(
|
||||||
Map.of(
|
Map.of(
|
||||||
"depoAccountId", depoAccount.getId(),
|
"depoAccountId", depoAccount.getAccountId(),
|
||||||
"status", Status.Active.getKey()
|
"status", Status.Active.getKey()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue