| | |
| | | baseRequest.setData(data); |
| | | baseRequest.setSig(hmacMD5); |
| | | String request_json = JacksonUtils.toJson(baseRequest); |
| | | log.info("获取三方平台授权token请求地址:" + post.getUrl()); |
| | | log.info("获取三方平台授权token请求参数:" + request_json); |
| | | log.info("获取三方平台授权token请求Data:" + jsonString); |
| | | log.info("【省监管平台】获取三方平台授权token请求地址:" + post.getUrl()); |
| | | log.info("【省监管平台】获取三方平台授权token请求参数:" + request_json); |
| | | log.info("【省监管平台】获取三方平台授权token请求Data:" + jsonString); |
| | | post.body(request_json); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("获取三方平台授权token失败:" + execute.body()); |
| | | log.error("【省监管平台】获取三方平台授权token失败:" + execute.body()); |
| | | return null; |
| | | } |
| | | log.info("获取三方平台授权token响应参数:" + execute.body()); |
| | | log.info("【省监管平台】获取三方平台授权token响应参数:" + execute.body()); |
| | | BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class); |
| | | Integer Ret = baseResult.getRet(); |
| | | if(0 != Ret){ |
| | | log.error("获取三方平台授权token失败:" + baseResult.getMsg()); |
| | | log.error("【省监管平台】获取三方平台授权token失败:" + baseResult.getMsg()); |
| | | return null; |
| | | } |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV); |
| | | log.info("获取三方平台授权token响应Data:" + decrypt); |
| | | log.info("【省监管平台】获取三方平台授权token响应Data:" + decrypt); |
| | | QueryTokenResult queryTokenResult = JSON.parseObject(decrypt, QueryTokenResult.class); |
| | | String token = queryTokenResult.getAccessToken(); |
| | | // Long tokenAvailableTime = LocalDateTime.now().toEpochSecond(ZoneOffset.UTC) + queryTokenResult.getTokenAvailab |
| | |
| | | buildBody(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送三方平台设备状态失败:" + execute.body()); |
| | | log.error("【省监管平台】推送三方平台设备状态失败:" + execute.body()); |
| | | return null; |
| | | } |
| | | log.info("推送三方平台设备状态响应:" + execute.body()); |
| | | log.info("【省监管平台】推送三方平台设备状态响应:" + execute.body()); |
| | | BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class); |
| | | Integer Ret = baseResult.getRet(); |
| | | if(0 != Ret){ |
| | | log.error("推送三方平台设备状态失败:" + baseResult.getMsg()); |
| | | log.error("【省监管平台】推送三方平台设备状态失败:" + baseResult.getMsg()); |
| | | return null; |
| | | } |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV); |
| | | log.info("推送三方平台设备状态Data:" + decrypt); |
| | | log.info("【省监管平台】推送三方平台设备状态Data:" + decrypt); |
| | | NotificationStationStatusResult notificationStationStatusResult = JSON.parseObject(decrypt, NotificationStationStatusResult.class); |
| | | return notificationStationStatusResult; |
| | | } |
| | |
| | | buildBody(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送三方平台充电状态失败:" + execute.body()); |
| | | log.error("【省监管平台】推送三方平台充电状态失败:" + execute.body()); |
| | | return null; |
| | | } |
| | | log.info("推送三方平台充电状态响应:" + execute.body()); |
| | | log.info("【省监管平台】推送三方平台充电状态响应:" + execute.body()); |
| | | BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class); |
| | | Integer Ret = baseResult.getRet(); |
| | | if(0 != Ret){ |
| | | log.error("推送三方平台充电状态失败:" + baseResult.getMsg()); |
| | | log.error("【省监管平台】推送三方平台充电状态失败:" + baseResult.getMsg()); |
| | | return null; |
| | | } |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV); |
| | | log.info("推送三方平台充电状态Data:" + decrypt); |
| | | log.info("【省监管平台】推送三方平台充电状态Data:" + decrypt); |
| | | NotificationEquipChargeStatusResult notificationEquipChargeStatusResult = JSON.parseObject(decrypt, NotificationEquipChargeStatusResult.class); |
| | | return notificationEquipChargeStatusResult; |
| | | } |
| | |
| | | buildBody(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送三方平台充电订单信息失败:" + execute.body()); |
| | | log.error("【省监管平台】推送三方平台充电订单信息失败:" + execute.body()); |
| | | return null; |
| | | } |
| | | log.info("推送三方平台充电订单信息响应:" + execute.body()); |
| | | log.info("【省监管平台】推送三方平台充电订单信息响应:" + execute.body()); |
| | | BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class); |
| | | Integer Ret = baseResult.getRet(); |
| | | if(0 != Ret){ |
| | | log.error("推送三方平台充电订单信息失败:" + baseResult.getMsg()); |
| | | log.error("【省监管平台】推送三方平台充电订单信息失败:" + baseResult.getMsg()); |
| | | return null; |
| | | } |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV); |
| | | log.info("推送三方平台充电订单信息Data:" + decrypt); |
| | | log.info("【省监管平台】推送三方平台充电订单信息Data:" + decrypt); |
| | | NotificationChargeOrderInfoResult notificationChargeOrderInfoResult = JSON.parseObject(decrypt, NotificationChargeOrderInfoResult.class); |
| | | return notificationChargeOrderInfoResult; |
| | | } |
| | |
| | | baseRequest.setSig(hmacMD5); |
| | | String request_json = JacksonUtils.toJson(baseRequest); |
| | | post.body(request_json); |
| | | log.info("推送三方平台请求地址:" + post.getUrl()); |
| | | log.info("推送三方平台请求参数:" + request_json); |
| | | log.info("推送三方平台请求Data:" + jsonString); |
| | | log.info("【省监管平台】推送三方平台请求地址:" + post.getUrl()); |
| | | log.info("【省监管平台】推送三方平台请求参数:" + request_json); |
| | | log.info("【省监管平台】推送三方平台请求Data:" + jsonString); |
| | | } |
| | | /** |
| | | * 构建请求参数和消息头 |
| | |
| | | baseRequest.setSig(hmacMD5); |
| | | String request_json = JacksonUtils.toJson(baseRequest); |
| | | post.body(request_json); |
| | | log.info("推送三方平台请求地址:" + post.getUrl()); |
| | | log.info("推送三方平台请求参数:" + request_json); |
| | | log.info("推送三方平台请求Data:" + request_json1); |
| | | log.info("【省监管平台】推送三方平台请求地址:" + post.getUrl()); |
| | | log.info("【省监管平台】推送三方平台请求参数:" + request_json); |
| | | log.info("【省监管平台】推送三方平台请求Data:" + request_json1); |
| | | } |
| | | |
| | | /** |
| | |
| | | buildBody(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送充电用能统计失败:" + execute.body()); |
| | | log.error("【省监管平台】推送充电用能统计失败:" + execute.body()); |
| | | return ; |
| | | } |
| | | log.info("推送充电用能统计信息响应:" + execute.body()); |
| | | log.info("【省监管平台】推送充电用能统计信息响应:" + execute.body()); |
| | | BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class); |
| | | Integer Ret = baseResult.getRet(); |
| | | if(0 != Ret){ |
| | | log.error("推送充电用能统计信息失败:" + baseResult.getMsg()); |
| | | log.error("【省监管平台】推送充电用能统计信息失败:" + baseResult.getMsg()); |
| | | return ; |
| | | } |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV); |
| | | log.info("推送充电用能统计信息Data:" + decrypt); |
| | | log.info("【省监管平台】推送充电用能统计信息Data:" + decrypt); |
| | | |
| | | } |
| | | /** |
| | |
| | | buildBody(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送充换电站信息失败:" + execute.body()); |
| | | log.error("【省监管平台】推送充换电站信息失败:" + execute.body()); |
| | | return ; |
| | | } |
| | | log.info("推送充换电站信息信息响应:" + execute.body()); |
| | | log.info("【省监管平台】推送充换电站信息信息响应:" + execute.body()); |
| | | BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class); |
| | | Integer Ret = baseResult.getRet(); |
| | | if(0 != Ret){ |
| | | log.error("推送充换电站信息失败:" + baseResult.getMsg()); |
| | | log.error("【省监管平台】推送充换电站信息失败:" + baseResult.getMsg()); |
| | | return ; |
| | | } |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV); |
| | | log.info("推送充换电站信息信息Data:" + decrypt); |
| | | log.info("【省监管平台】推送充换电站信息信息Data:" + decrypt); |
| | | } |
| | | /** |
| | | * 充换电站功率信息 |
| | |
| | | buildBodyStatus(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送充换电站实时功率失败:" + execute.body()); |
| | | log.error("【省监管平台】推送充换电站实时功率失败:" + execute.body()); |
| | | return ; |
| | | } |
| | | log.info("推送充换电站实时功率信息响应:" + execute.body()); |
| | | log.info("【省监管平台】推送充换电站实时功率信息响应:" + execute.body()); |
| | | BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class); |
| | | Integer Ret = baseResult.getRet(); |
| | | if(0 != Ret){ |
| | | log.error("推送充换电站实时功率信息失败:" + baseResult.getMsg()); |
| | | log.error("【省监管平台】推送充换电站实时功率信息失败:" + baseResult.getMsg()); |
| | | return ; |
| | | } |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV); |
| | | log.info("推送充换电站实时功率信息Data:" + decrypt); |
| | | log.info("【省监管平台】推送充换电站实时功率信息Data:" + decrypt); |
| | | } |
| | | |
| | | public static void main(String[] args) { |