From 8e9d7cb457de22e52d607bdcb48f5dc2cf4d5f20 Mon Sep 17 00:00:00 2001 From: Guoqs Date: Fri, 19 Apr 2024 14:38:51 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=AF=B9=E6=8E=A5=E5=86=85=E8=92=99?= =?UTF-8?q?=E5=8F=A4=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/NeiMengGuPlatformServiceImpl.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformServiceImpl.java index dd2d2ceca..77704bae7 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformServiceImpl.java @@ -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 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 resultMap = ThirdPartyPlatformUtils.generateResultMap(map, configInfo); + Map resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO); return resultMap; } @@ -259,8 +260,9 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { List stationIds = dto.getStationIds(); List StationStatusInfos = new ArrayList<>(); List 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 resultMap = ThirdPartyPlatformUtils.generateResultMap(map, configInfo); + Map 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);