Explorar el Código

Merge branch 'fpg-master'

guoqiang hace 7 meses
padre
commit
be90236374

+ 0 - 6
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceLog/controller/DeviceController.java

@@ -1,20 +1,14 @@
 package org.jeecg.modules.deviceLog.controller;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.deviceLog.entity.Device;
-import org.jeecg.modules.deviceLog.entity.DeviceLog;
 import org.jeecg.modules.deviceLog.service.IDeviceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 import java.util.Map;
 

+ 0 - 6
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceLog/controller/DeviceLogController.java

@@ -2,18 +2,12 @@ package org.jeecg.modules.deviceLog.controller;
 
 import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.deviceLog.entity.DeviceLog;
 import org.jeecg.modules.deviceLog.service.IDeviceLogService;
 

+ 0 - 3
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceLog/mapper/DeviceLogMapper.java

@@ -1,8 +1,5 @@
 package org.jeecg.modules.deviceLog.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.deviceLog.entity.DeviceLog;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 

+ 0 - 1
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceLog/mapper/DeviceMapper.java

@@ -2,7 +2,6 @@ package org.jeecg.modules.deviceLog.mapper;
 
 import org.apache.ibatis.annotations.Mapper;
 import org.jeecg.modules.deviceLog.entity.Device;
-import org.jeecg.modules.deviceLog.entity.DeviceLog;
 
 import java.util.List;
 

+ 3 - 3
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceLog/mapper/xml/DeviceMapper.xml

@@ -4,16 +4,16 @@
 
     <select id="listAll" resultType="org.jeecg.modules.deviceLog.entity.Device">
         select id,device_title as name, device_code as code, device_gather as deviceType,'0' as useStatus,freq,status
-        from device_information
+        from device_gather_service
     </select>
     <select id="listStop" resultType="org.jeecg.modules.deviceLog.entity.Device">
         select id,device_title as name, device_code as code, device_gather as deviceType,'0' as useStatus,freq,status
-        from device_information
+        from device_gather_service
         where status = '1'
     </select>
     <select id="count" resultType="java.lang.Long">
         select count(0)
-        from device_information
+        from device_gather_service
         where status != '1'
     </select>
 </mapper>

+ 0 - 1
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceLog/service/impl/DeviceLogServiceImpl.java

@@ -1,6 +1,5 @@
 package org.jeecg.modules.deviceLog.service.impl;
 
-import org.jeecg.modules.common.entity.LogTopic;
 import org.jeecg.modules.deviceLog.entity.DeviceLog;
 import org.jeecg.modules.deviceLog.mapper.DeviceLogMapper;
 import org.jeecg.modules.deviceLog.service.IDeviceLogService;

+ 0 - 1
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceLog/service/impl/DeviceServiceImpl.java

@@ -3,7 +3,6 @@ package org.jeecg.modules.deviceLog.service.impl;
 import org.jeecg.modules.common.entity.LogTopic;
 import org.jeecg.modules.device.entity.DeviceGatherService;
 import org.jeecg.modules.device.service.IDeviceGatherServiceService;
-import org.jeecg.modules.device.service.IDeviceInformationService;
 import org.jeecg.modules.deviceLog.entity.Device;
 import org.jeecg.modules.deviceLog.mapper.DeviceMapper;
 import org.jeecg.modules.deviceLog.service.IDeviceLogService;

+ 18 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/fpgJob/LeanModelStatistics.java

@@ -177,6 +177,8 @@ public class LeanModelStatistics {
                         ((Update) update).set("updateTime", curentDate);
                         // 功率
                         BigDecimal activePower = new BigDecimal(String.valueOf(fpgGatherData.getActivePower()));
+                        // 电流
+                        BigDecimal selectricCurrent = new BigDecimal(String.valueOf(fpgGatherData.getRunCurrent()));
                         BigDecimal runTime = new BigDecimal("1");
                         BigDecimal oldPower = new BigDecimal(String.valueOf(FpgStatiscsModelMongo.getPower()));
                         BigDecimal oldingTime = new BigDecimal(String.valueOf(FpgStatiscsModelMongo.getIngTime()));
@@ -184,6 +186,22 @@ public class LeanModelStatistics {
                         if(fpgLeanModeInfo.getRunTime() != null && fpgLeanModeInfo.getRunTime() == 1) { // 运行时长统计
                             ((Update) update).set("ingTime", oldingTime.add(runTime));
                         }
+                        // 电流处理
+                        if(fpgLeanModeInfo.getElectricCurrent() != null && fpgLeanModeInfo.getElectricCurrent() == 1){
+                            if("tops".equals(jfpgStr.get())) { // 尖
+                                BigDecimal oldtopsSelectricCurrent = new BigDecimal(String.valueOf(FpgStatiscsModelMongo.getTopsSelectricCurrent()));
+                                ((Update) update).set("topSelectricCurrent", oldtopsSelectricCurrent.add(selectricCurrent));
+                            } else if("peaks".equals(jfpgStr.get())){ // 峰
+                                BigDecimal oldpeaksSelectricCurrent = new BigDecimal(String.valueOf(FpgStatiscsModelMongo.getPeaksSelectricCurrent()));
+                                ((Update) update).set("peaksSelectricCurrent", oldpeaksSelectricCurrent.add(selectricCurrent));
+                            } else if("flat".equals(jfpgStr.get())) { // 平
+                                BigDecimal oldtflatSelectricCurrent = new BigDecimal(String.valueOf(FpgStatiscsModelMongo.getFlatSelectricCurrent()));
+                                ((Update) update).set("flatSelectricCurrent", oldtflatSelectricCurrent.add(selectricCurrent));
+                            } else if("valleys".equals(jfpgStr.get())) { // 谷
+                                BigDecimal oldvalleysSelectricCurrent = new BigDecimal(String.valueOf(FpgStatiscsModelMongo.getValleysSelectricCurrent()));
+                                ((Update) update).set("valleysSelectricCurrent", oldvalleysSelectricCurrent.add(selectricCurrent));
+                            }
+                        }
                         // 总功率处理
                         ((Update) update).set("power", oldPower.add(activePower));
                         // 尖峰平谷判定

+ 5 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/fpgJob/entity/FpgLeanModel.java

@@ -110,4 +110,9 @@ public class FpgLeanModel implements Serializable {
     @Dict(dicCode = "proportion_run_status")
     @ApiModelProperty(value = "运行时长 1:开启 2: 关闭")
     private Integer runTime;
+    /**电流统计 1:开启 2: 关闭*/
+    @Excel(name = "电流统计 1:开启 2: 关闭", width = 15)
+    @Dict(dicCode = "electric_current")
+    @ApiModelProperty(value = "电流统计 1:开启 2: 关闭")
+    private Integer electricCurrent;
 }

+ 18 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/gatherData/entity/FpgStatiscsModelData.java

@@ -84,6 +84,18 @@ public class FpgStatiscsModelData{
     /**谷单价电费*/
     @ApiModelProperty(value = "谷单价电费")
     private BigDecimal valleysPrice;
+    /**尖电流*/
+    @ApiModelProperty(value = "尖电流")
+    private BigDecimal topSelectricCurrent;
+    /**峰电流*/
+    @ApiModelProperty(value = "峰电流")
+    private BigDecimal peaksSelectricCurrent;
+    /**平电流*/
+    @ApiModelProperty(value = "平电流")
+    private BigDecimal flatSelectricCurrent;
+    /**谷电流*/
+    @ApiModelProperty(value = "谷电流")
+    private BigDecimal valleysSelectricCurrent;
     /**尖占比%*/
     @ApiModelProperty(value = "尖占比%")
     private BigDecimal topsProportion;
@@ -134,6 +146,12 @@ public class FpgStatiscsModelData{
             this.flatProportion = new BigDecimal("0.00");
             this.valleysProportion = new BigDecimal("0.00");
         }
+        if(fpgLeanModel.getElectricCurrent() != null && fpgLeanModel.getElectricCurrent() == 1){ // 电流统计
+            this.topSelectricCurrent = new BigDecimal("0.00");
+            this.peaksSelectricCurrent = new BigDecimal("0.00");
+            this.flatSelectricCurrent = new BigDecimal("0.00");
+            this.valleysSelectricCurrent = new BigDecimal("0.00");
+        }
         if(fpgLeanModel.getRunTime() != null && fpgLeanModel.getRunTime() == 1){ // 运行时长统计
             this.topsIngTime = new BigDecimal("0.00");
             this.peaksIngTime = new BigDecimal("0.00");

+ 12 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/gatherData/entity/FpgStatiscsModelMongodb.java

@@ -84,6 +84,18 @@ public class FpgStatiscsModelMongodb {
     /**谷单价电费*/
     @ApiModelProperty(value = "谷单价电费")
     private BigDecimal valleysPrice;
+    /**尖电流*/
+    @ApiModelProperty(value = "尖电流")
+    private BigDecimal topsSelectricCurrent;
+    /**峰电流*/
+    @ApiModelProperty(value = "峰电流")
+    private BigDecimal peaksSelectricCurrent;
+    /**平电流*/
+    @ApiModelProperty(value = "平电流")
+    private BigDecimal flatSelectricCurrent;
+    /**谷电流*/
+    @ApiModelProperty(value = "谷电流")
+    private BigDecimal valleysSelectricCurrent;
     /**尖占比%*/
     @ApiModelProperty(value = "尖占比%")
     private BigDecimal topsProportion;