test: 补充流水标签参数解析日志

This commit is contained in:
wkc
2026-03-17 15:01:42 +08:00
parent e94e5398eb
commit 56d4fe5b84
2 changed files with 56 additions and 0 deletions

View File

@@ -14,10 +14,13 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/**
* 流水标签规则执行参数解析器
*/
@Slf4j
@Component
public class BankTagRuleConfigResolver {
@@ -61,11 +64,23 @@ public class BankTagRuleConfigResolver {
Map<String, String> thresholdValues = new LinkedHashMap<>();
Set<String> requiredParamCodes = RULE_PARAM_MAPPING.getOrDefault(ruleMeta.getRuleCode(), Set.of());
log.info("【流水标签】解析规则参数: projectId={}, effectiveProjectId={}, ruleCode={}, requiredParams={}",
projectId, effectiveProjectId, ruleMeta.getRuleCode(), requiredParamCodes);
for (CcdiModelParam param : params) {
if (requiredParamCodes.contains(param.getParamCode())) {
thresholdValues.put(param.getParamCode(), param.getParamValue());
}
}
log.debug("【流水标签】规则参数解析结果: projectId={}, ruleCode={}, thresholdValues={}",
projectId, ruleMeta.getRuleCode(), thresholdValues);
Set<String> missingParamCodes = requiredParamCodes.stream()
.filter(code -> !thresholdValues.containsKey(code))
.collect(Collectors.toSet());
if (!missingParamCodes.isEmpty()) {
log.warn("【流水标签】规则参数缺失: projectId={}, ruleCode={}, missingParams={}",
projectId, ruleMeta.getRuleCode(), missingParamCodes);
}
BankTagRuleExecutionConfig config = new BankTagRuleExecutionConfig();
config.setProjectId(projectId);