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; }
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; }
private BasketQueryResult getBasket(BaseConfig config) { Date businessDay = businessDayServiceImpl.getBusinessDay(SH_EXCHANGE_CODE, 0); BasketQueryResult basket = basketQuery.findBasketByfundIdAndDate(config.getSecurityId(), businessDay); return basket; }