新增 新运微平台Controller

This commit is contained in:
Lemon
2025-01-11 16:06:25 +08:00
parent 841ae04fba
commit a094a866d0
3 changed files with 202 additions and 11 deletions

View File

@@ -60,7 +60,7 @@ import java.util.stream.Collectors;
* @Date 2025/1/10 8:28:43
*/
@Service
public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
public class XinYunWeiPlatformServiceImpl implements ThirdPartyPlatformService {
@Autowired
private PileStationInfoService pileStationInfoService;
@@ -80,7 +80,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
private RedisCache redisCache;
// 平台类型
private final String thirdPlatformType = ThirdPlatformTypeEnum.XIN_YUN_PLATFORM.getTypeCode();
private final String thirdPlatformType = ThirdPlatformTypeEnum.XIN_YUN_WEI_PLATFORM.getTypeCode();
@Override
public void afterPropertiesSet() throws Exception {
@@ -104,7 +104,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
// token缓存key值
String redisKey = operatorId + "_token:";
// 通过operatorId 查出 operatorSecret
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo();
if (thirdPartySecretInfoVO == null) {
failReason = 1;
succStat = 1;
@@ -164,7 +164,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
return null;
}
// ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo();
PageInfo<ThirdPartyStationInfoVO> pageInfo = new PageInfo<>(stationInfos);
List<SupStationInfo> resultList = new ArrayList<>();
for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) {
@@ -231,7 +231,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
List<String> stationIds = dto.getStationIds();
List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
List<Object> ConnectorStatusInfos = new ArrayList<>();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo();
ConnectorStatusInfo connectorStatusInfo;
for (String stationId : stationIds) {
@@ -299,7 +299,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
*/
@Override
public Map<String, String> queryStationStats(QueryStationInfoDTO dto) {
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo();
// 根据站点id 查出这段时间的充电量
List<AccumulativeInfoVO> list = orderBasicInfoService.getAccumulativeInfoForLianLian(dto);
if (CollectionUtils.isEmpty(list)) {
@@ -390,7 +390,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
if (orderInfo == null) {
return null;
}
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo();
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode());
// 通过订单号查询实时数据
List<RealTimeMonitorData> realTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
@@ -454,7 +454,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
*/
@Override
public String notificationStationStatus(String stationId, String pileConnectorCode, String status, ThirdPartySecretInfoVO secretInfoVO) {
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo();
String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
@@ -512,7 +512,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
BigDecimal voltage = realTimeMonitorData.getOutputVoltage() == null ? BigDecimal.ZERO : new BigDecimal(realTimeMonitorData.getOutputVoltage());
String soc = realTimeMonitorData.getSOC() == null ? Constants.ZERO : realTimeMonitorData.getSOC();
// 查询相关配置信息
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunPlatformSecretInfo();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getXinYunWeiPlatformSecretInfo();
String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
@@ -621,7 +621,7 @@ public class XinYunPlatformServiceImpl implements ThirdPartyPlatformService {
*
* @return
*/
private ThirdPartySecretInfoVO getXinYunPlatformSecretInfo() {
private ThirdPartySecretInfoVO getXinYunWeiPlatformSecretInfo() {
// 通过第三方平台类型查询相关配置信息
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType);
if (thirdPartySecretInfoVO == null) {