新增 苏州市平台相关Service、controller

This commit is contained in:
Lemon
2024-09-24 09:49:47 +08:00
parent 637ffc0946
commit 407b9586fd
8 changed files with 725 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ public class NotificationService {
* 充电站信息变化推送
* notification_stationInfo
*/
public void notificationStationInfo(NotificationDTO dto) {
public String notificationStationInfo(NotificationDTO dto) {
String stationId = dto.getStationId();
String platformType = dto.getPlatformType();
@@ -43,9 +43,10 @@ public class NotificationService {
// 通过stationId 查询该站点需要对接的平台配置
List<ThirdPartySecretInfoVO> secretInfoVOS = thirdpartySecretInfoService.queryStationToPlatformList(stationId);
if (CollectionUtils.isEmpty(secretInfoVOS)) {
return;
return null;
}
// 调用相应平台的处理方法
StringBuilder result = new StringBuilder();
for (ThirdPartySecretInfoVO secretInfoVO : secretInfoVOS) {
if (StringUtils.isNotBlank(platformType) && !StringUtils.equals(platformType, secretInfoVO.getPlatformType())) {
// 如果dto中的platformType不为空并且不等于secretInfoVO.getPlatformType()continue
@@ -53,11 +54,13 @@ public class NotificationService {
}
try {
ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType());
platformService.notificationStationInfo(stationId);
String postResult = platformService.notificationStationInfo(stationId);
result.append(postResult).append("\n");
} catch (Exception e) {
logger.error("充电站信息变化推送error", e);
}
}
return result.toString();
}
/**