ialbert 2023-05-18 14:58:11 +03:00
parent c8725ae10f
commit 02e927ab1b
7 changed files with 30 additions and 4 deletions

View file

@ -1,12 +1,14 @@
package ru.clearing.classes.statics.data.execution;
import ru.clearing.classes.objects.BusinessObject;
import ru.spcex.platform.classes.base.interfaces.ExecutionType;
import ru.spcex.platform.classes.base.interfaces.IExecution;
import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDate;
public abstract class ExecutionCommon extends BusinessObject {
public abstract class ExecutionCommon extends BusinessObject implements IExecution {
protected Long exchangeExecutionId;
protected Instant exchangeExecutionTime;
protected LocalDate tradingDate;
@ -28,6 +30,8 @@ public abstract class ExecutionCommon extends BusinessObject {
protected Long sessionId;
protected LocalDate clearingDate;
public abstract ExecutionType type();
public LocalDate getClearingDate() {
return clearingDate;
}

View file

@ -1,6 +1,7 @@
package ru.clearing.classes.statics.data.execution;
import ru.clearing.classes.ConstSerializable;
import ru.spcex.platform.classes.base.interfaces.ExecutionType;
import java.math.BigDecimal;
import java.time.LocalDate;
@ -16,6 +17,11 @@ public class ExecutionDeposit extends ExecutionCommon {
private String secondLegSettlementCode;
private String contract;
@Override
public ExecutionType type() {
return ExecutionType.ExecutionDeposit;
}
public BigDecimal getFirstLegAmount() {
return firstLegAmount;
}

View file

@ -1,7 +1,7 @@
package ru.clearing.classes.statics.data.execution;
import ru.clearing.classes.ConstSerializable;
import ru.clearing.classes.objects.BusinessObject;
import ru.spcex.platform.classes.base.interfaces.ExecutionType;
import java.math.BigDecimal;
import java.time.Instant;
@ -23,6 +23,11 @@ public class ExecutionFond extends ExecutionCommon {
private LocalDate settlementDate;
private Instant exchangeExecutionMicroseconds;
@Override
public ExecutionType type() {
return ExecutionType.ExecutionFond;
}
public Long getExchangeOrderId() {
return exchangeOrderId;
}

View file

@ -11,6 +11,10 @@ public enum TaskType {
* step 1
*/
DealsPrepare,
/**
* step 2
*/
RequirementsAndObligationsCreate,
/**
* step 4
*/

View file

@ -56,7 +56,7 @@ public class DealsPrepare implements ISessionStage {
private StageResult<?> prepareDeals(Long sessionId, Long companyId, Long securityId) {
StringBuilder executionDepositSQL = new StringBuilder("sessionId = null");
if (companyId != null) {
executionDepositSQL.append(" and companyId = ").append(companyId);
executionDepositSQL.append(" and companyId = ").append(companyId); //fixme вероятно в ТЗ недостаточно условий для выборки - counterPartyId
}
if (securityId != null) {
executionDepositSQL.append(" and securityId = ").append(securityId);
@ -86,7 +86,7 @@ public class DealsPrepare implements ISessionStage {
executionFondImdg.update((ExecutionFond) exc);
}
}
StageResult<Collection<IExecution>> res = new StageResult<>(null, true);
StageResult<List<IExecution>> res = new StageResult<>(null, true);
res.setStageResult(excs);
return res;
}

View file

@ -0,0 +1,6 @@
package ru.spcex.platform.classes.base.interfaces;
public enum ExecutionType {
ExecutionDeposit, ExecutionFond;
}

View file

@ -1,4 +1,5 @@
package ru.spcex.platform.classes.base.interfaces;
public interface IExecution extends WithId, WithSessionId, WithExchangeExecutionId {
ExecutionType type();
}