区域稳态超标统计->报表下载
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
package com.njcn.harmonic.pojo.dto.excel.area;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||
import com.njcn.poi.pojo.constant.DeviceInfoConstant;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/5/17 10:12
|
||||
*/
|
||||
@Data
|
||||
public class AreaExcel implements Serializable {
|
||||
|
||||
@Excel(name = "名称", width = 25, needMerge = true)
|
||||
private String name;
|
||||
|
||||
@Excel(name = "在线监测点个数(个)", width = 25, needMerge = true)
|
||||
private Integer onlineMonitorNumber;
|
||||
|
||||
@Excel(name = "超标监测点个数(个)", width = 25, needMerge = true)
|
||||
private Integer overLimitMonitorNumber;
|
||||
|
||||
@Excel(name = "超标监测点数占比(%)", width = 25, needMerge = true)
|
||||
private Double overBiLi;
|
||||
|
||||
@ExcelCollection(name = "频率偏差超标情况",orderNum = "3")
|
||||
private List<OverData> list1;
|
||||
|
||||
@ExcelCollection(name = "电压偏差超标情况",orderNum = "3")
|
||||
private List<OverData> list2;
|
||||
|
||||
@ExcelCollection(name = "谐波电压超标情况",orderNum = "3")
|
||||
private List<OverData> list3;
|
||||
|
||||
@ExcelCollection(name = "谐波电流超标情况",orderNum = "3")
|
||||
private List<OverData> list4;
|
||||
|
||||
@ExcelCollection(name = "三相电压不平衡度超标情况",orderNum = "3")
|
||||
private List<OverData> list5;
|
||||
|
||||
@ExcelCollection(name = "闪变超标情况",orderNum = "3")
|
||||
private List<OverData> list6;
|
||||
|
||||
@ExcelCollection(name = "负序电流限值超标情况",orderNum = "3")
|
||||
private List<OverData> list7;
|
||||
|
||||
@ExcelCollection(name = "间谐波电压超标情况",orderNum = "3")
|
||||
private List<OverData> list8;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.njcn.harmonic.pojo.dto.excel.area;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/5/17 11:28
|
||||
*/
|
||||
@Data
|
||||
public class OverData implements Serializable {
|
||||
|
||||
@Excel(name = "个数", width = 25)
|
||||
private Integer number;
|
||||
|
||||
@Excel(name = "占比", width = 25)
|
||||
private Double bili;
|
||||
|
||||
@Excel(name = "平均超标天数", width = 25)
|
||||
private Double avgDay;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.njcn.harmonic.pojo.excel.area;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/5/17 10:12
|
||||
*/
|
||||
@Data
|
||||
public class AreaExcel implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "名称", width = 25, needMerge = true)
|
||||
private String name;
|
||||
|
||||
@Excel(name = "在线监测点个数(个)", width = 25, needMerge = true)
|
||||
private Integer onlineMonitorNumber;
|
||||
|
||||
@Excel(name = "超标监测点个数(个)", width = 25, needMerge = true)
|
||||
private Integer overLimitMonitorNumber;
|
||||
|
||||
@Excel(name = "超标监测点数占比(%)", width = 25, needMerge = true, replace = {"暂无数据_-1.0"})
|
||||
private Double overBiLi;
|
||||
|
||||
@Excel(name = "平均超标天数", groupName = "频率偏差超标情况", width = 25, replace = {"暂无数据_-1.0"} , orderNum = "1")
|
||||
private Double frequencyOverDayBiLi;
|
||||
|
||||
@Excel(name = "占比", groupName = "频率偏差超标情况", width = 25, replace = {"暂无数据_-1.0"} , orderNum = "1")
|
||||
private Double frequencyBiLi;
|
||||
|
||||
@Excel(name = "个数", groupName = "频率偏差超标情况", width = 25 , orderNum = "1")
|
||||
private Integer frequencyMonitorNumber;
|
||||
|
||||
@Excel(name = "平均超标天数", groupName = "电压偏差超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "2")
|
||||
private Double voltageOverDayBiLi;
|
||||
|
||||
@Excel(name = "占比", groupName = "电压偏差超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "2")
|
||||
private Double voltageBiLi;
|
||||
|
||||
@Excel(name = "个数", groupName = "电压偏差超标情况", width = 25, orderNum = "2")
|
||||
private Integer voltageMonitorNumber;
|
||||
|
||||
@Excel(name = "平均超标天数", groupName = "谐波电压超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "3")
|
||||
private Double harmonicVoltageOverDayBiLi;
|
||||
|
||||
@Excel(name = "占比", groupName = "谐波电压超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "3")
|
||||
private Double harmonicVoltageBiLi;
|
||||
|
||||
@Excel(name = "个数", groupName = "谐波电压超标情况", width = 25, orderNum = "3")
|
||||
private Integer harmonicVoltageMonitorNumber;
|
||||
|
||||
@Excel(name = "平均超标天数", groupName = "谐波电流超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "4")
|
||||
private Double harmonicCurrentOverDayBiLi;
|
||||
|
||||
@Excel(name = "占比", groupName = "谐波电流超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "4")
|
||||
private Double harmonicCurrentBiLi;
|
||||
|
||||
@Excel(name = "个数", groupName = "谐波电流超标情况", width = 25, orderNum = "4")
|
||||
private Integer harmonicCurrentMonitorNumber;
|
||||
|
||||
@Excel(name = "平均超标天数", groupName = "三相电压不平衡度超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "5")
|
||||
private Double threePhaseVoltageOverDayBiLi;
|
||||
|
||||
@Excel(name = "占比", groupName = "三相电压不平衡度超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "5")
|
||||
private Double threePhaseVoltageBiLi;
|
||||
|
||||
@Excel(name = "个数", groupName = "三相电压不平衡度超标情况", width = 25, orderNum = "5")
|
||||
private Integer threePhaseVoltageMonitorNumber;
|
||||
|
||||
@Excel(name = "平均超标天数", groupName = "闪变超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "6")
|
||||
private Double flickerOverDayBiLi;
|
||||
|
||||
@Excel(name = "占比", groupName = "闪变超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "6")
|
||||
private Double flickerBiLi;
|
||||
|
||||
@Excel(name = "个数", groupName = "闪变超标情况", width = 25, orderNum = "6")
|
||||
private Integer flickerMonitorNumber;
|
||||
|
||||
@Excel(name = "平均超标天数", groupName = "负序电流限值超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "7")
|
||||
private Double negativeOverDayBiLi;
|
||||
|
||||
@Excel(name = "占比", groupName = "负序电流限值超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "7")
|
||||
private Double negativeBiLi;
|
||||
|
||||
@Excel(name = "个数", groupName = "负序电流限值超标情况", width = 25, orderNum = "7")
|
||||
private Integer negativeMonitorNumber;
|
||||
|
||||
@Excel(name = "平均超标天数", groupName = "间谐波电压超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "8")
|
||||
private Double interHarmonicOverDayBiLi;
|
||||
|
||||
@Excel(name = "占比", groupName = "间谐波电压超标情况", width = 25, replace = {"暂无数据_-1.0"}, orderNum = "8")
|
||||
private Double interHarmonicBiLi;
|
||||
|
||||
@Excel(name = "个数", groupName = "间谐波电压超标情况", width = 25, orderNum = "8")
|
||||
private Integer interHarmonicMonitorNumber;
|
||||
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.njcn.harmonic.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
@@ -15,8 +14,6 @@ import com.njcn.harmonic.pojo.vo.*;
|
||||
import com.njcn.harmonic.service.IAnalyzeService;
|
||||
import com.njcn.harmonic.service.IHarmonicService;
|
||||
import com.njcn.harmonic.service.IPollutionService;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.user.pojo.param.UserParam;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -24,9 +21,11 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,5 +47,6 @@ public interface IAnalyzeService {
|
||||
Page<MonitorOverLimitVO> monitorOverLimitVO(OverAreaVO param);
|
||||
|
||||
|
||||
|
||||
String exportArea(OverAreaVO param, String methodDescribe);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.harmonic.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.CharUtil;
|
||||
import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
@@ -13,7 +14,7 @@ import com.njcn.device.pojo.dto.OverLimitLineDTO;
|
||||
import com.njcn.device.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pojo.dto.WarningSubstationDTO;
|
||||
import com.njcn.harmonic.constant.Param;
|
||||
import com.njcn.harmonic.pojo.dto.excel.area.AreaExcel;
|
||||
import com.njcn.harmonic.pojo.excel.area.AreaExcel;
|
||||
import com.njcn.harmonic.pojo.po.EventDetail;
|
||||
import com.njcn.harmonic.pojo.po.LimitRate;
|
||||
import com.njcn.harmonic.pojo.po.LimitTarget;
|
||||
@@ -26,6 +27,7 @@ import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
import org.influxdb.impl.InfluxDBResultMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -45,6 +47,7 @@ import java.util.stream.Collectors;
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/4/29 14:48
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AnalyzeServiceImpl implements IAnalyzeService {
|
||||
@@ -421,8 +424,10 @@ public class AnalyzeServiceImpl implements IAnalyzeService {
|
||||
@Override
|
||||
public String exportArea(OverAreaVO param, String methodDescribe) {
|
||||
List<AreaExcel> result = new ArrayList<>();
|
||||
String fileName = methodDescribe + "_" + param.getSearchBeginTime()+ "-" + param.getSearchEndTime() + "_" + param.getStatisticalType().getName() +".xlsx";
|
||||
String fileName = methodDescribe + CharUtil.UNDERLINE + param.getSearchBeginTime()+ CharUtil.DASHED + param.getSearchEndTime() + CharUtil.UNDERLINE + param.getStatisticalType().getName() +".xlsx";
|
||||
String targetDir = generalInfo.getBusinessTempPath() + File.separator + RequestUtil.getUserIndex();
|
||||
log.error("文件路径" + targetDir);
|
||||
log.error("文件名" + fileName);
|
||||
File excel = new File(targetDir, fileName);
|
||||
List<OverAreaLimitVO> list = getAreaData(param).getRecords();
|
||||
if (!CollectionUtil.isEmpty(list)) {
|
||||
@@ -488,31 +493,31 @@ public class AnalyzeServiceImpl implements IAnalyzeService {
|
||||
//超标监测点个数
|
||||
overAreaLimitVO.setOverLimitMonitorNumber(overLineCount);
|
||||
//超标监测点数占比
|
||||
overAreaLimitVO.setOverBiLi(BigDecimal.valueOf(overLineCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setOverBiLi(BigDecimal.valueOf(overLineCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
//频率偏差
|
||||
overAreaLimitVO.setFrequencyMonitorNumber(freqCount);
|
||||
overAreaLimitVO.setFrequencyBiLi(BigDecimal.valueOf(freqCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setFrequencyBiLi(BigDecimal.valueOf(freqCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
//电压偏差
|
||||
overAreaLimitVO.setVoltageMonitorNumber(voltageCount);
|
||||
overAreaLimitVO.setVoltageBiLi(BigDecimal.valueOf(voltageCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setVoltageBiLi(BigDecimal.valueOf(voltageCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
//谐波电压
|
||||
overAreaLimitVO.setHarmonicVoltageMonitorNumber(uharmCount);
|
||||
overAreaLimitVO.setHarmonicVoltageBiLi(BigDecimal.valueOf(uharmCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setHarmonicVoltageBiLi(BigDecimal.valueOf(uharmCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
//谐波电流
|
||||
overAreaLimitVO.setHarmonicCurrentMonitorNumber(iharmCount);
|
||||
overAreaLimitVO.setHarmonicCurrentBiLi(BigDecimal.valueOf(iharmCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setHarmonicCurrentBiLi(BigDecimal.valueOf(iharmCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
//三相电压不平衡度
|
||||
overAreaLimitVO.setThreePhaseVoltageMonitorNumber(ubalanceCount);
|
||||
overAreaLimitVO.setThreePhaseVoltageBiLi(BigDecimal.valueOf(ubalanceCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setThreePhaseVoltageBiLi(BigDecimal.valueOf(ubalanceCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
//闪变
|
||||
overAreaLimitVO.setFlickerMonitorNumber(flickerCount);
|
||||
overAreaLimitVO.setFlickerBiLi(BigDecimal.valueOf(flickerCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setFlickerBiLi(BigDecimal.valueOf(flickerCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
//负序电流
|
||||
overAreaLimitVO.setNegativeMonitorNumber(iNegCount);
|
||||
overAreaLimitVO.setNegativeBiLi(BigDecimal.valueOf(flickerCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setNegativeBiLi(BigDecimal.valueOf(iNegCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
//间谐波电压
|
||||
overAreaLimitVO.setInterHarmonicMonitorNumber(inuharmCount);
|
||||
overAreaLimitVO.setInterHarmonicBiLi(BigDecimal.valueOf(inuharmCount*1.0/data.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
overAreaLimitVO.setInterHarmonicBiLi(BigDecimal.valueOf(inuharmCount*1.0/data.size()*100).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
}
|
||||
}
|
||||
Map<Instant,List<LimitTarget>> map = list.stream().collect(Collectors.groupingBy(LimitTarget::getTime));
|
||||
|
||||
Reference in New Issue
Block a user