This commit is contained in:
YAS\29473
2025-09-28 17:09:17 +08:00
parent e25a230058
commit 9d9586d71a

View File

@@ -123,7 +123,7 @@ public class XinDiantuPlatfromServiceImpl implements ThirdPartyPlatformService {
// 0:无1:无此对接平台2:密钥错误; 399:自定义
int failReason = 0;
String operatorId = dto.getPlatformID();
String operatorId = StringUtils.isNotBlank(dto.getOperatorID()) ? dto.getOperatorID() : dto.getPlatformID();
// 通过operatorId 查出 operatorSecret
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
if (thirdPartySecretInfoVO == null) {
@@ -137,10 +137,14 @@ public class XinDiantuPlatfromServiceImpl implements ThirdPartyPlatformService {
String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv);
String inputOperatorSecret = null;
if (StringUtils.isNotBlank(decrypt)) {
inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret");
inputOperatorSecret = JSON.parseObject(decrypt).getString("OperatorSecret");
if (StringUtils.isBlank(inputOperatorSecret)) {
inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret");
}
}
// 对比密钥
if (!StringUtils.equals(theirOperatorSecret, inputOperatorSecret)) {
List<String> operatorSecretList = Lists.newArrayList(theirOperatorSecret, thirdPartySecretInfoVO.getOurOperatorSecret());
if (!operatorSecretList.contains(inputOperatorSecret)) {
failReason = 1;
succStat = 1;
} else {
@@ -155,8 +159,7 @@ public class XinDiantuPlatfromServiceImpl implements ThirdPartyPlatformService {
vo.setFailReason(failReason);
vo.setSuccStat(succStat);
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(vo, thirdPartySecretInfoVO);
return resultMap;
return ThirdPartyPlatformUtils.generateResultMap(vo, thirdPartySecretInfoVO);
}
/**