Промежуточная сессия МКР: 5 шаг сессий по сегодняшним сделкам, статусы FAIL/UNCV -> MNG
This commit is contained in:
parent
315d1e43ec
commit
5c1bcc3b1b
1 changed files with 23 additions and 35 deletions
|
|
@ -28,47 +28,19 @@ import java.time.LocalDate;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static ru.spcex.platform.enumeration.RegistryTradingParams.*;
|
||||
|
||||
|
||||
@Service
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public class InspectionObligations implements ISessionStage {
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
private ImdgProvider imdgProvider;
|
||||
private Imdg<Registry> registryImdg;
|
||||
private final Imdg<Registry> registryImdg;
|
||||
private final IMessageResolver msgResolver = new SimpleMessageResolver();
|
||||
private SessionType sessionType;
|
||||
|
||||
private final static RegistryTradingParams OS_T;
|
||||
private final static RegistryTradingParams OM_T;
|
||||
private final static RegistryTradingParams TS_T;
|
||||
private final static RegistryTradingParams TM_T;
|
||||
|
||||
static {
|
||||
OS_T = new RegistryTradingParams(RegistryDesignation.O,
|
||||
RegistryInstrumentType.S,
|
||||
null,
|
||||
RegistryUnit.T);
|
||||
|
||||
OM_T = new RegistryTradingParams(RegistryDesignation.O,
|
||||
RegistryInstrumentType.M,
|
||||
null,
|
||||
RegistryUnit.T);
|
||||
|
||||
TS_T = new RegistryTradingParams(RegistryDesignation.T,
|
||||
RegistryInstrumentType.S,
|
||||
null,
|
||||
RegistryUnit.T);
|
||||
|
||||
TM_T = new RegistryTradingParams(RegistryDesignation.T,
|
||||
RegistryInstrumentType.M,
|
||||
null,
|
||||
RegistryUnit.T);
|
||||
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public InspectionObligations(ImdgProvider imdgProvider) {
|
||||
this.imdgProvider = imdgProvider;
|
||||
this.registryImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_Registry, Registry.class);
|
||||
}
|
||||
|
||||
|
|
@ -164,11 +136,11 @@ public class InspectionObligations implements ISessionStage {
|
|||
!registry.getRegistryDesignation().equals(checkResult.registry.getRegistryDesignation())
|
||||
).findFirst();
|
||||
if (checkResult.isUncovered) {
|
||||
updateRegistryStatus(checkResult.registry, RegistryStatus.UNCV);
|
||||
tRegistryWithSameCompany.ifPresent(registry -> updateRegistryStatus(registry, RegistryStatus.FAIL));
|
||||
updateRegistryStatus(checkResult.registry, uncvStatus());
|
||||
tRegistryWithSameCompany.ifPresent(registry -> updateRegistryStatus(registry, failStatus()));
|
||||
} else {
|
||||
updateRegistryStatus(checkResult.registry, RegistryStatus.FAIL);
|
||||
tRegistryWithSameCompany.ifPresent(registry -> updateRegistryStatus(registry, RegistryStatus.FAIL));
|
||||
updateRegistryStatus(checkResult.registry, failStatus());
|
||||
tRegistryWithSameCompany.ifPresent(registry -> updateRegistryStatus(registry, failStatus()));
|
||||
}
|
||||
}
|
||||
//проверяем есть ли второй день для сделки (он не входит в пул, поэтому ищем отдельно)
|
||||
|
|
@ -203,4 +175,20 @@ public class InspectionObligations implements ISessionStage {
|
|||
|
||||
private record CheckResult(Registry registry, boolean isUncovered) {
|
||||
}
|
||||
|
||||
private RegistryStatus uncvStatus() {
|
||||
if (SessionType.MEDM.equals(sessionType)) {
|
||||
return RegistryStatus.MNG;
|
||||
} else {
|
||||
return RegistryStatus.UNCV;
|
||||
}
|
||||
}
|
||||
|
||||
private RegistryStatus failStatus() {
|
||||
if (SessionType.MEDM.equals(sessionType)) {
|
||||
return RegistryStatus.MNG;
|
||||
} else {
|
||||
return RegistryStatus.FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue