From 81c9ceb2aab6bb5cb5bd4077bb90bfaf0d0f4f95 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Wed, 20 Apr 2022 11:10:13 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8C=87=E7=A4=BA=E7=81=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=91=E6=9F=A5=E8=AF=A2=E5=88=97=E8=A1=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: weizhihong --- .../club/joylink/rtss/entity/IndicatorSection.java | 11 +++++++++++ .../rtss/services/AssistButtonIndicatorService.java | 1 + 2 files changed, 12 insertions(+) diff --git a/src/main/java/club/joylink/rtss/entity/IndicatorSection.java b/src/main/java/club/joylink/rtss/entity/IndicatorSection.java index ea6951222..fc90034c7 100644 --- a/src/main/java/club/joylink/rtss/entity/IndicatorSection.java +++ b/src/main/java/club/joylink/rtss/entity/IndicatorSection.java @@ -4,8 +4,11 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Getter; import lombok.Setter; +import org.springframework.util.StringUtils; import javax.validation.constraints.NotBlank; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -58,4 +61,12 @@ public class IndicatorSection { * 进路Code */ private String routeCode; + + public void generateSectionList() { + if (StringUtils.isEmpty(sectionsCode)) { + sectionList = new ArrayList<>(0); + } else { + sectionList = Arrays.asList(sectionsCode.split(",")); + } + } } diff --git a/src/main/java/club/joylink/rtss/services/AssistButtonIndicatorService.java b/src/main/java/club/joylink/rtss/services/AssistButtonIndicatorService.java index 6927e0665..59c4cf2ab 100644 --- a/src/main/java/club/joylink/rtss/services/AssistButtonIndicatorService.java +++ b/src/main/java/club/joylink/rtss/services/AssistButtonIndicatorService.java @@ -44,6 +44,7 @@ public class AssistButtonIndicatorService implements IAssistButtonIndicatorServi criteria.andRouteCodeEqualTo(routeCode); } Page page = (Page) assistIndicatorDAO.selectByExample(indicatorSectionExample); + page.getResult().forEach(IndicatorSection::generateSectionList); return PageVO.convert(page, page.getResult()); }