|
@@ -118,6 +118,24 @@ public class TXinyiForecastComparisonServiceImpl implements ITXinyiForecastCompa
|
|
|
jsonObject.put("real", this.getRealByTXinyiForecastComparison(tXinyiForecastComparisons, timeList));
|
|
|
jsonObject.put("hs", this.getHSByTXinyiForecastComparison(tXinyiForecastComparisons, timeList));
|
|
|
jsonObject.put("yy", this.getYYByTXinyiForecastComparison(tXinyiForecastComparisons, timeList));
|
|
|
+ jsonObject.put("jl", this.getJLByTXinyiForecastComparison(tXinyiForecastComparisons, timeList));
|
|
|
+ return jsonObject;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Object getJLByTXinyiForecastComparison(List<TXinyiForecastComparison> list, List<String> timeList) {
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ //获取日期集合
|
|
|
+ //把最新的一条数据的最后两个点的预测值补上
|
|
|
+ TXinyiForecastComparison tXinyiForecastComparison = list.get(list.size() - 1);
|
|
|
+ timeList.add(tXinyiForecastComparison.getForecastTimeTwo());
|
|
|
+ timeList.add(tXinyiForecastComparison.getForecastTimeThree());
|
|
|
+ jsonObject.put("time", timeList);
|
|
|
+ //获取数据集合
|
|
|
+ //把最新的一条数据的最后两个点的预测值补上
|
|
|
+ List<BigDecimal> dataList = list.stream().map(TXinyiForecastComparison::getJlForecastOne).collect(Collectors.toList());
|
|
|
+ dataList.add(tXinyiForecastComparison.getJlForecastTwo());
|
|
|
+ dataList.add(tXinyiForecastComparison.getJlForecastThree());
|
|
|
+ jsonObject.put("data", dataList);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|