| | |
| | | |
| | | private static final String QUERY_SEGMENTED_DATA_URL = "http://10.88.7.107:8081/SG.Web/api/services/nYJK/DiagnosticsSg/QuerySegmentedDataAsync"; |
| | | |
| | | private static final String USERNAME = "MX001@sgis"; |
| | | private static final String USERNAME = "Mx001@sgis"; |
| | | |
| | | private static final String PASSWORD = "123456"; |
| | | |
| | |
| | | String accessToken = "Bearer " + getAccessToken(requestAccessToken); |
| | | //获取保存后的数据 |
| | | List<ElectricityPriceSegmentedDTO> list = getElectricityPriceSegmentedList(accessToken); |
| | | list.forEach(item -> { |
| | | mcsApi.createElectricityPrice(item); |
| | | }); |
| | | mcsApi.createElectricityPrice(list); |
| | | } catch (Exception ex) { |
| | | logger.error("syncSegmentedDataTask运行异常"); |
| | | ex.printStackTrace(); |
| | |
| | | |
| | | public String getAccessToken(RequestAccessTokenVO requestAccessToken) { |
| | | String accessToken = ""; |
| | | logger.info("请求参数:" + JSON.toJSONString(requestAccessToken)); |
| | | String resp = HttpUtils.sendPost(ACCESS_TOKEN_URL, JSON.toJSONString(requestAccessToken)); |
| | | logger.info("获取token的返回值:" + resp); |
| | | JSONObject jsonObject = JSON.parseObject(resp); |