|
|
@@ -3,10 +3,12 @@ package com.zsElectric.boot.charging.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.json.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.zsElectric.boot.business.mapper.*;
|
|
|
import com.zsElectric.boot.business.model.entity.*;
|
|
|
import com.zsElectric.boot.business.service.ChargeOrderInfoService;
|
|
|
@@ -31,6 +33,7 @@ import com.zsElectric.boot.system.mapper.DictItemMapper;
|
|
|
import com.zsElectric.boot.system.model.entity.DictItem;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.codehaus.jettison.json.JSONObject;
|
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -456,7 +459,17 @@ public class ChargingReceptionServiceImpl implements ChargingReceptionService {
|
|
|
map.put("startTime", startTime);
|
|
|
map.put("connectorId", chargeOrderInfo.getConnectorId());
|
|
|
map.put("jsonNode", jsonNode);
|
|
|
- okHttpUtil.doPostForm(firmInfo.getChannelUrl() + "/notification_start_charge_result", map, null);
|
|
|
+ String url = firmInfo.getChannelUrl() + "/notification_start_charge_result";
|
|
|
+ Gson gson = new Gson();
|
|
|
+ String requestBody = gson.toJson(map);
|
|
|
+ try {
|
|
|
+ JsonNode response = okHttpUtil.doPostJson(url, requestBody, null);
|
|
|
+ log.info("推送启动充电结果成功 - StartChargeSeq: {}, chargeOrderNo: {}, url: {}, response: {}",
|
|
|
+ startChargeSeq, chargeOrderInfo.getChargeOrderNo(), url, response);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("推送启动充电结果失败 - StartChargeSeq: {}, chargeOrderNo: {}, url: {}, requestBody: {}",
|
|
|
+ startChargeSeq, chargeOrderInfo.getChargeOrderNo(), url, requestBody, e);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -844,7 +857,14 @@ public class ChargingReceptionServiceImpl implements ChargingReceptionService {
|
|
|
String channelUrl = firmInfo.getChannelUrl() + "/notification_equip_charge_status";
|
|
|
|
|
|
// 推送充电状态
|
|
|
- okHttpUtil.doPostForm(channelUrl, BeanUtil.beanToMap(chargeStatus), null);
|
|
|
+ try {
|
|
|
+ JsonNode response = okHttpUtil.doPostForm(channelUrl, BeanUtil.beanToMap(chargeStatus), null);
|
|
|
+ log.info("推送充电状态成功 - startChargeSeq: {}, firmId: {}, channelUrl: {}, response: {}",
|
|
|
+ startChargeSeq, firmId, channelUrl, response);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("推送充电状态失败 - startChargeSeq: {}, firmId: {}, channelUrl: {}, 错误信息: {}",
|
|
|
+ startChargeSeq, firmId, channelUrl, e.getMessage(), e);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|