新增 批量推送第三方平台订单接口

This commit is contained in:
Lemon
2025-07-04 14:22:37 +08:00
parent 9b966b43ae
commit c6028873fa
2 changed files with 21 additions and 4 deletions

View File

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

View File

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