From 1641455993f428f4013ba1160f54b8ff8b7accad Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 26 May 2023 10:48:54 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=E6=8E=A8=E9=80=81=E8=81=94?= =?UTF-8?q?=E8=81=94=E5=B9=B3=E5=8F=B0=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thirdparty/service/LianLianService.java | 4 ++-- .../service/impl/LianLianServiceImpl.java | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/LianLianService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/LianLianService.java index fbdb093cc..e36a7331f 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/LianLianService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/LianLianService.java @@ -146,8 +146,8 @@ public interface LianLianService { /** * 设备充电中状态变化推送 - * @param pileConnectorCode + * @param orderCode * @return */ - String pushPileChargeStatusChange(String pileConnectorCode); + String pushPileChargeStatusChange(String orderCode); } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java index e769b7d68..1ad6705c7 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java @@ -1139,20 +1139,21 @@ public class LianLianServiceImpl implements LianLianService { /** * 设备充电中状态变化推送 notification_connector_charge_status - * @param pileConnectorCode + * @param orderCode * @return */ @Override - public String pushPileChargeStatusChange(String pileConnectorCode) { - + public String pushPileChargeStatusChange(String orderCode) { + // 通过订单号查询信息 + OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); // 根据枪口号查询充电实时状态 - OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(pileConnectorCode); + OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(orderInfo.getPileConnectorCode()); List list = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode()); RealTimeMonitorData realTimeMonitorData = list.get(0); // 拼装联联参数 ConnectorChargeStatusInfo info = ConnectorChargeStatusInfo.builder() .startChargeSeq(orderBasicInfo.getOrderCode()) - .connectorID(pileConnectorCode) + .connectorID(orderInfo.getPileConnectorCode()) .connectorStatus(Integer.valueOf(realTimeMonitorData.getConnectorStatus())) .currentA(new BigDecimal(realTimeMonitorData.getOutputCurrent())) .voltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage())) @@ -1185,7 +1186,10 @@ public class LianLianServiceImpl implements LianLianService { if (StringUtils.isBlank(token)){ return null; } - String jsonString = JSONObject.toJSONString(info); + JSONObject json = new JSONObject(); + json.put("ConnectorChargeStatusInfo", info); + + String jsonString = JSONObject.toJSONString(json); // 发送请求 String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);