From 0b0856f6871bf313263ac2fc2eb22c28dfee0e5a Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Wed, 6 Mar 2024 15:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B0=E7=AB=99=E5=AE=9E=E4=BD=93=E7=B1=BB?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5category=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=8F=B0=E7=AB=99=E7=B1=BB=E5=9E=8B=20=E5=8F=B0=E7=AB=99?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=AE=A1=E7=90=86=E6=9F=A5=E8=AF=A2=E5=8F=B0?= =?UTF-8?q?=E7=AB=99=E4=BF=A1=E6=81=AF=E6=97=B6=EF=BC=8C=E5=8F=B0=E7=AB=99?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=A2=9E=E5=8A=A0=E6=A0=B9=E6=8D=AEcategory?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E6=98=AF?= =?UTF-8?q?=E8=87=AA=E5=BB=BA=E5=8F=B0=E7=AB=99=E8=BD=A6/=E8=88=B9=20?= =?UTF-8?q?=E5=85=B3=E6=B3=A8=E5=8F=B0=E7=AB=99=E5=88=97=E8=A1=A8=E5=AD=98?= =?UTF-8?q?=E5=82=A8=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=97=B6=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=8F=B0=E7=AB=99=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/entity/configuration/GardsStations.java | 3 +++ .../main/java/org/jeecg/common/StationTypeUtil.java | 10 ++++++++-- .../service/impl/StationOperationServiceImpl.java | 2 +- .../service/impl/SysUserFocusStationServiceImpl.java | 9 ++++++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/configuration/GardsStations.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/configuration/GardsStations.java index fea65b6f..1787c66a 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/configuration/GardsStations.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/configuration/GardsStations.java @@ -98,4 +98,7 @@ public class GardsStations implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date moddate; + @TableField(value = "CATEGORY") + private Integer category; + } 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 212bdb7f..3bf78d4e 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 @@ -20,13 +20,19 @@ public class StationTypeUtil { return stationTypes; } - public String getStationType(Integer stationId){ + public String getStationType(Integer stationId, Integer category){ String type = ""; List stationTypeList = stationType.getTypes(); for (StationType stationType:stationTypeList) { if (StringUtils.isNotBlank(stationType.getMinId()) && StringUtils.isNotBlank(stationType.getMaxId())){ if (stationId>Integer.valueOf(stationType.getMinId()) && stationId<=Integer.valueOf(stationType.getMaxId())){ - type = stationType.getName(); + if (category == 3) { + type = "Car"; + } else if (category == 4) { + type = "Ship"; + } else { + type = stationType.getName(); + } } } } 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 c4bcfe0a..31f78e6c 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 @@ -85,7 +85,7 @@ public class StationOperationServiceImpl extends ServiceImpl stationInfoMap = (HashMap) redisUtil.get("stationInfoMap"); //获取request HttpServletRequest request = SpringContextUtils.getHttpServletRequest(); //获取当前操作人用户名 @@ -101,12 +103,13 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl focusStationStationList = new LinkedList<>(); for (Integer stationId:userFocusStation.getStationIds()) { + GardsStations stations = (GardsStations) stationInfoMap.get(stationId.toString()); SysUserFocusStationStation sysUserFocusStation = new SysUserFocusStationStation(); Long id = IdWorker.getId(); sysUserFocusStation.setId(String.valueOf(id)); sysUserFocusStation.setUserId(sysUser.getId()); sysUserFocusStation.setStationId(String.valueOf(stationId)); - String stationType = stationTypeUtil.getStationType(stationId); + String stationType = stationTypeUtil.getStationType(stationId, stations.getCategory()); sysUserFocusStation.setStationType(stationType); sysUserFocusStation.setCreateTime(LocalDateTime.now()); sysUserFocusStation.setCreateBy(username); @@ -244,7 +247,7 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl