From 8e9f2fc4e13c6f3116bb8b8887cc92b0f699c9f6 Mon Sep 17 00:00:00 2001 From: nieziyan Date: Tue, 1 Aug 2023 21:28:36 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++ .../org/jeecg/modules/base}/vo/AlarmVo.java | 7 +++- .../controller/AlarmLogController.java | 2 +- .../modules/service/IAlarmLogService.java | 2 +- .../service/impl/AlarmLogServiceImpl.java | 2 +- .../jeecg/common/CalculateStationData.java | 27 ++++++---------- .../StationOperationController.java | 2 +- .../impl/StationOperationServiceImpl.java | 32 ++++++++++++------- .../mapper/GardsSampleDataWebMapper.java | 1 + .../mapper/xml/GardsSampleDataWebMapper.xml | 4 +-- 10 files changed, 46 insertions(+), 36 deletions(-) rename {jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules => jeecg-boot-base-core/src/main/java/org/jeecg/modules/base}/vo/AlarmVo.java (91%) diff --git a/.gitignore b/.gitignore index d9949e64..1977fdcf 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ rebel.xml ## front **/*.lock + +## json +/json/ diff --git a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/vo/AlarmVo.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/vo/AlarmVo.java similarity index 91% rename from jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/vo/AlarmVo.java rename to jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/vo/AlarmVo.java index 6d2e9047..81008d37 100644 --- a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/vo/AlarmVo.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/vo/AlarmVo.java @@ -1,4 +1,4 @@ -package org.jeecg.modules.vo; +package org.jeecg.modules.base.vo; import lombok.Data; import org.jeecg.common.api.QueryRequest; @@ -9,10 +9,15 @@ import java.util.List; @Data public class AlarmVo extends QueryRequest implements Serializable { private String name; + private List type; + private String startDate; + private String endDate; + private Integer pageStart; + // 标记:根据条件查询但不进行分页 private String pageFlag; } diff --git a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/controller/AlarmLogController.java b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/controller/AlarmLogController.java index 585b009e..b812f17d 100644 --- a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/controller/AlarmLogController.java +++ b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/controller/AlarmLogController.java @@ -5,7 +5,7 @@ import io.swagger.annotations.ApiOperation; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.base.entity.postgre.AlarmLog; import org.jeecg.modules.service.IAlarmLogService; -import org.jeecg.modules.vo.AlarmVo; +import org.jeecg.modules.base.vo.AlarmVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; diff --git a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/IAlarmLogService.java b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/IAlarmLogService.java index fb37dcc0..55227b9e 100644 --- a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/IAlarmLogService.java +++ b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/IAlarmLogService.java @@ -3,7 +3,7 @@ package org.jeecg.modules.service; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.base.entity.postgre.AlarmLog; -import org.jeecg.modules.vo.AlarmVo; +import org.jeecg.modules.base.vo.AlarmVo; public interface IAlarmLogService extends IService { diff --git a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/AlarmLogServiceImpl.java b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/AlarmLogServiceImpl.java index 6e373030..c698663c 100644 --- a/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/AlarmLogServiceImpl.java +++ b/jeecg-module-abnormal-alarm/src/main/java/org/jeecg/modules/service/impl/AlarmLogServiceImpl.java @@ -16,7 +16,7 @@ import org.jeecg.modules.base.entity.postgre.AlarmLog; import org.jeecg.modules.entity.AlarmHistory; import org.jeecg.modules.mapper.AlarmLogMapper; import org.jeecg.modules.service.IAlarmLogService; -import org.jeecg.modules.vo.AlarmVo; +import org.jeecg.modules.base.vo.AlarmVo; import org.springframework.stereotype.Service; import java.time.LocalDate; diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateStationData.java b/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateStationData.java index ec2f54c5..90caa72a 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateStationData.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateStationData.java @@ -846,7 +846,7 @@ public class CalculateStationData { if( threadNum == works ){ countDownLatch = new CountDownLatch(threadNum); //遍历台站信息 - for (int i=0 ; i infos = new ArrayList<>(); int startIndex = i * threadNum; - int endIndex = ((i + 1) * threadNum) - 1; + int endIndex = ((i + 1) * threadNum); //判断当前结束下标是否超出台站数量 没有超出说明还在范围内 正常截取数组 - if (endIndex <= stationInfos.size()){ + if (endIndex <= works){ infos = stationInfos.subList(startIndex, endIndex); }else {//如果超出台站数量 则从截取开始下标 截取到台站数组长度 - infos = stationInfos.subList(startIndex, stationInfos.size()); + infos = stationInfos.subList(startIndex, works); } countDownLatch = new CountDownLatch(infos.size()); //遍历当前组的台站并进行计算 - for (int j=0; j findList(String status, String stationType){ List result = stationOperationService.findList(status, stationType); return result; 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 a0c1daf9..415130a6 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 @@ -28,6 +28,7 @@ import org.jeecg.modules.service.IStationOperationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.io.*; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; @@ -38,18 +39,25 @@ import java.util.stream.Collectors; public class StationOperationServiceImpl extends ServiceImpl implements IStationOperationService { @Autowired private RedisUtil redisUtil; + @Autowired private ICacheTimeService cacheTimeService; - @Autowired + + @Resource private StationSampleDataMapper stationSampleDataMapper; - @Autowired + + @Resource private StationSohDataMapper stationSohDataMapper; - @Autowired + + @Resource private StationMetDataMapper stationMetDataMapper; - @Autowired + + @Resource private SysUserFocusStationMapper sysUserFocusStationMapper; + @Autowired private StationTypeUtil stationTypeUtil; + @Autowired private CalculateStationData calCulateStationData; @@ -518,13 +526,14 @@ public class StationOperationServiceImpl extends ServiceImpl stationInfoMap = (HashMap) redisUtil.get("stationInfoMap"); - //获取所有的台站信息 - List stations = stationInfoMap.values().stream().sorted(Comparator.comparing(GardsStations::getStationId)).collect(Collectors.toList()); + // 获取所有的台站信息 + List stations = stationInfoMap.values().stream() + .sorted(Comparator.comparing(GardsStations::getStationId)) + .collect(Collectors.toList()); List stationInfos = new ArrayList<>(); - for (GardsStations gardsStations:stations) { + for (GardsStations gardsStations : stations) { StationInfo stationInfo = new StationInfo(); stationInfo.setStationCode(gardsStations.getStationCode()); stationInfo.setCountryCode(gardsStations.getCountryCode()); @@ -532,9 +541,8 @@ public class StationOperationServiceImpl extends ServiceImpl stationInfoList = calCulateStationData.mutiThreadGetStationInfo(stationInfos,mRateParam); - result.setSuccess(true); - result.setResult(stationInfoList); - return result; + + return Result.OK(stationInfoList); } } diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDataWebMapper.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDataWebMapper.java index 4ee88830..b3f8e51f 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDataWebMapper.java +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDataWebMapper.java @@ -2,6 +2,7 @@ package org.jeecg.modules.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.jeecg.modules.base.entity.original.GardsSampleData; import org.jeecg.modules.entity.GardsSampleDataWeb; import java.util.List; diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/xml/GardsSampleDataWebMapper.xml b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/xml/GardsSampleDataWebMapper.xml index 0d010cdf..c30fc0e2 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/xml/GardsSampleDataWebMapper.xml +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/xml/GardsSampleDataWebMapper.xml @@ -2,7 +2,7 @@ - SELECT sam.SITE_DET_CODE, sam.SAMPLE_ID, @@ -41,7 +41,7 @@ - SELECT sam.SITE_DET_CODE, sam.SAMPLE_ID,