final MKR deals conditions
This commit is contained in:
parent
59d06cd0a8
commit
50201be458
1 changed files with 11 additions and 12 deletions
|
|
@ -25,7 +25,6 @@ import ru.spcex.platform.utils.enumeration.IMessageResolver;
|
|||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Service
|
||||
|
|
@ -83,7 +82,7 @@ public class FinalMkrSession extends AbstractSession implements InitializingBean
|
|||
public void afterPropertiesSet() throws Exception {
|
||||
dealsPrepare.searchForExecutions(ExecutionType.ExecutionDeposit);
|
||||
ImdgPredicateBuilder execFondPb = executionDepositImdg.predicateBuilder();
|
||||
dealsPrepare.addExecutionDepositCondition(execFondPb.regex("firstLegSettlementCode", "(^T0.*$)|(B[^0]\\d*$)"));
|
||||
dealsPrepare.addExecutionDepositCondition(execFondPb.equals("tradingDate", LocalDate.now()));
|
||||
// dealsPrepare.addExecutionDepositCondition(execFondPb.in("market", marketCodes.get().toArray(new String[0])));
|
||||
}
|
||||
|
||||
|
|
@ -128,16 +127,16 @@ public class FinalMkrSession extends AbstractSession implements InitializingBean
|
|||
dealsPreparationResult = runStage(TaskType.DealsPrepare, payload, dealsPrepare);
|
||||
//Сначала обрабатываются записи, у которых settlementCode = значению, у которого первый символ ="T", второй =0,
|
||||
// а после settlementCode = значению, у которого первый символ ="B", второй ≠0, последующие =любые цифры
|
||||
dealsPreparationResult.getStageResult().sort((o1, o2) -> {
|
||||
String o1SettlementCode = ((ExecutionDeposit) o1).getFirstLegSettlementCode();
|
||||
String o2SettlementCode = ((ExecutionDeposit) o2).getSecondLegSettlementCode();
|
||||
Function<String, Integer> mapper = (settlementCode) -> {
|
||||
if (settlementCode.startsWith("T")) return -1;
|
||||
else if (settlementCode.startsWith("B")) return 1;
|
||||
else return 0;
|
||||
};
|
||||
return mapper.apply(o1SettlementCode).compareTo(mapper.apply(o2SettlementCode));
|
||||
});
|
||||
//dealsPreparationResult.getStageResult().sort((o1, o2) -> {
|
||||
// String o1SettlementCode = ((ExecutionDeposit) o1).getFirstLegSettlementCode();
|
||||
// String o2SettlementCode = ((ExecutionDeposit) o2).getSecondLegSettlementCode();
|
||||
// Function<String, Integer> mapper = (settlementCode) -> {
|
||||
// if (settlementCode.startsWith("T")) return -1;
|
||||
// else if (settlementCode.startsWith("B")) return 1;
|
||||
// else return 0;
|
||||
// };
|
||||
// return mapper.apply(o1SettlementCode).compareTo(mapper.apply(o2SettlementCode));
|
||||
//});
|
||||
}
|
||||
//stage 2
|
||||
runStage(TaskType.RequirementsAndObligationsCreate, dealsPreparationResult.getStageResult(), requirementsAndObligationCreation);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue