diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/common/StationTypeUtil.java b/jeecg-module-station-operation/src/main/java/org/jeecg/common/StationTypeUtil.java index 3bf78d4e..58dfda9b 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/common/StationTypeUtil.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/common/StationTypeUtil.java @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; @Component @@ -26,11 +27,7 @@ public class StationTypeUtil { for (StationType stationType:stationTypeList) { if (StringUtils.isNotBlank(stationType.getMinId()) && StringUtils.isNotBlank(stationType.getMaxId())){ if (stationId>Integer.valueOf(stationType.getMinId()) && stationId<=Integer.valueOf(stationType.getMaxId())){ - if (category == 3) { - type = "Car"; - } else if (category == 4) { - type = "Ship"; - } else { + if (Objects.equals(category, stationType.getCategory())) { type = stationType.getName(); } } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/entity/data/StationType.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/entity/data/StationType.java index 15e5b842..231cd437 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/entity/data/StationType.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/entity/data/StationType.java @@ -19,6 +19,8 @@ public class StationType implements Serializable { private String maxId; + private Integer category; + private List types = new ArrayList<>(); } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java index 4d553fda..cbe350f0 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java @@ -60,6 +60,9 @@ public class StationOperationServiceImpl extends ServiceImpl stationTypes = stationType.getTypes().stream().map(StationType::getName).collect(Collectors.toList()); + if (stationTypes.contains(type)){ HashMap stationInfoMap = (HashMap) redisUtil.get("stationInfoMap"); GardsStations stations = stationInfoMap.get(stationId); if (Objects.nonNull(stations)){