From c9cf6dcb7bd839f16e33ba88d394ca424d303659 Mon Sep 17 00:00:00 2001 From: huangfeng Date: Wed, 23 Apr 2025 17:19:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3hour=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xymanager_common/dto/ScheduleDetailsDto.java | 2 ++ .../com/shxy/xymanager_common/model/StatChannel.java | 4 +--- .../com/shxy/xymanager_common/model/StatPreset.java | 12 +++++++----- .../com/shxy/xymanager_common/model/StatTerm.java | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/ScheduleDetailsDto.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/ScheduleDetailsDto.java index c552b99..2caa9bb 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/ScheduleDetailsDto.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/ScheduleDetailsDto.java @@ -1,9 +1,11 @@ package com.shxy.xymanager_common.dto; +import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; import java.io.Serializable; +@JsonInclude(JsonInclude.Include.NON_NULL) @Data public class ScheduleDetailsDto implements Serializable { private Integer id; diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatChannel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatChannel.java index a31c264..cb19eae 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatChannel.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatChannel.java @@ -12,7 +12,6 @@ public class StatChannel { Integer channelId; List presets = new ArrayList<>(); List hourList; - List scheduleList; public void addPhoto(TerminalPhotoSelectListModel.PhotoBean photo) { StatPreset the = null; @@ -24,10 +23,10 @@ public class StatChannel { } if (the == null) { the = new StatPreset(); - the.init(hourList); the.setPresetId(photo.getPresetId()); presets.add(the); } + the.init(hourList); the.addPhoto(photo); } @@ -51,7 +50,6 @@ public class StatChannel { if (CollectionUtils.isEmpty(list)) { return; } - scheduleList = list; for (ScheduleDetailsDto detail : list) { StatPreset the = null; for (StatPreset item : presets) { diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatPreset.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatPreset.java index 02ab6e9..66df973 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatPreset.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatPreset.java @@ -14,11 +14,13 @@ public class StatPreset { List scheduleList = new ArrayList<>(); public void init(List hourList) { - for (String str : hourList) { - StatHour hour = new StatHour(); - hour.setHour(str); - hour.setBase(2); - hours.add(hour); + if (hours.size() == 0) { + for (String str : hourList) { + StatHour hour = new StatHour(); + hour.setHour(str); + hour.setBase(2); + hours.add(hour); + } } } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatTerm.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatTerm.java index d818ffb..ac09cbd 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatTerm.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/StatTerm.java @@ -28,10 +28,10 @@ public class StatTerm { } if (the == null) { the = new StatChannel(); - the.setHourList(hourList); the.setChannelId(photo.getChannelid()); channels.add(the); } + the.setHourList(hourList); the.addPhoto(photo); }