http://jira.mfd.msk:8088/browse/CLS-795 (in progress)
This commit is contained in:
parent
e6329fa778
commit
1fe25f814e
1 changed files with 2 additions and 98 deletions
|
|
@ -33,12 +33,12 @@ public class KSRepLccValueReportBuilder extends CSVReportBuilder<EmptyParams, KS
|
|||
|
||||
@Override
|
||||
public ReportBuilderType getReportType() {
|
||||
return ReportBuilderType.KS_REP_LCC_NETTO;
|
||||
return ReportBuilderType.KS_REP_LCC_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReportKeys getReportKey() {
|
||||
return ReportKeys.KS_REP_LCC_NETTO_REPORT;
|
||||
return ReportKeys.KS_REP_LCC_VALUE_REPORT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -53,102 +53,6 @@ public class KSRepLccValueReportBuilder extends CSVReportBuilder<EmptyParams, KS
|
|||
|
||||
@Override
|
||||
protected void collect(EmptyParams params) {
|
||||
// ImdgPredicateBuilder registryPB = registryImdg.predicateBuilder();
|
||||
// ImdgPredicate baseRegistriesPredicate = RegistryCodeSqlBuilder.getInstance(
|
||||
// RegistryTradingParams.AM_F,
|
||||
// RegistryTradingParams.OM_T,
|
||||
// RegistryTradingParams.TM_T
|
||||
// ).buildPredicate(registryPB);
|
||||
// Collection<Registry> baseRegistries = registryImdg.getCollectionObjectsByPredicate(baseRegistriesPredicate);
|
||||
//
|
||||
// Map<Long, List<Registry>> groupedByTKR = baseRegistries.stream()
|
||||
// .filter(registry -> {
|
||||
// if (registry.getTradingClearingRegistryId() == null) {
|
||||
// log.warn("Skip registry (id = {}): empty trading_clearing_registry_id", registry.getId());
|
||||
// return false;
|
||||
// }
|
||||
// if (registry.getSecurityId() == null) {
|
||||
// log.warn("Skip registry (id = {}): empty security_id", registry.getId());
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// })
|
||||
// .collect(Collectors.groupingBy(Registry::getTradingClearingRegistryId));
|
||||
//
|
||||
// Map<Long, Rates> currencyRates = new HashMap<>();
|
||||
// LocalDateTime nowTime = LocalDateTime.now();
|
||||
// LocalDate now = LocalDate.now();
|
||||
// for (Map.Entry<Long, List<Registry>> entryTKR : groupedByTKR.entrySet()) {
|
||||
// Long tradingClearingRegistryId = entryTKR.getKey();
|
||||
// List<Registry> registriesForTKR = entryTKR.getValue();
|
||||
//
|
||||
// Registry sampleRegistry = registriesForTKR.iterator().next();
|
||||
// String firmId = sampleRegistry.getTradingCode();
|
||||
// String tkr = sampleRegistry.getTradingClearingRegistry();
|
||||
// BigDecimal sumValue = BigDecimal.ZERO;
|
||||
// for (Registry registry : registriesForTKR) {
|
||||
// if (
|
||||
// registry.getRegistryDesignation().equals(RegistryDesignation.A.getKey()) &&
|
||||
// registry.getRegistryInstrumentType().equals(RegistryInstrumentType.M.getKey()) &&
|
||||
// registry.getRegistryUnit().equals(RegistryUnit.F.getKey())
|
||||
// ) {
|
||||
// if (registry.getBalance() == null) continue;
|
||||
// Long securityId = registry.getSecurityId();
|
||||
// Rates currencyRate = currencyRates.get(securityId);
|
||||
// if (currencyRate == null) {
|
||||
// ImdgPredicateBuilder ratesPB = ratesImdg.predicateBuilder();
|
||||
// Collection<Rates> rates = ratesImdg.getCollectionObjectsByPredicate(
|
||||
// ratesPB.and(
|
||||
// ratesPB.equals("currency_id", securityId),
|
||||
// ratesPB.notNull("value"),
|
||||
// ratesPB.equals("value_date", now)
|
||||
// )
|
||||
// );
|
||||
// if (!rates.isEmpty()) {
|
||||
// currencyRate = rates.iterator().next();
|
||||
// } else {
|
||||
// currencyRate = new Rates();
|
||||
// currencyRate.setValue(BigDecimal.ONE);
|
||||
// };
|
||||
// currencyRates.put(securityId, currencyRate);
|
||||
// }
|
||||
// sumValue = sumValue.add(registry.getBalance().multiply(currencyRate.getValue()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Map<Long, List<Registry>> registriesForSecurityId = registriesForTKR.stream().collect(
|
||||
// Collectors.groupingBy(Registry::getSecurityId)
|
||||
// );
|
||||
//
|
||||
// List<KSRepLccValueReport> rowsForGroup = new ArrayList<>();
|
||||
// for (Map.Entry<Long, List<Registry>> entrySecurityId : registriesForSecurityId.entrySet()) {
|
||||
// KSRepLccValueReport ksRepLccValueReport = new KSRepLccValueReport();
|
||||
// ksRepLccValueReport.setFirmId(firmId);
|
||||
// ksRepLccValueReport.setReportDate(nowTime);
|
||||
// ksRepLccValueReport.setTkr(tkr);
|
||||
// ksRepLccValueReport.setSumValue(sumValue);
|
||||
//
|
||||
// Long securityId = entrySecurityId.getKey();
|
||||
// List<Registry> registries = entrySecurityId.getValue();
|
||||
// BigDecimal demandMoney = BigDecimal.ZERO;
|
||||
// BigDecimal obligMoney = BigDecimal.ZERO;
|
||||
// BigDecimal posMoney = BigDecimal.ZERO;
|
||||
// for (Registry registry : registries) {
|
||||
// if (
|
||||
// List.of(RegistryStatus.PROC, RegistryStatus.MNG).contains(
|
||||
// IEnumKey.getEnumByKey(RegistryStatus.class, registry.getRegistryStatus())
|
||||
// ) &&
|
||||
// registry.getRegistryInstrumentType().equals(RegistryInstrumentType.M.getKey()) &&
|
||||
// registry.getRegistryUnit().equals(RegistryUnit.T.getKey())
|
||||
// ) {
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// rowsForGroup.add(ksRepLccValueReport);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
|
||||
rows = new ArrayList<>();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue