This commit is contained in:
parent
0390f3d20e
commit
3bf9d651cd
1 changed files with 16 additions and 7 deletions
|
|
@ -71,6 +71,11 @@ public class InspectionObligations implements ISessionStage {
|
|||
null,
|
||||
RegistryUnit.T);
|
||||
|
||||
RegistryTradingParams registryTradingParamsTST = new RegistryTradingParams(RegistryDesignation.T,
|
||||
RegistryInstrumentType.S,
|
||||
null,
|
||||
RegistryUnit.T);
|
||||
|
||||
RegistryTradingParams registryTradingParamsTMT = new RegistryTradingParams(RegistryDesignation.T,
|
||||
RegistryInstrumentType.M,
|
||||
null,
|
||||
|
|
@ -78,7 +83,7 @@ public class InspectionObligations implements ISessionStage {
|
|||
|
||||
|
||||
String sqlCondition = String.format("%s and registryStatus = '%s'",
|
||||
RegistryCodeSqlBuilder.getInstance(registryTradingParamsOST, registryTradingParamsTMT, registryTradingParamsOMT).build(),
|
||||
RegistryCodeSqlBuilder.getInstance(registryTradingParamsOST, registryTradingParamsTMT, registryTradingParamsOMT, registryTradingParamsTST).build(),
|
||||
RegistryStatus.POOL.getKey());
|
||||
|
||||
Collection<Registry> obligations = registryImdg.getCollectionObjectsBySQL(sqlCondition);
|
||||
|
|
@ -92,10 +97,6 @@ public class InspectionObligations implements ISessionStage {
|
|||
log.debug("Skip insecurity groupId: {}", currentRegistry.getGroupId());
|
||||
continue;
|
||||
}
|
||||
if (IEnumKey.getEnumByKey(RegistryDesignation.class, currentRegistry.getRegistryDesignation()) == RegistryDesignation.O) {
|
||||
log.debug("Its t registry, skip");
|
||||
continue;
|
||||
}
|
||||
|
||||
RegistryTradingParams counterRegistryTradingParams = null;
|
||||
if (IEnumKey.getEnumByKey(RegistryDesignation.class, currentRegistry.getRegistryDesignation()) == RegistryDesignation.O
|
||||
|
|
@ -112,15 +113,23 @@ public class InspectionObligations implements ISessionStage {
|
|||
RegistryUnit.F);
|
||||
}
|
||||
|
||||
if (counterRegistryTradingParams == null) {
|
||||
continue;
|
||||
}
|
||||
String sqlCounterRegistryCondition = String.format("%s and " +
|
||||
"tradingClearingRegistryId = '%s' and " +
|
||||
"companyId = '%s' and ",
|
||||
"companyId = '%s'",
|
||||
RegistryCodeSqlBuilder.getInstance(counterRegistryTradingParams).build(),
|
||||
currentRegistry.getTradingClearingRegistryId(),
|
||||
currentRegistry.getCompanyId());
|
||||
Registry counterRegistry = registryImdg.getSingleObjectBySQL(sqlCounterRegistryCondition);
|
||||
if (counterRegistry == null) {
|
||||
log.warn("Not found registry by params: {}", sqlCounterRegistryCondition);
|
||||
continue;
|
||||
}
|
||||
if (currentRegistry.getBalance().compareTo(counterRegistry.getBalance()) > 0) {
|
||||
log.warn("{}", msgResolver.resolve(new EnumMessage(ClearingError.InsecurityObligation, currentRegistry.getCompanyId())));
|
||||
log.warn("groupId: {}: {}", currentRegistry.getGroupId(),
|
||||
msgResolver.resolve(new EnumMessage(ClearingError.InsecurityObligation, currentRegistry.getCompanyId())));
|
||||
currentRegistry.setRegistryStatus("UNCV");
|
||||
alreadyUpdatedToUncover.add(currentRegistry.getId());
|
||||
insecurityGroups.add(currentRegistry.getGroupId());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue