Beispiel #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;
 }
Beispiel #2
0
  // TODO速度会很慢,要优化
  @Override
  @Transactional(rollbackFor = Throwable.class)
  public void processReport(Report report) {
    try {
      BaseConfig config = baseConfigService.getConfig(report.getPbu());

      BasketQueryResult basket = getBasket(config);

      EtfReportInfo etfReportInfo = convertReport(basket, report, config);

      persitenceReport(basket, etfReportInfo);

      updateFundShare(etfReportInfo);

      persitenceService.createReport(report);

      updatePosition(etfReportInfo, config, basket);
    } catch (Exception e) {
      logger.error("处理etf回报异常:{}", e.getMessage());
    }
  }