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