From dc6ef1a3c464d55e8a7ffb23433cc0cb56232aeb Mon Sep 17 00:00:00 2001 From: nieziyan Date: Wed, 30 Aug 2023 16:29:28 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysDatabaseServiceImpl.java | 4 +++- .../service/impl/SysServerServiceImpl.java | 4 +++- .../modules/mapper/StationMetDataMapper.java | 3 +++ .../mapper/StationSampleDataMapper.java | 2 ++ .../modules/mapper/StationSohDataMapper.java | 5 ++-- .../mapper/xml/stationSampleDataMapper.xml | 2 +- .../mapper/xml/stationSohDataMapper.xml | 3 +-- .../impl/StationOperationServiceImpl.java | 23 +++++++++++++------ 8 files changed, 32 insertions(+), 14 deletions(-) diff --git a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysDatabaseServiceImpl.java b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysDatabaseServiceImpl.java index 06e754d6..74965c4f 100644 --- a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysDatabaseServiceImpl.java +++ b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysDatabaseServiceImpl.java @@ -167,8 +167,10 @@ public class SysDatabaseServiceImpl extends ServiceImpl listAll() { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.orderByDesc(SysDatabase::getStatus); + wrapper.orderByAsc(SysDatabase::getName); List sourceDtos = new ArrayList<>(); - for (SysDatabase sysDatabase : list()) { + for (SysDatabase sysDatabase : list(wrapper)) { SourceDto sourceDto = new SourceDto(); sourceDto.setSourceId(sysDatabase.getId()); sourceDto.setSourceName(sysDatabase.getName()); diff --git a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysServerServiceImpl.java b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysServerServiceImpl.java index 9766e9d1..3c18ab28 100644 --- a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysServerServiceImpl.java +++ b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/SysServerServiceImpl.java @@ -158,8 +158,10 @@ public class SysServerServiceImpl extends ServiceImpl listAll() { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.orderByDesc(SysServer::getStatus); + wrapper.orderByAsc(SysServer::getName); List sourceDtos = new ArrayList<>(); - for (SysServer sysServer : list()) { + for (SysServer sysServer : list(wrapper)) { SourceDto sourceDto = new SourceDto(); sourceDto.setSourceId(sysServer.getId()); sourceDto.setSourceName(sysServer.getName()); diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationMetDataMapper.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationMetDataMapper.java index 4bd5b650..83822d7c 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationMetDataMapper.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationMetDataMapper.java @@ -2,12 +2,15 @@ package org.jeecg.modules.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.base.entity.original.GardsMetData; +import org.springframework.beans.factory.annotation.Autowired; import java.util.List; @DS("ora") +@Mapper public interface StationMetDataMapper extends BaseMapper { List findMetDataList(@Param("stationIds") List stationIds, @Param("startDate") String startDate); diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationSampleDataMapper.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationSampleDataMapper.java index f534e9c2..d0c234d1 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationSampleDataMapper.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationSampleDataMapper.java @@ -2,12 +2,14 @@ package org.jeecg.modules.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.base.entity.original.GardsSampleData; import java.util.List; @DS("ora") +@Mapper public interface StationSampleDataMapper extends BaseMapper { List findSampleDataList(@Param("detectorIds") List detectorIds, @Param("startDate") String startDate); diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationSohDataMapper.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationSohDataMapper.java index 43048b64..7b5779e2 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationSohDataMapper.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationSohDataMapper.java @@ -2,15 +2,16 @@ package org.jeecg.modules.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.cursor.Cursor; import org.jeecg.modules.base.entity.original.GardsSohData; import java.util.List; @DS("ora") +@Mapper public interface StationSohDataMapper extends BaseMapper { List findSohDataList(@Param("stationId") String stationId, @Param("detectorIds") List detectorIds, @Param("startDate") String startDate); - - } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationSampleDataMapper.xml b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationSampleDataMapper.xml index 7df1bee2..0d06e88b 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationSampleDataMapper.xml +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationSampleDataMapper.xml @@ -20,7 +20,7 @@ - and MODDATE >= TO_DATE(#{startDate}, 'YYYY-MM-DD hh24:mi:ss') + and MODDATE >= TO_DATE('${startDate}', 'YYYY-MM-DD hh24:mi:ss') ORDER BY ACQUISITION_STOP diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationSohDataMapper.xml b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationSohDataMapper.xml index 314cd50a..5ea5afe8 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationSohDataMapper.xml +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationSohDataMapper.xml @@ -19,9 +19,8 @@ and STATION_ID = #{stationId} - and MODDATE >= TO_DATE(#{startDate}, 'YYYY-MM-DD hh24:mi:ss') + and MODDATE >= TO_DATE('${startDate}', 'YYYY-MM-DD hh24:mi:ss') - \ No newline at end of file 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 415130a6..f6be1886 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 @@ -1,5 +1,6 @@ package org.jeecg.modules.service.impl; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; @@ -116,6 +117,10 @@ public class StationOperationServiceImpl extends ServiceImpl StringUtils.isNotBlank(item.getStationType()) && item.getStationType().equalsIgnoreCase(stationType)).collect(Collectors.toList()); } + // 根据StationId排序 + result = result.stream() + .sorted(Comparator.comparingInt(StationOperation::getStationId)) + .collect(Collectors.toList()); return result; } @@ -419,6 +424,7 @@ public class StationOperationServiceImpl extends ServiceImpl sohDataList = stationSohDataMapper.findSohDataList(stationId, detectorIds, startDateTime); //用于接收当前台站下所有探测器及探测器所有的样品数据,气体数据,状态数据集合 List> detectorDataList = new LinkedList<>(); + for (Integer detectorId:detectorIds) { Map detectorMap = new HashMap<>(); DetectorData detectorData = new DetectorData(); @@ -432,21 +438,23 @@ public class StationOperationServiceImpl extends ServiceImpl