define marketcodes for bn session
This commit is contained in:
parent
8546affd94
commit
9a40d06eb9
2 changed files with 36 additions and 5 deletions
|
|
@ -0,0 +1,28 @@
|
||||||
|
package ru.spcex.clearing.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import ru.clearing.classes.statics.data.misc.Market;
|
||||||
|
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
|
import ru.spcex.platform.enumeration.MarketType;
|
||||||
|
import ru.spcex.platform.enumeration.Section;
|
||||||
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
|
import ru.spcex.platform.imdg.api.ImdgProvider;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MarketCodesBySessionConfig {
|
||||||
|
|
||||||
|
@Bean(name = "marketCodesForBn")
|
||||||
|
public List<String> marketCodesForBn(ImdgProvider imdgProvider) {
|
||||||
|
Imdg<Market> marketImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_Market, Market.class);
|
||||||
|
Collection<Market> markets = marketImdg.getCollectionObjectsByFieldValues(Map.of(
|
||||||
|
"section", Section.FOND.getKey(),
|
||||||
|
"marketType", MarketType.PRMR.getKey()));
|
||||||
|
return markets.stream().map(Market::getCode).distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ package ru.spcex.clearing.session.stage;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import ru.clearing.classes.statics.data.execution.ExecutionCommon;
|
import ru.clearing.classes.statics.data.execution.ExecutionCommon;
|
||||||
import ru.clearing.classes.statics.data.execution.ExecutionFond;
|
import ru.clearing.classes.statics.data.execution.ExecutionFond;
|
||||||
|
|
@ -40,10 +41,7 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
|
||||||
private final EndStageNotification endStageNotification;
|
private final EndStageNotification endStageNotification;
|
||||||
|
|
||||||
private final Imdg<ExecutionFond> executionFondImdg;
|
private final Imdg<ExecutionFond> executionFondImdg;
|
||||||
|
private final List<String> marketCodes;
|
||||||
private List<String> marketCodes = List.of("BMFC", "SMMC", "AEPC", "WBIC", "KBVC", "WBFC", "BMVC", "ABIC",
|
|
||||||
"AESC", "ABFC", "KBIC", "WBMC", "BMMC", "ABEC", "SMIC", "ABMC", "SMVC", "KBFC", "SKVC", "ABVC", "WEPC",
|
|
||||||
"KBMC", "SMFC", "BKVC", "WBVC", "BMIC", "WESC");
|
|
||||||
|
|
||||||
|
|
||||||
public PrimaryAuctionBnSession(
|
public PrimaryAuctionBnSession(
|
||||||
|
|
@ -56,7 +54,11 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
|
||||||
FormingRegistersOnOS formingRegistersOnOS,
|
FormingRegistersOnOS formingRegistersOnOS,
|
||||||
FormingPaymentInstruction formingPaymentInstruction,
|
FormingPaymentInstruction formingPaymentInstruction,
|
||||||
UnlockResources unlockResources,
|
UnlockResources unlockResources,
|
||||||
FinishingSession finishingSession, EndStageNotification endStageNotification, IMessageResolver messageResolver, InspectionObligations inspectionObligations) {
|
FinishingSession finishingSession,
|
||||||
|
EndStageNotification endStageNotification,
|
||||||
|
IMessageResolver messageResolver,
|
||||||
|
InspectionObligations inspectionObligations,
|
||||||
|
@Qualifier("marketCodesForBn") List<String> marketCodes) {
|
||||||
super(imdgProvider, messageResolver);
|
super(imdgProvider, messageResolver);
|
||||||
this.balanceRevise = balanceRevise;
|
this.balanceRevise = balanceRevise;
|
||||||
this.dealsPrepare = dealsPrepare;
|
this.dealsPrepare = dealsPrepare;
|
||||||
|
|
@ -70,6 +72,7 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
|
||||||
this.endStageNotification = endStageNotification;
|
this.endStageNotification = endStageNotification;
|
||||||
this.executionFondImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_ExecutionFond, ExecutionFond.class);
|
this.executionFondImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_ExecutionFond, ExecutionFond.class);
|
||||||
this.inspectionObligations = inspectionObligations;
|
this.inspectionObligations = inspectionObligations;
|
||||||
|
this.marketCodes = marketCodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue