Przeglądaj źródła

运营的 预测比对报表接口 新增机理模型的数据列表

王苗苗 1 miesiąc temu
rodzic
commit
b64979b50a

+ 18 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/TXinyiForecastComparisonServiceImpl.java

@@ -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;
     }