Ejemplo n.º 1
0
 private EtfReportInfo convertReport(
     BasketQueryResult basket, Report etfReport, BaseConfig config) {
   EtfReportInfo etfReportInfo = new EtfReportInfo();
   etfReportInfo.setFundId(config.getFundId());
   etfReportInfo.setPortfolioId(config.getPortfolioId());
   List<ExecutionReport> excutionReports = etfReport.getExcutionReports();
   for (ExecutionReport executionReport : excutionReports) {
     assortmentReport(basket, etfReportInfo, executionReport);
   }
   return etfReportInfo;
 }
Ejemplo n.º 2
0
  private AdjustTradeEvent createPositionEvent(
      EtfReportInfo etfReportInfo, BaseConfig config, BasketQueryResult basket)
      throws AccountException {
    AdjustTradeEvent adjustTradeEvent = new AdjustTradeEvent();
    adjustTradeEvent.setTradeLevel(TradeLevelConsts.FILL);
    if (ETFTradeTypeConsts.ETF_ADMIN_CREATION.equals(etfReportInfo.getTradeType())) {
      adjustTradeEvent.setTradeType(TradeTypeConsts.ETF_ADMIN_SUBSCRIBE);
    }
    if (ETFTradeTypeConsts.ETF_ADMIN_REDEEM.equals(etfReportInfo.getTradeType())) {
      adjustTradeEvent.setTradeType(TradeTypeConsts.ETF_ADMIN_REDEEM);
    }
    adjustTradeEvent.setPortfolioId(config.getPortfolioId());

    adjustTradeEvent.setUserId(SYSTEM_USER_ID);
    adjustTradeEvent.setExchange(etfReportInfo.getEtfExecutionReport2().getExchangeCode());
    List<AdjustTradeEventLeg> adjustTradeEventLegs = getTradeEventLegs(etfReportInfo, basket);
    adjustTradeEvent.setTradeEventlegs(adjustTradeEventLegs);

    return adjustTradeEvent;
  }