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)
|
||||
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() {
|
||||
return firmId;
|
||||
|
|
@ -134,4 +142,20 @@ public class KSRepCashNettoReport {
|
|||
public void setLotCurrency(String 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)
|
||||
private String tradeNum;
|
||||
|
||||
@CsvBindByName(column = "LOT_CURRENCY")
|
||||
@CsvBindByName(column = "OPER_TYPE")
|
||||
@CsvBindByPosition(position = 8)
|
||||
private String lotCurrency;
|
||||
private String operType;
|
||||
|
||||
|
||||
public String getFirmId() {
|
||||
|
|
@ -125,12 +125,12 @@ public class KSRepDepoRegisterQuantitiesReport {
|
|||
this.tradeNum = tradeNum;
|
||||
}
|
||||
|
||||
public String getLotCurrency() {
|
||||
return lotCurrency;
|
||||
public String getOperType() {
|
||||
return operType;
|
||||
}
|
||||
|
||||
public void setLotCurrency(String lotCurrency) {
|
||||
this.lotCurrency = lotCurrency;
|
||||
public void setOperType(String operType) {
|
||||
this.operType = operType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
}
|
||||
|
||||
boolean invalid = false;
|
||||
BigDecimal currencyNetto = null;
|
||||
if (!cmtRegistries.isEmpty() || !lmtRegistries.isEmpty()) {
|
||||
String sourceTradingCode = 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");
|
||||
break;
|
||||
}
|
||||
currencyNetto = currRegistry.getBalance();
|
||||
}
|
||||
for (Registry currRegistry : lmtRegistries) {
|
||||
if (!Objects.equals(sourceTradingCode, currRegistry.getTradingCode())) {
|
||||
|
|
@ -241,19 +243,11 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
ksRepCashNettoReport.setValue(withValue ? value : null);
|
||||
ksRepCashNettoReport.setOblValue(withOblReqValue ? oblValue : null);
|
||||
ksRepCashNettoReport.setReqValue(withOblReqValue ? reqValue : null);
|
||||
|
||||
CurrencyPairSecurity currencyPairSecurity = currencyPairSecurityImdg.getFirstObjectByFieldValues(Map.of(
|
||||
"securityId", registry.getSecurityId()
|
||||
));
|
||||
if (currencyPairSecurity != null) {
|
||||
CurrencyPairDictionary currencyPairDictionary = currencyPairDictionaryImdg.getSingleObjectByFieldValues(
|
||||
Map.of(
|
||||
"baseCurrency", currencyPairSecurity.getCurrencyPairId()
|
||||
)
|
||||
);
|
||||
if (currencyPairDictionary != null) {
|
||||
ksRepCashNettoReport.setLotCurrency(currencyPairDictionary.getBaseCurrency());
|
||||
}
|
||||
ksRepCashNettoReport.setLotCurrency(registry.getSecuritySymbol());
|
||||
SessionType sessionType = IEnumKey.getEnumByKey(SessionType.class, registry.getSessionType());
|
||||
if (sessionType == SessionType.CURR) {
|
||||
ksRepCashNettoReport.setCurrencyNetto(currencyNetto);
|
||||
ksRepCashNettoReport.setTrExecDate(LocalDate.now());
|
||||
}
|
||||
|
||||
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.bean.KSRepDepoRegisterQuantitiesReport;
|
||||
import ru.spcex.platform.enumeration.AccountType;
|
||||
import ru.spcex.platform.enumeration.OperationType;
|
||||
import ru.spcex.platform.enumeration.RegistryStatus;
|
||||
import ru.spcex.platform.enumeration.RegistryTradingParams;
|
||||
import ru.spcex.platform.enumeration.ReportBuilderType;
|
||||
|
|
@ -136,20 +137,7 @@ public class KSRepDepoRegisterQuantitiesReportBuilder extends CSVReportBuilder<E
|
|||
BigDecimal addQuantity = registry.getBalance();
|
||||
Instant addTime = registry.getUpdated();
|
||||
LocalDate addDate = LocalDate.now();
|
||||
String lotCurrency = null;
|
||||
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();
|
||||
}
|
||||
}
|
||||
OperationType operationType = OperationType.forBigDecimal(registry.getBalance());
|
||||
|
||||
KSRepDepoRegisterQuantitiesReport ksRepDepoRegisterQuantitiesReport = new KSRepDepoRegisterQuantitiesReport();
|
||||
ksRepDepoRegisterQuantitiesReport.setFirmId(firmId);
|
||||
|
|
@ -161,7 +149,7 @@ public class KSRepDepoRegisterQuantitiesReportBuilder extends CSVReportBuilder<E
|
|||
ksRepDepoRegisterQuantitiesReport.setAddQuantity(addQuantity);
|
||||
ksRepDepoRegisterQuantitiesReport.setAddTime(LocalTime.ofInstant(addTime, getReportZoneId()));
|
||||
ksRepDepoRegisterQuantitiesReport.setAddDate(addDate);
|
||||
ksRepDepoRegisterQuantitiesReport.setLotCurrency(lotCurrency);
|
||||
ksRepDepoRegisterQuantitiesReport.setOperType(operationType.getCode());
|
||||
rows.add(ksRepDepoRegisterQuantitiesReport);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue