diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationsInfoController.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationsInfoController.java index a9a77eb1..2a11db37 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationsInfoController.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationsInfoController.java @@ -43,7 +43,7 @@ public class QueryStationsInfoController { @PostMapping("/v1/query_stations_info") public CommonResponse queryStationsInfo(@RequestBody(required = false) CommonRequest commonRequest) throws Exception { - // todo 电站状态更新逻辑,没必要做,全推 + // 电站状态更新逻辑,没必要做,全推 // chargingStationPushStatusService.editStationStatus(); // chargingStationPushStatusService.saveStationStatus(); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/CheckChargeOrders.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/CheckChargeOrders.java index df6a7abf..fb1d830f 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/CheckChargeOrders.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/CheckChargeOrders.java @@ -52,7 +52,7 @@ public class CheckChargeOrders extends CoreDispatcher { } String orderNo = pushOrderKey.substring(10); Map order = REDIS.getCacheMap("order:" + orderNo); - String operatorId3rdpty = (String) order.get("operatorId3rdpty"); //todo zz + String operatorId3rdpty = (String) pushOrder.get("operatorId3rdpty"); if (operatorId3rdpty == null) { continue; } diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo.java index dfd085c3..d78ab697 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo.java @@ -58,7 +58,7 @@ public class NotificationChargeOrderInfo extends CoreDispatcher { } String orderNo = pushOrderKey.substring(10); Map order = REDIS.getCacheMap("order:" + orderNo); - String operatorId3rdpty = (String) order.get("operatorId3rdpty"); //todo zz + String operatorId3rdpty = (String) pushOrder.get("operatorId3rdpty"); if (operatorId3rdpty == null) { continue; } diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java index 3161a1f1..6c7254c3 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java @@ -27,7 +27,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher { @Scheduled(fixedRate = 1000 * 20) public void run() throws IOException { - notifyService(); + //notifyService(); } /** @@ -41,7 +41,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher { * 出现异常逻辑 * 如果当充电桩因为异常停止充电时,那么谁告诉我订单是个异常订单? */ - public void notifyService() throws IOException { + public void notifyService() throws Exception { //获取Redis中的所有订单状态数据 Collection pushOrders = REDIS.keys("pushOrder:*"); @@ -54,7 +54,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher { } String orderNo = pushOrderKey.substring(10); Map order = REDIS.getCacheMap("order:" + orderNo); - String operatorId3rdpty = (String) order.get("operatorId3rdpty"); //todo zz + String operatorId3rdpty = (String) pushOrder.get("operatorId3rdpty"); if (operatorId3rdpty == null) { continue; } @@ -82,18 +82,27 @@ public class NotificationStopChargeResultTask extends CoreDispatcher { chargeResultRequest.setFailReason(failReason); //将其转换为json + chargeResultRequestCommonRequest.setOperatorId(operatorId3rdpty); String jsonData = JSONUtil.toJSONString(chargeResultRequest); chargeResultRequestCommonRequest.setData(jsonData); String result = ok(chargeResultRequestCommonRequest, "/notification_stop_charge_result", authSecretTokenOut, operatorId3rdpty); ChargeResultResponse chargeResultResponse = JSONUtil.readParams(result, ChargeResultResponse.class); succStat = chargeResultResponse.getSuccStat(); - //推送成功则排除这个已推送的订单,否则则继续推送该订单 //todo 用于测试暂时注释 + //推送成功则排除这个已推送的订单,否则则继续推送该订单 // 用于测试暂时注释 // if (succStat==0){ // REDIS.deleteObject(pushOrderKey); // } + + } } } + + //推送充电订单信息 + new NotificationChargeOrderInfo().pushChargeOrderInfo(); + + //进行账单对账 + new CheckChargeOrders().checkChargeOrder(); } } \ No newline at end of file