http://jira.mfd.msk:8088/browse/CLS-497 KSRepCashNettoReportBuilder
This commit is contained in:
parent
8ae41b9d16
commit
632bdf9e09
2 changed files with 23 additions and 9 deletions
|
|
@ -179,6 +179,8 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
||||||
BigDecimal lmtBalance = BigDecimal.ZERO;
|
BigDecimal lmtBalance = BigDecimal.ZERO;
|
||||||
BigDecimal oblValue = BigDecimal.ZERO;
|
BigDecimal oblValue = BigDecimal.ZERO;
|
||||||
BigDecimal reqValue = BigDecimal.ZERO;
|
BigDecimal reqValue = BigDecimal.ZERO;
|
||||||
|
boolean withValue = false;
|
||||||
|
boolean withOblReqValue = false;
|
||||||
Set<SessionType> sessionTypeForValue = Set.of(
|
Set<SessionType> sessionTypeForValue = Set.of(
|
||||||
SessionType.IPOT,
|
SessionType.IPOT,
|
||||||
SessionType.TRDT,
|
SessionType.TRDT,
|
||||||
|
|
@ -195,21 +197,33 @@ public class KSRepCashNettoReportBuilder extends CSVReportBuilder<SessionIdParam
|
||||||
if (cmtRegistry.getBalance() != null) {
|
if (cmtRegistry.getBalance() != null) {
|
||||||
SessionType sessionType = IEnumKey.getEnumByKey(SessionType.class, cmtRegistry.getSessionType());
|
SessionType sessionType = IEnumKey.getEnumByKey(SessionType.class, cmtRegistry.getSessionType());
|
||||||
if (sessionType == null) continue;
|
if (sessionType == null) continue;
|
||||||
if (sessionTypeForValue.contains(sessionType)) cmtBalance = cmtBalance.add(cmtRegistry.getBalance());
|
if (sessionTypeForValue.contains(sessionType)) {
|
||||||
if (sessionTypeForOblReqValue.contains(sessionType)) reqValue = reqValue.add(cmtRegistry.getBalance());
|
cmtBalance = cmtBalance.add(cmtRegistry.getBalance());
|
||||||
|
withValue = true;
|
||||||
|
}
|
||||||
|
if (sessionTypeForOblReqValue.contains(sessionType)) {
|
||||||
|
reqValue = reqValue.add(cmtRegistry.getBalance());
|
||||||
|
withOblReqValue = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Registry lmtRegistry : lmtRegistries) {
|
for (Registry lmtRegistry : lmtRegistries) {
|
||||||
if (lmtRegistry.getBalance() != null) {
|
if (lmtRegistry.getBalance() != null) {
|
||||||
SessionType sessionType = IEnumKey.getEnumByKey(SessionType.class, lmtRegistry.getSessionType());
|
SessionType sessionType = IEnumKey.getEnumByKey(SessionType.class, lmtRegistry.getSessionType());
|
||||||
if (sessionType == null) continue;
|
if (sessionType == null) continue;
|
||||||
if (sessionTypeForValue.contains(sessionType)) lmtBalance = lmtBalance.add(lmtRegistry.getBalance());
|
if (sessionTypeForValue.contains(sessionType)) {
|
||||||
if (sessionTypeForOblReqValue.contains(sessionType)) oblValue = oblValue.add(lmtRegistry.getBalance());
|
lmtBalance = lmtBalance.add(lmtRegistry.getBalance());
|
||||||
|
withValue = true;
|
||||||
|
}
|
||||||
|
if (sessionTypeForOblReqValue.contains(sessionType)) {
|
||||||
|
oblValue = oblValue.add(lmtRegistry.getBalance());
|
||||||
|
withOblReqValue = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ksRepCashNettoReport.setValue(cmtBalance.subtract(lmtBalance));
|
ksRepCashNettoReport.setValue(withValue ? cmtBalance.subtract(lmtBalance) : null);
|
||||||
ksRepCashNettoReport.setOblValue(oblValue);
|
ksRepCashNettoReport.setOblValue(withOblReqValue ? oblValue : null);
|
||||||
ksRepCashNettoReport.setReqValue(reqValue);
|
ksRepCashNettoReport.setReqValue(withOblReqValue ? reqValue : null);
|
||||||
|
|
||||||
rows.add(ksRepCashNettoReport);
|
rows.add(ksRepCashNettoReport);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
"FIRMID","SESSION_ID","SESSION_DATE","ACCOUNT","TKR","VALUE","DATE","OBL_VALUE","REQ_VALUE"
|
"FIRMID","SESSION_ID","SESSION_DATE","ACCOUNT","TKR","VALUE","DATE","OBL_VALUE","REQ_VALUE"
|
||||||
"TRADING_CODE","2","20.01.1970T02:49:58","ACCOUNT","TKR","22.22","16.11.2023","0.00","0.00"
|
"TRADING_CODE","2","20.01.1970T02:49:58","ACCOUNT","TKR","22.22","16.11.2023","",""
|
||||||
"TRADING_CODE","2","20.01.1970T02:49:58","ACCOUNT_FROM_ACCOUNT","TKR","0.00","16.11.2023","22.22","44.44"
|
"TRADING_CODE","2","20.01.1970T02:49:58","ACCOUNT_FROM_ACCOUNT","TKR","","16.11.2023","22.22","44.44"
|
||||||
|
Loading…
Add table
Reference in a new issue