values.add(oneDayValue);
}
double[] result = m_baselineCreator.createBaseLine(values, weights, POINT_NUMBER);
Baseline baseline = new Baseline();
baseline.setDataInDoubleArray(result);
baseline.setIndexKey(key);
baseline.setReportName(reportName);
baseline.setReportPeriod(targetDate);
m_baselineService.insertBaseline(baseline);
Date tomorrow = new Date(reportPeriod.getTime() + TimeHelper.ONE_DAY);
double[] baseLine = m_baselineService.queryDailyBaseline(reportName, key, tomorrow);
if (baseLine == null) {
Baseline tomorrowBaseline = new Baseline();
tomorrowBaseline.setDataInDoubleArray(result);
tomorrowBaseline.setIndexKey(key);
tomorrowBaseline.setReportName(reportName);
tomorrowBaseline.setReportPeriod(tomorrow);
m_baselineService.insertBaseline(tomorrowBaseline);
}
}
}