mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-03 21:48:13 +08:00
update
This commit is contained in:
@@ -123,7 +123,7 @@ public class XinDiantuPlatfromServiceImpl implements ThirdPartyPlatformService {
|
|||||||
// 0:无;1:无此对接平台;2:密钥错误; 3~99:自定义
|
// 0:无;1:无此对接平台;2:密钥错误; 3~99:自定义
|
||||||
int failReason = 0;
|
int failReason = 0;
|
||||||
|
|
||||||
String operatorId = dto.getPlatformID();
|
String operatorId = StringUtils.isNotBlank(dto.getOperatorID()) ? dto.getOperatorID() : dto.getPlatformID();
|
||||||
// 通过operatorId 查出 operatorSecret
|
// 通过operatorId 查出 operatorSecret
|
||||||
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
|
||||||
if (thirdPartySecretInfoVO == null) {
|
if (thirdPartySecretInfoVO == null) {
|
||||||
@@ -137,10 +137,14 @@ public class XinDiantuPlatfromServiceImpl implements ThirdPartyPlatformService {
|
|||||||
String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv);
|
String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv);
|
||||||
String inputOperatorSecret = null;
|
String inputOperatorSecret = null;
|
||||||
if (StringUtils.isNotBlank(decrypt)) {
|
if (StringUtils.isNotBlank(decrypt)) {
|
||||||
|
inputOperatorSecret = JSON.parseObject(decrypt).getString("OperatorSecret");
|
||||||
|
if (StringUtils.isBlank(inputOperatorSecret)) {
|
||||||
inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret");
|
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;
|
failReason = 1;
|
||||||
succStat = 1;
|
succStat = 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -155,8 +159,7 @@ public class XinDiantuPlatfromServiceImpl implements ThirdPartyPlatformService {
|
|||||||
vo.setFailReason(failReason);
|
vo.setFailReason(failReason);
|
||||||
vo.setSuccStat(succStat);
|
vo.setSuccStat(succStat);
|
||||||
|
|
||||||
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(vo, thirdPartySecretInfoVO);
|
return ThirdPartyPlatformUtils.generateResultMap(vo, thirdPartySecretInfoVO);
|
||||||
return resultMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user