| | |
| | | baseRequest.setOperator(operator); |
| | | baseRequest.setSig(buildSign(baseRequest)); |
| | | String request_json = JacksonUtils.toJson(baseRequest); |
| | | log.info("获取授权token请求:" + request_json); |
| | | log.info("获取授权token请求地址:" + post.getUrl()); |
| | | log.info("获取授权token请求参数:" + request_json); |
| | | log.info("获取授权token请求Data:" + jsonString); |
| | | post.body(request_json); |
| | | HttpResponse execute = post.execute(); |
| | |
| | | buildBody(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送三方设备状态变化失败:" + execute.body()); |
| | | log.error("推送三方平台设备状态失败:" + execute.body()); |
| | | return null; |
| | | } |
| | | return JSON.parseObject(execute.body(), NotificationStationStatusResult.class); |
| | | log.info("推送三方平台设备状态响应:" + execute.body()); |
| | | BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class); |
| | | Integer Ret = baseResult.getRet(); |
| | | if(0 != Ret){ |
| | | log.error("推送三方平台设备状态失败:" + baseResult.getMsg()); |
| | | return null; |
| | | } |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), operator.getDataSecret(), operator.getDataSecretIv()); |
| | | 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; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.body()); |
| | | Integer ret = jsonObject.getInteger("Ret"); |
| | | if(0 != ret){ |
| | | log.error("推送三方启动充电结果失败:" + 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()); |
| | | return null; |
| | | } |
| | | return jsonObject.getObject("Data", NotificationStartChargeResult.class); |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), operator.getDataSecret(), operator.getDataSecretIv()); |
| | | log.info("推送三方平台启动充电结果Data:" + decrypt); |
| | | NotificationStartChargeResult notificationStartChargeResult = JSON.parseObject(decrypt, NotificationStartChargeResult.class); |
| | | return notificationStartChargeResult; |
| | | } |
| | | |
| | | |
| | |
| | | buildBody(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送三方充电状态失败:" + execute.body()); |
| | | log.error("推送三方平台充电状态失败:" + execute.body()); |
| | | return null; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.body()); |
| | | Integer ret = jsonObject.getInteger("Ret"); |
| | | if(0 != ret){ |
| | | log.error("推送三方充电状态失败:" + 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()); |
| | | return null; |
| | | } |
| | | return jsonObject.getObject("Data", NotificationEquipChargeStatusResult.class); |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), operator.getDataSecret(), operator.getDataSecretIv()); |
| | | 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; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.body()); |
| | | Integer ret = jsonObject.getInteger("Ret"); |
| | | if(0 != ret){ |
| | | log.error("推送三方停止充电结果失败:" + 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()); |
| | | return null; |
| | | } |
| | | return jsonObject.getObject("Data", NotificationStopCharge.class); |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), operator.getDataSecret(), operator.getDataSecretIv()); |
| | | log.info("推送三方平台停止充电结果Data:" + decrypt); |
| | | NotificationStopCharge notificationStopCharge = JSON.parseObject(decrypt, NotificationStopCharge.class); |
| | | return notificationStopCharge; |
| | | } |
| | | |
| | | |
| | |
| | | buildBody(post, info, operator); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("推送三方充电订单信息失败:" + execute.body()); |
| | | log.error("推送三方平台充电订单信息失败:" + execute.body()); |
| | | return null; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.body()); |
| | | Integer ret = jsonObject.getInteger("Ret"); |
| | | if(0 != ret){ |
| | | log.error("推送三方充电订单信息失败:" + 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()); |
| | | return null; |
| | | } |
| | | return jsonObject.getObject("Data", NotificationChargeOrderInfoResult.class); |
| | | //解密参数 |
| | | String decrypt = AESUtil.decrypt(baseResult.getData(), operator.getDataSecret(), operator.getDataSecretIv()); |
| | | log.info("推送三方平台充电订单信息Data:" + decrypt); |
| | | NotificationChargeOrderInfoResult notificationChargeOrderInfoResult = JSON.parseObject(decrypt, NotificationChargeOrderInfoResult.class); |
| | | return notificationChargeOrderInfoResult; |
| | | } |
| | | |
| | | |
| | |
| | | baseRequest.setData(encrypt); |
| | | baseRequest.setOperator(operator); |
| | | baseRequest.setSig(buildSign(baseRequest)); |
| | | post.body(JacksonUtils.toJson(baseRequest)); |
| | | String request_json = JacksonUtils.toJson(baseRequest); |
| | | post.body(request_json); |
| | | log.info("推送三方平台请求地址:" + post.getUrl()); |
| | | log.info("推送三方平台请求参数:" + request_json); |
| | | log.info("推送三方平台请求Data:" + jsonString); |
| | | } |
| | | |
| | | |