update 对接内蒙古平台

This commit is contained in:
2024-04-19 14:38:51 +08:00
parent 7e41f69f5a
commit 8e9d7cb457

View File

@@ -192,8 +192,9 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
// 未查到数据
return null;
}
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
if (configInfo == null) {
// ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType);
if (thirdPartySecretInfoVO == null) {
return null;
}
PageInfo<ThirdPartyStationInfoVO> pageInfo = new PageInfo<>(stationInfos);
@@ -244,7 +245,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
map.put("PageCount", pageInfo.getPages());
map.put("ItemSize", resultList.size());
map.put("StationInfos", resultList);
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, configInfo);
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
return resultMap;
}
@@ -259,8 +260,9 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
List<String> stationIds = dto.getStationIds();
List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
List<Object> connectorStatusInfos = new ArrayList<>();
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
if (configInfo == null) {
// ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType);
if (thirdPartySecretInfoVO == null) {
return null;
}
ConnectorStatusInfo connectorStatusInfo;
@@ -322,7 +324,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
map.put("Total", total);
map.put("StationStatusInfos", collect);
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, configInfo);
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
return resultMap;
}
@@ -473,6 +475,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
String data = map.get("Data");
// 解密data (此处解密需用 thirdparty_platform_config 的密钥配置)
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorIdByType);
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType);
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data),
configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes());
String dataStr = new String(plainText, StandardCharsets.UTF_8);