|
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
-import com.google.gson.Gson;
|
|
|
|
|
import com.zsElectric.boot.business.mapper.*;
|
|
import com.zsElectric.boot.business.mapper.*;
|
|
|
import com.zsElectric.boot.business.model.entity.*;
|
|
import com.zsElectric.boot.business.model.entity.*;
|
|
|
import com.zsElectric.boot.business.service.ChargeOrderInfoService;
|
|
import com.zsElectric.boot.business.service.ChargeOrderInfoService;
|
|
@@ -186,9 +185,10 @@ public class ChargingReceptionServiceImpl implements ChargingReceptionService {
|
|
|
Map<String, Object> map = objectMapper.convertValue(jsonNode, Map.class);
|
|
Map<String, Object> map = objectMapper.convertValue(jsonNode, Map.class);
|
|
|
map.put("chargeOrderNo", chargeOrderInfo.getChargeOrderNo());
|
|
map.put("chargeOrderNo", chargeOrderInfo.getChargeOrderNo());
|
|
|
FirmInfo firmInfo = firmInfoMapper.selectById(chargeOrderInfo.getFirmId());
|
|
FirmInfo firmInfo = firmInfoMapper.selectById(chargeOrderInfo.getFirmId());
|
|
|
|
|
+ String requestBody = new JSONObject(map).toString();
|
|
|
if (ObjectUtil.isNotNull(firmInfo)) {
|
|
if (ObjectUtil.isNotNull(firmInfo)) {
|
|
|
try {
|
|
try {
|
|
|
- JsonNode response = okHttpUtil.doPostForm(firmInfo.getChannelUrl() + "/notification_charge_order_info", map, null);
|
|
|
|
|
|
|
+ JsonNode response = okHttpUtil.doPostJson(firmInfo.getChannelUrl() + "/notification_charge_order_info", requestBody, null);
|
|
|
log.info("渠道方推送充电订单信息成功 - chargeOrderNo: {}, firmId: {}, response: {}",
|
|
log.info("渠道方推送充电订单信息成功 - chargeOrderNo: {}, firmId: {}, response: {}",
|
|
|
chargeOrderInfo.getChargeOrderNo(), chargeOrderInfo.getFirmId(), response);
|
|
chargeOrderInfo.getChargeOrderNo(), chargeOrderInfo.getFirmId(), response);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -460,8 +460,8 @@ public class ChargingReceptionServiceImpl implements ChargingReceptionService {
|
|
|
map.put("connectorId", chargeOrderInfo.getConnectorId());
|
|
map.put("connectorId", chargeOrderInfo.getConnectorId());
|
|
|
map.put("jsonNode", jsonNode);
|
|
map.put("jsonNode", jsonNode);
|
|
|
String url = firmInfo.getChannelUrl() + "/notification_start_charge_result";
|
|
String url = firmInfo.getChannelUrl() + "/notification_start_charge_result";
|
|
|
- Gson gson = new Gson();
|
|
|
|
|
- String requestBody = gson.toJson(map);
|
|
|
|
|
|
|
+ String requestBody = new JSONObject(map).toString();
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
JsonNode response = okHttpUtil.doPostJson(url, requestBody, null);
|
|
JsonNode response = okHttpUtil.doPostJson(url, requestBody, null);
|
|
|
log.info("推送启动充电结果成功 - StartChargeSeq: {}, chargeOrderNo: {}, url: {}, response: {}",
|
|
log.info("推送启动充电结果成功 - StartChargeSeq: {}, chargeOrderNo: {}, url: {}, response: {}",
|
|
@@ -557,7 +557,16 @@ public class ChargingReceptionServiceImpl implements ChargingReceptionService {
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
map.put("chargeOrderNo", chargeOrderInfo.getChargeOrderNo());
|
|
map.put("chargeOrderNo", chargeOrderInfo.getChargeOrderNo());
|
|
|
map.put("status", SystemConstants.STATUS_TWO);
|
|
map.put("status", SystemConstants.STATUS_TWO);
|
|
|
- okHttpUtil.doPostForm(firmInfo.getChannelUrl() + "/notification_stop_charge_result", map, null);
|
|
|
|
|
|
|
+ String url = firmInfo.getChannelUrl() + "/notification_stop_charge_result";
|
|
|
|
|
+ String requestBody = new JSONObject(map).toString();
|
|
|
|
|
+ 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: {}, params: {}",
|
|
|
|
|
+ startChargeSeq, chargeOrderInfo.getChargeOrderNo(), url, map, e);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|