新增 青海平台推送站点实时功率接口

This commit is contained in:
Lemon
2024-04-19 11:15:48 +08:00
parent c76cbf3c07
commit 9cf000a2d9
4 changed files with 190 additions and 14 deletions

View File

@@ -179,10 +179,11 @@ public class CommonService {
// 海南
result = haiNanChargeService.pushStationInfoV2(dto);
}
// if (StringUtils.equals(ThirdPlatformTypeEnum.QING_HAI_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// // 青海平台
// qingHaiPlatformService.
// }
if (StringUtils.equals(ThirdPlatformTypeEnum.QING_HAI_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 青海平台
insertInfo2DataBase(dto);
result = dto.getThirdPartyType() + "" + "OK";
}
finalResult.append(result).append("\n");
}
return finalResult.toString();
@@ -319,8 +320,24 @@ public class CommonService {
if (StringUtils.equals(ThirdPlatformTypeEnum.QING_HAI_PLATFORM.getTypeCode(), thirdPartyType)) {
// 青海省平台
String result = qingHaiPlatformService.notificationStationStatus(pileConnectorCode, changedStatus);
log.info("推送甬城泊车平台设备状态变化推送 pileConnectorCode:{}, changedStatus:{}, result:{}"
log.info("推送青海平台设备状态变化推送 pileConnectorCode:{}, changedStatus:{}, result:{}"
, pileConnectorCode, changedStatus, result);
// 先判断缓存中是否有数据
String redisKey = CacheConstants.JIANGSU_PUSH_PILE_STATUS + pileConnectorCode;
Object cacheObject = redisCache.getCacheObject(redisKey);
if (StringUtils.equals(connectorStatus, "03")) {
// 充电状态, 查出订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
if (orderInfo == null) {
return;
}
// 如果缓存有数据证明上次推送未超过2分钟不予推送若缓存中无数据说明需要推送
if (cacheObject == null) {
String pushResult = qingHaiPlatformService.notificationEquipChargeStatus(orderInfo.getOrderCode());
redisCache.setCacheObject(redisKey, realTimeMonitorData, 2, TimeUnit.MINUTES);
}
}
}
}
@@ -394,6 +411,10 @@ public class CommonService {
// log.info("甬城泊车平台 推送充电订单信息 result:{}", result);
}
}
if (StringUtils.equals(ThirdPlatformTypeEnum.QING_HAI_PLATFORM.getTypeCode(), thirdPartyType)) {
// 青海平台
qingHaiPlatformService.notificationChargeOrderInfo(orderBasicInfo.getOrderCode());
}
}
}