Пример #1
0
  @Override
  public boolean buildMonthlyTask(String name, String domain, Date period) {
    ServiceReport serviceReport =
        queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
    MonthlyReport report = new MonthlyReport();

    report.setCreationDate(new Date());
    report.setDomain(domain);
    report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    report.setName(name);
    report.setPeriod(period);
    report.setType(1);
    byte[] binaryContent = DefaultNativeBuilder.build(serviceReport);
    return m_reportService.insertMonthlyReport(report, binaryContent);
  }
Пример #2
0
  @Override
  public boolean buildMonthlyTask(String name, String domain, Date period) {
    BugReport bugReport =
        queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));

    for (Domain d : bugReport.getDomains().values()) {
      d.setProblemUrl(
          String.format(
              "http://%s/cat/r/p?op=history&reportType=month&domain=%s&date=%s",
              getDomainName(), d.getId(), m_daily_formate.format(period)));
    }
    MonthlyReport report = new MonthlyReport();

    report.setContent("");
    report.setCreationDate(new Date());
    report.setDomain(domain);
    report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    report.setName(name);
    report.setPeriod(period);
    report.setType(1);
    byte[] binaryContent = DefaultNativeBuilder.build(bugReport);
    return m_reportService.insertMonthlyReport(report, binaryContent);
  }