| | |
| | | public List<ElectricityPriceSegmentedDTO> getElectricityPriceSegmentedList(String accessToken){ |
| | | Map<String, String> paramsMap = new HashMap<>(); |
| | | LocalDate date = LocalDate.now(); // 获取当前日期的LocalDate实例 |
| | | int year = date.getYear(); |
| | | paramsMap.put("clock", String.valueOf(year)); |
| | | String year = String.valueOf(date.getYear()); |
| | | paramsMap.put("clock", year); |
| | | String resp = HttpUtils.sendPost(QUERY_SEGMENTED_DATA_URL, JSON.toJSONString(paramsMap), accessToken); |
| | | JSONObject jsonObject = JSON.parseObject(resp); |
| | | return jsonObject.getJSONArray("data").toJavaList(ElectricityPriceSegmentedDTO.class); |
| | | List<ElectricityPriceSegmentedDTO> list = jsonObject.getJSONArray("data").toJavaList(ElectricityPriceSegmentedDTO.class); |
| | | list.forEach(item -> item.setYear(year)); |
| | | return list; |
| | | } |
| | | |
| | | public static String encryptWithPublicKey(String publicKeyString, String data) throws Exception { |