| | |
| | | // 生成每天数据 |
| | | for (int i = 7; i >= 1; i--) {//升序 |
| | | LocalDate day = today.minusDays(i); |
| | | |
| | | dates.add(day); |
| | | Map<String, Object> stringObjectMap = monthEnergy.stream().filter(e -> e.get("time").toString().contains(day.toString())).findFirst().orElse(null); |
| | | if(stringObjectMap!=null){ |
| | | values.add(Double.valueOf(stringObjectMap.get("value").toString())); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | ArrayList<Map<String, Object>> monthEnergy = getMonthEnergy("2025-05", "2025-06"); |
| | | System.out.println(monthEnergy); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 光伏累计 |
| | |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | String electricity = getElectricity(); |
| | | System.out.println(electricity); |
| | | } |
| | | |
| | | |
| | | |