From 4c8350a1dc64006f95c86142b0e57808c710c5f9 Mon Sep 17 00:00:00 2001 From: zz Date: Fri, 24 Dec 2021 17:25:30 +0800 Subject: [PATCH] incase cache fail --- .../xhpc/evcs/jpa/XhpcHistoryOrderRepository.java | 2 ++ .../NotificationChargeOrderInfoTask.java | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/jpa/XhpcHistoryOrderRepository.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/jpa/XhpcHistoryOrderRepository.java index b91cb687..b26d749a 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/jpa/XhpcHistoryOrderRepository.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/jpa/XhpcHistoryOrderRepository.java @@ -16,4 +16,6 @@ public interface XhpcHistoryOrderRepository extends JpaRepository findByConfirmResultNotAndOperatorId3rdptyEvcsIsNotNull(int succCode); + List findByConfirmResultNotAndSource(int confirmResult, int source); + } diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java index 9e3c7104..0ba116cc 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java @@ -54,15 +54,21 @@ public class NotificationChargeOrderInfoTask extends CoreDispatcher { } List authSecretTokenList = authSecretTokenRepository.findBySecretTokenType(SECRET_TOKEN_TYPE_OUT); List xhpcHistoryOrderList = - xhpcHistoryOrderRepository.findByConfirmResultNotAndOperatorId3rdptyEvcsIsNotNull(0); + xhpcHistoryOrderRepository.findByConfirmResultNotAndSource(0, 1); for (XhpcHistoryOrder horder : xhpcHistoryOrderList) { for (AuthSecretToken authSecretToken : authSecretTokenList) { String operatorId3rdptyEvcs = horder.getOperatorId3rdptyEvcs(); if (operatorId3rdptyEvcs == null) { - if (horder.getInternetSerialNumber() != null) operatorId3rdptyEvcs = - horder.getInternetSerialNumber().substring(0, 9); + if (horder.getInternetSerialNumber() != null) { + operatorId3rdptyEvcs = horder.getInternetSerialNumber().substring(0, 9); + horder.setOperatorId3rdptyEvcs(operatorId3rdptyEvcs); + xhpcHistoryOrderRepository.save(horder); // mending + } } if (authSecretToken.getOperatorId3irdpty().equals(operatorId3rdptyEvcs)) { +// final List statisticsTimeIntervals = +// xhpcStatisticsTimeIntervalRepository.findAllByHistoryOrderId(horder.getHistoryOrderId()); +// horder.setXhpcStatisticsTimeIntervalList(statisticsTimeIntervals); //似乎并不需要 ChargeOrderInfo chargeOrderInfo = new ChargeOrderInfo(horder); final ChargeOrderInfoResponse pushResp = notify(chargeOrderInfo, authSecretToken); if (pushResp != null) {