From 5004a3fb319e24ebfcd1e4253d79abc7e42e42d9 Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 19 May 2023 15:24:53 +0800 Subject: [PATCH] =?UTF-8?q?add=20=20=E8=81=94=E8=81=94=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=85=85=E7=94=B5=E7=8A=B6=E6=80=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/SpringBootTestController.java | 8 ++++- .../com/jsowell/pile/domain/OrderDetail.java | 4 +-- .../thirdparty/service/LianLianService.java | 7 ++++ .../service/impl/LianLianServiceImpl.java | 36 +++++++++++++++++-- 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index 566c5b1af..01a181721 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -186,7 +186,13 @@ public class SpringBootTestController { // lianLianService.pushOrderInfo("C27680791529"); // 推送启动充电结果 - lianLianService.pushStartChargeResult("C27680791529"); + // lianLianService.pushStartChargeResult("C27680791529"); + + // 推送充电状态 + lianLianService.pushChargeStatus("C27680791529"); + + + } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderDetail.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderDetail.java index 11d9ddf52..94f1c5d1e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderDetail.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderDetail.java @@ -228,7 +228,7 @@ public class OrderDetail extends BaseEntity { this.totalServiceAmount = totalServiceAmount; } - public BigDecimal getTotalServiceAnount() { + public BigDecimal getTotalServiceAmount() { return totalServiceAmount; } @@ -344,7 +344,7 @@ public class OrderDetail extends BaseEntity { .append("totalUsedElectricity", getTotalUsedElectricity()) .append("totalOrderAmount", getTotalOrderAmount()) .append("totalElectricityAmount", getTotalElectricityAmount()) - .append("totalServiceAnount", getTotalServiceAnount()) + .append("totalServiceAnount", getTotalServiceAmount()) .append("sharpUsedElectricity", getSharpUsedElectricity()) .append("sharpElectricityPrice", getSharpElectricityPrice()) .append("sharpServicePrice", getSharpServicePrice()) 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 f05a4698f..8162d3166 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 @@ -100,4 +100,11 @@ public interface LianLianService { * @return */ String pushStartChargeResult(String orderCode); + + /** + * 推送充电状态 + * @param orderCode + * @return + */ + String pushChargeStatus(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 275807a92..3922f77ea 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 @@ -237,6 +237,13 @@ public class LianLianServiceImpl implements LianLianService { return pageResponse; } + /** + * 设备接口状态查询 + * 此接口用于批量查询设备实时状态 + * + * @param StationIDs + * @return + */ @Override public LianLianPageResponse query_station_status(List StationIDs) { List StationStatusInfos = new ArrayList<>(); @@ -494,7 +501,7 @@ public class LianLianServiceImpl implements LianLianService { if (orderInfo == null) { throw new BusinessException("", ""); } - // OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode()); + OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode()); List realTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode()); RealTimeMonitorData data = realTimeData.get(0); String orderStatus = orderInfo.getOrderStatus(); @@ -520,8 +527,8 @@ public class LianLianServiceImpl implements LianLianService { .StartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间 .EndTime(DateUtils.getTime()) // 本次采样时间 .TotalPower(new BigDecimal(data.getChargingDegree())) // 累计充电量 - // .ElecMoney(new BigDecimal()) // 累计电费 - // .SeviceMoney(new BigDecimal()) // 累计服务费 + .ElecMoney(orderDetail.getTotalElectricityAmount()) // 累计电费 + .SeviceMoney(orderDetail.getTotalServiceAmount()) // 累计服务费 .TotalMoney(new BigDecimal(data.getChargingAmount())) // 已充金额 .build(); @@ -802,6 +809,29 @@ public class LianLianServiceImpl implements LianLianService { return result; } + /** + * 推送充电状态(仅桩充电时调) + * @param orderCode + * @return + */ + @Override + public String pushChargeStatus(String orderCode) { + // 调用 查询充电状态方法 + QueryChargingStatusVO vo = query_equip_charge_status(orderCode); + // 获取令牌 + String token = getToken(OPERATOR_ID, OPERATOR_SECRET); + if (StringUtils.isBlank(token)) { + return null; + } + String url = TEST_URL + "notification_equip_charge_status"; + // 调用联联平台接口 + String jsonString = JSONObject.toJSONString(vo); + + String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET); + + return result; + } + // private ChargeDetail setChargeDetail(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) { // ChargeDetail detail = new ChargeDetail(); //