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; package ru.clearing.classes.statics.data.execution;
import ru.clearing.classes.objects.BusinessObject; 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.math.BigDecimal;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDate; import java.time.LocalDate;
public abstract class ExecutionCommon extends BusinessObject { public abstract class ExecutionCommon extends BusinessObject implements IExecution {
protected Long exchangeExecutionId; protected Long exchangeExecutionId;
protected Instant exchangeExecutionTime; protected Instant exchangeExecutionTime;
protected LocalDate tradingDate; protected LocalDate tradingDate;
@ -28,6 +30,8 @@ public abstract class ExecutionCommon extends BusinessObject {
protected Long sessionId; protected Long sessionId;
protected LocalDate clearingDate; protected LocalDate clearingDate;
public abstract ExecutionType type();
public LocalDate getClearingDate() { public LocalDate getClearingDate() {
return clearingDate; return clearingDate;
} }

View file

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

View file

@ -1,7 +1,7 @@
package ru.clearing.classes.statics.data.execution; package ru.clearing.classes.statics.data.execution;
import ru.clearing.classes.ConstSerializable; 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.math.BigDecimal;
import java.time.Instant; import java.time.Instant;
@ -23,6 +23,11 @@ public class ExecutionFond extends ExecutionCommon {
private LocalDate settlementDate; private LocalDate settlementDate;
private Instant exchangeExecutionMicroseconds; private Instant exchangeExecutionMicroseconds;
@Override
public ExecutionType type() {
return ExecutionType.ExecutionFond;
}
public Long getExchangeOrderId() { public Long getExchangeOrderId() {
return exchangeOrderId; return exchangeOrderId;
} }

View file

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

View file

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