This commit is contained in:
YAS\29473
2025-08-15 08:58:09 +08:00
parent 0d36d79f34
commit 8f7dbf56e0
2 changed files with 75 additions and 78 deletions

View File

@@ -231,42 +231,54 @@ public class JsowellTask {
*/ */
public void pushStationRealTimePowerInfo() { public void pushStationRealTimePowerInfo() {
String env = SpringUtils.getActiveProfile(); String env = SpringUtils.getActiveProfile();
if (StringUtils.equalsIgnoreCase(env, "pre")) { if (StringUtils.equalsIgnoreCase(env, "prd")) {
log.debug("PRE环境不执行"); log.debug("PRE环境不执行");
return; return;
} }
// 查询出要推送的站点(贵州、) // 查询出要推送的站点(贵州、)
String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(); try {
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType); String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode();
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType);
List<String> stationIdList = stationInfoVOS.stream() List<String> stationIdList = stationInfoVOS.stream()
.map(StationInfoVO::getStationId) .map(StationInfoVO::getStationId)
.collect(Collectors.toList()); .collect(Collectors.toList());
GuiZhouPlatformServiceImpl guiZhouPlatformService = new GuiZhouPlatformServiceImpl(); GuiZhouPlatformServiceImpl guiZhouPlatformService = new GuiZhouPlatformServiceImpl();
guiZhouPlatformService.notificationPowerInfo(stationIdList); guiZhouPlatformService.notificationPowerInfo(stationIdList);
} catch (Exception e) {
log.error("贵州省平台推送充电站实时功率失败", e);
}
//四川省平台推送充电站实时功率 //四川省平台推送充电站实时功率
String thirdPartyType2 = ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(); try {
List<StationInfoVO> stationInfoVOS2 = thirdPartyStationRelationService.selectStationList(thirdPartyType2); String thirdPartyType2 = ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode();
List<StationInfoVO> stationInfoVOS2 = thirdPartyStationRelationService.selectStationList(thirdPartyType2);
List<String> stationIdList2 = stationInfoVOS2.stream() List<String> stationIdList2 = stationInfoVOS2.stream()
.map(StationInfoVO::getStationId) .map(StationInfoVO::getStationId)
.collect(Collectors.toList()); .collect(Collectors.toList());
SiChuanPlatformServiceImpl sichuanPlatformService = new SiChuanPlatformServiceImpl(); SiChuanPlatformServiceImpl sichuanPlatformService = new SiChuanPlatformServiceImpl();
sichuanPlatformService.notificationPowerInfo(stationIdList2); sichuanPlatformService.notificationPowerInfo(stationIdList2);
} catch (Exception e) {
log.error("四川省平台推送充电站实时功率失败", e);
}
// 吉林省平台推送充电站实时功率 // 吉林省平台推送充电站实时功率
String thirdPartyType3 = ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(); try {
List<StationInfoVO> stationInfoVOS3 = thirdPartyStationRelationService.selectStationList(thirdPartyType3); String thirdPartyType3 = ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode();
List<StationInfoVO> stationInfoVOS3 = thirdPartyStationRelationService.selectStationList(thirdPartyType3);
List<String> stationIdList3 = stationInfoVOS3.stream() List<String> stationIdList3 = stationInfoVOS3.stream()
.map(StationInfoVO::getStationId) .map(StationInfoVO::getStationId)
.collect(Collectors.toList()); .collect(Collectors.toList());
JiLinPlatformServiceImpl jiLinPlatformService = new JiLinPlatformServiceImpl(); JiLinPlatformServiceImpl jiLinPlatformService = new JiLinPlatformServiceImpl();
jiLinPlatformService.notificationPowerInfo(stationIdList3); jiLinPlatformService.notificationPowerInfo(stationIdList3);
} catch (Exception e) {
log.error("吉林省平台推送充电站实时功率失败", e);
}
} }
@@ -276,72 +288,57 @@ public class JsowellTask {
*/ */
public void pushStatisticsInfo() { public void pushStatisticsInfo() {
String env = SpringUtils.getActiveProfile(); String env = SpringUtils.getActiveProfile();
if (StringUtils.equalsIgnoreCase(env, "pre")) { if (StringUtils.equalsIgnoreCase(env, "prd")) {
log.debug("PRE环境不执行"); log.debug("PRE环境不执行");
return; return;
} }
// 贵州推送充电站统计信息 // 贵州推送充电站统计信息
String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(); try {
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType); String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode();
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType);
List<String> stationIdList = stationInfoVOS.stream() List<String> stationIdList = stationInfoVOS.stream()
.map(StationInfoVO::getStationId) .map(StationInfoVO::getStationId)
.collect(Collectors.toList()); .collect(Collectors.toList());
GuiZhouPlatformServiceImpl guiZhouPlatformService = new GuiZhouPlatformServiceImpl(); GuiZhouPlatformServiceImpl guiZhouPlatformService = new GuiZhouPlatformServiceImpl();
for (String stationId : stationIdList) { for (String stationId : stationIdList) {
guiZhouPlatformService.notificationOperationStatsInfo(stationId); guiZhouPlatformService.notificationOperationStatsInfo(stationId);
}
} catch (Exception e) {
log.error("贵州省平台推送充电站统计信息失败", e);
} }
//四川省平台推送用能统计 //四川省平台推送用能统计
String thirdPartyType2 = ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(); try {
List<StationInfoVO> stationInfoVOS2 = thirdPartyStationRelationService.selectStationList(thirdPartyType2); String thirdPartyType2 = ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode();
List<StationInfoVO> stationInfoVOS2 = thirdPartyStationRelationService.selectStationList(thirdPartyType2);
List<String> stationIdList2 = stationInfoVOS2.stream() List<String> stationIdList2 = stationInfoVOS2.stream()
.map(StationInfoVO::getStationId) .map(StationInfoVO::getStationId)
.collect(Collectors.toList()); .collect(Collectors.toList());
SiChuanPlatformServiceImpl sichuanPlatformService = new SiChuanPlatformServiceImpl(); SiChuanPlatformServiceImpl sichuanPlatformService = new SiChuanPlatformServiceImpl();
for (String stationId : stationIdList2) { for (String stationId : stationIdList2) {
sichuanPlatformService.notificationOperationStatsInfo(stationId); sichuanPlatformService.notificationOperationStatsInfo(stationId);
}
} catch (Exception e) {
log.error("四川省平台推送用能统计失败", e);
} }
// 吉林省平台推送充电站用能统计 // 吉林省平台推送充电站用能统计
String thirdPartyType3 = ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode();
List<StationInfoVO> stationInfoVOS3 = thirdPartyStationRelationService.selectStationList(thirdPartyType3);
List<String> stationIdList3 = stationInfoVOS3.stream()
.map(StationInfoVO::getStationId)
.collect(Collectors.toList());
JiLinPlatformServiceImpl jiLinPlatformService = new JiLinPlatformServiceImpl();
for (String stationId : stationIdList3) {
jiLinPlatformService.notificationOperationStatsInfo(stationId);
}
}
/**
* 定时任务,实时站点功率推送
*/
public void realTimePowerPush() {
/* String env = SpringUtils.getActiveProfile();
if (StringUtils.equalsIgnoreCase(env, "pre")) {
log.debug("PRE环境不执行");
return;
}*/
String thirdPartyType = ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode();
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType);
// 获取站点列表
List<String> stationIdList = stationInfoVOS.stream()
.map(StationInfoVO::getStationId)
.collect(Collectors.toList());
JiLinPlatformServiceImpl jilinPlatformService = new JiLinPlatformServiceImpl();
try { try {
jilinPlatformService.notificationPowerInfo(stationIdList); String thirdPartyType3 = ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode();
}catch (Exception e){ List<StationInfoVO> stationInfoVOS3 = thirdPartyStationRelationService.selectStationList(thirdPartyType3);
log.error("实时站点功率推送失败", e);
List<String> stationIdList3 = stationInfoVOS3.stream()
.map(StationInfoVO::getStationId)
.collect(Collectors.toList());
JiLinPlatformServiceImpl jiLinPlatformService = new JiLinPlatformServiceImpl();
for (String stationId : stationIdList3) {
jiLinPlatformService.notificationOperationStatsInfo(stationId);
}
} catch (Exception e) {
log.error("吉林省平台推送充电站用能统计失败", e);
} }
} }

View File

@@ -345,7 +345,7 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
*/ */
@Override @Override
public String notificationStationInfo(String stationId) { public String notificationStationInfo(String stationId) {
List<SupStationInfoDTO1> stationInfos = new ArrayList<>(); // List<SupStationInfoDTO1> stationInfos = new ArrayList<>();
// 通过id查询站点相关信息 // 通过id查询站点相关信息
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId)); PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId));
// 查询相关配置信息 // 查询相关配置信息
@@ -457,7 +457,7 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
if (CollectionUtils.isNotEmpty(pileList)) { if (CollectionUtils.isNotEmpty(pileList)) {
info.setEquipmentInfosDTO(pileList); // 充电设备信息列表 info.setEquipmentInfosDTO(pileList); // 充电设备信息列表
} }
stationInfos.add(info); // stationInfos.add(info);
// 调用中电联平台接口 // 调用中电联平台接口
String url = urlAddress + "notification_station_info"; String url = urlAddress + "notification_station_info";
@@ -465,7 +465,7 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
/* JSONObject data = new JSONObject(); /* JSONObject data = new JSONObject();
data.put("StationInfo", stationInfos);*/ data.put("StationInfo", stationInfos);*/
String jsonString = JSON.toJSONString(stationInfos); String jsonString = JSON.toJSONString(info);
// 获取令牌 // 获取令牌
@@ -1496,7 +1496,7 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
supStationPowerInfo.setDataTime(dateTimeNow); supStationPowerInfo.setDataTime(dateTimeNow);
supStationPowerInfo.setStationRealTimePower(stationPower); supStationPowerInfo.setStationRealTimePower(stationPower);
log.info("站点{}查询实时功率信息", stationId);
// 根据站点id查询桩信息 // 根据站点id查询桩信息
List<PileBasicInfo> pileList = pileBasicInfoService.getPileListByStationId(stationId); List<PileBasicInfo> pileList = pileBasicInfoService.getPileListByStationId(stationId);
if (CollectionUtils.isEmpty(pileList)) { if (CollectionUtils.isEmpty(pileList)) {