示例#1
0
 private void assortmentReport(
     BasketQueryResult basket, EtfReportInfo etfReportInfo, ExecutionReport executionReport) {
   if (basket.getFundInstrumentId2().equals(executionReport.getSymbol())) {
     setEtfReport(basket, etfReportInfo, executionReport);
   }
   if (basket.getCashInstrumentId() != null
       && basket.getCashInstrumentId().equals(executionReport.getSymbol())) {
     etfReportInfo.getEtfCashExecutionReport().add(executionReport);
     if (etfReportInfo.getCashReplaceAmount() == null) {
       etfReportInfo.setCashReplaceAmount(BigDecimal.ZERO);
     }
     etfReportInfo.setCashReplaceAmount(
         etfReportInfo.getCashReplaceAmount().add(executionReport.getAmount()));
   }
   if (basket.getCashInstrumentId2() != null
       && basket.getCashInstrumentId2().equals(executionReport.getSymbol())) {
     etfReportInfo.getEtfCashExecutionReport2().add(executionReport);
     if (etfReportInfo.getCashReplaceAmount() == null) {
       etfReportInfo.setCashReplaceAmount(BigDecimal.ZERO);
     }
     etfReportInfo.setCashReplaceAmount(
         etfReportInfo.getCashReplaceAmount().add(executionReport.getAmount()));
   }
   if (isConsstituent(executionReport.getSymbol(), basket.getConstituentStockQueryResult())) {
     etfReportInfo.getEtfSecurityExecutionReport().add(executionReport);
   }
 }
示例#2
0
  private BigDecimal getCashExecutionAmount(EtfReportInfo etfReportInfo) {
    List<ExecutionReport> etfCashExecutionReport = etfReportInfo.getEtfCashExecutionReport();

    BigDecimal balance = BigDecimal.ZERO;
    for (ExecutionReport executionReport : etfCashExecutionReport) {
      balance = balance.add(executionReport.getAmount());
    }

    List<ExecutionReport> etfCashExecutionReport2 = etfReportInfo.getEtfCashExecutionReport2();
    for (ExecutionReport executionReport : etfCashExecutionReport2) {
      balance = balance.add(executionReport.getAmount());
    }
    return balance;
  }