|
|
@@ -110,7 +110,15 @@ public class RiskStrategyContext {
|
|
|
log.info("visitor[{}] last check success time < {} h", dyzUser.getUserId(), loginCheckValidityPeriod);
|
|
|
} else {
|
|
|
List<String> templateCodes = Arrays.asList("344", "345");
|
|
|
- List<RiskTemplateView> risks = configMapper.getEnableRiskTemplateBtCodes(dyzUser.getAppId(), templateCodes);
|
|
|
+ List<RiskTemplateView> risks = configMapper.getEnableRiskTemplateByCodes(dyzUser.getAppId(), templateCodes);
|
|
|
+ // 兼容旧包逻辑
|
|
|
+ if (CollUtil.isEmpty(risks)) {
|
|
|
+ templateCodes = Arrays.asList(
|
|
|
+ StrUtil.format("{}-344",dyzUser.getAppId()),
|
|
|
+ StrUtil.format("{}-345",dyzUser.getAppId())
|
|
|
+ );
|
|
|
+ risks = configMapper.getEnableRiskByCodes(templateCodes);
|
|
|
+ }
|
|
|
riskCheck(dyzUser, params, risks);
|
|
|
redisService.setTimeOutHoursStr(cacheKey, "ok", loginCheckValidityPeriod);
|
|
|
}
|
|
|
@@ -125,7 +133,7 @@ public class RiskStrategyContext {
|
|
|
validate(new RiskTemplateVo(risk322View), dyzUser, params);
|
|
|
}
|
|
|
List<String> templateCodes = Arrays.asList("334", "335");
|
|
|
- List<RiskTemplateView> risks = configMapper.getEnableRiskTemplateBtCodes(dyzUser.getAppId(), templateCodes);
|
|
|
+ List<RiskTemplateView> risks = configMapper.getEnableRiskTemplateByCodes(dyzUser.getAppId(), templateCodes);
|
|
|
riskCheck(dyzUser, params, risks);
|
|
|
}
|
|
|
|
|
|
@@ -143,7 +151,7 @@ public class RiskStrategyContext {
|
|
|
List<String> templateCodes = strategyMap.values().stream()
|
|
|
.filter(strategy -> AbstractRiskStrategy.RISK_TIMING_AD.equals(strategy.getRiskTiming()))
|
|
|
.map(RiskStrategy::getRiskCode).collect(Collectors.toList());
|
|
|
- List<RiskTemplateView> risks = configMapper.getEnableRiskTemplateBtCodes(dyzUser.getAppId(), templateCodes);
|
|
|
+ List<RiskTemplateView> risks = configMapper.getEnableRiskTemplateByCodes(dyzUser.getAppId(), templateCodes);
|
|
|
riskCheck(dyzUser, params, risks);
|
|
|
}
|
|
|
|
|
|
@@ -189,13 +197,18 @@ public class RiskStrategyContext {
|
|
|
String riskCode = templateVo.getRiskCode();
|
|
|
YtApp ytApp = appMapper.selectRiskApp(dyzUser.getAppId());
|
|
|
if (ytApp == null) {
|
|
|
- log.warn(StrUtil.format("[RiskStrategyContext]校验应用查询不存在:appId: {} userId: {}",
|
|
|
+ log.warn(StrUtil.format("[RiskStrategyContext]查询应用不存在,可能来自旧包请求:appId: {} userId: {}",
|
|
|
dyzUser.getAppId(), dyzUser.getUserId()));
|
|
|
}
|
|
|
YtPlatformUserApp userApp = ytApp == null ? null : appMapper.selectParentApp(ytApp.getSuperiorId());
|
|
|
- if (ytApp != null && userApp == null) {
|
|
|
- log.warn(StrUtil.format("[RiskStrategyContext]校验母包应用查询不存在:superiorId:{} appId: {} userId: {}",
|
|
|
- ytApp.getSuperiorId(), dyzUser.getAppId(), dyzUser.getUserId()));
|
|
|
+ // 兼容旧包
|
|
|
+ if (userApp == null && StrUtil.isNotEmpty(dyzUser.getAppId())) {
|
|
|
+ userApp = appMapper.selectParentApp(dyzUser.getAppId());
|
|
|
+ }
|
|
|
+ if (userApp == null) {
|
|
|
+ String superiorId = ytApp == null ? "" : ytApp.getSuperiorId();
|
|
|
+ log.warn(StrUtil.format("[RiskStrategyContext]查询母包应用不存在:superiorId:{} appId: {} userId: {}",
|
|
|
+ superiorId, dyzUser.getAppId(), dyzUser.getUserId()));
|
|
|
}
|
|
|
params.put("app", ytApp);
|
|
|
params.put("platformUserApp", userApp);
|