From 30d88aa5e38dab5eeae3c9e655cce45b568cf30d Mon Sep 17 00:00:00 2001 From: xiaoguangbin Date: Thu, 7 Nov 2024 09:28:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=8F=B0?= =?UTF-8?q?=E7=AB=99=E7=AE=A1=E7=90=86=20=E8=87=AA=E5=BB=BA=E5=8F=B0?= =?UTF-8?q?=E7=AB=99=E7=B1=BB=E5=9E=8B=E6=B2=A1=E6=9C=89=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/jeecg/common/StationTypeUtil.java | 7 ++----- .../java/org/jeecg/modules/entity/data/StationType.java | 2 ++ .../modules/service/impl/StationOperationServiceImpl.java | 7 +++++-- 3 files changed, 9 insertions(+), 7 deletions(-) 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)){