This commit is contained in:
parent
b3a5565dc0
commit
e95e5bd677
1 changed files with 21 additions and 4 deletions
|
|
@ -125,7 +125,7 @@ public class InspectionObligations implements ISessionStage {
|
||||||
Registry counterRegistry = registryImdg.getSingleObjectBySQL(sqlCounterRegistryCondition);
|
Registry counterRegistry = registryImdg.getSingleObjectBySQL(sqlCounterRegistryCondition);
|
||||||
if (counterRegistry == null) {
|
if (counterRegistry == null) {
|
||||||
log.warn("Not found registry by params: {}; set not uncovered", sqlCounterRegistryCondition);
|
log.warn("Not found registry by params: {}; set not uncovered", sqlCounterRegistryCondition);
|
||||||
currentRegistry.setRegistryStatus("UNCV");
|
setUncover(currentRegistry);
|
||||||
alreadyUpdatedToUncover.add(currentRegistry.getId());
|
alreadyUpdatedToUncover.add(currentRegistry.getId());
|
||||||
insecurityGroups.add(currentRegistry.getGroupId());
|
insecurityGroups.add(currentRegistry.getGroupId());
|
||||||
registryImdg.update(currentRegistry);
|
registryImdg.update(currentRegistry);
|
||||||
|
|
@ -134,7 +134,7 @@ public class InspectionObligations implements ISessionStage {
|
||||||
if (currentRegistry.getBalance().compareTo(counterRegistry.getBalance()) > 0) {
|
if (currentRegistry.getBalance().compareTo(counterRegistry.getBalance()) > 0) {
|
||||||
log.warn("groupId: {}: {}", currentRegistry.getGroupId(),
|
log.warn("groupId: {}: {}", currentRegistry.getGroupId(),
|
||||||
msgResolver.resolve(new EnumMessage(ClearingError.InsecurityObligation, currentRegistry.getCompanyId())));
|
msgResolver.resolve(new EnumMessage(ClearingError.InsecurityObligation, currentRegistry.getCompanyId())));
|
||||||
currentRegistry.setRegistryStatus("UNCV");
|
setUncover(currentRegistry);
|
||||||
alreadyUpdatedToUncover.add(currentRegistry.getId());
|
alreadyUpdatedToUncover.add(currentRegistry.getId());
|
||||||
insecurityGroups.add(currentRegistry.getGroupId());
|
insecurityGroups.add(currentRegistry.getGroupId());
|
||||||
registryImdg.update(currentRegistry);
|
registryImdg.update(currentRegistry);
|
||||||
|
|
@ -143,13 +143,14 @@ public class InspectionObligations implements ISessionStage {
|
||||||
currentRegistry.setRegistryStatus("OK");
|
currentRegistry.setRegistryStatus("OK");
|
||||||
registryImdg.update(currentRegistry);
|
registryImdg.update(currentRegistry);
|
||||||
}
|
}
|
||||||
|
//todo установить ok для
|
||||||
|
|
||||||
if (!insecurityGroups.isEmpty()) {
|
if (!insecurityGroups.isEmpty()) {
|
||||||
for (Long insecuritiesGroupId : insecurityGroups) {
|
for (Long insecuritiesGroupId : insecurityGroups) {
|
||||||
for (Registry registry : registryByGroupIdAndCompanyId.get(insecuritiesGroupId)) {
|
for (Registry registry : registryByGroupIdAndCompanyId.get(insecuritiesGroupId)) {
|
||||||
if (!alreadyUpdatedToUncover.contains(registry)) {
|
if (!alreadyUpdatedToUncover.contains(registry.getId())) {
|
||||||
log.warn("set fail for registry.id: {}", registry.getId());
|
log.warn("set fail for registry.id: {}", registry.getId());
|
||||||
registry.setRegistryStatus("FAIL");
|
defineUncoverOrFail(registry);
|
||||||
registryImdg.update(registry);
|
registryImdg.update(registry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -157,4 +158,20 @@ public class InspectionObligations implements ISessionStage {
|
||||||
}
|
}
|
||||||
return new StageResult(null, true);
|
return new StageResult(null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void defineUncoverOrFail(Registry registry) {
|
||||||
|
if (IEnumKey.getEnumByKey(RegistryDesignation.class, registry.getRegistryDesignation()) == RegistryDesignation.O) {
|
||||||
|
setUncover(registry);
|
||||||
|
} else {
|
||||||
|
setFail(registry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setFail(Registry registry) {
|
||||||
|
registry.setRegistryStatus("FAIL");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setUncover(Registry registry) {
|
||||||
|
registry.setRegistryStatus("UNCV");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue