Procházet zdrojové kódy

事件触发告警功能005

qiangxuan před 7 měsíci
rodič
revize
6bf8208717

+ 161 - 28
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/service/impl/LeanEventWarnInfoServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.leanEventWarn.service.impl;
 import org.jeecg.modules.events.entity.LeanEventsHost;
+import org.jeecg.modules.gatherData.entity.FpgStatiscsModelData;
 import org.jeecg.modules.leanEventWarn.entity.LeanEventWarnInfo;
 import org.jeecg.modules.leanEventWarn.entity.LeanEventsHostConfig;
 import org.jeecg.modules.leanEventWarn.mapper.LeanEventWarnInfoMapper;
@@ -14,11 +15,14 @@ import org.jeecg.modules.peaksAndValleysTimeConfig.entity.PeaksAndValleysTimeCon
 import org.jeecg.modules.peaksAndValleysTimeConfig.service.IPeaksAndValleysTimeConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.Instant;
@@ -64,7 +68,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
 
         if (fpgGatherData.getRunCurrent().compareTo(limitVoltage) < 0){
             // 上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("HOST_OPEN状态下,辅设备电流小于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("HOST_OPEN状态下,辅设备电流小于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -83,7 +87,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         BigDecimal limitVoltage = new BigDecimal("5");
         if (fpgGatherData.getRunCurrent().compareTo(limitVoltage) > 0){
             // 上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("HOST_CLOSE状态下,辅设备电流大于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("HOST_CLOSE状态下,辅设备电流大于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -116,7 +120,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean topsIsExit = topsNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (topsIsExit && fpgGatherData.getRunCurrent().compareTo(limitVoltage) < 0){
             // 采集到的数据电流小于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,尖时段采集到的数据电流小于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,尖时段采集到的数据电流小于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -125,7 +129,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean peaksIsExit = peaksNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (peaksIsExit && fpgGatherData.getRunCurrent().compareTo(limitVoltage) < 0){
             // 采集到的数据电流小于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,峰时段采集到的数据电流小于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,峰时段采集到的数据电流小于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -134,7 +138,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean flatIsExit = flatNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (flatIsExit && fpgGatherData.getRunCurrent().compareTo(limitVoltage) < 0){
             // 采集到的数据电流小于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,平时段采集到的数据电流小于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,平时段采集到的数据电流小于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -143,7 +147,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean valleysIsExit = valleysNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (valleysIsExit && fpgGatherData.getRunCurrent().compareTo(limitVoltage) < 0){
             // 采集到的数据电流小于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,谷时段采集到的数据电流小于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,谷时段采集到的数据电流小于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -197,7 +201,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean topsIsExit = topsNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (topsIsExit && fpgGatherData.getRunCurrent().compareTo(limitVoltage) > 0){
             // 采集到的数据电流大于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,采集到的数据电流大于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,采集到的数据电流大于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -206,7 +210,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean peaksIsExit = peaksNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (peaksIsExit && fpgGatherData.getRunCurrent().compareTo(limitVoltage) > 0){
             // 采集到的数据电流大于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,采集到的数据电流大于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,采集到的数据电流大于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -215,7 +219,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean flatIsExit = flatNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (flatIsExit && fpgGatherData.getRunCurrent().compareTo(limitVoltage) > 0){
             // 采集到的数据电流大于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,采集到的数据电流大于5A,触发精益事件告警!");
+            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,采集到的数据电流大于5A,触发告警!");
             leanEventWarnInfo.setWarnType("1");
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -239,27 +243,80 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         leanEventWarnInfo.setDeviceInformationId(fpgGatherData.getDeviceInformationId());
         leanEventWarnInfo.setDevicePointId(fpgGatherData.getDevicePointId());
         leanEventWarnInfo.setCreateTime(new Date());
-        // 获取MongoDB中设备的限制运行时间
-        int sumRunTime = 10;
 
         // 根据辅设备ID、事件ID、限制类型,获取精益时间配置关联信息
         LambdaQueryWrapper<LeanEventsHostConfig> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(LeanEventsHostConfig::getDeviceInformationListId, fpgGatherData.getDeviceInformationId())
                 .eq(LeanEventsHostConfig::getEventsId, leanEventsHost.getEventsId()).eq(LeanEventsHostConfig::getLimitType, "0");
         LeanEventsHostConfig leanEventsHostConfig = leanEventsHostConfigService.list(queryWrapper).stream().findFirst().orElse(null);
-        if (leanEventsHostConfig != null){
-            // 判断MongoDB中的累加运行时长是否大于 LeanEventsHostConfig中的限制时长
-            int runTimeLimit = Integer.parseInt(leanEventsHostConfig.getRunTime());
-            if (sumRunTime > runTimeLimit){
-                // 累加运行时长超过限制时长,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,累计运行时长超过限制时长,触发精益事件告警!");
+        if (leanEventsHostConfig == null){
+            return;
+        }
+        // 获取峰平谷配置的时段
+        PeaksAndValleysTimeConfigParam peaksAndValleysTimeConfigParam = peaksAndValleysTimeConfigService.get();
+        // 处理开始时间、
+        List<Date[]> timeRanges = new ArrayList<>();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        List<PeaksAndValleysTimeConfig> newPeaksAndValleysTimeConfigList = getPeaksAndValleysTimeConfigByType(peaksAndValleysTimeConfigParam, leanEventsHost.getDeviceInformationId(), new Date());
+        newPeaksAndValleysTimeConfigList.forEach(x ->{
+            try {
+                timeRanges.add(new Date[]{dateFormat.parse(x.getStartTime()), dateFormat.parse(x.getEndTime())});
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+        });
+        // 根据类型、采集点ID、设备ID、区域ID、峰平谷配置时间范围查询mongoDB
+        List<FpgStatiscsModelData> fpgStatiscsModelDataList = queryByTimeRanges(mongoTemplate, timeRanges, fpgGatherData.getDevicePointId(), fpgGatherData.getDeviceInformationId(), fpgGatherData.getDeviceRegionId());
+        if (!oConvertUtils.listIsNotEmpty(fpgStatiscsModelDataList) ){
+            return;
+        }
+        // 判断MongoDB中的累加运行时长是否大于 LeanEventsHostConfig中的尖峰平谷运行限制时长
+        int runTimeLimit = Integer.parseInt(leanEventsHostConfig.getRunTime());
+        if("tops".equals(leanEventsHost.getDeviceInformationId())){
+            BigDecimal topsIngTimeSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelData::getTopsIngTime)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
+            if (topsIngTimeSum.intValue() > runTimeLimit){
+                // 尖——累加运行时长超过限制时长,触发告警
+                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,尖运行时长超过限制时长,触发告警!");
+                leanEventWarnInfo.setWarnType("1");
+                leanEventWarnInfo.setDeviceWarnLevel("0");
+                // 更新或者新增逻辑处理
+                saveOrUpdateLeanEventWarnInfo(fpgGatherData, leanEventWarnInfo);
+            }
+        }else if ("peaks".equals(leanEventsHost.getDeviceInformationId())){
+            BigDecimal peaksIngTimeSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelData::getPeaksIngTime)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
+            if (peaksIngTimeSum.intValue() > runTimeLimit){
+                // 峰——累加运行时长超过限制时长,触发告警
+                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,峰运行时长超过限制时长,触发告警!");
+                leanEventWarnInfo.setWarnType("1");
+                leanEventWarnInfo.setDeviceWarnLevel("0");
+                // 更新或者新增逻辑处理
+                saveOrUpdateLeanEventWarnInfo(fpgGatherData, leanEventWarnInfo);
+            }
+        }else if ("flat".equals(leanEventsHost.getDeviceInformationId())){
+            BigDecimal flatIngTimeSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelData::getFlatIngTime)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
+            if (flatIngTimeSum.intValue() > runTimeLimit){
+                // 平——累加运行时长超过限制时长,触发告警
+                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,平运行时长超过限制时长,触发告警!");
+                leanEventWarnInfo.setWarnType("1");
+                leanEventWarnInfo.setDeviceWarnLevel("0");
+                // 更新或者新增逻辑处理
+                saveOrUpdateLeanEventWarnInfo(fpgGatherData, leanEventWarnInfo);
+            }
+        } else if ("valleys".equals(leanEventsHost.getDeviceInformationId())) {
+            BigDecimal valleysIngTimeSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelData::getValleysIngTime)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
+            if (valleysIngTimeSum.intValue() > runTimeLimit){
+                // 谷——累加运行时长超过限制时长,触发告警
+                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,谷运行时长超过限制时长,触发告警!");
                 leanEventWarnInfo.setWarnType("1");
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
                 saveOrUpdateLeanEventWarnInfo(fpgGatherData, leanEventWarnInfo);
             }
         }
-
     }
 
     @Override
@@ -269,28 +326,104 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         leanEventWarnInfo.setDeviceInformationId(fpgGatherData.getDeviceInformationId());
         leanEventWarnInfo.setDevicePointId(fpgGatherData.getDevicePointId());
         leanEventWarnInfo.setCreateTime(new Date());
-        // 获取MongoDB中设备的功率限制
-        int sumPowerLimit = 10;
 
         // 根据辅设备ID、事件ID、限制类型,获取精益时间配置关联信息
         LambdaQueryWrapper<LeanEventsHostConfig> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(LeanEventsHostConfig::getDeviceInformationListId, fpgGatherData.getDeviceInformationId())
-                .eq(LeanEventsHostConfig::getEventsId, leanEventsHost.getEventsId()).eq(LeanEventsHostConfig::getLimitType, "1");
+                .eq(LeanEventsHostConfig::getEventsId, leanEventsHost.getEventsId()).eq(LeanEventsHostConfig::getLimitType, "0");
         LeanEventsHostConfig leanEventsHostConfig = leanEventsHostConfigService.list(queryWrapper).stream().findFirst().orElse(null);
-        if (leanEventsHostConfig != null){
-            // 判断MongoDB中的累加功率限制是否大于 LeanEventsHostConfig中的功率限制
-            int powerLimit = Integer.parseInt(leanEventsHostConfig.getPowerLimit());
-            if (sumPowerLimit > powerLimit){
-                // 累加运行时长超过限制时长,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_POWER_LIMIT,累计功率超过功率限制,触发精益事件告警!");
+        if (leanEventsHostConfig == null){
+            return;
+        }
+        // 获取峰平谷配置的时段
+        PeaksAndValleysTimeConfigParam peaksAndValleysTimeConfigParam = peaksAndValleysTimeConfigService.get();
+        // 处理开始时间、
+        List<Date[]> timeRanges = new ArrayList<>();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        List<PeaksAndValleysTimeConfig> newPeaksAndValleysTimeConfigList = getPeaksAndValleysTimeConfigByType(peaksAndValleysTimeConfigParam, leanEventsHost.getDeviceInformationId(), new Date());
+        newPeaksAndValleysTimeConfigList.forEach(x ->{
+            try {
+                timeRanges.add(new Date[]{dateFormat.parse(x.getStartTime()), dateFormat.parse(x.getEndTime())});
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+        });
+        // 根据类型、采集点ID、设备ID、区域ID、峰平谷配置时间范围查询mongoDB
+        List<FpgStatiscsModelData> fpgStatiscsModelDataList = queryByTimeRanges(mongoTemplate, timeRanges, fpgGatherData.getDevicePointId(), fpgGatherData.getDeviceInformationId(), fpgGatherData.getDeviceRegionId());
+        if (!oConvertUtils.listIsNotEmpty(fpgStatiscsModelDataList) ){
+            return;
+        }
+        // 判断MongoDB中的累加运行时长是否大于 LeanEventsHostConfig中的尖峰平谷运行限制时长
+        int runTimeLimit = Integer.parseInt(leanEventsHostConfig.getRunTime());
+        if("tops".equals(leanEventsHost.getDeviceInformationId())){
+            BigDecimal topsPowerLimitSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelData::getTopsPower)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
+            if (topsPowerLimitSum.intValue() > runTimeLimit){
+                // 尖——累加累计功率超过功率限制,触发告警
+                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,尖累计功率超过功率限制,触发告警!");
+                leanEventWarnInfo.setWarnType("1");
+                leanEventWarnInfo.setDeviceWarnLevel("0");
+                // 更新或者新增逻辑处理
+                saveOrUpdateLeanEventWarnInfo(fpgGatherData, leanEventWarnInfo);
+            }
+        }else if ("peaks".equals(leanEventsHost.getDeviceInformationId())){
+            BigDecimal peaksPowerLimitSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelData::getPeaksPower)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
+            if (peaksPowerLimitSum.intValue() > runTimeLimit){
+                // 峰——累加累计功率超过功率限制,触发告警
+                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,峰累计功率超过功率限制,触发告警!");
+                leanEventWarnInfo.setWarnType("1");
+                leanEventWarnInfo.setDeviceWarnLevel("0");
+                // 更新或者新增逻辑处理
+                saveOrUpdateLeanEventWarnInfo(fpgGatherData, leanEventWarnInfo);
+            }
+        }else if ("flat".equals(leanEventsHost.getDeviceInformationId())){
+            BigDecimal flatPowerLimitSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelData::getFlatPower)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
+            if (flatPowerLimitSum.intValue() > runTimeLimit){
+                // 平——累加累计功率超过功率限制,触发告警
+                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,平累计功率超过功率限制,触发告警!");
+                leanEventWarnInfo.setWarnType("1");
+                leanEventWarnInfo.setDeviceWarnLevel("0");
+                // 更新或者新增逻辑处理
+                saveOrUpdateLeanEventWarnInfo(fpgGatherData, leanEventWarnInfo);
+            }
+        } else if ("valleys".equals(leanEventsHost.getDeviceInformationId())) {
+            BigDecimal valleysPowerLimitSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelData::getValleysPower)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
+            if (valleysPowerLimitSum.intValue() > runTimeLimit){
+                // 谷——累加累计功率超过功率限制,触发告警
+                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_POWER_LIMIT,谷累计功率超过功率限制,触发精益事件告警!");
                 leanEventWarnInfo.setWarnType("1");
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
                 saveOrUpdateLeanEventWarnInfo(fpgGatherData, leanEventWarnInfo);
             }
         }
+    }
 
-
+    /**
+     * 基于采集点ID、设备ID、区域ID、峰平谷配置时间范围 动态查询mongoDB
+     * @param mongoTemplate
+     * @param timeRanges
+     * @param devicePointId
+     * @param deviceInformationId
+     * @param deviceRegionId
+     * @return
+     */
+    public List<FpgStatiscsModelData> queryByTimeRanges(MongoTemplate mongoTemplate, List<Date[]> timeRanges, String devicePointId, String deviceInformationId, String deviceRegionId) {
+        Query query = new Query();
+        query.addCriteria(Criteria.where("devicePointId").is(devicePointId));
+        query.addCriteria(Criteria.where("deviceInformationId").is(deviceInformationId));
+        query.addCriteria(Criteria.where("deviceRegionId").is(deviceRegionId));
+        // 使用Criteria添加多个时间范围条件
+        for (int i = 0; i < timeRanges.size(); i++) {
+            Date startTime = timeRanges.get(i)[0];
+            Date endTime = timeRanges.get(i)[1];
+            query.addCriteria(Criteria.where("createTime").gte(startTime).lt(endTime));
+        }
+        // 执行查询
+        return mongoTemplate.find(query, FpgStatiscsModelData.class);
     }
 
     /**