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);