소스 검색

调整统计

guoqiang 5 달 전
부모
커밋
614b46cadf

+ 2 - 7
jeecg-module-gather/src/main/java/org/jeecg/modules/fpgJob/LeanModelStatistics.java

@@ -496,15 +496,10 @@ public class LeanModelStatistics {
                                 .addCriteria(Criteria.where("dates").is(dayDate))
                                 .addCriteria(Criteria.where("datestr").is(finalDatestr));
                     }else{
-                        query.addCriteria(Criteria.where("devicePointId").is(fpgGatherData.getDevicePointId()))
+                        query.addCriteria(Criteria.where("deviceRegionId").is(fpgGatherData.getDeviceRegionId()))
+                                .addCriteria(Criteria.where("deviceInformationId").is(fpgGatherData.getDeviceInformationId()))
                                 .addCriteria(Criteria.where("dates").is(dayDate))
                                 .addCriteria(Criteria.where("datestr").is(finalDatestr));
-                        if(fpgGatherData.getDeviceRegionId() != null && !fpgGatherData.getDeviceRegionId().isEmpty()){ // 区域特殊处理
-                            query.addCriteria(Criteria.where("deviceRegionId").is(fpgGatherData.getDeviceRegionId()));
-                        }
-                        if(fpgGatherData.getDeviceInformationId() != null && !fpgGatherData.getDeviceInformationId().isEmpty()){ // 设备特殊处理
-                            query.addCriteria(Criteria.where("deviceInformationId").is(fpgGatherData.getDeviceInformationId()));
-                        }
                     }
 
                     if(!classs.isEmpty()){ // 增加班次条件

+ 3 - 6
jeecg-module-gather/src/main/java/org/jeecg/modules/gatherData/entity/FpgStatiscsModelData.java

@@ -132,14 +132,11 @@ public class FpgStatiscsModelData{
 
     // 峰平谷精益模型数据统计
     public FpgStatiscsModelData(FpgGatherData fpgGather, FpgLeanModel fpgLeanModel, String datestr, String dates, String classs, Date createTime, Date updateTime) {
-        // 基础信息配置
-        if(fpgGather.getDeviceRegionId() != null && !fpgGather.getDeviceRegionId().isEmpty()) { // 区域特殊处理
-            this.deviceRegionId = fpgGather.getDeviceRegionId(); // 区域id
-        }
-        if(fpgGather.getDeviceInformationId() != null && !fpgGather.getDeviceInformationId().isEmpty()) { // 区域特殊处理
+        this.deviceRegionId = fpgGather.getDeviceRegionId(); // 区域id
+        if(fpgLeanModel.getDeviceRegionStatus() != null && fpgLeanModel.getDeviceRegionStatus() == 2){ // 非区域统计放开一下字段
             this.deviceInformationId = fpgGather.getDeviceInformationId(); // 设备id
+            this.devicePointId = fpgGather.getDevicePointId(); // 采集点id
         }
-        this.devicePointId = fpgGather.getDevicePointId(); // 采集点id
         this.ingTime = new BigDecimal("0.00"); // 运行时长
         this.power = new BigDecimal("0.00"); // 运行功率
         this.selectricCurrent = new BigDecimal("0.00"); // 运行电流