mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 12:05:05 +08:00
update 浙江省平台接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.thirdparty.common;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
@@ -116,15 +117,19 @@ public class NotificationService {
|
||||
// 如果dto中的platformType不为空,并且不等于secretInfoVO.getPlatformType(),continue
|
||||
continue;
|
||||
}
|
||||
// 根据平台类型获取Service
|
||||
ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType());
|
||||
try {
|
||||
// 根据平台类型获取Service
|
||||
ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType());
|
||||
platformService.notificationConnectorChargeStatus(orderCode, secretInfoVO);
|
||||
|
||||
platformService.notificationEquipChargeStatus(orderCode);
|
||||
} catch (Exception e) {
|
||||
logger.error("设备充电中状态变化推送error:", e);
|
||||
}
|
||||
try {
|
||||
platformService.notificationEquipChargeStatus(orderCode);
|
||||
}catch (Exception e){
|
||||
logger.error("notification_equip_charge_status error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +165,34 @@ public class NotificationService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 站点功率信息推送
|
||||
* notification_orderInfo/notification_charge_order_info
|
||||
*/
|
||||
public void notificationStationPowerInfo(NotificationDTO dto) {
|
||||
String stationId = dto.getStationId();
|
||||
String platformType = dto.getPlatformType();
|
||||
// 通过stationId 查询该站点需要对接的平台配置
|
||||
List<ThirdPartySecretInfoVO> secretInfoVOS = thirdpartySecretInfoService.queryStationToPlatformList(stationId);
|
||||
if (CollectionUtils.isEmpty(secretInfoVOS)) {
|
||||
return;
|
||||
}
|
||||
// 调用相应平台的处理方法
|
||||
for (ThirdPartySecretInfoVO secretInfoVO : secretInfoVOS) {
|
||||
if (StringUtils.isNotBlank(platformType) && !StringUtils.equals(platformType, secretInfoVO.getPlatformType())) {
|
||||
// 如果dto中的platformType不为空,并且不等于secretInfoVO.getPlatformType(),continue
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
// 根据平台类型获取Service
|
||||
ThirdPartyPlatformService platformService = ThirdPartyPlatformFactory.getInvokeStrategy(secretInfoVO.getPlatformType());
|
||||
platformService.notificationPowerInfo(Lists.newArrayList(stationId));
|
||||
} catch (Exception e) {
|
||||
logger.error("站点功率信息推送error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 站点费率变化推送
|
||||
* notification_stationFee
|
||||
|
||||
Reference in New Issue
Block a user