revert last fixes
This commit is contained in:
parent
1d0f669c41
commit
d98b2ce176
1 changed files with 33 additions and 35 deletions
|
|
@ -127,6 +127,8 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
}
|
||||
|
||||
boolean invalid = false;
|
||||
BigDecimal currencyNettoCmt = BigDecimal.ZERO;
|
||||
BigDecimal currencyNettoLmt = BigDecimal.ZERO;
|
||||
if (!cmtRegistries.isEmpty() || !lmtRegistries.isEmpty()) {
|
||||
String sourceTradingCode = null;
|
||||
String sourceTkr = null;
|
||||
|
|
@ -151,6 +153,9 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
log.warn("Invalid CM_T registries set, tradingClearingRegistry not equals. Registries was skipped");
|
||||
break;
|
||||
}
|
||||
if (currRegistry.getBalance().compareTo(ReportConst.DB_ZERO) != 0) {
|
||||
currencyNettoCmt = currencyNettoCmt.add(currRegistry.getBalance());
|
||||
}
|
||||
}
|
||||
for (Registry currRegistry : lmtRegistries) {
|
||||
if (!Objects.equals(sourceTradingCode, currRegistry.getTradingCode())) {
|
||||
|
|
@ -163,6 +168,9 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
log.warn("Invalid CM_T registries set, tradingClearingRegistry not equals. Registries was skipped");
|
||||
break;
|
||||
}
|
||||
if (currRegistry.getBalance().compareTo(ReportConst.DB_ZERO) != 0) {
|
||||
currencyNettoLmt = currencyNettoLmt.add(currRegistry.getBalance());
|
||||
}
|
||||
}
|
||||
if (invalid) continue;
|
||||
}
|
||||
|
|
@ -196,22 +204,22 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
BigDecimal lmtBalance = BigDecimal.ZERO;
|
||||
BigDecimal oblValue = BigDecimal.ZERO;
|
||||
BigDecimal reqValue = BigDecimal.ZERO;
|
||||
BigDecimal cmtCurrencyNetto = BigDecimal.ZERO;
|
||||
BigDecimal lmtCurrencyNetto = BigDecimal.ZERO;
|
||||
boolean withValue = false;
|
||||
boolean withOblReqValue = false;
|
||||
boolean withCurrencyNettoValue = false;
|
||||
boolean forUnitSession = false;
|
||||
Set<SessionType> sessionTypeForValue = Set.of(
|
||||
SessionType.IPOT,
|
||||
SessionType.TRDT,
|
||||
SessionType.LIQU,
|
||||
SessionType.IPOB,
|
||||
SessionType.IPO0
|
||||
SessionType.IPO0,
|
||||
SessionType.UNIT
|
||||
);
|
||||
Set<SessionType> sessionTypeForOblReqValue = Set.of(
|
||||
SessionType.FINL,
|
||||
SessionType.MEDM,
|
||||
SessionType.XDEP
|
||||
SessionType.XDEP,
|
||||
SessionType.UNIT
|
||||
);
|
||||
for (Registry cmtRegistry : cmtRegistries) {
|
||||
if (cmtRegistry.getBalance() != null) {
|
||||
|
|
@ -219,22 +227,14 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
Section section = IEnumKey.getEnumByKey(Section.class, cmtRegistry.getSection());
|
||||
if (sessionType == null || section == null) continue;
|
||||
if (section == Section.FOND || sessionTypeForValue.contains(sessionType)) {
|
||||
if (ReportConst.DB_ZERO.compareTo(cmtRegistry.getBalance()) != 0) {
|
||||
cmtBalance = cmtBalance.add(cmtRegistry.getBalance());
|
||||
withValue = true;
|
||||
}
|
||||
if (sessionType == SessionType.UNIT && section == Section.CURR) forUnitSession = true;
|
||||
else withValue = true;
|
||||
}
|
||||
if (section == Section.MKR || sessionTypeForOblReqValue.contains(sessionType)) {
|
||||
if (ReportConst.DB_ZERO.compareTo(cmtRegistry.getBalance()) != 0) {
|
||||
reqValue = reqValue.add(cmtRegistry.getBalance());
|
||||
withOblReqValue = true;
|
||||
}
|
||||
}
|
||||
if (section == Section.CURR || sessionType == SessionType.CURR) {
|
||||
if (ReportConst.DB_ZERO.compareTo(cmtRegistry.getBalance()) != 0) {
|
||||
cmtCurrencyNetto = cmtCurrencyNetto.add(cmtBalance);
|
||||
withCurrencyNettoValue = true;
|
||||
}
|
||||
if (sessionType == SessionType.UNIT && section == Section.CURR) forUnitSession = true;
|
||||
else withOblReqValue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -245,20 +245,18 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
if (sessionType == null) continue;
|
||||
if (section == Section.FOND || sessionTypeForValue.contains(sessionType)) {
|
||||
lmtBalance = lmtBalance.add(lmtRegistry.getBalance());
|
||||
withValue = true;
|
||||
if (sessionType == SessionType.UNIT && section == Section.CURR) forUnitSession = true;
|
||||
else withValue = true;
|
||||
}
|
||||
if (section == Section.MKR || sessionTypeForOblReqValue.contains(sessionType)) {
|
||||
oblValue = oblValue.add(lmtRegistry.getBalance());
|
||||
withOblReqValue = true;
|
||||
}
|
||||
if (section == Section.CURR && sessionType == SessionType.UNIT) {
|
||||
lmtCurrencyNetto = lmtCurrencyNetto.add(lmtCurrencyNetto);
|
||||
withCurrencyNettoValue = true;
|
||||
if (sessionType == SessionType.UNIT && section == Section.CURR) forUnitSession = true;
|
||||
else withOblReqValue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
BigDecimal value = cmtBalance.subtract(lmtBalance);
|
||||
BigDecimal currencyNetto = cmtCurrencyNetto.subtract(lmtCurrencyNetto);
|
||||
BigDecimal value;
|
||||
value = cmtBalance.subtract(lmtBalance);
|
||||
ksRepCashNettoReport.setLotCurrency(registry.getSecuritySymbol());
|
||||
if (withValue) {
|
||||
KSRepCashNettoReport withoutValueClone = ksRepCashNettoReport.cloneWithoutValues();
|
||||
|
|
@ -271,9 +269,9 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
|||
withoutValueClone.setReqValue(reqValue);
|
||||
rows.add(withoutValueClone);
|
||||
}
|
||||
if (withCurrencyNettoValue) {
|
||||
if (forUnitSession) {
|
||||
KSRepCashNettoReport withoutValueClone = ksRepCashNettoReport.cloneWithoutValues();
|
||||
withoutValueClone.setCurrencyNetto(currencyNetto);
|
||||
withoutValueClone.setCurrencyNetto(currencyNettoCmt.subtract(currencyNettoLmt));
|
||||
withoutValueClone.setTrExecDate(LocalDate.now());
|
||||
rows.add(withoutValueClone);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue