yeg
2026-09-08 cee1a4e3bcd2eefea83d242fcfa89ba4fc6d5409
battery-business/src/main/java/com/battery/business/report/FormationReportRequest.java
@@ -20,7 +20,8 @@
    public record Settings(@NotNull @Size(min = 1, max = 100) List<@NotNull @Valid FormationField> fields,
            @NotNull Map<String, @NotNull String> values,
            @NotNull Map<String, @NotNull Integer> chargeStepSelections,
            List<@NotNull String> metrics, Map<String, @NotNull String> seriesColors)
            List<@NotNull String> metrics, Map<String, @NotNull String> seriesColors,
            Map<String, @Valid DetailOverride> sourceDetailOverrides)
    {
        /** 旧版缺少显隐设置时显示五类指标,不补造测量快照。 */
        public List<String> metrics() { return metrics == null ? List.of("voltage", "current", "positiveVoltage", "negativeVoltage", "temperature") : metrics; }
@@ -32,6 +33,13 @@
        public void rejectUnknown(String field, Object value) { throw new ServiceException("化成设置不允许提交属性:" + field); }
    }
    /** 人工详情覆盖与来源快照分开保存,空字符串是明确填写值。 */
    public record DetailOverride(@Size(max = 500) String experimentName, Map<String, @NotNull @Size(max = 500) String> fieldValues)
    {
        @JsonAnySetter
        public void rejectUnknown(String field, Object value) { throw new ServiceException("详情调整不允许提交属性:" + field); }
    }
    /** 编辑保持后端冻结来源范围,不接收替代来源或测量。 */
    public record Edit(@Positive int baseVersionNo, @NotBlank @Size(max = 100) String name,
            @Size(max = 2000) String description, @NotNull @Valid Settings settings,