securities-service http://jira.mfd.msk:8088/browse/CLS-516 уникальность FixedIncomeCashFlow
This commit is contained in:
parent
9f32cd93a4
commit
c5398c7a1d
2 changed files with 14 additions and 4 deletions
|
|
@ -47,9 +47,14 @@ public class FixedIncomeCashFlowValidationConfig {
|
||||||
IMDGDistributedNames.Map_FixedIncomeCashFlow, FixedIncomeCashFlow.class
|
IMDGDistributedNames.Map_FixedIncomeCashFlow, FixedIncomeCashFlow.class
|
||||||
);
|
);
|
||||||
Long securityId = Long.valueOf(securitySymbol);
|
Long securityId = Long.valueOf(securitySymbol);
|
||||||
HashMap<String, Long> query = new HashMap<>();
|
HashMap<String, Comparable<?>> query = new HashMap<>();
|
||||||
query.put("securityId", securityId);
|
query.put("securityId", securityId);
|
||||||
query.put("number", fixedIncomeCashFlowNewRequest.getNumber());
|
if (fixedIncomeCashFlowNewRequest.getNumber() != null) {
|
||||||
|
query.put("number", fixedIncomeCashFlowNewRequest.getNumber());
|
||||||
|
}
|
||||||
|
if (fixedIncomeCashFlowNewRequest.getValueDate() != null) {
|
||||||
|
query.put("valueDate", fixedIncomeCashFlowNewRequest.getValueDate());
|
||||||
|
}
|
||||||
Collection<FixedIncomeCashFlow> fixedIncomeCashFlows = fixedIncomeCashFlowImdg.getCollectionObjectsByFieldValues(query);
|
Collection<FixedIncomeCashFlow> fixedIncomeCashFlows = fixedIncomeCashFlowImdg.getCollectionObjectsByFieldValues(query);
|
||||||
if (!fixedIncomeCashFlows.isEmpty()) return SecuritiesError.CouponPeriodAlreadyExists;
|
if (!fixedIncomeCashFlows.isEmpty()) return SecuritiesError.CouponPeriodAlreadyExists;
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -358,9 +358,14 @@ public class GatewaySecurityService extends QueueConsumer implements Initializin
|
||||||
log.error("Not a number \"{}\": {}", byRequest.getSecuritySymbol(), nan.toString());
|
log.error("Not a number \"{}\": {}", byRequest.getSecuritySymbol(), nan.toString());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Map<String, Long> query = new HashMap<>();
|
Map<String, Comparable<?>> query = new HashMap<>();
|
||||||
query.put("securityId", securityId);
|
query.put("securityId", securityId);
|
||||||
query.put("number", byRequest.getNumber());
|
if (byRequest.getNumber() != null) {
|
||||||
|
query.put("number", byRequest.getNumber());
|
||||||
|
}
|
||||||
|
if (byRequest.getValueDate() != null) {
|
||||||
|
query.put("valueDate", byRequest.getValueDate());
|
||||||
|
}
|
||||||
FixedIncomeCashFlow existFixedIncomeCashFlow = fixedIncomeCashFlowImdg.getFirstObjectByFieldValues(query);
|
FixedIncomeCashFlow existFixedIncomeCashFlow = fixedIncomeCashFlowImdg.getFirstObjectByFieldValues(query);
|
||||||
if (existFixedIncomeCashFlow == null)
|
if (existFixedIncomeCashFlow == null)
|
||||||
log.trace("FixedIncomeCashFlow not found by securityId={}", securityId);
|
log.trace("FixedIncomeCashFlow not found by securityId={}", securityId);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue