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()); }