监测点报告抽取公共方法
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.njcn.device.overlimit.mapper;
|
||||
package com.njcn.device.biz.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.overlimit.mapper.OverlimitMapper">
|
||||
<mapper namespace="com.njcn.device.biz.mapper.OverlimitMapper">
|
||||
|
||||
<select id="getAllLineOverLimit" resultType="com.njcn.device.biz.pojo.po.Overlimit">
|
||||
select f.* from pq_line a
|
||||
@@ -762,81 +762,6 @@ public class Overlimit implements Serializable {
|
||||
public Overlimit(){}
|
||||
|
||||
|
||||
public Overlimit(String lineId, String scaTmp, float fDLRL, float fJZRL, float fXYRL, float fSBRL){
|
||||
float[] fLimit = COverlimit.GetOverLimit(scaTmp, fDLRL, fJZRL, fXYRL, fSBRL);
|
||||
this.id=lineId;
|
||||
this.freqDev=fLimit[0];
|
||||
this.voltageDev=fLimit[1];
|
||||
this.ubalance=fLimit[2];
|
||||
this.flicker=fLimit[3];
|
||||
this.uaberrance=fLimit[4];
|
||||
this.uharm2=fLimit[5];
|
||||
this.uharm3=fLimit[6];
|
||||
this.uharm4=fLimit[7];
|
||||
this.uharm5=fLimit[8];
|
||||
this.uharm6=fLimit[9];
|
||||
this.uharm7=fLimit[10];
|
||||
this.uharm8=fLimit[11];
|
||||
this.uharm9=fLimit[12];
|
||||
this.uharm10=fLimit[13];
|
||||
this.uharm11=fLimit[14];
|
||||
this.uharm12=fLimit[15];
|
||||
this.uharm13=fLimit[16];
|
||||
this.uharm14=fLimit[17];
|
||||
this.uharm15=fLimit[18];
|
||||
this.uharm16=fLimit[19];
|
||||
this.uharm17=fLimit[20];
|
||||
this.uharm18=fLimit[21];
|
||||
this.uharm19=fLimit[22];
|
||||
this.uharm20=fLimit[23];
|
||||
this.uharm21=fLimit[24];
|
||||
this.uharm22=fLimit[25];
|
||||
this.uharm23=fLimit[26];
|
||||
this.uharm24=fLimit[27];
|
||||
this.uharm25=fLimit[28];
|
||||
this.iharm2=fLimit[29];
|
||||
this.iharm3=fLimit[30];
|
||||
this.iharm4=fLimit[31];
|
||||
this.iharm5=fLimit[32];
|
||||
this.iharm6=fLimit[33];
|
||||
this.iharm7=fLimit[34];
|
||||
this.iharm8=fLimit[35];
|
||||
this.iharm9=fLimit[36];
|
||||
this.iharm10=fLimit[37];
|
||||
this.iharm11=fLimit[38];
|
||||
this.iharm12=fLimit[39];
|
||||
this.iharm13=fLimit[40];
|
||||
this.iharm14=fLimit[41];
|
||||
this.iharm15=fLimit[42];
|
||||
this.iharm16=fLimit[43];
|
||||
this.iharm17=fLimit[44];
|
||||
this.iharm18=fLimit[45];
|
||||
this.iharm19=fLimit[46];
|
||||
this.iharm20=fLimit[47];
|
||||
this.iharm21=fLimit[48];
|
||||
this.iharm22=fLimit[49];
|
||||
this.iharm23=fLimit[50];
|
||||
this.iharm24=fLimit[51];
|
||||
this.iharm25=fLimit[52];
|
||||
this.uvoltageDev=fLimit[53];
|
||||
this.iNeg=fLimit[54];
|
||||
this.inuharm1=fLimit[55];
|
||||
this.inuharm2=fLimit[56];
|
||||
this.inuharm3=fLimit[57];
|
||||
this.inuharm4=fLimit[58];
|
||||
this.inuharm5=fLimit[59];
|
||||
this.inuharm6=fLimit[60];
|
||||
this.inuharm7=fLimit[61];
|
||||
this.inuharm8=fLimit[62];
|
||||
this.inuharm9=fLimit[63];
|
||||
this.inuharm10=fLimit[64];
|
||||
this.inuharm11=fLimit[65];
|
||||
this.inuharm12=fLimit[66];
|
||||
this.inuharm13=fLimit[67];
|
||||
this.inuharm14=fLimit[68];
|
||||
this.inuharm15=fLimit[69];
|
||||
this.inuharm16=fLimit[70];
|
||||
}
|
||||
|
||||
public void buildIHarm(Float[] iHarmTem){
|
||||
this.iharm2= iHarmTem[0];
|
||||
|
||||
@@ -41,7 +41,7 @@ import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.LineBakService;
|
||||
import com.njcn.device.node.service.INodeService;
|
||||
import com.njcn.device.overlimit.mapper.OverlimitMapper;
|
||||
import com.njcn.device.biz.mapper.OverlimitMapper;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PvDeviceResponseEnum;
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.overlimit.mapper.OverlimitMapper;
|
||||
import com.njcn.device.biz.mapper.OverlimitMapper;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.overlimit.mapper.OverlimitMapper;
|
||||
import com.njcn.device.biz.mapper.OverlimitMapper;
|
||||
import com.njcn.device.overlimit.service.IOverLimitService;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.controller;
|
||||
package com.njcn.harmonic.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -12,7 +12,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.*;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.*;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.service.IRStatLimitRateDService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.controller;
|
||||
package com.njcn.harmonic.controller;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
@@ -15,7 +15,7 @@ import com.njcn.harmonic.pojo.vo.LimitCalendarVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitExtentVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitProbabilityVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitTimeProbabilityVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDetailDService;
|
||||
import com.njcn.harmonic.service.IRStatLimitRateDetailDService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -10,7 +10,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.ReportSearchParam;
|
||||
import com.njcn.harmonic.pojo.param.ReportTemplateParam;
|
||||
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||
import com.njcn.harmonic.pojo.vo.ReportTemplateVO;
|
||||
import com.njcn.harmonic.common.pojo.vo.ReportTemplateVO;
|
||||
import com.njcn.harmonic.pojo.vo.ReportTreeVO;
|
||||
import com.njcn.harmonic.pojo.vo.SysDeptTempVO;
|
||||
import com.njcn.harmonic.service.report.CustomReportService;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.mapper;
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.mapper;
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDetailDPO;
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.RStatDataIDMapper">
|
||||
<mapper namespace="com.njcn.harmonic.rstatlimitrate.mapper.RStatDataIDMapper">
|
||||
|
||||
<select id="getINeg" resultType="com.njcn.harmonic.pojo.po.day.RStatDataIDPO">
|
||||
select
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.RStatDataInharmVDMapper">
|
||||
<mapper namespace="com.njcn.harmonic.rstatlimitrate.mapper.RStatDataInharmVDMapper">
|
||||
|
||||
|
||||
<select id="getV" resultType="com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.RStatDataVDMapper">
|
||||
<mapper namespace="com.njcn.harmonic.rstatlimitrate.mapper.RStatDataVDMapper">
|
||||
|
||||
<select id="getFreqDev" resultType="com.njcn.harmonic.pojo.po.RStatDataVD">
|
||||
select
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.service;
|
||||
package com.njcn.harmonic.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.service;
|
||||
package com.njcn.harmonic.service;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -33,7 +33,7 @@ import com.njcn.harmonic.pojo.vo.MonitorOverLimitVO;
|
||||
import com.njcn.harmonic.pojo.vo.OverAreaLimitVO;
|
||||
import com.njcn.harmonic.pojo.vo.OverAreaVO;
|
||||
import com.njcn.harmonic.pojo.vo.WarningSubstationVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.service.IAnalyzeService;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
|
||||
@@ -23,7 +23,10 @@ import com.njcn.harmonic.pojo.vo.hebeinorth.AssessDetailVo;
|
||||
import com.njcn.harmonic.pojo.vo.hebeinorth.AssessVo;
|
||||
import com.njcn.harmonic.pojo.vo.hebeinorth.EvaluationLevelVo;
|
||||
import com.njcn.harmonic.pojo.vo.hebeinorth.EvaluationVo;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataIDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataInharmVDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataVDMapper;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.service.hebeinorth.IGridService;
|
||||
import com.njcn.harmonic.util.ComAssesUtil;
|
||||
import com.njcn.harmonic.util.TimeUtil;
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.dataProcess.pojo.po.RStatDataHarmRateVD;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
@@ -20,7 +19,6 @@ import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||
import com.njcn.harmonic.mapper.*;
|
||||
import com.njcn.harmonic.pojo.QueryResultLimitVO;
|
||||
@@ -33,8 +31,10 @@ import com.njcn.harmonic.pojo.vo.AssessEvaluation;
|
||||
import com.njcn.harmonic.pojo.vo.EventDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.HistoryDataResultVO;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataHarmRateVDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataIDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataVDMapper;
|
||||
import com.njcn.harmonic.service.HistoryResultService;
|
||||
import com.njcn.harmonic.service.IRStatDataVDService;
|
||||
import com.njcn.influx.imapper.CommonMapper;
|
||||
import com.njcn.influx.imapper.DataHarmRateVMapper;
|
||||
import com.njcn.influx.imapper.DataIMapper;
|
||||
@@ -50,14 +50,11 @@ import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.PollutionSubstationVO;
|
||||
import com.njcn.harmonic.pojo.vo.PollutionVO;
|
||||
import com.njcn.harmonic.pojo.vo.SubstationVo;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.service.PollutionSubstationService;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.njcn.harmonic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.harmonic.mapper.RStatDataVDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataVDMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
||||
import com.njcn.harmonic.service.IRStatDataVDService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.service.impl;
|
||||
package com.njcn.harmonic.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
@@ -19,8 +19,8 @@ import com.njcn.harmonic.pojo.param.TotalLimitStatisticsDetailsQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.TotalLimitStatisticsParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.*;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.service.IRStatLimitRateDService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.service.impl;
|
||||
package com.njcn.harmonic.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
@@ -24,9 +24,9 @@ import com.njcn.harmonic.pojo.vo.LimitCalendarVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitExtentVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitProbabilityVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitTimeProbabilityVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDetailDMapper;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDetailDService;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDetailDMapper;
|
||||
import com.njcn.harmonic.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.service.IRStatLimitRateDetailDService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -4,9 +4,9 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.harmonic.mapper.RStatDataHarmRateVDMapper;
|
||||
import com.njcn.harmonic.mapper.RStatDataIDMapper;
|
||||
import com.njcn.harmonic.mapper.RStatDataInharmVDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataHarmRateVDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataIDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataInharmVDMapper;
|
||||
import com.njcn.harmonic.mapper.ReportMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataHarmrateVDPO;
|
||||
@@ -15,6 +15,7 @@ import com.njcn.harmonic.pojo.param.ReportQueryParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
import com.njcn.harmonic.pojo.po.report.OverLimitInfo;
|
||||
import com.njcn.harmonic.pojo.vo.ReportValue;
|
||||
import com.njcn.harmonic.common.service.impl.RegroupDataComm;
|
||||
import com.njcn.harmonic.service.IRStatDataVDService;
|
||||
import com.njcn.harmonic.service.ReportService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -74,9 +75,9 @@ public class ReportServiceImpl implements ReportService {
|
||||
//获取线电压有效值
|
||||
List<ReportValue> listVV = reportMapper.getVVirtualData(param);
|
||||
|
||||
RegroupData.regroupData(listV, true);
|
||||
RegroupData.regroupData(listI, true);
|
||||
RegroupData.regroupData(listVV, true);
|
||||
RegroupDataComm.regroupData(listV, true);
|
||||
RegroupDataComm.regroupData(listI, true);
|
||||
RegroupDataComm.regroupData(listVV, true);
|
||||
list.addAll(listV);
|
||||
list.addAll(listI);
|
||||
list.addAll(listVV);
|
||||
@@ -96,10 +97,10 @@ public class ReportServiceImpl implements ReportService {
|
||||
//获取功率因数
|
||||
List<ReportValue> listF = reportMapper.getPF(param);
|
||||
|
||||
RegroupData.regroupData(listP, true, false);
|
||||
RegroupData.regroupData(listQ, true, false);
|
||||
RegroupData.regroupData(listS, true, false);
|
||||
RegroupData.regroupData(listF, true, false);
|
||||
RegroupDataComm.regroupData(listP, true, false);
|
||||
RegroupDataComm.regroupData(listQ, true, false);
|
||||
RegroupDataComm.regroupData(listS, true, false);
|
||||
RegroupDataComm.regroupData(listF, true, false);
|
||||
list.addAll(listP);
|
||||
list.addAll(listQ);
|
||||
list.addAll(listS);
|
||||
@@ -116,8 +117,8 @@ public class ReportServiceImpl implements ReportService {
|
||||
//长时闪变
|
||||
List<ReportValue> listLFlicker = reportMapper.getLFlickerData(param);
|
||||
|
||||
RegroupData.regroupData(listFlicker, true);
|
||||
RegroupData.regroupData(listLFlicker, true);
|
||||
RegroupDataComm.regroupData(listFlicker, true);
|
||||
RegroupDataComm.regroupData(listLFlicker, true);
|
||||
list.addAll(listFlicker);
|
||||
list.addAll(listLFlicker);
|
||||
|
||||
@@ -132,8 +133,8 @@ public class ReportServiceImpl implements ReportService {
|
||||
List<ReportValue> listU = reportMapper.getUVdeviationData(param);
|
||||
List<ReportValue> listL = reportMapper.getLVdeviationData(param);
|
||||
|
||||
RegroupData.regroupData(listU, true);
|
||||
RegroupData.regroupData(listL, true);
|
||||
RegroupDataComm.regroupData(listU, true);
|
||||
RegroupDataComm.regroupData(listL, true);
|
||||
list.addAll(listU);
|
||||
list.addAll(listL);
|
||||
return list;
|
||||
@@ -148,8 +149,8 @@ public class ReportServiceImpl implements ReportService {
|
||||
List<ReportValue> listI = reportMapper.getDistortionDataI(param);
|
||||
|
||||
//添加之前判断数据库是否有数据,如果没有数据模拟数据添加到集合中
|
||||
RegroupData.regroupData(listU, true);
|
||||
RegroupData.regroupData(listI, true);
|
||||
RegroupDataComm.regroupData(listU, true);
|
||||
RegroupDataComm.regroupData(listI, true);
|
||||
list.addAll(listU);
|
||||
list.addAll(listI);
|
||||
|
||||
@@ -164,8 +165,8 @@ public class ReportServiceImpl implements ReportService {
|
||||
List<ReportValue> listFreDEV = reportMapper.getDEVFrequencyData(param);
|
||||
|
||||
|
||||
RegroupData.regroupData(listFre, true);
|
||||
RegroupData.regroupData(listFreDEV, true);
|
||||
RegroupDataComm.regroupData(listFre, true);
|
||||
RegroupDataComm.regroupData(listFreDEV, true);
|
||||
list.addAll(listFre);
|
||||
list.addAll(listFreDEV);
|
||||
return list;
|
||||
@@ -201,7 +202,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
List<ReportValue> listI = dataI(param, Arrays.asList("A", "B", "C"), 1, 51, false, 0);
|
||||
if (CollUtil.isEmpty(listI)) {
|
||||
for (int i = 0; i < 50; i++) {
|
||||
RegroupData.regroupData(list, true, true);
|
||||
RegroupDataComm.regroupData(list, true, true);
|
||||
}
|
||||
} else {
|
||||
list.addAll(listI);
|
||||
@@ -217,7 +218,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
List<ReportValue> listV = dataV(param, Arrays.asList("A", "B", "C"), 1, 2, false, 5);
|
||||
|
||||
if (CollUtil.isEmpty(listV)) {
|
||||
RegroupData.regroupData(list, true, true);
|
||||
RegroupDataComm.regroupData(list, true, true);
|
||||
} else {
|
||||
list.addAll(listV);
|
||||
}
|
||||
@@ -227,7 +228,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
if (CollUtil.isEmpty(listRate)) {
|
||||
for (int i = 0; i < 49; i++) {
|
||||
RegroupData.regroupData(list, true, true);
|
||||
RegroupDataComm.regroupData(list, true, true);
|
||||
}
|
||||
} else {
|
||||
list.addAll(listRate);
|
||||
@@ -235,7 +236,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
//获取电压畸变率
|
||||
List<ReportValue> listU = reportMapper.getDistortionDataV(param);
|
||||
RegroupData.regroupData(listU, true);
|
||||
RegroupDataComm.regroupData(listU, true);
|
||||
list.addAll(listU);
|
||||
return list;
|
||||
}
|
||||
@@ -290,7 +291,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
});
|
||||
if (CollUtil.isEmpty(a)) {
|
||||
for (int i = 1; i < 17; i++) {
|
||||
RegroupData.regroupData(a, true, true);
|
||||
RegroupDataComm.regroupData(a, true, true);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
@@ -301,7 +302,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
//负序电流
|
||||
List<ReportValue> iNegData = reportMapper.getINegData(param);
|
||||
RegroupData.regroupData(iNegData, true);
|
||||
RegroupDataComm.regroupData(iNegData, true);
|
||||
list.addAll(iNegData);
|
||||
return list;
|
||||
}
|
||||
@@ -310,7 +311,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
private void regroupData(List<ReportValue> list) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
List<ReportValue> list1 = new ArrayList<>();
|
||||
RegroupData.regroupData(list1, false);
|
||||
RegroupDataComm.regroupData(list1, false);
|
||||
list.addAll(list1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,7 @@ import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.MonitorOverLimitVO;
|
||||
import com.njcn.harmonic.pojo.vo.SteadyExceedRateCensusVO;
|
||||
import com.njcn.harmonic.pojo.vo.SteadyExceedRateVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.service.SteadyExceedRateService;
|
||||
import com.njcn.harmonic.utils.PubUtils;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
@@ -53,7 +52,6 @@ public class SteadyExceedRateServiceImpl implements SteadyExceedRateService {
|
||||
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
private final SteadyExceedRateMapper steadyExceedRateMapper;
|
||||
private final IRStatLimitRateDService rateDService;
|
||||
private final RStatLimitRateDMapper rateDMapper;
|
||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||
|
||||
@@ -531,7 +529,7 @@ public class SteadyExceedRateServiceImpl implements SteadyExceedRateService {
|
||||
*/
|
||||
private List<LimitRatePO> getQualifiesRate(List<String> lineIndexes, String startTime, String endTime) {
|
||||
List<LimitRatePO> limitRatePOS = new ArrayList<>();
|
||||
List<RStatLimitRateDPO> limitRates = rateDService.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
List<RStatLimitRateDPO> limitRates = rateDMapper.selectList(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.in(RStatLimitRateDPO::getLineId, lineIndexes)
|
||||
.eq(RStatLimitRateDPO::getPhasicType, InfluxDBTableConstant.PHASE_TYPE_T)
|
||||
.ge(StrUtil.isNotBlank(startTime), RStatLimitRateDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(startTime)))
|
||||
|
||||
@@ -13,12 +13,12 @@ import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.mapper.SteadyQualifyMapper;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.SteadyQualifyCensusVO;
|
||||
import com.njcn.harmonic.pojo.vo.SteadyQualifyDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.SteadyQualifyVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.service.SteadyQualifyService;
|
||||
import com.njcn.harmonic.utils.PubUtils;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
@@ -45,7 +45,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
|
||||
private final SteadyQualifyMapper steadyQualifyMapper;
|
||||
|
||||
private final IRStatLimitRateDService rateDService;
|
||||
private final RStatLimitRateDMapper rStatLimitRateDMapper;
|
||||
|
||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||
|
||||
@@ -543,7 +543,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
* @param endTime
|
||||
*/
|
||||
private List<RStatLimitRateDPO> getQualifiesRate(List<String> lineIndexes, String startTime, String endTime) {
|
||||
return rateDService.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
return rStatLimitRateDMapper.selectList(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.in(RStatLimitRateDPO::getLineId, lineIndexes)
|
||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
||||
.ge(StrUtil.isNotBlank(startTime), RStatLimitRateDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(startTime)))
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.njcn.harmonic.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
@@ -16,7 +13,7 @@ import com.njcn.harmonic.pojo.param.RMpPartHarmonicDetailQueryParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpPartHarmonicDetailD;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPartHarmonicDetailIconVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.service.majornetwork.RMpPartHarmonicDetailDService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||
import com.njcn.harmonic.pojo.vo.MonitorLimitRateVO;
|
||||
import com.njcn.harmonic.pojo.vo.PwLimitDataVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.service.IRStatLimitTargetDService;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
|
||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.njcn.harmonic.service.report;
|
||||
import com.njcn.harmonic.pojo.param.ReportSearchParam;
|
||||
import com.njcn.harmonic.pojo.param.ReportTemplateParam;
|
||||
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||
import com.njcn.harmonic.pojo.vo.ReportTemplateVO;
|
||||
import com.njcn.harmonic.common.pojo.vo.ReportTemplateVO;
|
||||
import com.njcn.harmonic.pojo.vo.ReportTreeVO;
|
||||
import com.njcn.harmonic.pojo.vo.SysDeptTempVO;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||
import com.njcn.harmonic.mapper.DeptTempMapper;
|
||||
import com.njcn.harmonic.mapper.EleEpdMapper;
|
||||
import com.njcn.harmonic.mapper.ExcelRptTempMapper;
|
||||
import com.njcn.harmonic.common.mapper.ExcelRptTempMapper;
|
||||
import com.njcn.harmonic.pojo.dto.ReportTemplateDTO;
|
||||
import com.njcn.harmonic.pojo.param.ReportSearchParam;
|
||||
import com.njcn.harmonic.pojo.param.ReportTemplateParam;
|
||||
@@ -39,7 +39,7 @@ import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||
import com.njcn.harmonic.pojo.po.SysDeptTemp;
|
||||
import com.njcn.harmonic.pojo.vo.ReportTemplateVO;
|
||||
import com.njcn.harmonic.common.pojo.vo.ReportTemplateVO;
|
||||
import com.njcn.harmonic.pojo.vo.ReportTreeVO;
|
||||
import com.njcn.harmonic.pojo.vo.SysDeptTempVO;
|
||||
import com.njcn.harmonic.service.report.CustomReportService;
|
||||
@@ -101,7 +101,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
private final WlRecordFeignClient wlRecordFeignClient;
|
||||
|
||||
private final ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1);
|
||||
|
||||
|
||||
private final String CELL_DATA = "celldata";
|
||||
private final String V = "v";
|
||||
private final String STR_ONE = "#";
|
||||
@@ -1167,6 +1167,115 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 对多测点数据进行计算求出一组数据
|
||||
* @param method
|
||||
* @param allList
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> dealResultMap(String method, List<Map<String, Object>> allList) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
// 遍历列表中的每个Map
|
||||
if (method.equals(InfluxDbSqlConstant.MIN)) {
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
// 检查结果Map中是否已包含该键
|
||||
if (!resultMap.containsKey(key) || (double) resultMap.get(key) > value) {
|
||||
// 如果不包含,或当前值更大,则更新结果Map
|
||||
resultMap.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (method.equals(InfluxDbSqlConstant.MAX) || method.equals(InfluxDbSqlConstant.PERCENTILE)) {
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
// 检查结果Map中是否已包含该键
|
||||
if (!resultMap.containsKey(key) || (double) resultMap.get(key) < value) {
|
||||
// 如果不包含,或当前值更大,则更新结果Map
|
||||
resultMap.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (method.equals(InfluxDbSqlConstant.AVG)) {
|
||||
Map<String, Double> sumMap = new HashMap<>();
|
||||
Map<String, Integer> countMap = new HashMap<>();
|
||||
// 遍历列表中的每个Map
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
|
||||
// 更新累计和
|
||||
sumMap.put(key, sumMap.getOrDefault(key, 0.0) + value);
|
||||
// 更新计数
|
||||
countMap.put(key, countMap.getOrDefault(key, 0) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 计算平均值并存储到结果Map中
|
||||
for (String key : sumMap.keySet()) {
|
||||
double sum = sumMap.get(key);
|
||||
int count = countMap.get(key);
|
||||
double average = BigDecimal.valueOf(sum / count).setScale(3, RoundingMode.HALF_UP).doubleValue();
|
||||
resultMap.put(key, average);
|
||||
}
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 处理指标超标结论
|
||||
*/
|
||||
private void dealTargetResult
|
||||
(Map<String, ReportTemplateDTO> assNoPassMap, Map<String, ReportTemplateDTO> limitTargetMapX, List<ReportTemplateDTO> endList) {
|
||||
assNoPassMap.forEach((key, val) -> {
|
||||
limitTargetMapX.remove(key);
|
||||
if ("Freq_Dev".toUpperCase().equals(val.getTemplateName())) {
|
||||
val.setValue("±" + val.getValue());
|
||||
}
|
||||
|
||||
String expend = "";
|
||||
if(Objects.nonNull(val.getLowValue())){
|
||||
expend = val.getLowValue()+",";
|
||||
}
|
||||
if (val.getOverLimitFlag() == 1) {
|
||||
val.setValue("不合格 (" + expend+val.getValue() + ")");
|
||||
} else {
|
||||
val.setValue("合格 (" + expend+val.getValue() + ")");
|
||||
}
|
||||
endList.add(val);
|
||||
});
|
||||
|
||||
limitTargetMapX.forEach((key, val) -> {
|
||||
if (Objects.isNull(val.getOverLimitFlag())) {
|
||||
val.setValue("/");
|
||||
} else {
|
||||
val.setValue("合格");
|
||||
}
|
||||
endList.add(val);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void analyzeReportZhejiang(ReportSearchParam reportSearchParam, ExcelRptTemp excelRptTemp, HttpServletResponse response) {
|
||||
//指标
|
||||
List<ReportTemplateDTO> reportTemplateDTOList = new ArrayList<>();
|
||||
@@ -1438,178 +1547,6 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
endList.addAll(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对多测点数据进行计算求出一组数据
|
||||
* @param method
|
||||
* @param allList
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> dealResultMap(String method, List<Map<String, Object>> allList) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
// 遍历列表中的每个Map
|
||||
if (method.equals(InfluxDbSqlConstant.MIN)) {
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
// 检查结果Map中是否已包含该键
|
||||
if (!resultMap.containsKey(key) || (double) resultMap.get(key) > value) {
|
||||
// 如果不包含,或当前值更大,则更新结果Map
|
||||
resultMap.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (method.equals(InfluxDbSqlConstant.MAX) || method.equals(InfluxDbSqlConstant.PERCENTILE)) {
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
// 检查结果Map中是否已包含该键
|
||||
if (!resultMap.containsKey(key) || (double) resultMap.get(key) < value) {
|
||||
// 如果不包含,或当前值更大,则更新结果Map
|
||||
resultMap.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (method.equals(InfluxDbSqlConstant.AVG)) {
|
||||
Map<String, Double> sumMap = new HashMap<>();
|
||||
Map<String, Integer> countMap = new HashMap<>();
|
||||
// 遍历列表中的每个Map
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
|
||||
// 更新累计和
|
||||
sumMap.put(key, sumMap.getOrDefault(key, 0.0) + value);
|
||||
// 更新计数
|
||||
countMap.put(key, countMap.getOrDefault(key, 0) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 计算平均值并存储到结果Map中
|
||||
for (String key : sumMap.keySet()) {
|
||||
double sum = sumMap.get(key);
|
||||
int count = countMap.get(key);
|
||||
double average = BigDecimal.valueOf(sum / count).setScale(3, RoundingMode.HALF_UP).doubleValue();
|
||||
resultMap.put(key, average);
|
||||
}
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
private void dealExcelResult(JSONArray
|
||||
jsonArray, Map<String, List<ReportTemplateDTO>> assMap, Map<String, String> unit,Map<String,String> finalTerminalMap) {
|
||||
jsonArray.forEach(item -> {
|
||||
JSONObject jsonObject = (JSONObject) item;
|
||||
JSONArray itemArr = (JSONArray) jsonObject.get(CELL_DATA);
|
||||
itemArr.forEach((it) -> {
|
||||
if (Objects.nonNull(it) && !"null".equals(it.toString())) {
|
||||
//获取到1列
|
||||
JSONObject data = (JSONObject) it;
|
||||
JSONObject son = (JSONObject) data.get(V);
|
||||
if (son.containsKey(V)) {
|
||||
String v = son.getStr(V);
|
||||
//数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$
|
||||
if (v.charAt(0) == '$' && v.contains(STR_ONE)) {
|
||||
String str = "";
|
||||
List<ReportTemplateDTO> rDto = assMap.get(v.replace(STR_TWO, ""));
|
||||
if (Objects.nonNull(rDto)) {
|
||||
str = rDto.get(0).getValue();
|
||||
//没有值,赋"/"
|
||||
if (StringUtils.isBlank(str)) {
|
||||
str = "/";
|
||||
}
|
||||
son.set(V, str);
|
||||
if (Objects.nonNull(rDto.get(0).getOverLimitFlag()) && rDto.get(0).getOverLimitFlag() == 1) {
|
||||
son.set("fc", "#990000");
|
||||
}
|
||||
}
|
||||
} else if (v.charAt(0) == '%' && v.contains(STR_ONE)) {
|
||||
//指标合格情况
|
||||
String str = "";
|
||||
List<ReportTemplateDTO> rDto = assMap.get(v.replace(STR_FOUR, ""));
|
||||
if (Objects.nonNull(rDto)) {
|
||||
str = rDto.get(0).getValue();
|
||||
//没有值,赋"/"
|
||||
if (StringUtils.isBlank(str)) {
|
||||
str = "/";
|
||||
}
|
||||
son.set(V, str);
|
||||
if ("不合格".equals(str)) {
|
||||
son.set("fc", "#990000");
|
||||
}
|
||||
}
|
||||
} else if (v.charAt(0) == '&') {
|
||||
//结论
|
||||
String tem = v.replace(STR_THREE, "");
|
||||
if (Objects.nonNull(finalTerminalMap)) {
|
||||
if ("statis_time".equals(tem)) {
|
||||
// son.set(V, reportSearchParam.getStartTime() + InfluxDbSqlConstant.START_TIME + "_" + reportSearchParam.getEndTime() + InfluxDbSqlConstant.END_TIME);
|
||||
} else {
|
||||
//台账信息
|
||||
son.set(V, finalTerminalMap.getOrDefault(tem, "/"));
|
||||
}
|
||||
}
|
||||
} else if (v.charAt(0) == '@' && v.contains(STR_ONE)) {
|
||||
//解决数据单位问题 @指标#类型@
|
||||
String replace = v.replace("@", "");
|
||||
son.set(V, unit.getOrDefault(replace, "/"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理指标超标结论
|
||||
*/
|
||||
private void dealTargetResult
|
||||
(Map<String, ReportTemplateDTO> assNoPassMap, Map<String, ReportTemplateDTO> limitTargetMapX, List<ReportTemplateDTO> endList) {
|
||||
assNoPassMap.forEach((key, val) -> {
|
||||
limitTargetMapX.remove(key);
|
||||
if ("Freq_Dev".toUpperCase().equals(val.getTemplateName())) {
|
||||
val.setValue("±" + val.getValue());
|
||||
}
|
||||
|
||||
String expend = "";
|
||||
if(Objects.nonNull(val.getLowValue())){
|
||||
expend = val.getLowValue()+",";
|
||||
}
|
||||
if (val.getOverLimitFlag() == 1) {
|
||||
val.setValue("不合格 (" + expend+val.getValue() + ")");
|
||||
} else {
|
||||
val.setValue("合格 (" + expend+val.getValue() + ")");
|
||||
}
|
||||
endList.add(val);
|
||||
});
|
||||
|
||||
limitTargetMapX.forEach((key, val) -> {
|
||||
if (Objects.isNull(val.getOverLimitFlag())) {
|
||||
val.setValue("/");
|
||||
} else {
|
||||
val.setValue("合格");
|
||||
}
|
||||
endList.add(val);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析模板
|
||||
*
|
||||
@@ -1689,6 +1626,74 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void dealExcelResult(JSONArray
|
||||
jsonArray, Map<String, List<ReportTemplateDTO>> assMap, Map<String, String> unit,Map<String,String> finalTerminalMap) {
|
||||
jsonArray.forEach(item -> {
|
||||
JSONObject jsonObject = (JSONObject) item;
|
||||
JSONArray itemArr = (JSONArray) jsonObject.get(CELL_DATA);
|
||||
itemArr.forEach((it) -> {
|
||||
if (Objects.nonNull(it) && !"null".equals(it.toString())) {
|
||||
//获取到1列
|
||||
JSONObject data = (JSONObject) it;
|
||||
JSONObject son = (JSONObject) data.get(V);
|
||||
if (son.containsKey(V)) {
|
||||
String v = son.getStr(V);
|
||||
//数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$
|
||||
if (v.charAt(0) == '$' && v.contains(STR_ONE)) {
|
||||
String str = "";
|
||||
List<ReportTemplateDTO> rDto = assMap.get(v.replace(STR_TWO, ""));
|
||||
if (Objects.nonNull(rDto)) {
|
||||
str = rDto.get(0).getValue();
|
||||
//没有值,赋"/"
|
||||
if (StringUtils.isBlank(str)) {
|
||||
str = "/";
|
||||
}
|
||||
son.set(V, str);
|
||||
if (Objects.nonNull(rDto.get(0).getOverLimitFlag()) && rDto.get(0).getOverLimitFlag() == 1) {
|
||||
son.set("fc", "#990000");
|
||||
}
|
||||
}
|
||||
} else if (v.charAt(0) == '%' && v.contains(STR_ONE)) {
|
||||
//指标合格情况
|
||||
String str = "";
|
||||
List<ReportTemplateDTO> rDto = assMap.get(v.replace(STR_FOUR, ""));
|
||||
if (Objects.nonNull(rDto)) {
|
||||
str = rDto.get(0).getValue();
|
||||
//没有值,赋"/"
|
||||
if (StringUtils.isBlank(str)) {
|
||||
str = "/";
|
||||
}
|
||||
son.set(V, str);
|
||||
if ("不合格".equals(str)) {
|
||||
son.set("fc", "#990000");
|
||||
}
|
||||
}
|
||||
} else if (v.charAt(0) == '&') {
|
||||
//结论
|
||||
String tem = v.replace(STR_THREE, "");
|
||||
if (Objects.nonNull(finalTerminalMap)) {
|
||||
if ("statis_time".equals(tem)) {
|
||||
// son.set(V, reportSearchParam.getStartTime() + InfluxDbSqlConstant.START_TIME + "_" + reportSearchParam.getEndTime() + InfluxDbSqlConstant.END_TIME);
|
||||
} else {
|
||||
//台账信息
|
||||
son.set(V, finalTerminalMap.getOrDefault(tem, "/"));
|
||||
}
|
||||
}
|
||||
} else if (v.charAt(0) == '@' && v.contains(STR_ONE)) {
|
||||
//解决数据单位问题 @指标#类型@
|
||||
String replace = v.replace("@", "");
|
||||
son.set(V, unit.getOrDefault(replace, "/"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static boolean isInteger(String str) {
|
||||
try {
|
||||
Integer.parseInt(str);
|
||||
|
||||
@@ -13,17 +13,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.baomidou.mybatisplus.extension.api.R;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.LineIntegrityDataClient;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.api.PmsMidLedgerClient;
|
||||
import com.njcn.device.pms.pojo.param.DataQualityDetailsParam;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.harmonic.mapper.RStatDataVDMapper;
|
||||
import com.njcn.harmonic.common.mapper.RStatDataVDMapper;
|
||||
import com.njcn.harmonic.mapper.upload.*;
|
||||
import com.njcn.harmonic.pojo.dto.upload.PqEvaluationCreateDTO;
|
||||
import com.njcn.harmonic.pojo.dto.upload.RDimUpDTO;
|
||||
@@ -35,7 +33,7 @@ import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.po.upload.*;
|
||||
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
|
||||
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.service.upload.IEvaluationDataService;
|
||||
import com.njcn.harmonic.service.upload.IRUploadDataLogService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
|
||||
Binary file not shown.
@@ -24,6 +24,11 @@
|
||||
<artifactId>harmonic-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>cs-device-api</artifactId>
|
||||
@@ -37,4 +42,4 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
package com.njcn.harmonic.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.harmonic.pojo.param.ReportSearchParam;
|
||||
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||
import com.njcn.harmonic.pojo.vo.ReportTemplateVO;
|
||||
import com.njcn.harmonic.common.pojo.vo.ReportTemplateVO;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.njcn.harmonic.common.mapper;
|
||||
|
||||
import com.njcn.harmonic.pojo.param.ReportQueryParam;
|
||||
import com.njcn.harmonic.pojo.vo.ReportValue;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 谐波报告查询
|
||||
*/
|
||||
public interface MonitorCommReportMapper {
|
||||
/**
|
||||
* 获取电流有效值
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getVirtualDataI(@Param("param") ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 获取电压有效值
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getVirtualDataV(@Param("param") ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* CP95条数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Integer getTotalCP95Day(@Param("param")ReportQueryParam param);
|
||||
/**
|
||||
* CP95条数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Integer getTotalPltCP95Day(@Param("param")ReportQueryParam param);
|
||||
/**
|
||||
* CP95条数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Integer getTotalPstCP95Day(@Param("param")ReportQueryParam param);
|
||||
|
||||
|
||||
List<ReportValue> getVVirtualData(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 获取有功功率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getPowerP(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 无功功率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getPowerQ(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 视在功率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getPowerS(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 功率因数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getPF(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 短时闪变
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getFlickerData(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 长时闪变
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getLFlickerData(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 电压负偏差
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getUVdeviationData(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 电压正偏差
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getLVdeviationData(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 获取电压畸变率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getDistortionDataV(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 获取电流畸变率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getDistortionDataI(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
*频率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getFrequencyData(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
*频率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getDEVFrequencyData(@Param("param")ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 负序电流
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getINegData(@Param("param")ReportQueryParam param);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
package com.njcn.harmonic.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataHarmrateVDPO;
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
package com.njcn.harmonic.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataIDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
package com.njcn.harmonic.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
package com.njcn.harmonic.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.ExcelRptTempMapper">
|
||||
<mapper namespace="com.njcn.harmonic.rstatlimitrate.mapper.ExcelRptTempMapper">
|
||||
|
||||
<select id="getReportTemplateListPage" resultType="ReportTemplateVO">
|
||||
<select id="getReportTemplateListPage" resultType="com.njcn.harmonic.common.pojo.vo.ReportTemplateVO">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
@@ -23,7 +23,7 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getReportTemplateList" resultType="ReportTemplateVO">
|
||||
<select id="getReportTemplateList" resultType="com.njcn.harmonic.common.pojo.vo.ReportTemplateVO">
|
||||
SELECT
|
||||
a.id,
|
||||
a.NAME,
|
||||
@@ -40,7 +40,7 @@
|
||||
a.state = 1
|
||||
</select>
|
||||
|
||||
<select id="getReportTemplateByDept" resultType="ReportTemplateVO">
|
||||
<select id="getReportTemplateByDept" resultType="com.njcn.harmonic.common.pojo.vo.ReportTemplateVO">
|
||||
SELECT
|
||||
DISTINCT
|
||||
a.id,
|
||||
@@ -0,0 +1,467 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.common.mapper.MonitorCommReportMapper">
|
||||
<select id="getVirtualDataI" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN rms END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN rms END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN rms END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN rms END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_i_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type;
|
||||
</select>
|
||||
<select id="getVirtualDataV" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN rms END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN rms END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN rms END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN rms END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type
|
||||
</select>
|
||||
<select id="getTotalCP95Day" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count( rms ) total
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
phasic_type IN ( 'A' )
|
||||
AND value_type = "CP95"
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getTotalPltCP95Day" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count( plt ) total
|
||||
FROM
|
||||
r_stat_data_plt_d
|
||||
<where>
|
||||
phasic_type IN ( 'A' )
|
||||
AND value_type = "CP95"
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getTotalPstCP95Day" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count( pst ) total
|
||||
FROM
|
||||
r_stat_data_flicker_d
|
||||
<where>
|
||||
phasic_type IN ( 'A' )
|
||||
AND value_type = "CP95"
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getVVirtualData" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN rms_lvr END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN rms_lvr END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN rms_lvr END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN rms_lvr END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type
|
||||
</select>
|
||||
<select id="getPowerP" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN p END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN p END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN p END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN p END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_harmpower_p_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' ,'T')
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type
|
||||
</select>
|
||||
<select id="getPF" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN pf END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN pf END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN pf END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN pf END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_harmpower_p_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' ,'T')
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type
|
||||
</select>
|
||||
<select id="getPowerQ" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN q END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN q END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN q END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN q END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_harmpower_q_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' ,'T')
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type
|
||||
</select>
|
||||
<select id="getPowerS" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN s END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN s END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN s END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN s END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_harmpower_s_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' ,'T')
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type
|
||||
</select>
|
||||
<!-- 短闪字段错了-->
|
||||
<select id="getFlickerData" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN pst END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN pst END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN pst END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN pst END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_flicker_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type
|
||||
</select>
|
||||
<!-- 长闪表查错了-->
|
||||
<select id="getLFlickerData" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN plt END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN plt END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN plt END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN plt END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_plt_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C')
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type
|
||||
</select>
|
||||
<select id="getUVdeviationData" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN vu_dev END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN vu_dev END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN vu_dev END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN vu_dev END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type;
|
||||
</select>
|
||||
<select id="getLVdeviationData" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN vl_dev END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN vl_dev END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN vl_dev END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN vl_dev END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type;
|
||||
</select>
|
||||
<select id="getDistortionDataV" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN v_thd END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN v_thd END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN v_thd END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN v_thd END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type;
|
||||
</select>
|
||||
<select id="getDistortionDataI" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN i_thd END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN i_thd END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN i_thd END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN i_thd END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_i_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type;
|
||||
</select>
|
||||
<select id="getFrequencyData" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN freq END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN freq END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN freq END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN freq END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
phasic_type = 'T'
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type;
|
||||
</select>
|
||||
<select id="getDEVFrequencyData" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN freq_dev END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN freq_dev END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN freq_dev END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN freq_dev END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
phasic_type = 'T'
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type;
|
||||
</select>
|
||||
<select id="getINegData" resultType="com.njcn.harmonic.pojo.vo.ReportValue">
|
||||
SELECT
|
||||
phasic_type AS phaseType,
|
||||
AVG( CASE WHEN value_type = 'AVG' THEN i_neg END ) AS meanValue,
|
||||
MIN( CASE WHEN value_type = 'MIN' THEN i_neg END ) AS minValue,
|
||||
MAX( CASE WHEN value_type = 'MAX' THEN i_neg END ) AS fmaxValue,
|
||||
MAX( CASE WHEN value_type = 'CP95' THEN i_neg END ) AS cp95Value
|
||||
FROM
|
||||
r_stat_data_i_d
|
||||
<where>
|
||||
phasic_type IN ( 'A', 'B', 'C' )
|
||||
and quality_flag = 0
|
||||
<if test="param.startTime != null and param.startTime != ''">
|
||||
and time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
and time <= #{param.endTime}
|
||||
</if>
|
||||
<if test="param.lineId != null and param.lineId != ''">
|
||||
and line_id = #{param.lineId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
phasic_type;
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.njcn.harmonic.common.pojo.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2026/1/17
|
||||
*/
|
||||
@Data
|
||||
public class DeviceUnitCommDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "DEV_INDEX")
|
||||
@ApiModelProperty(value = "终端编号")
|
||||
private String devIndex;
|
||||
|
||||
@TableField("UNIT_FREQUENCY")
|
||||
@ApiModelProperty(value = "频率")
|
||||
private String unitFrequency = "Hz";
|
||||
|
||||
@TableField("UNIT_FREQUENCY_DEV")
|
||||
@ApiModelProperty(value = "频率偏差")
|
||||
private String unitFrequencyDev = "Hz";
|
||||
|
||||
@TableField("PHASE_VOLTAGE")
|
||||
@ApiModelProperty(value = "相电压有效值")
|
||||
private String phaseVoltage = "kV";
|
||||
|
||||
@TableField("LINE_VOLTAGE")
|
||||
@ApiModelProperty(value = "线电压有效值")
|
||||
private String lineVoltage = "kV";
|
||||
|
||||
@TableField("VOLTAGE_DEV")
|
||||
@ApiModelProperty(value = "电压上偏差")
|
||||
private String voltageDev = "%";
|
||||
|
||||
@TableField("UVOLTAGE_DEV")
|
||||
@ApiModelProperty(value = "电压下偏差")
|
||||
private String uvoltageDev = "%";
|
||||
|
||||
@TableField("I_EFFECTIVE")
|
||||
@ApiModelProperty(value = "电流有效值")
|
||||
private String ieffective = "A";
|
||||
|
||||
@TableField("SINGLE_P")
|
||||
@ApiModelProperty(value = "单相有功功率")
|
||||
private String singleP = "kW";
|
||||
|
||||
@TableField("SINGLE_VIEW_P")
|
||||
@ApiModelProperty(value = "单相视在功率")
|
||||
private String singleViewP = "kVA";
|
||||
|
||||
@TableField("SINGLE_NO_P")
|
||||
@ApiModelProperty(value = "单相无功功率")
|
||||
private String singleNoP = "kVar";
|
||||
|
||||
@TableField("TOTAL_ACTIVE_P")
|
||||
@ApiModelProperty(value = "总有功功率")
|
||||
private String totalActiveP = "kW";
|
||||
|
||||
@TableField("TOTAL_VIEW_P")
|
||||
@ApiModelProperty(value = "总视在功率")
|
||||
private String totalViewP = "kVA";
|
||||
|
||||
@TableField("TOTAL_NO_P")
|
||||
@ApiModelProperty(value = "总无功功率")
|
||||
private String totalNoP = "kVar";
|
||||
|
||||
@TableField("V_FUND_EFFECTIVE")
|
||||
@ApiModelProperty(value = "相(线)电压基波有效值")
|
||||
private String vfundEffective = "kV";
|
||||
|
||||
@TableField("I_FUND")
|
||||
@ApiModelProperty(value = "基波电流")
|
||||
private String ifund = "A";
|
||||
|
||||
@TableField("FUND_ACTIVE_P")
|
||||
@ApiModelProperty(value = "基波有功功率")
|
||||
private String fundActiveP = "kW";
|
||||
|
||||
@TableField("FUND_NO_P")
|
||||
@ApiModelProperty(value = "基波无功功率")
|
||||
private String fundNoP = "kVar";
|
||||
|
||||
@TableField("V_DISTORTION")
|
||||
@ApiModelProperty(value = "电压总谐波畸变率")
|
||||
private String vdistortion = "%";
|
||||
|
||||
@TableField("V_HARMONIC_RATE")
|
||||
@ApiModelProperty(value = "2~50次谐波电压含有率")
|
||||
private String vharmonicRate = "%";
|
||||
|
||||
@TableField("I_HARMONIC")
|
||||
@ApiModelProperty(value = "2~50次谐波电流有效值")
|
||||
private String iharmonic = "A";
|
||||
|
||||
@TableField("P_HARMONIC")
|
||||
@ApiModelProperty(value = "2~50次谐波有功功率")
|
||||
private String pharmonic = "kW";
|
||||
|
||||
@TableField("I_IHARMONIC")
|
||||
@ApiModelProperty(value = "0.5~49.5次间谐波电流有效值")
|
||||
private String iiharmonic = "A";
|
||||
|
||||
@TableField("POSITIVE_V")
|
||||
@ApiModelProperty(value = "正序电压")
|
||||
private String positiveV = "kV";
|
||||
|
||||
@TableField("NO_POSITIVE_V")
|
||||
@ApiModelProperty(value = "零序负序电压")
|
||||
private String noPositiveV = "V";
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.njcn.harmonic.common.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2026/1/17
|
||||
*/
|
||||
@Data
|
||||
public class LineDetailDataCommVO {
|
||||
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty(name = "id",value = "监测点序号")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(name = "lineName",value = "监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty(name = "areaName",value = "工程名称")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty(name = "gdName",value = "单位")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty(name = "bdName",value = "部门")
|
||||
private String bdName;
|
||||
|
||||
@ApiModelProperty(name = "scale",value = "电压等级")
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty(name = "manufacturer",value = "厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(name = "devId",value = "终端Id")
|
||||
private String devId;
|
||||
|
||||
@ApiModelProperty(name = "devName",value = "终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(name = "runFlag",value = "终端运行状态")
|
||||
private String runFlag;
|
||||
|
||||
@ApiModelProperty(name = "comFlag",value = "通讯状态")
|
||||
private String comFlag;
|
||||
|
||||
@ApiModelProperty(name = "loadType",value = "干扰源类型")
|
||||
private String loadType;
|
||||
|
||||
@ApiModelProperty(name = "businessType",value = "行业类型")
|
||||
private String businessType;
|
||||
|
||||
@ApiModelProperty(name = "objName",value = "监测点对象名称")
|
||||
private String objName;
|
||||
|
||||
@ApiModelProperty(name = "ptType",value = "接线方式")
|
||||
private String ptType;
|
||||
|
||||
@ApiModelProperty(name = "pt",value = "PT变比")
|
||||
private String pt;
|
||||
|
||||
@ApiModelProperty(name = "ct",value = "CT变比")
|
||||
private String ct;
|
||||
|
||||
@ApiModelProperty(name = "standardCapacity",value = "基准容量(MVA)")
|
||||
private Float standardCapacity;
|
||||
|
||||
@ApiModelProperty(name = "shortCapacity",value = "最小短路容量(MVA)")
|
||||
private Float shortCapacity;
|
||||
|
||||
@ApiModelProperty(name = "devCapacity",value = "供电设备容量(MVA)")
|
||||
private Float devCapacity;
|
||||
|
||||
@ApiModelProperty(name = "dealCapacity",value = "用户协议容量(MVA)")
|
||||
private Float dealCapacity;
|
||||
|
||||
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||
private Integer powerFlag;
|
||||
|
||||
/**
|
||||
* 测量间隔(1-10分钟)
|
||||
*/
|
||||
@ApiModelProperty(name = "timeInterval",value = "测量间隔(1-10分钟)")
|
||||
private Integer timeInterval;
|
||||
|
||||
/**
|
||||
* 监测点拥有者
|
||||
*/
|
||||
@ApiModelProperty(name = "owner",value = "监测点拥有者")
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 拥有者职务
|
||||
*/
|
||||
@ApiModelProperty(name = "ownerDuty",value = "拥有者职务")
|
||||
private String ownerDuty;
|
||||
|
||||
/**
|
||||
* 拥有者联系方式
|
||||
*/
|
||||
@ApiModelProperty(name = "ownerTel",value = "拥有者联系方式")
|
||||
private String ownerTel;
|
||||
|
||||
/**
|
||||
* 接线图
|
||||
*/
|
||||
@ApiModelProperty(name = "wiringDiagram",value = "接线图")
|
||||
private String wiringDiagram;
|
||||
@ApiModelProperty(name = "ptPhaseType",value = "监测点接线相别(0,单相,1,三相,默认三相)")
|
||||
private Integer ptPhaseType;
|
||||
|
||||
@ApiModelProperty(name = "投运日期")
|
||||
private LocalDate loginTime;
|
||||
|
||||
@ApiModelProperty(name = "最新数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(name = "监测对象信息ID")
|
||||
private String objId;
|
||||
|
||||
@ApiModelProperty(name = "对象类型大类")
|
||||
private String bigObjType;
|
||||
}
|
||||
@@ -0,0 +1,870 @@
|
||||
package com.njcn.harmonic.common.pojo.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2026/1/17
|
||||
*/
|
||||
@Data
|
||||
public class OverLimitInfoCommDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 监测点序号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 频率限值
|
||||
*/
|
||||
private Float freqDev;
|
||||
|
||||
/**
|
||||
* 电压波动
|
||||
*/
|
||||
private Float voltageFluctuation;
|
||||
|
||||
/**
|
||||
* 电压上偏差限值
|
||||
*/
|
||||
private Float voltageDev;
|
||||
|
||||
/**
|
||||
* 电压下偏差限值
|
||||
*/
|
||||
private Float uvoltageDev;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡度限值
|
||||
*/
|
||||
private Float ubalance;
|
||||
|
||||
/**
|
||||
* 短时电压不平衡度限值
|
||||
*/
|
||||
private Float shortUbalance;
|
||||
|
||||
/**
|
||||
* 闪变限值
|
||||
*/
|
||||
private Float flicker;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率限值
|
||||
*/
|
||||
private Float uaberrance;
|
||||
|
||||
/**
|
||||
* 负序电流限值
|
||||
*/
|
||||
private Float iNeg;
|
||||
|
||||
/**
|
||||
* 2次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_2")
|
||||
private Float uharm2;
|
||||
|
||||
/**
|
||||
* 3次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_3")
|
||||
private Float uharm3;
|
||||
|
||||
/**
|
||||
* 4次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_4")
|
||||
private Float uharm4;
|
||||
|
||||
/**
|
||||
* 5次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_5")
|
||||
private Float uharm5;
|
||||
|
||||
/**
|
||||
* 6次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_6")
|
||||
private Float uharm6;
|
||||
|
||||
/**
|
||||
* 7次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_7")
|
||||
private Float uharm7;
|
||||
|
||||
/**
|
||||
* 8次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_8")
|
||||
private Float uharm8;
|
||||
|
||||
/**
|
||||
* 9次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_9")
|
||||
private Float uharm9;
|
||||
|
||||
/**
|
||||
* 10次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_10")
|
||||
private Float uharm10;
|
||||
|
||||
/**
|
||||
* 11次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_11")
|
||||
private Float uharm11;
|
||||
|
||||
/**
|
||||
* 12次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_12")
|
||||
private Float uharm12;
|
||||
|
||||
/**
|
||||
* 13次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_13")
|
||||
private Float uharm13;
|
||||
|
||||
/**
|
||||
* 14次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_14")
|
||||
private Float uharm14;
|
||||
|
||||
/**
|
||||
* 15次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_15")
|
||||
private Float uharm15;
|
||||
|
||||
/**
|
||||
* 16次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_16")
|
||||
private Float uharm16;
|
||||
|
||||
/**
|
||||
* 17次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_17")
|
||||
private Float uharm17;
|
||||
|
||||
/**
|
||||
* 18次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_18")
|
||||
private Float uharm18;
|
||||
|
||||
/**
|
||||
* 19次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_19")
|
||||
private Float uharm19;
|
||||
|
||||
/**
|
||||
* 20次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_20")
|
||||
private Float uharm20;
|
||||
|
||||
/**
|
||||
* 21次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_21")
|
||||
private Float uharm21;
|
||||
|
||||
/**
|
||||
* 22次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_22")
|
||||
private Float uharm22;
|
||||
|
||||
/**
|
||||
* 23次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_23")
|
||||
private Float uharm23;
|
||||
|
||||
/**
|
||||
* 24次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_24")
|
||||
private Float uharm24;
|
||||
|
||||
/**
|
||||
* 25次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_25")
|
||||
private Float uharm25;
|
||||
|
||||
/**
|
||||
* 2次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_26")
|
||||
private Float uharm26;
|
||||
|
||||
/**
|
||||
* 3次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_27")
|
||||
private Float uharm27;
|
||||
|
||||
/**
|
||||
* 4次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_28")
|
||||
private Float uharm28;
|
||||
|
||||
/**
|
||||
* 5次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_29")
|
||||
private Float uharm29;
|
||||
|
||||
/**
|
||||
* 6次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_30")
|
||||
private Float uharm30;
|
||||
|
||||
/**
|
||||
* 7次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_31")
|
||||
private Float uharm31;
|
||||
|
||||
/**
|
||||
* 8次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_32")
|
||||
private Float uharm32;
|
||||
|
||||
/**
|
||||
* 9次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_33")
|
||||
private Float uharm33;
|
||||
|
||||
/**
|
||||
* 10次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_34")
|
||||
private Float uharm34;
|
||||
|
||||
/**
|
||||
* 11次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_35")
|
||||
private Float uharm35;
|
||||
|
||||
/**
|
||||
* 12次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_36")
|
||||
private Float uharm36;
|
||||
|
||||
/**
|
||||
* 13次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_37")
|
||||
private Float uharm37;
|
||||
|
||||
/**
|
||||
* 14次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_38")
|
||||
private Float uharm38;
|
||||
|
||||
/**
|
||||
* 15次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_39")
|
||||
private Float uharm39;
|
||||
|
||||
/**
|
||||
* 16次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_40")
|
||||
private Float uharm40;
|
||||
|
||||
/**
|
||||
* 17次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_41")
|
||||
private Float uharm41;
|
||||
|
||||
/**
|
||||
* 18次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_42")
|
||||
private Float uharm42;
|
||||
|
||||
/**
|
||||
* 19次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_43")
|
||||
private Float uharm43;
|
||||
|
||||
/**
|
||||
* 20次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_44")
|
||||
private Float uharm44;
|
||||
|
||||
/**
|
||||
* 21次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_45")
|
||||
private Float uharm45;
|
||||
|
||||
/**
|
||||
* 22次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_46")
|
||||
private Float uharm46;
|
||||
|
||||
/**
|
||||
* 23次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_47")
|
||||
private Float uharm47;
|
||||
|
||||
/**
|
||||
* 24次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_48")
|
||||
private Float uharm48;
|
||||
|
||||
/**
|
||||
* 25次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_49")
|
||||
private Float uharm49;
|
||||
|
||||
/**
|
||||
* 50次谐波电压限值
|
||||
*/
|
||||
@TableField("uharm_50")
|
||||
private Float uharm50;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 2次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_2")
|
||||
private Float iharm2;
|
||||
|
||||
/**
|
||||
* 3次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_3")
|
||||
private Float iharm3;
|
||||
|
||||
/**
|
||||
* 4次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_4")
|
||||
private Float iharm4;
|
||||
|
||||
/**
|
||||
* 5次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_5")
|
||||
private Float iharm5;
|
||||
|
||||
/**
|
||||
* 6次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_6")
|
||||
private Float iharm6;
|
||||
|
||||
/**
|
||||
* 7次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_7")
|
||||
private Float iharm7;
|
||||
|
||||
/**
|
||||
* 8次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_8")
|
||||
private Float iharm8;
|
||||
|
||||
/**
|
||||
* 9次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_9")
|
||||
private Float iharm9;
|
||||
|
||||
/**
|
||||
* 10次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_10")
|
||||
private Float iharm10;
|
||||
|
||||
/**
|
||||
* 11次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_11")
|
||||
private Float iharm11;
|
||||
|
||||
/**
|
||||
* 12次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_12")
|
||||
private Float iharm12;
|
||||
|
||||
/**
|
||||
* 13次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_13")
|
||||
private Float iharm13;
|
||||
|
||||
/**
|
||||
* 14次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_14")
|
||||
private Float iharm14;
|
||||
|
||||
/**
|
||||
* 15次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_15")
|
||||
private Float iharm15;
|
||||
|
||||
/**
|
||||
* 16次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_16")
|
||||
private Float iharm16;
|
||||
|
||||
/**
|
||||
* 17次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_17")
|
||||
private Float iharm17;
|
||||
|
||||
/**
|
||||
* 18次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_18")
|
||||
private Float iharm18;
|
||||
|
||||
/**
|
||||
* 19次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_19")
|
||||
private Float iharm19;
|
||||
|
||||
/**
|
||||
* 20次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_20")
|
||||
private Float iharm20;
|
||||
|
||||
/**
|
||||
* 21次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_21")
|
||||
private Float iharm21;
|
||||
|
||||
/**
|
||||
* 22次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_22")
|
||||
private Float iharm22;
|
||||
|
||||
/**
|
||||
* 23次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_23")
|
||||
private Float iharm23;
|
||||
|
||||
/**
|
||||
* 24次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_24")
|
||||
private Float iharm24;
|
||||
|
||||
/**
|
||||
* 25次谐波电流限值
|
||||
*/
|
||||
@TableField("iharm_25")
|
||||
private Float iharm25;
|
||||
|
||||
/**
|
||||
* 2次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_26")
|
||||
private Float iharm26;
|
||||
|
||||
/**
|
||||
* 3次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_27")
|
||||
private Float iharm27;
|
||||
|
||||
/**
|
||||
* 4次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_28")
|
||||
private Float iharm28;
|
||||
|
||||
/**
|
||||
* 5次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_29")
|
||||
private Float iharm29;
|
||||
|
||||
/**
|
||||
* 6次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_30")
|
||||
private Float iharm30;
|
||||
|
||||
/**
|
||||
* 7次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_31")
|
||||
private Float iharm31;
|
||||
|
||||
/**
|
||||
* 8次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_32")
|
||||
private Float iharm32;
|
||||
|
||||
/**
|
||||
* 9次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_33")
|
||||
private Float iharm33;
|
||||
|
||||
/**
|
||||
* 10次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_34")
|
||||
private Float iharm34;
|
||||
|
||||
/**
|
||||
* 11次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_35")
|
||||
private Float iharm35;
|
||||
|
||||
/**
|
||||
* 12次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_36")
|
||||
private Float iharm36;
|
||||
|
||||
/**
|
||||
* 13次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_37")
|
||||
private Float iharm37;
|
||||
|
||||
/**
|
||||
* 14次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_38")
|
||||
private Float iharm38;
|
||||
|
||||
/**
|
||||
* 15次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_39")
|
||||
private Float iharm39;
|
||||
|
||||
/**
|
||||
* 16次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_40")
|
||||
private Float iharm40;
|
||||
|
||||
/**
|
||||
* 17次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_41")
|
||||
private Float iharm41;
|
||||
|
||||
/**
|
||||
* 18次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_42")
|
||||
private Float iharm42;
|
||||
|
||||
/**
|
||||
* 19次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_43")
|
||||
private Float iharm43;
|
||||
|
||||
/**
|
||||
* 20次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_44")
|
||||
private Float iharm44;
|
||||
|
||||
/**
|
||||
* 21次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_45")
|
||||
private Float iharm45;
|
||||
|
||||
/**
|
||||
* 22次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_46")
|
||||
private Float iharm46;
|
||||
|
||||
/**
|
||||
* 23次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_47")
|
||||
private Float iharm47;
|
||||
|
||||
/**
|
||||
* 24次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_48")
|
||||
private Float iharm48;
|
||||
|
||||
/**
|
||||
* 25次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_49")
|
||||
private Float iharm49;
|
||||
|
||||
/**
|
||||
* 50次谐波电压限值
|
||||
*/
|
||||
@TableField("iharm_50")
|
||||
private Float iharm50;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 0.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_1")
|
||||
private Float inuharm1;
|
||||
|
||||
/**
|
||||
* 1.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_2")
|
||||
private Float inuharm2;
|
||||
|
||||
/**
|
||||
* 2.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_3")
|
||||
private Float inuharm3;
|
||||
|
||||
/**
|
||||
* 3.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_4")
|
||||
private Float inuharm4;
|
||||
|
||||
/**
|
||||
* 4.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_5")
|
||||
private Float inuharm5;
|
||||
|
||||
/**
|
||||
* 5.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_6")
|
||||
private Float inuharm6;
|
||||
|
||||
/**
|
||||
* 6.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_7")
|
||||
private Float inuharm7;
|
||||
|
||||
/**
|
||||
* 7.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_8")
|
||||
private Float inuharm8;
|
||||
|
||||
/**
|
||||
* 8.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_9")
|
||||
private Float inuharm9;
|
||||
|
||||
/**
|
||||
* 9.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_10")
|
||||
private Float inuharm10;
|
||||
|
||||
/**
|
||||
* 10.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_11")
|
||||
private Float inuharm11;
|
||||
|
||||
/**
|
||||
* 11.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_12")
|
||||
private Float inuharm12;
|
||||
|
||||
/**
|
||||
* 12.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_13")
|
||||
private Float inuharm13;
|
||||
|
||||
/**
|
||||
* 13.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_14")
|
||||
private Float inuharm14;
|
||||
|
||||
/**
|
||||
* 14.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_15")
|
||||
private Float inuharm15;
|
||||
|
||||
/**
|
||||
* 15.5次间谐波电压限值
|
||||
*/
|
||||
@TableField("inuharm_16")
|
||||
private Float inuharm16;
|
||||
|
||||
public OverLimitInfoCommDTO(){}
|
||||
|
||||
|
||||
public void buildIHarm(Float[] iHarmTem){
|
||||
this.iharm2= iHarmTem[0];
|
||||
this.iharm4= iHarmTem[2];
|
||||
this.iharm6= iHarmTem[4];
|
||||
this.iharm8= iHarmTem[6];
|
||||
this.iharm10= iHarmTem[8];
|
||||
this.iharm12= iHarmTem[10];
|
||||
this.iharm14= iHarmTem[12];
|
||||
this.iharm16= iHarmTem[14];
|
||||
this.iharm18= iHarmTem[16];
|
||||
this.iharm20= iHarmTem[18];
|
||||
this.iharm22= iHarmTem[20];
|
||||
this.iharm24= iHarmTem[22];
|
||||
this.iharm26= iHarmTem[24];
|
||||
this.iharm28= iHarmTem[26];
|
||||
this.iharm30= iHarmTem[28];
|
||||
this.iharm32= iHarmTem[30];
|
||||
this.iharm34= iHarmTem[32];
|
||||
this.iharm36= iHarmTem[34];
|
||||
this.iharm38= iHarmTem[36];
|
||||
this.iharm40= iHarmTem[38];
|
||||
this.iharm42= iHarmTem[40];
|
||||
this.iharm44= iHarmTem[42];
|
||||
this.iharm46= iHarmTem[44];
|
||||
this.iharm48= iHarmTem[46];
|
||||
this.iharm50= iHarmTem[48];
|
||||
|
||||
|
||||
|
||||
this.iharm3= iHarmTem[1];
|
||||
this.iharm5= iHarmTem[3];
|
||||
this.iharm7= iHarmTem[5];
|
||||
this.iharm9= iHarmTem[7];
|
||||
this.iharm11= iHarmTem[9];
|
||||
this.iharm13= iHarmTem[11];
|
||||
this.iharm15= iHarmTem[13];
|
||||
this.iharm17= iHarmTem[15];
|
||||
this.iharm19= iHarmTem[17];
|
||||
this.iharm21= iHarmTem[19];
|
||||
this.iharm23= iHarmTem[21];
|
||||
this.iharm25= iHarmTem[23];
|
||||
this.iharm27= iHarmTem[25];
|
||||
this.iharm29= iHarmTem[27];
|
||||
this.iharm31= iHarmTem[29];
|
||||
this.iharm33= iHarmTem[31];
|
||||
this.iharm35= iHarmTem[33];
|
||||
this.iharm37= iHarmTem[35];
|
||||
this.iharm39= iHarmTem[37];
|
||||
this.iharm41= iHarmTem[39];
|
||||
this.iharm43= iHarmTem[41];
|
||||
this.iharm45= iHarmTem[43];
|
||||
this.iharm47= iHarmTem[45];
|
||||
this.iharm49= iHarmTem[47];
|
||||
}
|
||||
|
||||
public void buildUharm(Float resultEven,Float resultOdd){
|
||||
this.uharm2=resultEven;
|
||||
this.uharm4=resultEven;
|
||||
this.uharm6=resultEven;
|
||||
this.uharm8=resultEven;
|
||||
this.uharm10=resultEven;
|
||||
this.uharm12=resultEven;
|
||||
this.uharm14=resultEven;
|
||||
this.uharm16=resultEven;
|
||||
this.uharm18=resultEven;
|
||||
this.uharm20=resultEven;
|
||||
this.uharm22=resultEven;
|
||||
this.uharm24=resultEven;
|
||||
this.uharm26=resultEven;
|
||||
this.uharm28=resultEven;
|
||||
this.uharm30=resultEven;
|
||||
this.uharm32=resultEven;
|
||||
this.uharm34=resultEven;
|
||||
this.uharm36=resultEven;
|
||||
this.uharm38=resultEven;
|
||||
this.uharm40=resultEven;
|
||||
this.uharm42=resultEven;
|
||||
this.uharm44=resultEven;
|
||||
this.uharm46=resultEven;
|
||||
this.uharm48=resultEven;
|
||||
this.uharm50=resultEven;
|
||||
|
||||
|
||||
this.uharm3=resultOdd;
|
||||
this.uharm5=resultOdd;
|
||||
this.uharm7=resultOdd;
|
||||
this.uharm9=resultOdd;
|
||||
this.uharm11=resultOdd;
|
||||
this.uharm13=resultOdd;
|
||||
this.uharm15=resultOdd;
|
||||
this.uharm17=resultOdd;
|
||||
this.uharm19=resultOdd;
|
||||
this.uharm21=resultOdd;
|
||||
this.uharm23=resultOdd;
|
||||
this.uharm25=resultOdd;
|
||||
this.uharm27=resultOdd;
|
||||
this.uharm29=resultOdd;
|
||||
this.uharm31=resultOdd;
|
||||
this.uharm33=resultOdd;
|
||||
this.uharm35=resultOdd;
|
||||
this.uharm37=resultOdd;
|
||||
this.uharm39=resultOdd;
|
||||
this.uharm41=resultOdd;
|
||||
this.uharm43=resultOdd;
|
||||
this.uharm45=resultOdd;
|
||||
this.uharm47=resultOdd;
|
||||
this.uharm49=resultOdd;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
package com.njcn.harmonic.common.pojo.vo;
|
||||
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.harmonic.common.service;
|
||||
|
||||
import com.njcn.harmonic.pojo.param.ReportSearchParam;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2026/1/15
|
||||
*/
|
||||
public interface CustomReportTableService {
|
||||
|
||||
|
||||
/**
|
||||
* 替换报表数据并返回
|
||||
*
|
||||
* @param reportSearchParam 请求参数
|
||||
* @param response
|
||||
* @author qijian
|
||||
* @date 2022/10/18
|
||||
*/
|
||||
void getCustomReport(ReportSearchParam reportSearchParam, HttpServletResponse response);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.njcn.harmonic.common.service;
|
||||
|
||||
import com.njcn.harmonic.pojo.param.ReportQueryParam;
|
||||
import com.njcn.harmonic.pojo.vo.ReportValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 谐波报告
|
||||
*/
|
||||
public interface MonitorCommReportService {
|
||||
|
||||
/**
|
||||
* 限值
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
/* OverLimitInfo getOverLimitData(ReportQueryParam param);
|
||||
*/
|
||||
/**
|
||||
* 基波增幅
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getVirtualData(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 功率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getPowerData(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 闪变
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getFlickerData(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 电压偏差
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getVdeviation(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 畸变率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getDistortionData(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 频率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getFrequencyData(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 三相不平衡
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getThreephase(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 谐波电流
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getICurrent(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 谐波电压
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getVoltageRate(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 间谐波
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getInharmVeRate(ReportQueryParam param);
|
||||
|
||||
/**
|
||||
* 负序电流
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<ReportValue> getINegDataRate(ReportQueryParam param);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.harmonic.common.service;
|
||||
|
||||
import com.njcn.harmonic.common.pojo.dto.DeviceUnitCommDTO;
|
||||
import com.njcn.harmonic.common.pojo.dto.LineDetailDataCommVO;
|
||||
import com.njcn.harmonic.common.pojo.dto.OverLimitInfoCommDTO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2026/1/17
|
||||
*/
|
||||
public interface MonitorHarmonicReportService {
|
||||
|
||||
void exportWorld(HttpServletResponse response,
|
||||
String startTime,
|
||||
String endTime,
|
||||
Integer type,
|
||||
String lineIndex,
|
||||
String name,
|
||||
String reportNumber,
|
||||
String crmName,
|
||||
Boolean isUrl,
|
||||
MultipartFile file,
|
||||
LineDetailDataCommVO lineDto, OverLimitInfoCommDTO overLimitData, DeviceUnitCommDTO deviceUnit);
|
||||
}
|
||||
@@ -0,0 +1,788 @@
|
||||
package com.njcn.harmonic.common.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONConfig;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONTokener;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.api.CsCommTerminalFeignClient;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||
import com.njcn.harmonic.pojo.dto.ReportTemplateDTO;
|
||||
import com.njcn.harmonic.pojo.param.ReportSearchParam;
|
||||
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||
import com.njcn.harmonic.common.mapper.ExcelRptTempMapper;
|
||||
import com.njcn.harmonic.common.service.CustomReportTableService;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
import com.njcn.oss.enums.OssResponseEnum;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.EpdFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2026/1/15
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@DS("sjzx")
|
||||
public class CustomReportTableServiceImpl implements CustomReportTableService {
|
||||
|
||||
private final ExcelRptTempMapper excelRptTempMapper;
|
||||
|
||||
private final EpdFeignClient epdFeignClient;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
|
||||
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||
|
||||
private final CsCommTerminalFeignClient csCommTerminalFeignClient;
|
||||
|
||||
private final ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1);
|
||||
|
||||
private final String CELL_DATA = "celldata";
|
||||
private final String V = "v";
|
||||
private final String STR_ONE = "#";
|
||||
private final String STR_TWO = "$";
|
||||
private final String STR_THREE = "&";
|
||||
private final String STR_FOUR = "%";
|
||||
private final String UVOLTAGE_DEV = "UVOLTAGE_DEV";
|
||||
private final String VOLTAGE_DEV = "VOLTAGE_DEV";
|
||||
|
||||
@Override
|
||||
public void getCustomReport(ReportSearchParam reportSearchParam, HttpServletResponse response) {
|
||||
TimeInterval timeInterval = new TimeInterval();
|
||||
ExcelRptTemp excelRptTemp = excelRptTempMapper.selectById(reportSearchParam.getTempId());
|
||||
if (Objects.isNull(excelRptTemp)) {
|
||||
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_ACTIVE);
|
||||
}
|
||||
if (Objects.isNull(reportSearchParam.getCustomType())) {
|
||||
//通用报表
|
||||
analyzeReport(reportSearchParam, excelRptTemp, response);
|
||||
|
||||
log.info("报表执行时间{}秒", timeInterval.intervalSecond());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/10/8
|
||||
*/
|
||||
|
||||
private void analyzeReport(ReportSearchParam reportSearchParam, ExcelRptTemp excelRptTemp, HttpServletResponse response) {
|
||||
//定义一个线程集合
|
||||
List<Future<?>> futures = new ArrayList<>();
|
||||
//指标
|
||||
List<ReportTemplateDTO> reportTemplateDTOList = new ArrayList<>();
|
||||
//限值
|
||||
List<ReportTemplateDTO> reportLimitList = new ArrayList<>();
|
||||
//台账
|
||||
List<ReportTemplateDTO> terminalList = new ArrayList<>();
|
||||
JSONArray jsonArray;
|
||||
try (InputStream fileStream = fileStorageUtil.getFileStream(excelRptTemp.getContent())) {
|
||||
jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||
parseTemplate(jsonArray, reportTemplateDTOList, reportLimitList, terminalList);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof BusinessException){
|
||||
throw new BusinessException(e.getMessage());
|
||||
}else {
|
||||
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
|
||||
}
|
||||
}
|
||||
//查询不分相别的指标
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.EPD.getCode(), DicDataTypeEnum.CS_DATA_TYPE.getCode()).getData();
|
||||
if(Objects.isNull(dictData)){
|
||||
throw new BusinessException(CommonResponseEnum.FAIL,"字典类型模板缺少!");
|
||||
}
|
||||
|
||||
|
||||
DictData epdDic = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.EPD.getCode(),DicDataTypeEnum.CS_DATA_TYPE.getCode()).getData();
|
||||
List<EleEpdPqd> eleEpdPqdList= epdFeignClient.dictMarkByDataType(epdDic.getId()).getData();
|
||||
eleEpdPqdList = eleEpdPqdList.stream().filter(it->"T".equals(it.getPhase())||"M".equals(it.getPhase())).collect(Collectors.toList());
|
||||
List<String> noPhaseList = eleEpdPqdList.stream().filter(it->StrUtil.isNotBlank(it.getOtherName())).map(it->it.getOtherName().toUpperCase()).collect(Collectors.toList());
|
||||
|
||||
//处理指标是否合格
|
||||
reportLimitList = new LinkedHashSet<>(reportLimitList).stream().sorted(Comparator.comparing(ReportTemplateDTO::getItemName)).collect(Collectors.toList());
|
||||
Map<String, Float> limitMap = overLimitDeal(reportLimitList, reportSearchParam);
|
||||
//存放限值指标的map
|
||||
Map<String, ReportTemplateDTO> limitTargetMapX = reportLimitList.stream().collect(Collectors.toMap(ReportTemplateDTO::getItemName, Function.identity()));
|
||||
|
||||
List<ReportTemplateDTO> endList = new CopyOnWriteArrayList<>();
|
||||
if (CollUtil.isNotEmpty(reportTemplateDTOList)) {
|
||||
//开始组织sql
|
||||
reportTemplateDTOList = new LinkedHashSet<>(reportTemplateDTOList).stream().sorted(Comparator.comparing(ReportTemplateDTO::getItemName)).collect(Collectors.toList());
|
||||
Map<String, List<ReportTemplateDTO>> classMap = reportTemplateDTOList.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getResourceId));
|
||||
//定义存放越限指标的map
|
||||
Map<String, ReportTemplateDTO> assNoPassMap = new HashMap<>();
|
||||
classMap.forEach((classKey, templateValue) -> {
|
||||
Map<String, List<ReportTemplateDTO>> valueTypeMap = templateValue.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getStatMethod));
|
||||
//每张表开启一个独立线程查询
|
||||
futures.add(executorService.submit(() -> {
|
||||
//avg.max,min,cp95
|
||||
valueTypeMap.forEach((valueTypeKey, valueTypeVal) -> {
|
||||
//相别分组
|
||||
Map<String, List<ReportTemplateDTO>> phaseMap = valueTypeVal.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getPhase));
|
||||
phaseMap.forEach((phaseKey, phaseVal) -> {
|
||||
StringBuilder sql = new StringBuilder(InfluxDbSqlConstant.SELECT);
|
||||
if (InfluxDbSqlConstant.MAX.equalsIgnoreCase(valueTypeKey)) {
|
||||
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap,noPhaseList);
|
||||
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(valueTypeKey)) {
|
||||
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap,noPhaseList);
|
||||
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(valueTypeKey)) {
|
||||
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.AVG_WEB, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap,noPhaseList);
|
||||
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(valueTypeKey)) {
|
||||
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.CP95, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap,noPhaseList);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
// 等待所有任务完成
|
||||
for (Future<?> future : futures) {
|
||||
try {
|
||||
future.get(); // 这会阻塞直到任务完成或抛出异常
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
log.error("自定义报表多线程查询流程出错!错误信息{}",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//处理指标最终判定合格还是不合格
|
||||
dealTargetResult(assNoPassMap, limitTargetMapX, endList);
|
||||
}
|
||||
resultAssemble(endList,reportSearchParam,terminalList,jsonArray);
|
||||
//导出自定义报表
|
||||
downReport(jsonArray, response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 解析模板
|
||||
* @author cdf
|
||||
* @date 2023/10/20
|
||||
*/
|
||||
private void parseTemplate(JSONArray jsonArray, List<ReportTemplateDTO> reportTemplateDTOList, List<ReportTemplateDTO> reportLimitList, List<ReportTemplateDTO> terminalList) {
|
||||
try {
|
||||
//通过文件服务器获取
|
||||
jsonArray.forEach(item -> {
|
||||
JSONObject jsonObject = (JSONObject) item;
|
||||
JSONArray itemArr = (JSONArray) jsonObject.get(CELL_DATA);
|
||||
itemArr.forEach((it) -> {
|
||||
if (Objects.nonNull(it) && !"null".equals(it.toString())) {
|
||||
//获取到1列
|
||||
JSONObject data = (JSONObject) it;
|
||||
JSONObject son = (JSONObject) data.get(V);
|
||||
if (son.containsKey(V)) {
|
||||
String v = son.getStr(V);
|
||||
//数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$
|
||||
if (v.charAt(0) == '$' && v.contains(STR_ONE)) {
|
||||
//剔除前后$
|
||||
v = v.replace(STR_TWO, "");
|
||||
//封装ReportTemplateDTO
|
||||
ReportTemplateDTO reportTemplateDTO = new ReportTemplateDTO();
|
||||
reportTemplateDTO.setItemName(v.toUpperCase());
|
||||
//根据#分割数据
|
||||
String[] vItem = v.split(STR_ONE);
|
||||
if (vItem.length == 5) {
|
||||
//$HA[_25]#B#max#classId$
|
||||
reportTemplateDTO.setTemplateName(vItem[0].toUpperCase());
|
||||
reportTemplateDTO.setPhase(vItem[1].substring(0, 1).toUpperCase());
|
||||
reportTemplateDTO.setStatMethod(vItem[2].toUpperCase());
|
||||
reportTemplateDTO.setResourceId(vItem[3].toUpperCase());
|
||||
reportTemplateDTO.setLimitName(vItem[4].toUpperCase());
|
||||
} else if (vItem.length == 4) {
|
||||
//$HA[_25]#max#classId$
|
||||
reportTemplateDTO.setTemplateName(vItem[0].toUpperCase());
|
||||
reportTemplateDTO.setPhase("T");
|
||||
reportTemplateDTO.setStatMethod(vItem[1].toUpperCase());
|
||||
reportTemplateDTO.setResourceId(vItem[2].toUpperCase());
|
||||
reportTemplateDTO.setLimitName(vItem[3].toUpperCase());
|
||||
}
|
||||
|
||||
reportTemplateDTOList.add(reportTemplateDTO);
|
||||
} else if (v.charAt(0) == '%' && v.contains(STR_ONE)) {
|
||||
//封装指标结论ReportTemplateDTO
|
||||
ReportTemplateDTO reportTemplateDTO = new ReportTemplateDTO();
|
||||
v = v.replace(STR_FOUR, "");
|
||||
reportTemplateDTO.setItemName(v.toUpperCase());
|
||||
//根据#分割数据
|
||||
String[] vItem = v.split(STR_ONE);
|
||||
if (vItem.length == 3) {
|
||||
reportTemplateDTO.setTemplateName(vItem[0].toUpperCase());
|
||||
reportTemplateDTO.setStatMethod(vItem[1].toUpperCase());
|
||||
reportTemplateDTO.setResourceId(vItem[2].toUpperCase());
|
||||
}
|
||||
reportLimitList.add(reportTemplateDTO);
|
||||
} else if (v.charAt(0) == '&') {
|
||||
//封装ReportTemplateDTO
|
||||
ReportTemplateDTO reportTemplateDTO = new ReportTemplateDTO();
|
||||
v = v.replace(STR_THREE, "");
|
||||
reportTemplateDTO.setItemName(v.toUpperCase());
|
||||
reportTemplateDTO.setTemplateName(v.toUpperCase());
|
||||
terminalList.add(reportTemplateDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取测点限值
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/10/23
|
||||
*/
|
||||
private Map<String, Float> overLimitDeal(List<ReportTemplateDTO> reportLimitList, ReportSearchParam
|
||||
reportSearchParam) {
|
||||
Map<String, Float> limitMap = new HashMap<>();
|
||||
if (CollUtil.isNotEmpty(reportLimitList)) {
|
||||
StringBuilder sql = new StringBuilder(InfluxDbSqlConstant.SELECT);
|
||||
for (int i = 0; i < reportLimitList.size(); i++) {
|
||||
if (i == reportLimitList.size() - 1) {
|
||||
sql.append(UVOLTAGE_DEV).append(StrUtil.COMMA);
|
||||
sql.append(reportLimitList.get(i).getTemplateName()).append(StrUtil.C_SPACE);
|
||||
} else {
|
||||
sql.append(reportLimitList.get(i).getTemplateName()).append(StrUtil.COMMA);
|
||||
}
|
||||
}
|
||||
|
||||
sql.append(InfluxDbSqlConstant.FROM).append(reportLimitList.get(0).getResourceId()).append(InfluxDbSqlConstant.WHERE).append("id ='").append(reportSearchParam.getLineId()).append("'");
|
||||
limitMap = excelRptTempMapper.dynamicSqlMap(sql.toString());
|
||||
if (Objects.isNull(limitMap)) {
|
||||
throw new BusinessException("当前报表测点限值缺失!");
|
||||
}
|
||||
|
||||
for (ReportTemplateDTO item : reportLimitList) {
|
||||
if (limitMap.containsKey(item.getTemplateName())) {
|
||||
|
||||
if(item.getTemplateName().equalsIgnoreCase(VOLTAGE_DEV)){
|
||||
item.setLowValue(limitMap.get(UVOLTAGE_DEV).toString());
|
||||
}
|
||||
item.setValue(limitMap.get(item.getTemplateName()).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
limitMap = convertKeysToUpperCase(limitMap);
|
||||
return limitMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 报告下载
|
||||
*/
|
||||
private void downReport(JSONArray jsonArray, HttpServletResponse response) {
|
||||
InputStream reportStream = IoUtil.toStream(jsonArray.toString(), CharsetUtil.UTF_8);
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + "aa");
|
||||
OutputStream toClient = null;
|
||||
try {
|
||||
toClient = new BufferedOutputStream(response.getOutputStream());
|
||||
//通过IOUtils对接输入输出流,实现文件下载
|
||||
IOUtils.copy(reportStream, toClient);
|
||||
toClient.flush();
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(OssResponseEnum.DOWNLOAD_FILE_STREAM_ERROR);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(reportStream);
|
||||
IOUtils.closeQuietly(toClient);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对多测点数据进行计算求出一组数据
|
||||
* @param method
|
||||
* @param allList
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> dealResultMap(String method, List<Map<String, Object>> allList) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
// 遍历列表中的每个Map
|
||||
if (method.equals(InfluxDbSqlConstant.MIN)) {
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
// 检查结果Map中是否已包含该键
|
||||
if (!resultMap.containsKey(key) || (double) resultMap.get(key) > value) {
|
||||
// 如果不包含,或当前值更大,则更新结果Map
|
||||
resultMap.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (method.equals(InfluxDbSqlConstant.MAX) || method.equals(InfluxDbSqlConstant.PERCENTILE)) {
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
// 检查结果Map中是否已包含该键
|
||||
if (!resultMap.containsKey(key) || (double) resultMap.get(key) < value) {
|
||||
// 如果不包含,或当前值更大,则更新结果Map
|
||||
resultMap.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (method.equals(InfluxDbSqlConstant.AVG)) {
|
||||
Map<String, Double> sumMap = new HashMap<>();
|
||||
Map<String, Integer> countMap = new HashMap<>();
|
||||
// 遍历列表中的每个Map
|
||||
for (Map<String, Object> map : allList) {
|
||||
// 遍历当前Map的键值对
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (Objects.nonNull(entry.getValue()) && !key.equals("time")) {
|
||||
double value = (double) entry.getValue();
|
||||
|
||||
// 更新累计和
|
||||
sumMap.put(key, sumMap.getOrDefault(key, 0.0) + value);
|
||||
// 更新计数
|
||||
countMap.put(key, countMap.getOrDefault(key, 0) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 计算平均值并存储到结果Map中
|
||||
for (String key : sumMap.keySet()) {
|
||||
double sum = sumMap.get(key);
|
||||
int count = countMap.get(key);
|
||||
double average = BigDecimal.valueOf(sum / count).setScale(3, RoundingMode.HALF_UP).doubleValue();
|
||||
resultMap.put(key, average);
|
||||
}
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 处理指标超标结论
|
||||
*/
|
||||
private void dealTargetResult
|
||||
(Map<String, ReportTemplateDTO> assNoPassMap, Map<String, ReportTemplateDTO> limitTargetMapX, List<ReportTemplateDTO> endList) {
|
||||
assNoPassMap.forEach((key, val) -> {
|
||||
limitTargetMapX.remove(key);
|
||||
if ("Freq_Dev".toUpperCase().equals(val.getTemplateName())) {
|
||||
val.setValue("±" + val.getValue());
|
||||
}
|
||||
|
||||
String expend = "";
|
||||
if(Objects.nonNull(val.getLowValue())){
|
||||
expend = val.getLowValue()+",";
|
||||
}
|
||||
if (val.getOverLimitFlag() == 1) {
|
||||
val.setValue("不合格 (" + expend+val.getValue() + ")");
|
||||
} else {
|
||||
val.setValue("合格 (" + expend+val.getValue() + ")");
|
||||
}
|
||||
endList.add(val);
|
||||
});
|
||||
|
||||
limitTargetMapX.forEach((key, val) -> {
|
||||
if (Objects.isNull(val.getOverLimitFlag())) {
|
||||
val.setValue("/");
|
||||
} else {
|
||||
val.setValue("合格");
|
||||
}
|
||||
endList.add(val);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param data 同类型的cell模板
|
||||
* @param sql 单个cell模板
|
||||
* @param endList 用于返回最终组装好的数据,类似data
|
||||
* @param limitMap 指标是否合格模板
|
||||
* @param assNoPassMap 用于存储不合格的指标
|
||||
* @date 2023/10/20
|
||||
*/
|
||||
|
||||
private void assSqlByMysql(List<ReportTemplateDTO> data, StringBuilder sql, List<ReportTemplateDTO> endList, String method, ReportSearchParam reportSearchParam, Map<String, ReportTemplateDTO> limitMap, Map<String, Float> overLimitMap, Map<String, ReportTemplateDTO> assNoPassMap,List<String> noPhaseList) {
|
||||
//sql拼接示例:select MAX(IHA2) as IHA2 from power_quality_data where Phase = 'A' and LineId='1324564568' and Stat_Method='max' tz('Asia/Shanghai')
|
||||
if (InfluxDbSqlConstant.CP95.equals(method)) {
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
if (i == data.size() - 1) {
|
||||
sql.append(InfluxDbSqlConstant.MAX)
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.get(i).getTemplateName())
|
||||
.append(InfluxDbSqlConstant.RBK)
|
||||
.append(InfluxDbSqlConstant.AS)
|
||||
.append("\""+data.get(i).getItemName()+"\"");
|
||||
} else {
|
||||
sql.append(InfluxDbSqlConstant.MAX)
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.get(i).getTemplateName())
|
||||
.append(InfluxDbSqlConstant.RBK)
|
||||
.append(InfluxDbSqlConstant.AS)
|
||||
.append("\""+data.get(i).getItemName()+"\"").append(StrUtil.COMMA);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
if (i == data.size() - 1) {
|
||||
sql.append(method)
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.get(i).getTemplateName())
|
||||
.append(InfluxDbSqlConstant.RBK)
|
||||
.append(InfluxDbSqlConstant.AS)
|
||||
.append("\""+data.get(i).getItemName()+"\"");
|
||||
} else {
|
||||
sql.append(method)
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.get(i).getTemplateName())
|
||||
.append(InfluxDbSqlConstant.RBK)
|
||||
.append(InfluxDbSqlConstant.AS)
|
||||
.append("\""+data.get(i).getItemName()+"\"").append(StrUtil.COMMA);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//拼接表名
|
||||
sql.append(StrPool.C_SPACE)
|
||||
.append(InfluxDbSqlConstant.FROM)
|
||||
.append(data.get(0).getResourceId());
|
||||
|
||||
|
||||
sql.append(InfluxDbSqlConstant.WHERE)
|
||||
.append(InfluxDBTableConstant.LINE_ID)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(reportSearchParam.getLineId())
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
//相别特殊处理
|
||||
if (!InfluxDBTableConstant.NO_PHASE.equals(data.get(0).getPhase())) {
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDBTableConstant.PHASIC_TYPE)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(data.get(0).getPhase())
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
}
|
||||
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDBTableConstant.VALUE_TYPE)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(data.get(0).getStatMethod())
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
|
||||
|
||||
//频率和频率偏差仅统计T相
|
||||
if (noPhaseList.contains(data.get(0).getTemplateName())) {
|
||||
if(data.get(0).getTemplateName().equalsIgnoreCase("v_unbalance")){
|
||||
System.out.println(44);
|
||||
}
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDBTableConstant.PHASIC_TYPE)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(InfluxDBTableConstant.PHASE_TYPE_T)
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
}
|
||||
//时间范围处理
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.GE).append(InfluxDbSqlConstant.QM).append(reportSearchParam.getStartTime()).append(InfluxDbSqlConstant.START_TIME).append(InfluxDbSqlConstant.QM)
|
||||
.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.LT).append(InfluxDbSqlConstant.QM).append(reportSearchParam.getEndTime()).append(InfluxDbSqlConstant.END_TIME).append(InfluxDbSqlConstant.QM);
|
||||
|
||||
System.out.println(sql);
|
||||
|
||||
List<Map<String, Object>> mapList = SqlRunner.DEFAULT.selectList(sql.toString());
|
||||
if (CollUtil.isEmpty(mapList) || Objects.isNull(mapList.get(0))) {
|
||||
data = data.stream().peek(item -> item.setValue("/")).collect(Collectors.toList());
|
||||
} else {
|
||||
//兼容达梦数据库方法
|
||||
Map<String, Object> map = convertKeysToUpperCase(mapList.get(0));
|
||||
for (ReportTemplateDTO item : data) {
|
||||
if (map.containsKey(item.getItemName())) {
|
||||
double v = Double.parseDouble(map.get(item.getItemName()).toString());
|
||||
item.setValue(String.format("%.3f", v));
|
||||
if (overLimitMap.containsKey(item.getLimitName())) {
|
||||
Float tagVal = overLimitMap.get(item.getLimitName());
|
||||
|
||||
if(item.getLimitName().equalsIgnoreCase(UVOLTAGE_DEV)){
|
||||
//对电压偏差特殊处理
|
||||
Float tagVal_U = overLimitMap.get(UVOLTAGE_DEV);
|
||||
if (v > tagVal || v<tagVal_U) {
|
||||
item.setOverLimitFlag(1);
|
||||
} else {
|
||||
item.setOverLimitFlag(0);
|
||||
}
|
||||
|
||||
}else {
|
||||
if (v > tagVal) {
|
||||
item.setOverLimitFlag(1);
|
||||
} else {
|
||||
item.setOverLimitFlag(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否越限
|
||||
if (!limitMap.isEmpty()) {
|
||||
String key = item.getLimitName() + STR_ONE + item.getStatMethod() + "#PQ_OVERLIMIT";
|
||||
if (limitMap.containsKey(key)) {
|
||||
ReportTemplateDTO tem = limitMap.get(key);
|
||||
double limitVal = Double.parseDouble(tem.getValue());
|
||||
|
||||
if(VOLTAGE_DEV.equalsIgnoreCase(tem.getLimitName())){
|
||||
//针对电压偏差特殊处理
|
||||
double limitLowVal = Double.parseDouble(tem.getLowValue());
|
||||
|
||||
if (v > limitVal || v<limitLowVal) {
|
||||
tem.setOverLimitFlag(1);
|
||||
assNoPassMap.put(key, tem);
|
||||
} else if (!assNoPassMap.containsKey(key)) {
|
||||
tem.setOverLimitFlag(0);
|
||||
assNoPassMap.put(key, tem);
|
||||
}
|
||||
}else {
|
||||
//其他指标
|
||||
if (v > limitVal) {
|
||||
tem.setOverLimitFlag(1);
|
||||
assNoPassMap.put(key, tem);
|
||||
} else if (!assNoPassMap.containsKey(key)) {
|
||||
tem.setOverLimitFlag(0);
|
||||
assNoPassMap.put(key, tem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
item.setValue("/");
|
||||
}
|
||||
}
|
||||
}
|
||||
endList.addAll(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据单位信息
|
||||
*
|
||||
* @param reportSearchParam
|
||||
* @return
|
||||
*/
|
||||
private Map<String, String> unitMap(ReportSearchParam reportSearchParam) {
|
||||
PqsDeviceUnit deviceUnit;
|
||||
if (Objects.isNull(reportSearchParam.getResourceType())) {
|
||||
deviceUnit = commTerminalGeneralClient.lineUnitDetail(reportSearchParam.getLineId()).getData();
|
||||
} else {
|
||||
deviceUnit = csCommTerminalFeignClient.lineUnitDetail(reportSearchParam.getLineId()).getData();
|
||||
}
|
||||
List<DictData> dictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEVICE_UNIT.getCode()).getData();
|
||||
Map<String, String> unit = new HashMap<>();
|
||||
List<String> list = dictData.stream().map(DictData::getCode).collect(Collectors.toList());
|
||||
for (String s : list) {
|
||||
//有效值
|
||||
if (s.equals(DicDataEnum.EFFECTIVE.getCode())) {
|
||||
unit.put(s + "#i", deviceUnit.getIeffective());
|
||||
unit.put(s + "#v", deviceUnit.getLineVoltage());
|
||||
}
|
||||
//功率
|
||||
if (s.equals(DicDataEnum.POWER.getCode())) {
|
||||
unit.put(s + "#p", deviceUnit.getTotalActiveP());
|
||||
unit.put(s + "#q", deviceUnit.getTotalNoP());
|
||||
unit.put(s + "#s", deviceUnit.getTotalViewP());
|
||||
}
|
||||
//畸变率
|
||||
if (s.equals(DicDataEnum.DISTORTION.getCode())) {
|
||||
unit.put(s + "#v", deviceUnit.getVdistortion());
|
||||
}
|
||||
//电压偏差
|
||||
if (s.equals(DicDataEnum.VOLTAGE.getCode())) {
|
||||
unit.put(s + "#v", deviceUnit.getVoltageDev());
|
||||
}
|
||||
//频率
|
||||
if (s.equals(DicDataEnum.UNIT_FREQUENCY.getCode())) {
|
||||
unit.put(s + "#freq", deviceUnit.getUnitFrequency());
|
||||
unit.put(s + "#freqDev", deviceUnit.getUnitFrequencyDev());
|
||||
}
|
||||
//三项不平衡度
|
||||
if (s.equals(DicDataEnum.UNBALANCE.getCode())) {
|
||||
unit.put(s + "#v", STR_FOUR);
|
||||
unit.put(s + "#vPos", deviceUnit.getPositiveV());
|
||||
unit.put(s + "#vNeg", deviceUnit.getNoPositiveV());
|
||||
unit.put(s + "#vZero", deviceUnit.getNoPositiveV());
|
||||
unit.put(s + "#i", STR_FOUR);
|
||||
unit.put(s + "#iPos", "A");
|
||||
unit.put(s + "#iNeg", "A");
|
||||
unit.put(s + "#iZero", "A");
|
||||
}
|
||||
//基波
|
||||
if (s.equals(DicDataEnum.FUND.getCode())) {
|
||||
unit.put(s + "#i", deviceUnit.getIfund());
|
||||
unit.put(s + "#v", deviceUnit.getVfundEffective());
|
||||
|
||||
}
|
||||
}
|
||||
return unit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理最终结果
|
||||
* @author cdf
|
||||
* @date 2026/1/16
|
||||
*/
|
||||
public void resultAssemble(List<ReportTemplateDTO> endList,ReportSearchParam reportSearchParam,List<ReportTemplateDTO> terminalList,JSONArray jsonArray){
|
||||
if (CollUtil.isNotEmpty(endList)) {
|
||||
//数据单位信息
|
||||
Map<String, String> unit = unitMap(reportSearchParam);
|
||||
//进行反向赋值到模板
|
||||
//1、根据itemName分组
|
||||
Map<String, List<ReportTemplateDTO>> assMap = endList.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getItemName));
|
||||
//处理台账信息
|
||||
Map<String, String> finalTerminalMap;
|
||||
if (CollUtil.isNotEmpty(terminalList)) {
|
||||
finalTerminalMap = convertKeysToUpperCase(commTerminalGeneralClient.getCustomDetailByLineId(reportSearchParam.getLineId()).getData());
|
||||
}else {
|
||||
finalTerminalMap = new HashMap<>();
|
||||
}
|
||||
//2、把itemName的value赋给v和m
|
||||
jsonArray.forEach(item -> {
|
||||
JSONObject jsonObject = (JSONObject) item;
|
||||
JSONArray itemArr = (JSONArray) jsonObject.get(CELL_DATA);
|
||||
itemArr.forEach((it) -> {
|
||||
if (Objects.nonNull(it) && !"null".equals(it.toString())) {
|
||||
//获取到1列
|
||||
JSONObject data = (JSONObject) it;
|
||||
JSONObject son = (JSONObject) data.get(V);
|
||||
if (son.containsKey(V)) {
|
||||
String v = son.getStr(V);
|
||||
//数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$
|
||||
if (v.charAt(0) == '$' && v.contains(STR_ONE)) {
|
||||
String str = "";
|
||||
List<ReportTemplateDTO> rDto = assMap.get(v.replace(STR_TWO, "").toUpperCase());
|
||||
if (Objects.nonNull(rDto)) {
|
||||
str = rDto.get(0).getValue();
|
||||
//没有值,赋"/"
|
||||
if (StringUtils.isBlank(str)) {
|
||||
str = "/";
|
||||
}
|
||||
son.set(V, str);
|
||||
if (Objects.nonNull(rDto.get(0).getOverLimitFlag()) && rDto.get(0).getOverLimitFlag() == 1) {
|
||||
son.set("fc", "#990000");
|
||||
}
|
||||
}
|
||||
} else if (v.charAt(0) == '%' && v.contains(STR_ONE)) {
|
||||
//指标合格情况
|
||||
String str = "";
|
||||
List<ReportTemplateDTO> rDto = assMap.get(v.replace(STR_FOUR, "").toUpperCase());
|
||||
if (Objects.nonNull(rDto)) {
|
||||
str = rDto.get(0).getValue();
|
||||
//没有值,赋"/"
|
||||
if (StringUtils.isBlank(str)) {
|
||||
str = "/";
|
||||
}
|
||||
son.set(V, str);
|
||||
if ("不合格".equals(str)) {
|
||||
son.set("fc", "#990000");
|
||||
}
|
||||
}
|
||||
} else if (v.charAt(0) == '&') {
|
||||
//结论
|
||||
String tem = v.replace(STR_THREE, "").toUpperCase();
|
||||
if (finalTerminalMap.size()>0) {
|
||||
if ("STATIS_TIME".equals(tem)) {
|
||||
//如何时间是大于当前时间则用当前时间
|
||||
String localTime = InfluxDbSqlConstant.END_TIME;
|
||||
LocalDate localDate = LocalDateTimeUtil.parseDate(reportSearchParam.getEndTime(), DatePattern.NORM_DATE_PATTERN);
|
||||
LocalDate nowDate = LocalDate.now();
|
||||
if (nowDate.isAfter(localDate)) {
|
||||
son.set(V, reportSearchParam.getStartTime() + InfluxDbSqlConstant.START_TIME + "_" + reportSearchParam.getEndTime() + localTime);
|
||||
} else {
|
||||
localTime = " " + LocalTime.now().format(DatePattern.NORM_TIME_FORMATTER);
|
||||
son.set(V, reportSearchParam.getStartTime() + InfluxDbSqlConstant.START_TIME + "_" + nowDate + localTime);
|
||||
}
|
||||
} else {
|
||||
//台账信息
|
||||
son.set(V, finalTerminalMap.getOrDefault(tem, "/"));
|
||||
}
|
||||
}
|
||||
}
|
||||
//解决数据单位问题 @指标#类型@
|
||||
if (v.charAt(0) == '@' && v.contains(STR_ONE)) {
|
||||
String replace = v.replace("@", "");
|
||||
son.set(V, unit.getOrDefault(replace, "/"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* map key转大写
|
||||
*/
|
||||
public static <V> Map<String, V> convertKeysToUpperCase(Map<String, V> originalMap) {
|
||||
Map<String, V> newMap = new HashMap<>();
|
||||
for (Map.Entry<String, V> entry : originalMap.entrySet()) {
|
||||
newMap.put(entry.getKey().toUpperCase(), entry.getValue());
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,692 @@
|
||||
package com.njcn.harmonic.common.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.harmonic.pojo.param.ReportQueryParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataHarmrateVDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataIDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
import com.njcn.harmonic.pojo.vo.ReportValue;
|
||||
import com.njcn.harmonic.common.mapper.*;
|
||||
import com.njcn.harmonic.common.service.MonitorCommReportService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@DS("sjzx")
|
||||
@Slf4j
|
||||
public class MonitorCommReportServiceImpl implements MonitorCommReportService {
|
||||
|
||||
private final MonitorCommReportMapper reportMapper;
|
||||
private final RStatDataVDMapper statDataVDMapper;
|
||||
private final RStatDataHarmRateVDMapper rStatDataHarmRateVDMapper;
|
||||
private final RStatDataIDMapper rStatDataIDMapper;
|
||||
private final RStatDataInharmVDMapper rStatDataInharmVDMapper;
|
||||
|
||||
/* @Override
|
||||
public OverLimitInfo getOverLimitData(ReportQueryParam param) {
|
||||
|
||||
|
||||
OverLimitInfo overLimitInfo = new OverLimitInfo();
|
||||
|
||||
//查询时间段内共有多少条记录,并*0.95取整处理,用来计算CP95值 降序*0.05进一位计算
|
||||
double count = 0;
|
||||
double pstCount = 0;
|
||||
double pltCount = 0;
|
||||
if (param.getB()) {
|
||||
count = Math.ceil(1);
|
||||
pltCount = Math.ceil(1);
|
||||
pstCount = Math.ceil(1);
|
||||
} else {
|
||||
count = Math.ceil(reportMapper.getTotalCP95Day(param).intValue() * 0.05);
|
||||
pltCount = Math.ceil(reportMapper.getTotalPltCP95Day(param).intValue() * 0.05);
|
||||
pstCount = Math.ceil(reportMapper.getTotalPstCP95Day(param).intValue() * 0.05);
|
||||
}
|
||||
overLimitInfo.setCount(count);
|
||||
overLimitInfo.setPltCount(pltCount);
|
||||
overLimitInfo.setPstCount(pstCount);
|
||||
return overLimitInfo;
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
public List<ReportValue> getVirtualData(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
|
||||
// 获取电流有效值
|
||||
List<ReportValue> listI = reportMapper.getVirtualDataI(param);
|
||||
//获取电压有效值
|
||||
List<ReportValue> listV = reportMapper.getVirtualDataV(param);
|
||||
//获取线电压有效值
|
||||
List<ReportValue> listVV = reportMapper.getVVirtualData(param);
|
||||
|
||||
RegroupDataComm.regroupData(listV, true);
|
||||
RegroupDataComm.regroupData(listI, true);
|
||||
RegroupDataComm.regroupData(listVV, true);
|
||||
list.addAll(listV);
|
||||
list.addAll(listI);
|
||||
list.addAll(listVV);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getPowerData(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
//获取有功功率
|
||||
List<ReportValue> listP = reportMapper.getPowerP(param);
|
||||
//获取无功功率
|
||||
List<ReportValue> listQ = reportMapper.getPowerQ(param);
|
||||
//获取视在功率
|
||||
List<ReportValue> listS = reportMapper.getPowerS(param);
|
||||
//获取功率因数
|
||||
List<ReportValue> listF = reportMapper.getPF(param);
|
||||
|
||||
RegroupDataComm.regroupData(listP, true, false);
|
||||
RegroupDataComm.regroupData(listQ, true, false);
|
||||
RegroupDataComm.regroupData(listS, true, false);
|
||||
RegroupDataComm.regroupData(listF, true, false);
|
||||
list.addAll(listP);
|
||||
list.addAll(listQ);
|
||||
list.addAll(listS);
|
||||
list.addAll(listF);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getFlickerData(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
|
||||
//短时闪变
|
||||
List<ReportValue> listFlicker = reportMapper.getFlickerData(param);
|
||||
//长时闪变
|
||||
List<ReportValue> listLFlicker = reportMapper.getLFlickerData(param);
|
||||
|
||||
RegroupDataComm.regroupData(listFlicker, true);
|
||||
RegroupDataComm.regroupData(listLFlicker, true);
|
||||
list.addAll(listFlicker);
|
||||
list.addAll(listLFlicker);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getVdeviation(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
|
||||
//获取电压偏差
|
||||
List<ReportValue> listU = reportMapper.getUVdeviationData(param);
|
||||
List<ReportValue> listL = reportMapper.getLVdeviationData(param);
|
||||
|
||||
RegroupDataComm.regroupData(listU, true);
|
||||
RegroupDataComm.regroupData(listL, true);
|
||||
list.addAll(listU);
|
||||
list.addAll(listL);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getDistortionData(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
//获取电压畸变率
|
||||
List<ReportValue> listU = reportMapper.getDistortionDataV(param);
|
||||
//获取电流畸变率
|
||||
List<ReportValue> listI = reportMapper.getDistortionDataI(param);
|
||||
|
||||
//添加之前判断数据库是否有数据,如果没有数据模拟数据添加到集合中
|
||||
RegroupDataComm.regroupData(listU, true);
|
||||
RegroupDataComm.regroupData(listI, true);
|
||||
list.addAll(listU);
|
||||
list.addAll(listI);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getFrequencyData(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
|
||||
List<ReportValue> listFre = reportMapper.getFrequencyData(param);
|
||||
List<ReportValue> listFreDEV = reportMapper.getDEVFrequencyData(param);
|
||||
|
||||
|
||||
RegroupDataComm.regroupData(listFre, true);
|
||||
RegroupDataComm.regroupData(listFreDEV, true);
|
||||
list.addAll(listFre);
|
||||
list.addAll(listFreDEV);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getThreephase(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
//电压三相不平衡度
|
||||
List<ReportValue> listV = dataV(param, Arrays.asList("T"), 1, 5, true, 0);
|
||||
//电流三相不平衡度
|
||||
List<ReportValue> listI = dataI(param, Arrays.asList("T"), 1, 5, true, 0);
|
||||
|
||||
if (CollUtil.isNotEmpty(listV)) {
|
||||
list.addAll(listV);
|
||||
} else {
|
||||
regroupData(list);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(listI)) {
|
||||
list.addAll(listI);
|
||||
} else {
|
||||
regroupData(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getICurrent(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
|
||||
//获取电流幅值,包含基波
|
||||
List<ReportValue> listI = dataI(param, Arrays.asList("A", "B", "C"), 1, 51, false, 0);
|
||||
if (CollUtil.isEmpty(listI)) {
|
||||
for (int i = 0; i < 50; i++) {
|
||||
RegroupDataComm.regroupData(list, true, true);
|
||||
}
|
||||
} else {
|
||||
list.addAll(listI);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getVoltageRate(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
//这里获取的是电压有效值,不是V1
|
||||
//获取基波电压幅值,单位kV
|
||||
List<ReportValue> listV = dataV(param, Arrays.asList("A", "B", "C"), 1, 2, false, 5);
|
||||
|
||||
if (CollUtil.isEmpty(listV)) {
|
||||
RegroupDataComm.regroupData(list, true, true);
|
||||
} else {
|
||||
list.addAll(listV);
|
||||
}
|
||||
|
||||
//获取电压含有率,不包含基波
|
||||
List<ReportValue> listRate = dataHarmV(param, Arrays.asList("A", "B", "C"), 2, 51, false, 1);
|
||||
|
||||
if (CollUtil.isEmpty(listRate)) {
|
||||
for (int i = 0; i < 49; i++) {
|
||||
RegroupDataComm.regroupData(list, true, true);
|
||||
}
|
||||
} else {
|
||||
list.addAll(listRate);
|
||||
}
|
||||
|
||||
//获取电压畸变率
|
||||
List<ReportValue> listU = reportMapper.getDistortionDataV(param);
|
||||
RegroupDataComm.regroupData(listU, true);
|
||||
list.addAll(listU);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getInharmVeRate(ReportQueryParam param) {
|
||||
List<RStatDataInharmVDPO> inharm = rStatDataInharmVDMapper.selectList(new LambdaQueryWrapper<RStatDataInharmVDPO>()
|
||||
.eq(RStatDataInharmVDPO::getLineId, param.getLineId())
|
||||
.in(RStatDataInharmVDPO::getPhaseType, Arrays.asList("A", "B", "C"))
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatDataInharmVDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())))
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatDataInharmVDPO::getTime, DateUtil.endOfDay(DateUtil.parse(param.getEndTime())))
|
||||
);
|
||||
String max = "MAX";
|
||||
String avg = "AVG";
|
||||
String min = "MIN";
|
||||
String cp95 = "CP95";
|
||||
List<ReportValue> a = new ArrayList<>();
|
||||
Map<String, List<RStatDataInharmVDPO>> collect = inharm.stream().collect(Collectors.groupingBy(RStatDataInharmVDPO::getPhaseType));
|
||||
collect.forEach((key, value) -> {
|
||||
Map<String, List<RStatDataInharmVDPO>> valueTypeMap = value.stream().collect(Collectors.groupingBy(RStatDataInharmVDPO::getValueType));
|
||||
|
||||
for (int i = 1; i < 17; i++) {
|
||||
ReportValue reportValue = new ReportValue();
|
||||
String attribute = "v" + i;
|
||||
|
||||
if (valueTypeMap.containsKey(max)) {
|
||||
List<Float> aa = reflectDataInV(valueTypeMap.get(max), max, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
Float maxNum = aa.stream().distinct().max(Float::compareTo).get();
|
||||
reportValue.setFmaxValue(maxNum);
|
||||
}
|
||||
if (valueTypeMap.containsKey(avg)) {
|
||||
List<Float> aa = reflectDataInV(valueTypeMap.get(avg), avg, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
Double avgNum = aa.stream().distinct().collect(Collectors.averagingDouble(Float::doubleValue));
|
||||
reportValue.setMeanValue(avgNum.floatValue());
|
||||
}
|
||||
if (valueTypeMap.containsKey(min)) {
|
||||
List<Float> aa = reflectDataInV(valueTypeMap.get(min), min, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
double minNum = aa.stream().distinct().min(Float::compareTo).get();
|
||||
reportValue.setMinValue((float) minNum);
|
||||
}
|
||||
if (valueTypeMap.containsKey(cp95)) {
|
||||
List<Float> aa = reflectDataInV(valueTypeMap.get(cp95), cp95, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
List<Float> cp95Num = aa.stream().distinct().sorted(Comparator.comparing(Float::doubleValue).reversed()).collect(Collectors.toList());
|
||||
reportValue.setCp95Value(cp95Num.get(0).floatValue());
|
||||
}
|
||||
a.add(reportValue);
|
||||
}
|
||||
});
|
||||
if (CollUtil.isEmpty(a)) {
|
||||
for (int i = 1; i < 17; i++) {
|
||||
RegroupDataComm.regroupData(a, true, true);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportValue> getINegDataRate(ReportQueryParam param) {
|
||||
List<ReportValue> list = new ArrayList<>();
|
||||
//负序电流
|
||||
List<ReportValue> iNegData = reportMapper.getINegData(param);
|
||||
RegroupDataComm.regroupData(iNegData, true);
|
||||
list.addAll(iNegData);
|
||||
return list;
|
||||
}
|
||||
|
||||
//赋值默认值
|
||||
private void regroupData(List<ReportValue> list) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
List<ReportValue> list1 = new ArrayList<>();
|
||||
RegroupDataComm.regroupData(list1, false);
|
||||
list.addAll(list1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 电压信息
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @param valueTypes 区分类别 例如"A","B","C"
|
||||
* @param num 循环开始
|
||||
* @param size 循环结束
|
||||
* @param fly 否是启用获取属性电压
|
||||
* @param index 获取属性位置名称
|
||||
* @return
|
||||
*/
|
||||
private List<ReportValue> dataV(ReportQueryParam param, List<String> valueTypes, Integer num, Integer size, Boolean fly, Integer index) {
|
||||
List<RStatDataVD> rStatDataVDS = statDataVDMapper.selectList(new LambdaQueryWrapper<RStatDataVD>()
|
||||
.eq(RStatDataVD::getLineId, param.getLineId())
|
||||
.in(CollUtil.isNotEmpty(valueTypes), RStatDataVD::getPhasicType, valueTypes)
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatDataVD::getTime, DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())))
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatDataVD::getTime, DateUtil.endOfDay(DateUtil.parse(param.getEndTime())))
|
||||
);
|
||||
String max = "MAX";
|
||||
String avg = "AVG";
|
||||
String min = "MIN";
|
||||
String cp95 = "CP95";
|
||||
List<ReportValue> a = new ArrayList<>();
|
||||
Map<String, List<RStatDataVD>> collect = rStatDataVDS.stream().collect(Collectors.groupingBy(RStatDataVD::getPhasicType));
|
||||
collect.forEach((key, value) -> {
|
||||
Map<String, List<RStatDataVD>> valueTypeMap = value.stream().collect(Collectors.groupingBy(RStatDataVD::getValueType));
|
||||
|
||||
for (int i = num; i < size; i++) {
|
||||
ReportValue reportValue = new ReportValue();
|
||||
String attribute = "";
|
||||
if (fly) {
|
||||
if (index == 0) {
|
||||
attribute = attributeV(i);
|
||||
} else {
|
||||
attribute = attributeV(index);
|
||||
}
|
||||
} else {
|
||||
attribute = "v" + i;
|
||||
}
|
||||
|
||||
if (valueTypeMap.containsKey(max)) {
|
||||
List<Float> aa = reflectDataV(valueTypeMap.get(max), max, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
Float maxNum = aa.stream().distinct().max(Float::compareTo).get();
|
||||
reportValue.setFmaxValue(maxNum);
|
||||
}
|
||||
if (valueTypeMap.containsKey(avg)) {
|
||||
List<Float> aa = reflectDataV(valueTypeMap.get(avg), avg, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
Double avgNum = aa.stream().distinct().collect(Collectors.averagingDouble(Float::doubleValue));
|
||||
reportValue.setMeanValue(avgNum.floatValue());
|
||||
}
|
||||
if (valueTypeMap.containsKey(min)) {
|
||||
List<Float> aa = reflectDataV(valueTypeMap.get(min), min, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
double minNum = aa.stream().distinct().min(Float::compareTo).get();
|
||||
reportValue.setMinValue((float) minNum);
|
||||
}
|
||||
if (valueTypeMap.containsKey(cp95)) {
|
||||
List<Float> aa = reflectDataV(valueTypeMap.get(cp95), cp95, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
List<Float> cp95Num = aa.stream().distinct().sorted(Comparator.comparing(Float::doubleValue).reversed()).collect(Collectors.toList());
|
||||
reportValue.setCp95Value(cp95Num.get(0).floatValue());
|
||||
}
|
||||
a.add(reportValue);
|
||||
}
|
||||
});
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电压信息
|
||||
*
|
||||
* @param param 查询条件
|
||||
* @param valueTypes 区分类别 例如"A","B","C"
|
||||
* @param num 循环开始
|
||||
* @param size 循环结束
|
||||
* @param fly 否是启用获取属性电压
|
||||
* @param index 获取属性位置名称
|
||||
* @return
|
||||
*/
|
||||
private List<ReportValue> dataHarmV(ReportQueryParam param, List<String> valueTypes, Integer num, Integer size, Boolean fly, Integer index) {
|
||||
List<RStatDataHarmrateVDPO> harmRateVDPOS = rStatDataHarmRateVDMapper.selectList(new LambdaQueryWrapper<RStatDataHarmrateVDPO>()
|
||||
.eq(RStatDataHarmrateVDPO::getLineId, param.getLineId())
|
||||
.in(CollUtil.isNotEmpty(valueTypes), RStatDataHarmrateVDPO::getPhaseType, valueTypes)
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatDataHarmrateVDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())))
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatDataHarmrateVDPO::getTime, DateUtil.endOfDay(DateUtil.parse(param.getEndTime())))
|
||||
);
|
||||
String max = "MAX";
|
||||
String avg = "AVG";
|
||||
String min = "MIN";
|
||||
String cp95 = "CP95";
|
||||
List<ReportValue> a = new ArrayList<>();
|
||||
Map<String, List<RStatDataHarmrateVDPO>> collect = harmRateVDPOS.stream().collect(Collectors.groupingBy(RStatDataHarmrateVDPO::getPhaseType));
|
||||
//格式错误,之前数据50A,50B,50C,应该是50A,B,C
|
||||
for (int i = num; i < size; i++) {
|
||||
int finalI = i;
|
||||
collect.forEach((key, value) -> {
|
||||
Map<String, List<RStatDataHarmrateVDPO>> valueTypeMap = value.stream().collect(Collectors.groupingBy(RStatDataHarmrateVDPO::getValueType));
|
||||
|
||||
|
||||
ReportValue reportValue = new ReportValue();
|
||||
String attribute = "";
|
||||
if (fly) {
|
||||
if (index == 0) {
|
||||
attribute = attributeV(finalI);
|
||||
} else {
|
||||
attribute = attributeV(index);
|
||||
}
|
||||
} else {
|
||||
attribute = "v" + finalI;
|
||||
}
|
||||
|
||||
if (valueTypeMap.containsKey(max)) {
|
||||
List<Float> aa = reflectDataHarmV(valueTypeMap.get(max), max, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
Float maxNum = aa.stream().distinct().max(Float::compareTo).get();
|
||||
reportValue.setFmaxValue(maxNum);
|
||||
}
|
||||
if (valueTypeMap.containsKey(avg)) {
|
||||
List<Float> aa = reflectDataHarmV(valueTypeMap.get(avg), avg, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
Double avgNum = aa.stream().distinct().collect(Collectors.averagingDouble(Float::doubleValue));
|
||||
reportValue.setMeanValue(avgNum.floatValue());
|
||||
}
|
||||
if (valueTypeMap.containsKey(min)) {
|
||||
List<Float> aa = reflectDataHarmV(valueTypeMap.get(min), min, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
double minNum = aa.stream().distinct().min(Float::compareTo).get();
|
||||
reportValue.setMinValue((float) minNum);
|
||||
}
|
||||
if (valueTypeMap.containsKey(cp95)) {
|
||||
List<Float> aa = reflectDataHarmV(valueTypeMap.get(cp95), cp95, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
List<Float> cp95Num = aa.stream().distinct().sorted(Comparator.comparing(Float::doubleValue).reversed()).collect(Collectors.toList());
|
||||
reportValue.setCp95Value(cp95Num.get(0).floatValue());
|
||||
}
|
||||
a.add(reportValue);
|
||||
|
||||
});
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电压反射取属性值
|
||||
*
|
||||
* @param value
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private List<Float> reflectDataV(List<RStatDataVD> value, String name, String attribute) {
|
||||
Field field = null;
|
||||
try {
|
||||
field = RStatDataVD.class.getDeclaredField(attribute);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
field.setAccessible(true);
|
||||
|
||||
Field finalField = field;
|
||||
return value.stream().filter(x -> x.getValueType().equals(name)).map(temp -> {
|
||||
BigDecimal o = null;
|
||||
try {
|
||||
o = (BigDecimal) finalField.get(temp);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return o.floatValue();
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private List<Float> reflectDataHarmV(List<RStatDataHarmrateVDPO> value, String name, String attribute) {
|
||||
Field field = null;
|
||||
try {
|
||||
field = RStatDataHarmrateVDPO.class.getDeclaredField(attribute);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
field.setAccessible(true);
|
||||
|
||||
Field finalField = field;
|
||||
return value.stream().filter(x -> x.getValueType().equals(name)).map(temp -> {
|
||||
Double o = null;
|
||||
try {
|
||||
o = (Double) finalField.get(temp);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return o.floatValue();
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 电压反射取属性值
|
||||
*
|
||||
* @param value
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private List<Float> reflectDataInV(List<RStatDataInharmVDPO> value, String name, String attribute) {
|
||||
Field field;
|
||||
try {
|
||||
field = RStatDataInharmVDPO.class.getDeclaredField(attribute);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
field.setAccessible(true);
|
||||
|
||||
Field finalField = field;
|
||||
return value.stream().filter(x -> x.getValueType().equals(name)).map(temp -> {
|
||||
Double o;
|
||||
try {
|
||||
o = (Double) finalField.get(temp);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return o.floatValue();
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 电流信息
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
private List<ReportValue> dataI(ReportQueryParam param, List<String> valueTypes, Integer num, Integer size, Boolean fly, Integer index) {
|
||||
List<RStatDataIDPO> rStatDataVDS = rStatDataIDMapper.selectList(new LambdaQueryWrapper<RStatDataIDPO>()
|
||||
.eq(RStatDataIDPO::getLineId, param.getLineId())
|
||||
.in(CollUtil.isNotEmpty(valueTypes), RStatDataIDPO::getPhaseType, valueTypes)
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatDataIDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())))
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatDataIDPO::getTime, DateUtil.endOfDay(DateUtil.parse(param.getEndTime())))
|
||||
);
|
||||
String max = "MAX";
|
||||
String avg = "AVG";
|
||||
String min = "MIN";
|
||||
String cp95 = "CP95";
|
||||
List<ReportValue> a = new ArrayList<>();
|
||||
Map<String, List<RStatDataIDPO>> collect = rStatDataVDS.stream().collect(Collectors.groupingBy(RStatDataIDPO::getPhaseType));
|
||||
//格式错误,之前数据50A,50B,50C,应该是50A,B,C
|
||||
for (int i = num; i < size; i++) {
|
||||
int finalI = i;
|
||||
collect.forEach((key, value) -> {
|
||||
Map<String, List<RStatDataIDPO>> valueTypeMap = value.stream().collect(Collectors.groupingBy(RStatDataIDPO::getValueType));
|
||||
|
||||
|
||||
ReportValue reportValue = new ReportValue();
|
||||
String attribute = "";
|
||||
if (fly) {
|
||||
if (index == 0) {
|
||||
attribute = attributeI(finalI);
|
||||
} else {
|
||||
attribute = attributeI(index);
|
||||
}
|
||||
} else {
|
||||
attribute = "i" + finalI;
|
||||
}
|
||||
if (valueTypeMap.containsKey(max)) {
|
||||
List<Float> aa = reflectDataI(valueTypeMap.get(max), max, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
Float maxNum = aa.stream().distinct().max(Float::compareTo).get();
|
||||
reportValue.setFmaxValue(maxNum);
|
||||
}
|
||||
if (valueTypeMap.containsKey(avg)) {
|
||||
List<Float> aa = reflectDataI(valueTypeMap.get(avg), avg, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
Double avgNum = aa.stream().distinct().collect(Collectors.averagingDouble(Float::doubleValue));
|
||||
reportValue.setMeanValue(avgNum.floatValue());
|
||||
}
|
||||
if (valueTypeMap.containsKey(min)) {
|
||||
List<Float> aa = reflectDataI(valueTypeMap.get(min), min, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
double minNum = aa.stream().distinct().min(Float::compareTo).get();
|
||||
reportValue.setMinValue((float) minNum);
|
||||
}
|
||||
if (valueTypeMap.containsKey(cp95)) {
|
||||
List<Float> aa = reflectDataI(valueTypeMap.get(cp95), cp95, attribute);
|
||||
reportValue.setPhaseType(key);
|
||||
List<Float> cp95Num = aa.stream().distinct().sorted(Comparator.comparing(Float::doubleValue).reversed()).collect(Collectors.toList());
|
||||
reportValue.setCp95Value(cp95Num.get(0).floatValue());
|
||||
}
|
||||
a.add(reportValue);
|
||||
|
||||
});
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电流反射取属性值
|
||||
*
|
||||
* @param value
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private List<Float> reflectDataI(List<RStatDataIDPO> value, String name, String attribute) {
|
||||
Field field = null;
|
||||
try {
|
||||
field = RStatDataIDPO.class.getDeclaredField(attribute);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
field.setAccessible(true);
|
||||
Field finalField = field;
|
||||
return value.stream().filter(x -> x.getValueType().equals(name)).map(temp -> {
|
||||
Double o = null;
|
||||
try {
|
||||
o = (Double) finalField.get(temp);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return o.floatValue();
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取属性电压
|
||||
*
|
||||
* @param i
|
||||
* @return
|
||||
*/
|
||||
private String attributeV(Integer i) {
|
||||
String str = null;
|
||||
switch (i) {
|
||||
case 1:
|
||||
str = "vUnbalance";
|
||||
break;
|
||||
case 2:
|
||||
str = "vPos";
|
||||
break;
|
||||
case 3:
|
||||
str = "vNeg";
|
||||
break;
|
||||
case 4:
|
||||
str = "vZero";
|
||||
break;
|
||||
case 5:
|
||||
str = "v1";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取属性电流
|
||||
*
|
||||
* @param i
|
||||
* @return
|
||||
*/
|
||||
private String attributeI(Integer i) {
|
||||
String str = null;
|
||||
switch (i) {
|
||||
case 1:
|
||||
str = "iUnbalance";
|
||||
break;
|
||||
case 2:
|
||||
str = "iPos";
|
||||
break;
|
||||
case 3:
|
||||
str = "iNeg";
|
||||
break;
|
||||
case 4:
|
||||
str = "iZero";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
||||
package com.njcn.harmonic.service.impl;
|
||||
package com.njcn.harmonic.common.service.impl;
|
||||
|
||||
import com.njcn.harmonic.pojo.vo.ReportValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RegroupData {
|
||||
public class RegroupDataComm {
|
||||
public static void regroupData(List<ReportValue> list, boolean... b) {
|
||||
if (1 == b.length || (2 == b.length && b[1] == false)) {
|
||||
if (0 < list.size()) {
|
||||
Reference in New Issue
Block a user