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

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

View File

@@ -17,10 +17,7 @@ import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
import com.jsowell.thirdparty.lianlian.vo.LianLianResultVO;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.*;
/**
* 第三方平台对接需要的api集合
@@ -328,6 +325,15 @@ public interface ThirdPartyPlatformService {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充换电站实时功率
* @param stationIds
* @return
*/
default String notificationPowerInfo(List<String> stationIds) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
// -------------------------------------- 以下是公用方法 --------------------------------------- //
/**
* 从联联平台获取令牌
@@ -458,4 +464,5 @@ public interface ThirdPartyPlatformService {
return StringUtils.equals(sig, sign);
}
}

View File

@@ -18,10 +18,7 @@ import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.PageUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.*;
import com.jsowell.pile.dto.QueryConnectorListDTO;
import com.jsowell.pile.dto.QueryEquipChargeStatusDTO;
import com.jsowell.pile.dto.QueryStartChargeDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.service.*;
import com.jsowell.pile.thirdparty.ZDLEquipmentInfo;
import com.jsowell.pile.thirdparty.ZDLStationInfo;
@@ -96,7 +93,7 @@ public class QingHaiPlatformServiceImpl implements ThirdPartyPlatformService {
// 平台类型
private final String platformType = ThirdPlatformTypeEnum.QING_HAI_PLATFORM.getTypeCode();
/**
* 查询站点信息 query_stations_info