This commit is contained in:
parent
d46bd1fc5e
commit
827e6b7954
4 changed files with 40 additions and 34 deletions
|
|
@ -54,6 +54,14 @@ public class KSRepCashNettoReport {
|
||||||
@CsvBindByPosition(position = 9)
|
@CsvBindByPosition(position = 9)
|
||||||
private String lotCurrency;
|
private String lotCurrency;
|
||||||
|
|
||||||
|
@CsvBindByName(column = "CURRENCY_NETTO")
|
||||||
|
@CsvBindByPosition(position = 10)
|
||||||
|
private BigDecimal currencyNetto;
|
||||||
|
|
||||||
|
@CsvBindByName(column = "TR_EXECDATE")
|
||||||
|
@CsvBindByPosition(position = 11)
|
||||||
|
@CsvDate(value = "dd.MM.yyyy")
|
||||||
|
private LocalDate trExecDate;
|
||||||
|
|
||||||
public String getFirmId() {
|
public String getFirmId() {
|
||||||
return firmId;
|
return firmId;
|
||||||
|
|
@ -134,4 +142,20 @@ public class KSRepCashNettoReport {
|
||||||
public void setLotCurrency(String lotCurrency) {
|
public void setLotCurrency(String lotCurrency) {
|
||||||
this.lotCurrency = lotCurrency;
|
this.lotCurrency = lotCurrency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCurrencyNetto() {
|
||||||
|
return currencyNetto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyNetto(BigDecimal currencyNetto) {
|
||||||
|
this.currencyNetto = currencyNetto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getTrExecDate() {
|
||||||
|
return trExecDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrExecDate(LocalDate trExecDate) {
|
||||||
|
this.trExecDate = trExecDate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,9 @@ public class KSRepDepoRegisterQuantitiesReport {
|
||||||
@CsvBindByPosition(position = 8)
|
@CsvBindByPosition(position = 8)
|
||||||
private String tradeNum;
|
private String tradeNum;
|
||||||
|
|
||||||
@CsvBindByName(column = "LOT_CURRENCY")
|
@CsvBindByName(column = "OPER_TYPE")
|
||||||
@CsvBindByPosition(position = 8)
|
@CsvBindByPosition(position = 8)
|
||||||
private String lotCurrency;
|
private String operType;
|
||||||
|
|
||||||
|
|
||||||
public String getFirmId() {
|
public String getFirmId() {
|
||||||
|
|
@ -125,12 +125,12 @@ public class KSRepDepoRegisterQuantitiesReport {
|
||||||
this.tradeNum = tradeNum;
|
this.tradeNum = tradeNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLotCurrency() {
|
public String getOperType() {
|
||||||
return lotCurrency;
|
return operType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLotCurrency(String lotCurrency) {
|
public void setOperType(String operType) {
|
||||||
this.lotCurrency = lotCurrency;
|
this.operType = operType;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,7 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean invalid = false;
|
boolean invalid = false;
|
||||||
|
BigDecimal currencyNetto = null;
|
||||||
if (!cmtRegistries.isEmpty() || !lmtRegistries.isEmpty()) {
|
if (!cmtRegistries.isEmpty() || !lmtRegistries.isEmpty()) {
|
||||||
String sourceTradingCode = null;
|
String sourceTradingCode = null;
|
||||||
String sourceTkr = null;
|
String sourceTkr = null;
|
||||||
|
|
@ -149,6 +150,7 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
||||||
log.warn("Invalid CM_T registries set, tradingClearingRegistry not equals. Registries was skipped");
|
log.warn("Invalid CM_T registries set, tradingClearingRegistry not equals. Registries was skipped");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
currencyNetto = currRegistry.getBalance();
|
||||||
}
|
}
|
||||||
for (Registry currRegistry : lmtRegistries) {
|
for (Registry currRegistry : lmtRegistries) {
|
||||||
if (!Objects.equals(sourceTradingCode, currRegistry.getTradingCode())) {
|
if (!Objects.equals(sourceTradingCode, currRegistry.getTradingCode())) {
|
||||||
|
|
@ -241,19 +243,11 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
||||||
ksRepCashNettoReport.setValue(withValue ? value : null);
|
ksRepCashNettoReport.setValue(withValue ? value : null);
|
||||||
ksRepCashNettoReport.setOblValue(withOblReqValue ? oblValue : null);
|
ksRepCashNettoReport.setOblValue(withOblReqValue ? oblValue : null);
|
||||||
ksRepCashNettoReport.setReqValue(withOblReqValue ? reqValue : null);
|
ksRepCashNettoReport.setReqValue(withOblReqValue ? reqValue : null);
|
||||||
|
ksRepCashNettoReport.setLotCurrency(registry.getSecuritySymbol());
|
||||||
CurrencyPairSecurity currencyPairSecurity = currencyPairSecurityImdg.getFirstObjectByFieldValues(Map.of(
|
SessionType sessionType = IEnumKey.getEnumByKey(SessionType.class, registry.getSessionType());
|
||||||
"securityId", registry.getSecurityId()
|
if (sessionType == SessionType.CURR) {
|
||||||
));
|
ksRepCashNettoReport.setCurrencyNetto(currencyNetto);
|
||||||
if (currencyPairSecurity != null) {
|
ksRepCashNettoReport.setTrExecDate(LocalDate.now());
|
||||||
CurrencyPairDictionary currencyPairDictionary = currencyPairDictionaryImdg.getSingleObjectByFieldValues(
|
|
||||||
Map.of(
|
|
||||||
"baseCurrency", currencyPairSecurity.getCurrencyPairId()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if (currencyPairDictionary != null) {
|
|
||||||
ksRepCashNettoReport.setLotCurrency(currencyPairDictionary.getBaseCurrency());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rows.add(ksRepCashNettoReport);
|
rows.add(ksRepCashNettoReport);
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import ru.spcex.clearing.reports.builders.CSVReportBuilder;
|
||||||
import ru.spcex.clearing.reports.builders.EmptyParams;
|
import ru.spcex.clearing.reports.builders.EmptyParams;
|
||||||
import ru.spcex.clearing.reports.builders.bean.KSRepDepoRegisterQuantitiesReport;
|
import ru.spcex.clearing.reports.builders.bean.KSRepDepoRegisterQuantitiesReport;
|
||||||
import ru.spcex.platform.enumeration.AccountType;
|
import ru.spcex.platform.enumeration.AccountType;
|
||||||
|
import ru.spcex.platform.enumeration.OperationType;
|
||||||
import ru.spcex.platform.enumeration.RegistryStatus;
|
import ru.spcex.platform.enumeration.RegistryStatus;
|
||||||
import ru.spcex.platform.enumeration.RegistryTradingParams;
|
import ru.spcex.platform.enumeration.RegistryTradingParams;
|
||||||
import ru.spcex.platform.enumeration.ReportBuilderType;
|
import ru.spcex.platform.enumeration.ReportBuilderType;
|
||||||
|
|
@ -136,20 +137,7 @@ public class KSRepDepoRegisterQuantitiesReportBuilder extends CSVReportBuilder<E
|
||||||
BigDecimal addQuantity = registry.getBalance();
|
BigDecimal addQuantity = registry.getBalance();
|
||||||
Instant addTime = registry.getUpdated();
|
Instant addTime = registry.getUpdated();
|
||||||
LocalDate addDate = LocalDate.now();
|
LocalDate addDate = LocalDate.now();
|
||||||
String lotCurrency = null;
|
OperationType operationType = OperationType.forBigDecimal(registry.getBalance());
|
||||||
CurrencyPairSecurity currencyPairSecurity = currencyPairSecurityImdg.getFirstObjectByFieldValues(Map.of(
|
|
||||||
"securityId", registry.getSecurityId()
|
|
||||||
));
|
|
||||||
if (currencyPairSecurity != null) {
|
|
||||||
CurrencyPairDictionary currencyPairDictionary = currencyPairDictionaryImdg.getSingleObjectByFieldValues(
|
|
||||||
Map.of(
|
|
||||||
"baseCurrency", currencyPairSecurity.getCurrencyPairId()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if (currencyPairDictionary != null) {
|
|
||||||
lotCurrency = currencyPairDictionary.getBaseCurrency();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
KSRepDepoRegisterQuantitiesReport ksRepDepoRegisterQuantitiesReport = new KSRepDepoRegisterQuantitiesReport();
|
KSRepDepoRegisterQuantitiesReport ksRepDepoRegisterQuantitiesReport = new KSRepDepoRegisterQuantitiesReport();
|
||||||
ksRepDepoRegisterQuantitiesReport.setFirmId(firmId);
|
ksRepDepoRegisterQuantitiesReport.setFirmId(firmId);
|
||||||
|
|
@ -161,7 +149,7 @@ public class KSRepDepoRegisterQuantitiesReportBuilder extends CSVReportBuilder<E
|
||||||
ksRepDepoRegisterQuantitiesReport.setAddQuantity(addQuantity);
|
ksRepDepoRegisterQuantitiesReport.setAddQuantity(addQuantity);
|
||||||
ksRepDepoRegisterQuantitiesReport.setAddTime(LocalTime.ofInstant(addTime, getReportZoneId()));
|
ksRepDepoRegisterQuantitiesReport.setAddTime(LocalTime.ofInstant(addTime, getReportZoneId()));
|
||||||
ksRepDepoRegisterQuantitiesReport.setAddDate(addDate);
|
ksRepDepoRegisterQuantitiesReport.setAddDate(addDate);
|
||||||
ksRepDepoRegisterQuantitiesReport.setLotCurrency(lotCurrency);
|
ksRepDepoRegisterQuantitiesReport.setOperType(operationType.getCode());
|
||||||
rows.add(ksRepDepoRegisterQuantitiesReport);
|
rows.add(ksRepDepoRegisterQuantitiesReport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue