test: 补充流水标签参数解析日志
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user