|
@@ -592,11 +592,20 @@ public class InstitutionService {
|
|
|
rule.setTenantId(tenantId);
|
|
rule.setTenantId(tenantId);
|
|
|
rule.setSingleLimit(singleLimitVal);
|
|
rule.setSingleLimit(singleLimitVal);
|
|
|
|
|
|
|
|
- // 序列化 condition_info 为 JSON
|
|
|
|
|
|
|
+ // 序列化 condition_info 为扁平 Map(与 RuleService.toVO 格式一致)
|
|
|
if (conditionList != null) {
|
|
if (conditionList != null) {
|
|
|
try {
|
|
try {
|
|
|
|
|
+ Map<String, Object> flat = new LinkedHashMap<>();
|
|
|
|
|
+ for (Map<String, Object> c : conditionList) {
|
|
|
|
|
+ String factor = (String) c.get("rule_factor");
|
|
|
|
|
+ if ("QUOTA_TOTAL".equals(factor)) {
|
|
|
|
|
+ flat.put("max_amount", c.get("rule_value"));
|
|
|
|
|
+ } else if (factor != null) {
|
|
|
|
|
+ flat.put(factor.toLowerCase(), c.get("rule_value"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
rule.setConditionInfo(
|
|
rule.setConditionInfo(
|
|
|
- new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(conditionList));
|
|
|
|
|
|
|
+ new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(flat));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.warn("保存使用规则 - 序列化 conditionInfo 失败: {}", e.getMessage());
|
|
log.warn("保存使用规则 - 序列化 conditionInfo 失败: {}", e.getMessage());
|
|
|
}
|
|
}
|