From c6028873fa64f5f96a50b6e30edd0f78f590b6f3 Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 4 Jul 2025 14:22:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E7=AC=AC=E4=B8=89=E6=96=B9=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/jsowell/service/TempService.java | 11 +++++++++-- .../thirdparty/common/NotificationService.java | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/jsowell-admin/src/main/java/com/jsowell/service/TempService.java b/jsowell-admin/src/main/java/com/jsowell/service/TempService.java index e6f79d192..918271e51 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/TempService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/TempService.java @@ -40,6 +40,8 @@ import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO; import com.jsowell.pile.vo.web.*; import com.jsowell.thirdparty.common.CommonService; +import com.jsowell.thirdparty.common.NotificationDTO; +import com.jsowell.thirdparty.common.NotificationService; import com.jsowell.thirdparty.platform.dto.PushOrderDTO; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; import org.apache.commons.collections4.CollectionUtils; @@ -131,7 +133,7 @@ public class TempService { private ThirdPartyStationRelationService thirdPartyStationRelationService; @Autowired - private CommonService commonService; + private NotificationService notificationService; /** * 计算订单耗电量 @@ -1248,9 +1250,14 @@ public class TempService { if (CollectionUtils.isEmpty(orderInfos)) { return; } + NotificationDTO notificationDTO = new NotificationDTO(); orderInfos.forEach(orderBasicInfo -> { // 推送第三方平台 - commonService.commonPushOrderInfoV2(orderBasicInfo); + notificationDTO.setOrderCode(orderBasicInfo.getOrderCode()); + notificationDTO.setStationId(orderBasicInfo.getStationId()); + notificationDTO.setPlatformType(dto.getThirdPartyType()); + + notificationService.notificationChargeOrderInfoHistory(notificationDTO); }); } } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/NotificationService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/NotificationService.java index 5aa7fa97b..ab602b598 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/NotificationService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/NotificationService.java @@ -11,11 +11,15 @@ import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; import org.apache.commons.collections4.CollectionUtils; +import org.bouncycastle.crypto.CryptoException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.spec.InvalidKeySpecException; import java.util.List; /** @@ -338,9 +342,15 @@ public class NotificationService { // 如果dto中的platformType不为空,并且不等于secretInfoVO.getPlatformType(),continue continue; } + // 根据平台类型获取Service + ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType()); + try { + platformService.notificationChargeOrderInfo(orderCode); + } catch (Exception e) { + logger.error("历史充电订单信息推送 error", e); + } + try { - // 根据平台类型获取Service - ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType()); platformService.notificationChargeOrderInfoHistory(orderCode); } catch (Exception e) { logger.error("历史充电订单信息推送error", e);