新能源专项分析功能开发
This commit is contained in:
@@ -37,4 +37,7 @@ public class LineDTO {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "用户非网侧")
|
@ApiModelProperty(name = "用户非网侧")
|
||||||
private String objId;
|
private String objId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "对象类型大类")
|
||||||
|
private String bigObjType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,38 +71,4 @@ public interface Param {
|
|||||||
Integer WEEK = 4;
|
Integer WEEK = 4;
|
||||||
Integer DAY = 5;
|
Integer DAY = 5;
|
||||||
|
|
||||||
//以下四个固定ID用于某些业务判断
|
|
||||||
// //字典(sys_dict_data):电压暂升的ID
|
|
||||||
// String UPPEREVENT = "c5ce588cb76fba90c4519ab250c962d0";
|
|
||||||
// //字典(sys_dict_data):电压暂降的ID
|
|
||||||
// String LOWEREVENT = "c37861896dafab0883321e1d508caa51";
|
|
||||||
// //字典(sys_dict_data):光伏电站的ID
|
|
||||||
// String PHOTOVOLTAICPOWER = "45615057cb88650ffc4779b0629bac7e";
|
|
||||||
// //字典(sys_dict_data):风电场的ID
|
|
||||||
// String WINDFARM = "f9145acb79cbf136b9ee89fd38d72583";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 以下的四个Map为有功功率页面查看指标详情的四个指标分组下的具体指标(指标对应的可能不对 到时候直接改map里的key即可)
|
|
||||||
* put(name:表ele_epd_pqd中的名称,value:页面展示的指标名称)
|
|
||||||
*/
|
|
||||||
Map<String,String> DATABSEMAP = new HashMap(){{
|
|
||||||
put("线电压偏差","电压偏差");
|
|
||||||
put("电压负序不平衡度","三相电压不平衡度");
|
|
||||||
put("相电压电压变动幅度","电压波动");
|
|
||||||
put("相电压长时闪变","长时闪变");
|
|
||||||
put("电流负序不平衡度","电流不平衡度");
|
|
||||||
}};
|
|
||||||
|
|
||||||
Map<String,String> UHARMMAP = new HashMap(){{
|
|
||||||
put("相电压谐波含有率序列","谐波电压");
|
|
||||||
}};
|
|
||||||
|
|
||||||
Map<String,String> IHARMMAP = new HashMap(){{
|
|
||||||
put("谐波电流有效值","谐波电流");
|
|
||||||
}};
|
|
||||||
|
|
||||||
Map<String,String> INTERHARMONICMAP = new HashMap(){{
|
|
||||||
put("间谐波电压有效值序列","间谐波电压含有率");
|
|
||||||
}};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1435,7 +1435,8 @@
|
|||||||
pqd.Run_Flag as runFlag,
|
pqd.Run_Flag as runFlag,
|
||||||
detail.PT_Type AS ptType,
|
detail.PT_Type AS ptType,
|
||||||
detail.PT_Phase_Type AS ptPhaseType,
|
detail.PT_Phase_Type AS ptPhaseType,
|
||||||
detail.Obj_Id AS objId
|
detail.Obj_Id AS objId,
|
||||||
|
detail.Big_Obj_Type AS bigObjType
|
||||||
FROM
|
FROM
|
||||||
pq_line line,
|
pq_line line,
|
||||||
pq_line_detail detail,
|
pq_line_detail detail,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.njcn.harmonic.service.activepowerrange.impl;
|
|||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.excel.ExcelWriter;
|
import com.alibaba.excel.ExcelWriter;
|
||||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||||
@@ -27,6 +28,7 @@ import org.apache.poi.xssf.usermodel.XSSFDrawing;
|
|||||||
import org.apache.poi.xssf.usermodel.XSSFSimpleShape;
|
import org.apache.poi.xssf.usermodel.XSSFSimpleShape;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -38,6 +40,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 有功功率趋势统计 服务实现类
|
* 有功功率趋势统计 服务实现类
|
||||||
|
*
|
||||||
* @author guofeihu
|
* @author guofeihu
|
||||||
* @since 2024-08-20
|
* @since 2024-08-20
|
||||||
*/
|
*/
|
||||||
@@ -46,20 +49,36 @@ import java.util.stream.Collectors;
|
|||||||
public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||||
|
|
||||||
private final RActivePowerRangeFeignClient rActivePowerRangeFeignClient;
|
private final RActivePowerRangeFeignClient rActivePowerRangeFeignClient;
|
||||||
|
|
||||||
private final CommonService commonService;
|
private final CommonService commonService;
|
||||||
|
|
||||||
private final DecimalFormat df = new DecimalFormat(Param.DECIMAL_FORMATSTR);
|
private final DecimalFormat df = new DecimalFormat(Param.DECIMAL_FORMATSTR);
|
||||||
|
|
||||||
private final DecimalFormat dftwo = new DecimalFormat(Param.DECIMAL_FORMATTWOSTR);
|
private final DecimalFormat dftwo = new DecimalFormat(Param.DECIMAL_FORMATTWOSTR);
|
||||||
|
|
||||||
private final EpdFeignClient epdFeignClient;
|
private final EpdFeignClient epdFeignClient;
|
||||||
|
|
||||||
private List<String> METHODS = Arrays.asList(InfluxDBTableConstant.AVG,InfluxDBTableConstant.CP95,InfluxDBTableConstant.MIN,InfluxDBTableConstant.MAX);
|
private List<String> METHODS = Arrays.asList(InfluxDBTableConstant.AVG, InfluxDBTableConstant.CP95, InfluxDBTableConstant.MIN, InfluxDBTableConstant.MAX);
|
||||||
|
|
||||||
private List<String> PHASE = Arrays.asList(InfluxDBTableConstant.PHASE_TYPE_A,InfluxDBTableConstant.PHASE_TYPE_B,InfluxDBTableConstant.PHASE_TYPE_C);
|
private List<String> PHASE = Arrays.asList(InfluxDBTableConstant.PHASE_TYPE_A, InfluxDBTableConstant.PHASE_TYPE_B, InfluxDBTableConstant.PHASE_TYPE_C);
|
||||||
|
|
||||||
private List<String> times = Arrays.asList("0~10%","10~20%","20~30%","30~40%","40~50%","50~60%","60~70%","70~80%","80~90%","90~100%");
|
private List<String> times = Arrays.asList("0~10%", "10~20%", "20~30%", "30~40%", "40~50%", "50~60%", "60~70%", "70~80%", "80~90%", "90~100%");
|
||||||
|
|
||||||
|
Map<String, String> DATABSEMAP = new HashMap() {{
|
||||||
|
put("PPVDev", "电压偏差");
|
||||||
|
put("ImbNgV", "三相电压不平衡度");
|
||||||
|
put("PhFluc", "电压波动");
|
||||||
|
put("PhPlt", "长时闪变");
|
||||||
|
put("ImbNgA", "电流不平衡度");
|
||||||
|
}};
|
||||||
|
|
||||||
|
Map<String, String> UHARMMAP = new HashMap() {{
|
||||||
|
put("HRPhV", "谐波电压");
|
||||||
|
}};
|
||||||
|
|
||||||
|
Map<String, String> IHARMMAP = new HashMap() {{
|
||||||
|
put("HA", "谐波电流");
|
||||||
|
}};
|
||||||
|
|
||||||
|
Map<String, String> INTERHARMONICMAP = new HashMap() {{
|
||||||
|
put("IHRPhV", "间谐波电压含有率");
|
||||||
|
}};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PowerStatisticsVO getDataByLineId(PowerStatisticsParam powerStatisticsParam) {
|
public PowerStatisticsVO getDataByLineId(PowerStatisticsParam powerStatisticsParam) {
|
||||||
@@ -73,9 +92,9 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
rActivePowerRangeFeignClient.record(rActivePowerRangeParam);
|
rActivePowerRangeFeignClient.record(rActivePowerRangeParam);
|
||||||
//执行完就可以获取到区间数据了
|
//执行完就可以获取到区间数据了
|
||||||
RActivePowerRangePO rActivePowerRangePO = rActivePowerRangeFeignClient.getDataByLineId(powerStatisticsParam.getLineId(),
|
RActivePowerRangePO rActivePowerRangePO = rActivePowerRangeFeignClient.getDataByLineId(powerStatisticsParam.getLineId(),
|
||||||
powerStatisticsParam.getSearchBeginTime(),powerStatisticsParam.getSearchEndTime()).getData();
|
powerStatisticsParam.getSearchBeginTime(), powerStatisticsParam.getSearchEndTime()).getData();
|
||||||
//如果的确没有统计到数据则默认
|
//如果的确没有统计到数据则默认
|
||||||
if(rActivePowerRangePO == null){
|
if (rActivePowerRangePO == null) {
|
||||||
rActivePowerRangePO = new RActivePowerRangePO();
|
rActivePowerRangePO = new RActivePowerRangePO();
|
||||||
}
|
}
|
||||||
PowerStatisticsVO powerStatisticsVO = new PowerStatisticsVO();
|
PowerStatisticsVO powerStatisticsVO = new PowerStatisticsVO();
|
||||||
@@ -85,18 +104,18 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
+ powerStatisticsVO.getMinsNum3() + powerStatisticsVO.getMinsNum4() + powerStatisticsVO.getMinsNum5()
|
+ powerStatisticsVO.getMinsNum3() + powerStatisticsVO.getMinsNum4() + powerStatisticsVO.getMinsNum5()
|
||||||
+ powerStatisticsVO.getMinsNum6() + powerStatisticsVO.getMinsNum7() + powerStatisticsVO.getMinsNum8()
|
+ powerStatisticsVO.getMinsNum6() + powerStatisticsVO.getMinsNum7() + powerStatisticsVO.getMinsNum8()
|
||||||
+ powerStatisticsVO.getMinsNum9();
|
+ powerStatisticsVO.getMinsNum9();
|
||||||
if(total != 0){
|
if (total != 0) {
|
||||||
BigDecimal totalData = BigDecimal.valueOf(total);
|
BigDecimal totalData = BigDecimal.valueOf(total);
|
||||||
powerStatisticsVO.setProportion0(BigDecimal.valueOf(powerStatisticsVO.getMinsNum0()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion0(BigDecimal.valueOf(powerStatisticsVO.getMinsNum0() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion1(BigDecimal.valueOf(powerStatisticsVO.getMinsNum1()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion1(BigDecimal.valueOf(powerStatisticsVO.getMinsNum1() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion2(BigDecimal.valueOf(powerStatisticsVO.getMinsNum2()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion2(BigDecimal.valueOf(powerStatisticsVO.getMinsNum2() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion3(BigDecimal.valueOf(powerStatisticsVO.getMinsNum3()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion3(BigDecimal.valueOf(powerStatisticsVO.getMinsNum3() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion4(BigDecimal.valueOf(powerStatisticsVO.getMinsNum4()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion4(BigDecimal.valueOf(powerStatisticsVO.getMinsNum4() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion5(BigDecimal.valueOf(powerStatisticsVO.getMinsNum5()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion5(BigDecimal.valueOf(powerStatisticsVO.getMinsNum5() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion6(BigDecimal.valueOf(powerStatisticsVO.getMinsNum6()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion6(BigDecimal.valueOf(powerStatisticsVO.getMinsNum6() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion7(BigDecimal.valueOf(powerStatisticsVO.getMinsNum7()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion7(BigDecimal.valueOf(powerStatisticsVO.getMinsNum7() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion8(BigDecimal.valueOf(powerStatisticsVO.getMinsNum8()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion8(BigDecimal.valueOf(powerStatisticsVO.getMinsNum8() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
powerStatisticsVO.setProportion9(BigDecimal.valueOf(powerStatisticsVO.getMinsNum9()* 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
powerStatisticsVO.setProportion9(BigDecimal.valueOf(powerStatisticsVO.getMinsNum9() * 100.0).divide(totalData, 4, RoundingMode.HALF_UP).doubleValue());
|
||||||
}
|
}
|
||||||
return powerStatisticsVO;
|
return powerStatisticsVO;
|
||||||
}
|
}
|
||||||
@@ -108,11 +127,11 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
BeanUtil.copyProperties(powerStatisticsParam, rActivePowerRangeParam);
|
BeanUtil.copyProperties(powerStatisticsParam, rActivePowerRangeParam);
|
||||||
rActivePowerRangeParam.setSearch(true);
|
rActivePowerRangeParam.setSearch(true);
|
||||||
RActivePowerRangePO rActivePowerRangePO = rActivePowerRangeFeignClient.getDataByLineId(powerStatisticsParam.getLineId(),
|
RActivePowerRangePO rActivePowerRangePO = rActivePowerRangeFeignClient.getDataByLineId(powerStatisticsParam.getLineId(),
|
||||||
powerStatisticsParam.getSearchBeginTime(),powerStatisticsParam.getSearchEndTime()).getData();
|
powerStatisticsParam.getSearchBeginTime(), powerStatisticsParam.getSearchEndTime()).getData();
|
||||||
if(rActivePowerRangePO != null){
|
if (rActivePowerRangePO != null) {
|
||||||
String times = reflexObjValue(rActivePowerRangePO,"minsTime"+powerStatisticsParam.getField()).toString().replace("null","");
|
String times = reflexObjValue(rActivePowerRangePO, "minsTime" + powerStatisticsParam.getField()).toString().replace("null", "");
|
||||||
rActivePowerRangeParam.setSearchTimeFort(false);
|
rActivePowerRangeParam.setSearchTimeFort(false);
|
||||||
for(String se : times.split("&")){
|
for (String se : times.split("&")) {
|
||||||
String startTime = se.split(",")[0];
|
String startTime = se.split(",")[0];
|
||||||
String endTime = se.split(",")[1];
|
String endTime = se.split(",")[1];
|
||||||
rActivePowerRangeParam.setSearchBeginTime(startTime);
|
rActivePowerRangeParam.setSearchBeginTime(startTime);
|
||||||
@@ -125,9 +144,9 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 反射获取值
|
|
||||||
* @param obj
|
* @param obj
|
||||||
* @param fieldName
|
* @param fieldName
|
||||||
|
* @Description: 反射获取值
|
||||||
* @return: java.lang.Object
|
* @return: java.lang.Object
|
||||||
* @Author: wr
|
* @Author: wr
|
||||||
* @Date: 2025/3/26 19:24
|
* @Date: 2025/3/26 19:24
|
||||||
@@ -148,80 +167,68 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
public List<ThdDataVO> getTargetByTime(PowerStatisticsParam powerStatisticsParam) {
|
public List<ThdDataVO> getTargetByTime(PowerStatisticsParam powerStatisticsParam) {
|
||||||
List<ThdDataVO> result = new ArrayList();
|
List<ThdDataVO> result = new ArrayList();
|
||||||
List<EleEpdPqd> eleEpdPqds = new ArrayList<>();
|
List<EleEpdPqd> eleEpdPqds = new ArrayList<>();
|
||||||
//获取固定指标具体请看Param.DATABSEMAP
|
//获取固定指标具体请看
|
||||||
if("1".equals(powerStatisticsParam.getStatisticalId())){
|
if ("1".equals(powerStatisticsParam.getStatisticalId())) {
|
||||||
com.njcn.device.pq.constant.Param.DATABSEMAP.forEach((key,value) ->{
|
DATABSEMAP.forEach((key, value) -> {
|
||||||
List<EleEpdPqd> epdPqds = epdFeignClient.findListByShowName(key).getData();
|
EleEpdPqd epdPqd = epdFeignClient.findByName(key).getData();
|
||||||
for(EleEpdPqd epdPqd : epdPqds){
|
if(ObjectUtil.isNotEmpty(epdPqd)){
|
||||||
epdPqd.setShowName(value);
|
epdPqd.setShowName(value);
|
||||||
}
|
eleEpdPqds.add(epdPqd);
|
||||||
if(!epdPqds.isEmpty()){
|
|
||||||
//这边相别只需要获得一个即可
|
|
||||||
eleEpdPqds.add(epdPqds.get(0));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if("2".equals(powerStatisticsParam.getStatisticalId())){
|
if ("2".equals(powerStatisticsParam.getStatisticalId())) {
|
||||||
com.njcn.device.pq.constant.Param.UHARMMAP.forEach((key,value) ->{
|
UHARMMAP.forEach((key, value) -> {
|
||||||
List<EleEpdPqd> epdPqds = epdFeignClient.findListByShowName(key).getData();
|
EleEpdPqd epdPqd = epdFeignClient.findByName(key).getData();
|
||||||
for(EleEpdPqd epdPqd : epdPqds){
|
if(ObjectUtil.isNotEmpty(epdPqd)){
|
||||||
epdPqd.setShowName(value);
|
epdPqd.setShowName(value);
|
||||||
}
|
eleEpdPqds.add(epdPqd);
|
||||||
if(!epdPqds.isEmpty()){
|
|
||||||
//这边相别只需要获得一个即可
|
|
||||||
eleEpdPqds.add(epdPqds.get(0));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if("3".equals(powerStatisticsParam.getStatisticalId())){
|
if ("3".equals(powerStatisticsParam.getStatisticalId())) {
|
||||||
com.njcn.device.pq.constant.Param.IHARMMAP.forEach((key,value) ->{
|
IHARMMAP.forEach((key, value) -> {
|
||||||
List<EleEpdPqd> epdPqds = epdFeignClient.findListByShowName(key).getData();
|
EleEpdPqd epdPqd = epdFeignClient.findByName(key).getData();
|
||||||
for(EleEpdPqd epdPqd : epdPqds){
|
if(ObjectUtil.isNotEmpty(epdPqd)){
|
||||||
epdPqd.setShowName(value);
|
epdPqd.setShowName(value);
|
||||||
}
|
eleEpdPqds.add(epdPqd);
|
||||||
if(!epdPqds.isEmpty()){
|
|
||||||
//这边相别只需要获得一个即可
|
|
||||||
eleEpdPqds.add(epdPqds.get(0));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if("4".equals(powerStatisticsParam.getStatisticalId())){
|
if ("4".equals(powerStatisticsParam.getStatisticalId())) {
|
||||||
com.njcn.device.pq.constant.Param.INTERHARMONICMAP.forEach((key,value) ->{
|
INTERHARMONICMAP.forEach((key, value) -> {
|
||||||
List<EleEpdPqd> epdPqds = epdFeignClient.findListByShowName(key).getData();
|
EleEpdPqd epdPqd = epdFeignClient.findByName(key).getData();
|
||||||
for(EleEpdPqd epdPqd : epdPqds){
|
if(ObjectUtil.isNotEmpty(epdPqd)){
|
||||||
epdPqd.setShowName(value);
|
epdPqd.setShowName(value);
|
||||||
}
|
eleEpdPqds.add(epdPqd);
|
||||||
if(!epdPqds.isEmpty()){
|
|
||||||
//这边相别只需要获得一个即可
|
|
||||||
eleEpdPqds.add(epdPqds.get(0));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
eleEpdPqds.forEach(epdPqd->{
|
eleEpdPqds.forEach(epdPqd -> {
|
||||||
List<CommonQueryParam> commonQueryParams = new ArrayList<>();
|
List<CommonQueryParam> commonQueryParams = new ArrayList<>();
|
||||||
commonQueryParams.clear();
|
commonQueryParams.clear();
|
||||||
//带有谐波次数的指标
|
//带有谐波次数的指标
|
||||||
if(epdPqd.getHarmEnd()!=null && epdPqd.getHarmStart()!=null){
|
if (epdPqd.getHarmEnd() != null && epdPqd.getHarmStart() != null) {
|
||||||
for (int i = epdPqd.getHarmStart().intValue(); i <= epdPqd.getHarmEnd().intValue(); i++) {
|
for (int i = epdPqd.getHarmStart().intValue(); i <= epdPqd.getHarmEnd().intValue(); i++) {
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
thdDataVO.setUnit(epdPqd.getUnit());
|
thdDataVO.setUnit(epdPqd.getUnit());
|
||||||
thdDataVO.setTime(powerStatisticsParam.getSearchBeginTime());
|
thdDataVO.setTime(powerStatisticsParam.getSearchBeginTime());
|
||||||
String index = i+"";
|
String index = i + "";
|
||||||
if(epdPqd.getShowName().equals("间谐波电压含有率")){
|
if (epdPqd.getShowName().equals("间谐波电压含有率")) {
|
||||||
thdDataVO.setAnotherName(Integer.parseInt(index) - 0.5 + "次");
|
thdDataVO.setAnotherName(Integer.parseInt(index) - 0.5 + "次");
|
||||||
}else{
|
} else {
|
||||||
thdDataVO.setAnotherName(index + "次");
|
thdDataVO.setAnotherName(index + "次");
|
||||||
}
|
}
|
||||||
getThdDataVO(epdPqd.getOtherName()+"_"+index,thdDataVO,epdPqd,powerStatisticsParam);
|
getThdDataVO(epdPqd.getOtherName() + "_" + index, thdDataVO, epdPqd, powerStatisticsParam);
|
||||||
result.add(thdDataVO);
|
result.add(thdDataVO);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
//无谐波次数的指标
|
//无谐波次数的指标
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
thdDataVO.setAnotherName(epdPqd.getShowName());
|
thdDataVO.setAnotherName(epdPqd.getShowName());
|
||||||
thdDataVO.setUnit(epdPqd.getUnit());
|
thdDataVO.setUnit(epdPqd.getUnit());
|
||||||
thdDataVO.setTime(powerStatisticsParam.getSearchBeginTime());
|
thdDataVO.setTime(powerStatisticsParam.getSearchBeginTime());
|
||||||
getThdDataVO(null,thdDataVO,epdPqd,powerStatisticsParam);
|
getThdDataVO(null, thdDataVO, epdPqd, powerStatisticsParam);
|
||||||
result.add(thdDataVO);
|
result.add(thdDataVO);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -229,12 +236,12 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//将各个指标的所有的相别统计方式以表格的维度进行组装数据
|
//将各个指标的所有的相别统计方式以表格的维度进行组装数据
|
||||||
private ThdDataVO getThdDataVO(String columnName, ThdDataVO thdDataVO, EleEpdPqd epdPqd, PowerStatisticsParam powerStatisticsParam){
|
private ThdDataVO getThdDataVO(String columnName, ThdDataVO thdDataVO, EleEpdPqd epdPqd, PowerStatisticsParam powerStatisticsParam) {
|
||||||
List<CommonQueryParam> commonQueryParams = new ArrayList<>();
|
List<CommonQueryParam> commonQueryParams = new ArrayList<>();
|
||||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||||
commonQueryParam.setLineId(powerStatisticsParam.getLineId());
|
commonQueryParam.setLineId(powerStatisticsParam.getLineId());
|
||||||
commonQueryParam.setTableName(epdPqd.getClassId());
|
commonQueryParam.setTableName(epdPqd.getClassId());
|
||||||
commonQueryParam.setColumnName(columnName == null ? epdPqd.getOtherName():columnName);
|
commonQueryParam.setColumnName(columnName == null ? epdPqd.getOtherName() : columnName);
|
||||||
commonQueryParam.setStartTime(powerStatisticsParam.getSearchBeginTime());
|
commonQueryParam.setStartTime(powerStatisticsParam.getSearchBeginTime());
|
||||||
commonQueryParam.setEndTime(powerStatisticsParam.getSearchEndTime());
|
commonQueryParam.setEndTime(powerStatisticsParam.getSearchEndTime());
|
||||||
//唯一不同的条件时统计方式和相别,所以这边直接把所有的情况都考虑进去
|
//唯一不同的条件时统计方式和相别,所以这边直接把所有的情况都考虑进去
|
||||||
@@ -243,87 +250,87 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
commonQueryParams.add(commonQueryParam);
|
commonQueryParams.add(commonQueryParam);
|
||||||
|
|
||||||
List<StatisticalDataDTO> deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
List<StatisticalDataDTO> deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setAVGPhaseA(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setAVGPhaseA(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(0));
|
commonQueryParam.setDataType(METHODS.get(0));
|
||||||
commonQueryParam.setPhasic(PHASE.get(1));
|
commonQueryParam.setPhasic(PHASE.get(1));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setAVGPhaseB(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setAVGPhaseB(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(0));
|
commonQueryParam.setDataType(METHODS.get(0));
|
||||||
commonQueryParam.setPhasic(PHASE.get(2));
|
commonQueryParam.setPhasic(PHASE.get(2));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setAVGPhaseC(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setAVGPhaseC(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(1));
|
commonQueryParam.setDataType(METHODS.get(1));
|
||||||
commonQueryParam.setPhasic(PHASE.get(0));
|
commonQueryParam.setPhasic(PHASE.get(0));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setCP95PhaseA(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setCP95PhaseA(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(1));
|
commonQueryParam.setDataType(METHODS.get(1));
|
||||||
commonQueryParam.setPhasic(PHASE.get(1));
|
commonQueryParam.setPhasic(PHASE.get(1));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setCP95PhaseB(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setCP95PhaseB(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(1));
|
commonQueryParam.setDataType(METHODS.get(1));
|
||||||
commonQueryParam.setPhasic(PHASE.get(2));
|
commonQueryParam.setPhasic(PHASE.get(2));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setCP95PhaseC(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setCP95PhaseC(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(2));
|
commonQueryParam.setDataType(METHODS.get(2));
|
||||||
commonQueryParam.setPhasic(PHASE.get(0));
|
commonQueryParam.setPhasic(PHASE.get(0));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setMINPhaseA(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setMINPhaseA(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(2));
|
commonQueryParam.setDataType(METHODS.get(2));
|
||||||
commonQueryParam.setPhasic(PHASE.get(1));
|
commonQueryParam.setPhasic(PHASE.get(1));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setMINPhaseB(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setMINPhaseB(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(2));
|
commonQueryParam.setDataType(METHODS.get(2));
|
||||||
commonQueryParam.setPhasic(PHASE.get(2));
|
commonQueryParam.setPhasic(PHASE.get(2));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setMINPhaseC(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setMINPhaseC(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(3));
|
commonQueryParam.setDataType(METHODS.get(3));
|
||||||
commonQueryParam.setPhasic(PHASE.get(0));
|
commonQueryParam.setPhasic(PHASE.get(0));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setMAXPhaseA(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setMAXPhaseA(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(3));
|
commonQueryParam.setDataType(METHODS.get(3));
|
||||||
commonQueryParam.setPhasic(PHASE.get(1));
|
commonQueryParam.setPhasic(PHASE.get(1));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setMAXPhaseB(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setMAXPhaseB(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
commonQueryParam.setDataType(METHODS.get(3));
|
commonQueryParam.setDataType(METHODS.get(3));
|
||||||
commonQueryParam.setPhasic(PHASE.get(2));
|
commonQueryParam.setPhasic(PHASE.get(2));
|
||||||
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
deviceRtData = commonService.getNewDeviceRtDataByTime(commonQueryParams);
|
||||||
if(!deviceRtData.isEmpty()) {
|
if (!deviceRtData.isEmpty()) {
|
||||||
thdDataVO.setMAXPhaseC(Double.valueOf(df.format(deviceRtData.get(0).getValue()))+"");
|
thdDataVO.setMAXPhaseC(Double.valueOf(df.format(deviceRtData.get(0).getValue())) + "");
|
||||||
}
|
}
|
||||||
return thdDataVO;
|
return thdDataVO;
|
||||||
}
|
}
|
||||||
@@ -336,53 +343,53 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
ExportParams exportParams = new ExportParams(powerStatisticsParam.getSearchValue(), "区间数据");
|
ExportParams exportParams = new ExportParams(powerStatisticsParam.getSearchValue(), "区间数据");
|
||||||
//各区间数量
|
//各区间数量
|
||||||
PowerStatisticsExcelRangVO num = new PowerStatisticsExcelRangVO();
|
PowerStatisticsExcelRangVO num = new PowerStatisticsExcelRangVO();
|
||||||
num.setMinsNum0(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum0()+"");
|
num.setMinsNum0(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum0() + "");
|
||||||
num.setMinsNum1(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum1()+"");
|
num.setMinsNum1(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum1() + "");
|
||||||
num.setMinsNum2(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum2()+"");
|
num.setMinsNum2(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum2() + "");
|
||||||
num.setMinsNum3(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum3()+"");
|
num.setMinsNum3(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum3() + "");
|
||||||
num.setMinsNum4(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum4()+"");
|
num.setMinsNum4(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum4() + "");
|
||||||
num.setMinsNum5(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum5()+"");
|
num.setMinsNum5(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum5() + "");
|
||||||
num.setMinsNum6(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum6()+"");
|
num.setMinsNum6(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum6() + "");
|
||||||
num.setMinsNum7(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum7()+"");
|
num.setMinsNum7(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum7() + "");
|
||||||
num.setMinsNum8(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum8()+"");
|
num.setMinsNum8(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum8() + "");
|
||||||
num.setMinsNum9(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getMinsNum9()+"");
|
num.setMinsNum9(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getMinsNum9() + "");
|
||||||
num.setText("个数");
|
num.setText("个数");
|
||||||
powerStatisticsVOS.add(num);
|
powerStatisticsVOS.add(num);
|
||||||
//各区间是否越限
|
//各区间是否越限
|
||||||
PowerStatisticsExcelRangVO isOrNot = new PowerStatisticsExcelRangVO();
|
PowerStatisticsExcelRangVO isOrNot = new PowerStatisticsExcelRangVO();
|
||||||
isOrNot.setMinsNum0(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot0()>0?"是":"否");
|
isOrNot.setMinsNum0(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot0() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum1(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot1()>0?"是":"否");
|
isOrNot.setMinsNum1(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot1() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum2(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot2()>0?"是":"否");
|
isOrNot.setMinsNum2(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot2() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum3(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot3()>0?"是":"否");
|
isOrNot.setMinsNum3(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot3() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum4(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot4()>0?"是":"否");
|
isOrNot.setMinsNum4(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot4() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum5(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot5()>0?"是":"否");
|
isOrNot.setMinsNum5(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot5() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum6(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot6()>0?"是":"否");
|
isOrNot.setMinsNum6(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot6() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum7(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot7()>0?"是":"否");
|
isOrNot.setMinsNum7(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot7() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum8(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot8()>0?"是":"否");
|
isOrNot.setMinsNum8(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot8() > 0 ? "是" : "否");
|
||||||
isOrNot.setMinsNum9(powerStatisticsVO.getLineId() == null? "":powerStatisticsVO.getIsOrNot9()>0?"是":"否");
|
isOrNot.setMinsNum9(powerStatisticsVO.getLineId() == null ? "" : powerStatisticsVO.getIsOrNot9() > 0 ? "是" : "否");
|
||||||
isOrNot.setText("是否越限");
|
isOrNot.setText("是否越限");
|
||||||
powerStatisticsVOS.add(isOrNot);
|
powerStatisticsVOS.add(isOrNot);
|
||||||
//各区间占比
|
//各区间占比
|
||||||
PowerStatisticsExcelRangVO proportion = new PowerStatisticsExcelRangVO();
|
PowerStatisticsExcelRangVO proportion = new PowerStatisticsExcelRangVO();
|
||||||
int total = 0;
|
int total = 0;
|
||||||
if(powerStatisticsVO.getLineId() != null){
|
if (powerStatisticsVO.getLineId() != null) {
|
||||||
total = powerStatisticsVO.getMinsNum0() + powerStatisticsVO.getMinsNum1() + powerStatisticsVO.getMinsNum2()
|
total = powerStatisticsVO.getMinsNum0() + powerStatisticsVO.getMinsNum1() + powerStatisticsVO.getMinsNum2()
|
||||||
+ powerStatisticsVO.getMinsNum3() + powerStatisticsVO.getMinsNum4() + powerStatisticsVO.getMinsNum5()
|
+ powerStatisticsVO.getMinsNum3() + powerStatisticsVO.getMinsNum4() + powerStatisticsVO.getMinsNum5()
|
||||||
+ powerStatisticsVO.getMinsNum6() + powerStatisticsVO.getMinsNum7() + powerStatisticsVO.getMinsNum8()
|
+ powerStatisticsVO.getMinsNum6() + powerStatisticsVO.getMinsNum7() + powerStatisticsVO.getMinsNum8()
|
||||||
+ powerStatisticsVO.getMinsNum9();
|
+ powerStatisticsVO.getMinsNum9();
|
||||||
}
|
}
|
||||||
if(total != 0){
|
if (total != 0) {
|
||||||
proportion.setMinsNum0(dftwo.format((double)powerStatisticsVO.getMinsNum0().intValue() / total * 100) + "%");
|
proportion.setMinsNum0(dftwo.format((double) powerStatisticsVO.getMinsNum0().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum1(dftwo.format((double)powerStatisticsVO.getMinsNum1().intValue() / total * 100) + "%");
|
proportion.setMinsNum1(dftwo.format((double) powerStatisticsVO.getMinsNum1().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum2(dftwo.format((double)powerStatisticsVO.getMinsNum2().intValue() / total * 100) + "%");
|
proportion.setMinsNum2(dftwo.format((double) powerStatisticsVO.getMinsNum2().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum3(dftwo.format((double)powerStatisticsVO.getMinsNum3().intValue() / total * 100) + "%");
|
proportion.setMinsNum3(dftwo.format((double) powerStatisticsVO.getMinsNum3().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum4(dftwo.format((double)powerStatisticsVO.getMinsNum4().intValue() / total * 100) + "%");
|
proportion.setMinsNum4(dftwo.format((double) powerStatisticsVO.getMinsNum4().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum5(dftwo.format((double)powerStatisticsVO.getMinsNum5().intValue() / total * 100) + "%");
|
proportion.setMinsNum5(dftwo.format((double) powerStatisticsVO.getMinsNum5().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum6(dftwo.format((double)powerStatisticsVO.getMinsNum6().intValue() / total * 100) + "%");
|
proportion.setMinsNum6(dftwo.format((double) powerStatisticsVO.getMinsNum6().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum7(dftwo.format((double)powerStatisticsVO.getMinsNum7().intValue() / total * 100) + "%");
|
proportion.setMinsNum7(dftwo.format((double) powerStatisticsVO.getMinsNum7().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum8(dftwo.format((double)powerStatisticsVO.getMinsNum8().intValue() / total * 100) + "%");
|
proportion.setMinsNum8(dftwo.format((double) powerStatisticsVO.getMinsNum8().intValue() / total * 100) + "%");
|
||||||
proportion.setMinsNum9(dftwo.format((double)powerStatisticsVO.getMinsNum9().intValue() / total * 100) + "%");
|
proportion.setMinsNum9(dftwo.format((double) powerStatisticsVO.getMinsNum9().intValue() / total * 100) + "%");
|
||||||
}else{
|
} else {
|
||||||
proportion.setMinsNum0("");
|
proportion.setMinsNum0("");
|
||||||
proportion.setMinsNum1("");
|
proportion.setMinsNum1("");
|
||||||
proportion.setMinsNum2("");
|
proportion.setMinsNum2("");
|
||||||
@@ -414,7 +421,7 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
style.setAlignment(HorizontalAlignment.CENTER);
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
//如果当前表格为是(是否越限:是)则红色字体显示
|
//如果当前表格为是(是否越限:是)则红色字体显示
|
||||||
if(cell.getStringCellValue().equals("是")){
|
if (cell.getStringCellValue().equals("是")) {
|
||||||
style.setFont(redFont);
|
style.setFont(redFont);
|
||||||
}
|
}
|
||||||
cell.setCellStyle(style);
|
cell.setCellStyle(style);
|
||||||
@@ -441,49 +448,49 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
//设置线的风格
|
//设置线的风格
|
||||||
simpleShape.setLineStyle(0);
|
simpleShape.setLineStyle(0);
|
||||||
//设置线的颜色
|
//设置线的颜色
|
||||||
simpleShape.setLineStyleColor(0,0,0);
|
simpleShape.setLineStyleColor(0, 0, 0);
|
||||||
//删除第一行title
|
//删除第一行title
|
||||||
//sheet.removeRow(sheet.getRow(0));
|
//sheet.removeRow(sheet.getRow(0));
|
||||||
//上移(因为删除一行只是将数据清空了留下空行)
|
//上移(因为删除一行只是将数据清空了留下空行)
|
||||||
//sheet.shiftRows(1, sheet.getLastRowNum(), -1);
|
//sheet.shiftRows(1, sheet.getLastRowNum(), -1);
|
||||||
PoiUtil.exportFileByWorkbook(workbook, powerStatisticsParam.getSearchValue()+".xlsx", response);
|
PoiUtil.exportFileByWorkbook(workbook, powerStatisticsParam.getSearchValue() + ".xlsx", response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exportExcelListTemplate(PowerStatisticsParam powerStatisticsParam, HttpServletResponse response) {
|
public void exportExcelListTemplate(PowerStatisticsParam powerStatisticsParam, HttpServletResponse response) {
|
||||||
//获取各个区间的详细数据(就是调用getTargetByTime方法在进行某些指标的名称的处理)
|
//获取各个区间的详细数据(就是调用getTargetByTime方法在进行某些指标的名称的处理)
|
||||||
List<ThdDataVOExcel> time0 = getExcelListRecord(powerStatisticsParam.getTime0(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time0 = getExcelListRecord(powerStatisticsParam.getTime0(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time1 = getExcelListRecord(powerStatisticsParam.getTime1(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time1 = getExcelListRecord(powerStatisticsParam.getTime1(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time2 = getExcelListRecord(powerStatisticsParam.getTime2(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time2 = getExcelListRecord(powerStatisticsParam.getTime2(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time3 = getExcelListRecord(powerStatisticsParam.getTime3(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time3 = getExcelListRecord(powerStatisticsParam.getTime3(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time4 = getExcelListRecord(powerStatisticsParam.getTime4(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time4 = getExcelListRecord(powerStatisticsParam.getTime4(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time5 = getExcelListRecord(powerStatisticsParam.getTime5(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time5 = getExcelListRecord(powerStatisticsParam.getTime5(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time6 = getExcelListRecord(powerStatisticsParam.getTime6(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time6 = getExcelListRecord(powerStatisticsParam.getTime6(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time7 = getExcelListRecord(powerStatisticsParam.getTime7(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time7 = getExcelListRecord(powerStatisticsParam.getTime7(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time8 = getExcelListRecord(powerStatisticsParam.getTime8(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time8 = getExcelListRecord(powerStatisticsParam.getTime8(), powerStatisticsParam.getLineId());
|
||||||
List<ThdDataVOExcel> time9 = getExcelListRecord(powerStatisticsParam.getTime9(),powerStatisticsParam.getLineId());
|
List<ThdDataVOExcel> time9 = getExcelListRecord(powerStatisticsParam.getTime9(), powerStatisticsParam.getLineId());
|
||||||
try {
|
try {
|
||||||
//10个区间10个sheet10组数据
|
//10个区间10个sheet10组数据
|
||||||
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), ThdDataVOExcel.class).build();
|
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), ThdDataVOExcel.class).build();
|
||||||
WriteSheet sheet0 = EasyExcel.writerSheet(0, times.get(0) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet0 = EasyExcel.writerSheet(0, times.get(0)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time0, sheet0);
|
excelWriter.write(time0, sheet0);
|
||||||
WriteSheet sheet1 = EasyExcel.writerSheet(1, times.get(1) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet1 = EasyExcel.writerSheet(1, times.get(1)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time1, sheet1);
|
excelWriter.write(time1, sheet1);
|
||||||
WriteSheet sheet2 = EasyExcel.writerSheet(2, times.get(2) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet2 = EasyExcel.writerSheet(2, times.get(2)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time2, sheet2);
|
excelWriter.write(time2, sheet2);
|
||||||
WriteSheet sheet3 = EasyExcel.writerSheet(3, times.get(3) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet3 = EasyExcel.writerSheet(3, times.get(3)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time3, sheet3);
|
excelWriter.write(time3, sheet3);
|
||||||
WriteSheet sheet4 = EasyExcel.writerSheet(4, times.get(4) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet4 = EasyExcel.writerSheet(4, times.get(4)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time4, sheet4);
|
excelWriter.write(time4, sheet4);
|
||||||
WriteSheet sheet5 = EasyExcel.writerSheet(5, times.get(5) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet5 = EasyExcel.writerSheet(5, times.get(5)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time5, sheet5);
|
excelWriter.write(time5, sheet5);
|
||||||
WriteSheet sheet6 = EasyExcel.writerSheet(6, times.get(6) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet6 = EasyExcel.writerSheet(6, times.get(6)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time6, sheet6);
|
excelWriter.write(time6, sheet6);
|
||||||
WriteSheet sheet7 = EasyExcel.writerSheet(7, times.get(7) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet7 = EasyExcel.writerSheet(7, times.get(7)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time7, sheet7);
|
excelWriter.write(time7, sheet7);
|
||||||
WriteSheet sheet8 = EasyExcel.writerSheet(8, times.get(8) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet8 = EasyExcel.writerSheet(8, times.get(8)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time8, sheet8);
|
excelWriter.write(time8, sheet8);
|
||||||
WriteSheet sheet9 = EasyExcel.writerSheet(9, times.get(9) ).head(ThdDataVOExcel.class).build();
|
WriteSheet sheet9 = EasyExcel.writerSheet(9, times.get(9)).head(ThdDataVOExcel.class).build();
|
||||||
excelWriter.write(time9, sheet9);
|
excelWriter.write(time9, sheet9);
|
||||||
excelWriter.finish();
|
excelWriter.finish();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -491,28 +498,28 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ThdDataVOExcel> getExcelListRecord(List<String> times, String lineId){
|
private List<ThdDataVOExcel> getExcelListRecord(List<String> times, String lineId) {
|
||||||
List<ThdDataVO> thdDataVOS = new ArrayList<>();
|
List<ThdDataVO> thdDataVOS = new ArrayList<>();
|
||||||
List<ThdDataVOExcel> thdDataVOExcels = new ArrayList<>();
|
List<ThdDataVOExcel> thdDataVOExcels = new ArrayList<>();
|
||||||
PowerStatisticsParam powerStatisticsParam = new PowerStatisticsParam();
|
PowerStatisticsParam powerStatisticsParam = new PowerStatisticsParam();
|
||||||
powerStatisticsParam.setLineId(lineId);
|
powerStatisticsParam.setLineId(lineId);
|
||||||
for(String time : times){
|
for (String time : times) {
|
||||||
powerStatisticsParam.setSearchBeginTime(time);
|
powerStatisticsParam.setSearchBeginTime(time);
|
||||||
powerStatisticsParam.setSearchEndTime(time);
|
powerStatisticsParam.setSearchEndTime(time);
|
||||||
for (int i = 1; i <= 4; i++) {
|
for (int i = 1; i <= 4; i++) {
|
||||||
powerStatisticsParam.setStatisticalId(i+"");
|
powerStatisticsParam.setStatisticalId(i + "");
|
||||||
List<ThdDataVO> thdDataVOList = getTargetByTime(powerStatisticsParam);
|
List<ThdDataVO> thdDataVOList = getTargetByTime(powerStatisticsParam);
|
||||||
if(i != 1){
|
if (i != 1) {
|
||||||
for(ThdDataVO thdDataVO : thdDataVOList){
|
for (ThdDataVO thdDataVO : thdDataVOList) {
|
||||||
switch (i){
|
switch (i) {
|
||||||
case 2:
|
case 2:
|
||||||
thdDataVO.setAnotherName("谐波电压"+thdDataVO.getAnotherName());
|
thdDataVO.setAnotherName("谐波电压" + thdDataVO.getAnotherName());
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
thdDataVO.setAnotherName("谐波电流"+thdDataVO.getAnotherName());
|
thdDataVO.setAnotherName("谐波电流" + thdDataVO.getAnotherName());
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
thdDataVO.setAnotherName("间谐波电压"+thdDataVO.getAnotherName());
|
thdDataVO.setAnotherName("间谐波电压" + thdDataVO.getAnotherName());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -520,7 +527,7 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
thdDataVOS.addAll(thdDataVOList);
|
thdDataVOS.addAll(thdDataVOList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(ThdDataVO thdDataVO : thdDataVOS){
|
for (ThdDataVO thdDataVO : thdDataVOS) {
|
||||||
ThdDataVOExcel thdDataVOExcel = new ThdDataVOExcel();
|
ThdDataVOExcel thdDataVOExcel = new ThdDataVOExcel();
|
||||||
BeanUtils.copyProperties(thdDataVO, thdDataVOExcel);
|
BeanUtils.copyProperties(thdDataVO, thdDataVOExcel);
|
||||||
thdDataVOExcels.add(thdDataVOExcel);
|
thdDataVOExcels.add(thdDataVOExcel);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.prepare.harmonic.service.mysql.Impl.event;
|
package com.njcn.prepare.harmonic.service.mysql.Impl.event;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.alibaba.excel.util.DateUtils;
|
import com.alibaba.excel.util.DateUtils;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -7,9 +8,7 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
|||||||
import com.njcn.device.biz.commApi.CommLineClient;
|
import com.njcn.device.biz.commApi.CommLineClient;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.device.pq.api.NewStationClient;
|
|
||||||
import com.njcn.device.pq.api.OverLimitClient;
|
import com.njcn.device.pq.api.OverLimitClient;
|
||||||
import com.njcn.device.pq.pojo.po.NewStation;
|
|
||||||
import com.njcn.event.pojo.constant.Param;
|
import com.njcn.event.pojo.constant.Param;
|
||||||
import com.njcn.harmonic.pojo.vo.PowerStatisticsTargetVO;
|
import com.njcn.harmonic.pojo.vo.PowerStatisticsTargetVO;
|
||||||
import com.njcn.harmonic.pojo.vo.ThdDataVO;
|
import com.njcn.harmonic.pojo.vo.ThdDataVO;
|
||||||
@@ -21,10 +20,16 @@ import com.njcn.prepare.harmonic.mapper.mysql.event.RActivePowerRangeMapper;
|
|||||||
import com.njcn.prepare.harmonic.pojo.param.RActivePowerRangeParam;
|
import com.njcn.prepare.harmonic.pojo.param.RActivePowerRangeParam;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
|
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
|
||||||
import com.njcn.prepare.harmonic.service.mysql.event.RActivePowerRangeService;
|
import com.njcn.prepare.harmonic.service.mysql.event.RActivePowerRangeService;
|
||||||
|
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||||
|
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||||
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
|
import com.njcn.system.enums.DicTreeEnum;
|
||||||
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -48,31 +53,20 @@ import java.util.stream.Collectors;
|
|||||||
public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRangeMapper, RActivePowerRangePO> implements RActivePowerRangeService {
|
public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRangeMapper, RActivePowerRangePO> implements RActivePowerRangeService {
|
||||||
|
|
||||||
private final CommonService commonService;
|
private final CommonService commonService;
|
||||||
|
|
||||||
private final IDataVService iDataVService;
|
private final IDataVService iDataVService;
|
||||||
|
|
||||||
private final IDataIService iDataIService;
|
private final IDataIService iDataIService;
|
||||||
|
|
||||||
private final DataPltService dataPltService;
|
private final DataPltService dataPltService;
|
||||||
|
|
||||||
private final DataInHarmVService dataInHarmVService;
|
private final DataInHarmVService dataInHarmVService;
|
||||||
|
|
||||||
private final DataHarmRateVService dataHarmRateVService;
|
private final DataHarmRateVService dataHarmRateVService;
|
||||||
|
|
||||||
private final DataFlucService dataFlucService;
|
private final DataFlucService dataFlucService;
|
||||||
|
|
||||||
private final CommLineClient commLineClient;
|
private final CommLineClient commLineClient;
|
||||||
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
private final NewStationClient newStationClient;
|
|
||||||
|
|
||||||
private final OverLimitClient overLimitClient;
|
private final OverLimitClient overLimitClient;
|
||||||
|
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||||
|
|
||||||
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern(Param.DATE_FORMAT);
|
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern(Param.DATE_FORMAT);
|
||||||
|
|
||||||
private final DecimalFormat df = new DecimalFormat(com.njcn.harmonic.constant.Param.DECIMAL_FORMATSTR);
|
private final DecimalFormat df = new DecimalFormat(com.njcn.harmonic.constant.Param.DECIMAL_FORMATSTR);
|
||||||
|
|
||||||
private SimpleDateFormat sdf = new SimpleDateFormat(Param.DATE_FORMAT);
|
private SimpleDateFormat sdf = new SimpleDateFormat(Param.DATE_FORMAT);
|
||||||
|
|
||||||
private List<String> PHASE = Arrays.asList(InfluxDBTableConstant.PHASE_TYPE_A, InfluxDBTableConstant.PHASE_TYPE_B, InfluxDBTableConstant.PHASE_TYPE_C);
|
private List<String> PHASE = Arrays.asList(InfluxDBTableConstant.PHASE_TYPE_A, InfluxDBTableConstant.PHASE_TYPE_B, InfluxDBTableConstant.PHASE_TYPE_C);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,6 +91,7 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public List<PowerStatisticsTargetVO> record(RActivePowerRangeParam rActivePowerRangeParam) {
|
public List<PowerStatisticsTargetVO> record(RActivePowerRangeParam rActivePowerRangeParam) {
|
||||||
|
DictTreeVO windFarms = dictTreeFeignClient.queryByCode(DicTreeEnum.Wind_Farms.getCode()).getData();
|
||||||
if (rActivePowerRangeParam == null) {
|
if (rActivePowerRangeParam == null) {
|
||||||
rActivePowerRangeParam = new RActivePowerRangeParam();
|
rActivePowerRangeParam = new RActivePowerRangeParam();
|
||||||
}
|
}
|
||||||
@@ -110,10 +105,10 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||||
//控制参数中如果search为true,则获取有功功率集合的时间段内为BaseParam中的searchBeginTime和searchEndTime(用于前端有功功率查询页面相关接口)
|
//控制参数中如果search为true,则获取有功功率集合的时间段内为BaseParam中的searchBeginTime和searchEndTime(用于前端有功功率查询页面相关接口)
|
||||||
if (rActivePowerRangeParam.isSearch()) {
|
if (rActivePowerRangeParam.isSearch()) {
|
||||||
if(rActivePowerRangeParam.isSearchTimeFort()){
|
if (rActivePowerRangeParam.isSearchTimeFort()) {
|
||||||
startTime = rActivePowerRangeParam.getSearchBeginTime() + Param.BEGIN;
|
startTime = rActivePowerRangeParam.getSearchBeginTime() + Param.BEGIN;
|
||||||
endTime = rActivePowerRangeParam.getSearchEndTime() + Param.END;
|
endTime = rActivePowerRangeParam.getSearchEndTime() + Param.END;
|
||||||
}else{
|
} else {
|
||||||
startTime = rActivePowerRangeParam.getSearchBeginTime();
|
startTime = rActivePowerRangeParam.getSearchBeginTime();
|
||||||
endTime = rActivePowerRangeParam.getSearchEndTime();
|
endTime = rActivePowerRangeParam.getSearchEndTime();
|
||||||
}
|
}
|
||||||
@@ -145,11 +140,10 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
//获取监测点
|
//获取监测点
|
||||||
LineDTO lineDTO = commLineClient.getLineDetail(lineId).getData();
|
LineDTO lineDTO = commLineClient.getLineDetail(lineId).getData();
|
||||||
//监测点必须绑定新能源站
|
//监测点必须绑定新能源站
|
||||||
if (lineDTO != null && lineDTO.getNewStationId() != null) {
|
if (lineDTO != null && lineDTO.getObjId() != null && windFarms.getId().equals(lineDTO.getBigObjType())) {
|
||||||
//获取监测点的新能源站
|
List<NewUserReportVO> data = userLedgerFeignClient.getUserReportByIds(Collections.singletonList(lineDTO.getObjId())).getData();
|
||||||
NewStation newStation = newStationClient.selectById(lineDTO.getNewStationId()).getData();
|
if (CollUtil.isNotEmpty(data)) {
|
||||||
//新能源站有些切必须是风电场
|
//新能源站有些必须是风电场
|
||||||
if (newStation != null && com.njcn.device.pq.constant.Param.WINDFARM.equals(newStation.getStationType())) {
|
|
||||||
RActivePowerRangePO rActivePowerRangePO = new RActivePowerRangePO();
|
RActivePowerRangePO rActivePowerRangePO = new RActivePowerRangePO();
|
||||||
rActivePowerRangePO.setLineId(lineId);
|
rActivePowerRangePO.setLineId(lineId);
|
||||||
rActivePowerRangePO.setTimeId(LocalDate.now());
|
rActivePowerRangePO.setTimeId(LocalDate.now());
|
||||||
@@ -174,7 +168,7 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
//设置时间为当前功率的时间
|
//设置时间为当前功率的时间
|
||||||
powerStatisticsTargetVO.setTime(statisticalDataDTO.getTime().atZone(ZoneId.systemDefault()).format(formatter));
|
powerStatisticsTargetVO.setTime(statisticalDataDTO.getTime().atZone(ZoneId.systemDefault()).format(formatter));
|
||||||
//当前功率的p字段 / 风电场额定功率
|
//当前功率的p字段 / 风电场额定功率
|
||||||
double temp = statisticalDataDTO.getValue() / Double.parseDouble(newStation.getRatedPower());
|
double temp = statisticalDataDTO.getValue() / data.get(0).getRatePower();
|
||||||
//区间过滤下(如果进去此判断 那么只能是查询某个区间下的指标越限列表)
|
//区间过滤下(如果进去此判断 那么只能是查询某个区间下的指标越限列表)
|
||||||
if (finalRActivePowerRangeParam.isSearch() && finalRActivePowerRangeParam.getField() != null) {
|
if (finalRActivePowerRangeParam.isSearch() && finalRActivePowerRangeParam.getField() != null) {
|
||||||
if (Double.parseDouble(finalRActivePowerRangeParam.getField()) < temp * 10 && temp * 10 <= Double.parseDouble(finalRActivePowerRangeParam.getField()) + 1) {
|
if (Double.parseDouble(finalRActivePowerRangeParam.getField()) < temp * 10 && temp * 10 <= Double.parseDouble(finalRActivePowerRangeParam.getField()) + 1) {
|
||||||
@@ -185,16 +179,16 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
} else {
|
} else {
|
||||||
//否则是正常的定时任务插入,或者前端搜索插入
|
//否则是正常的定时任务插入,或者前端搜索插入
|
||||||
//设置每个区间的统计时间
|
//设置每个区间的统计时间
|
||||||
rActivePowerRangePO.setMinsTime0(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime0(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime1(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime1(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime2(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime2(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime3(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime3(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime4(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime4(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime5(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime5(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime6(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime6(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime7(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime7(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime8(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime8(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
rActivePowerRangePO.setMinsTime9(commonQueryParam.getStartTime()+","+commonQueryParam.getEndTime());
|
rActivePowerRangePO.setMinsTime9(commonQueryParam.getStartTime() + "," + commonQueryParam.getEndTime());
|
||||||
if (temp <= 0.1) {
|
if (temp <= 0.1) {
|
||||||
//占有率区间个数+1
|
//占有率区间个数+1
|
||||||
rActivePowerRangePO.setMinsNum0(rActivePowerRangePO.getMinsNum0() + 1);
|
rActivePowerRangePO.setMinsNum0(rActivePowerRangePO.getMinsNum0() + 1);
|
||||||
@@ -348,39 +342,41 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
}
|
}
|
||||||
|
|
||||||
//区间是否越限标识
|
//区间是否越限标识
|
||||||
|
if (isLimit) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0:
|
case 0:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot0(1);
|
rActivePowerRangePO.setIsOrNot0(1);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot1(1);
|
rActivePowerRangePO.setIsOrNot1(1);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot2(1);
|
rActivePowerRangePO.setIsOrNot2(1);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot3(1);
|
rActivePowerRangePO.setIsOrNot3(1);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot4(1);
|
rActivePowerRangePO.setIsOrNot4(1);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot5(1);
|
rActivePowerRangePO.setIsOrNot5(1);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot6(1);
|
rActivePowerRangePO.setIsOrNot6(1);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot7(1);
|
rActivePowerRangePO.setIsOrNot7(1);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot8(1);
|
rActivePowerRangePO.setIsOrNot8(1);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
if (isLimit) rActivePowerRangePO.setIsOrNot9(1);
|
rActivePowerRangePO.setIsOrNot9(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Float isLimit(List<StatisticalDataDTO> list, Overlimit overlimit) {
|
private Float isLimit(List<StatisticalDataDTO> list, Overlimit overlimit) {
|
||||||
List<StatisticalDataDTO> maxList = list.stream().filter(dto -> dto.equals(InfluxDBTableConstant.MAX)).collect(Collectors.toList());
|
List<StatisticalDataDTO> maxList = list.stream().filter(dto -> dto.equals(InfluxDBTableConstant.MAX)).collect(Collectors.toList());
|
||||||
@@ -388,12 +384,12 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
StatisticalDataDTO maxDto = maxList.stream().max(Comparator.comparingDouble(StatisticalDataDTO::getValue)).orElse(null);
|
StatisticalDataDTO maxDto = maxList.stream().max(Comparator.comparingDouble(StatisticalDataDTO::getValue)).orElse(null);
|
||||||
StatisticalDataDTO minDto = minList.stream().min(Comparator.comparingDouble(StatisticalDataDTO::getValue)).orElse(null);
|
StatisticalDataDTO minDto = minList.stream().min(Comparator.comparingDouble(StatisticalDataDTO::getValue)).orElse(null);
|
||||||
if (!maxList.isEmpty()) {
|
if (!maxList.isEmpty()) {
|
||||||
if (Double.compare(maxDto.getValue(), 0) > 0 && Double.compare(maxDto.getValue(), overlimit.getVoltageDev()) > 0) {
|
if (Double.compare(maxDto.getValue(), 0) > 0 && Double.compare(maxDto.getValue(), overlimit.getVoltageDev()) < 0) {
|
||||||
return overlimit.getVoltageDev();
|
return overlimit.getVoltageDev();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!minList.isEmpty()) {
|
if (!minList.isEmpty()) {
|
||||||
if (Double.compare(minDto.getValue(), 0) < 0 && Double.compare(maxDto.getValue(), overlimit.getUvoltageDev()) > 0) {
|
if (Double.compare(minDto.getValue(), 0) < 0 && Double.compare(minDto.getValue(), overlimit.getUvoltageDev()) > 0) {
|
||||||
return overlimit.getUvoltageDev();
|
return overlimit.getUvoltageDev();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -469,7 +465,7 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
//反射获取当前谐波次数对应的国标限值
|
//反射获取当前谐波次数对应的国标限值
|
||||||
Float frequencyLimit = (Float) reflexObjValue(overlimit, finalField + frequencyNum);
|
Float frequencyLimit = (Float) reflexObjValue(overlimit, finalField + frequencyNum);
|
||||||
//相别和统计方式的值和ThdDataVO字段相对于
|
//相别和统计方式的值和ThdDataVO字段相对于
|
||||||
ThdDataVO tdv = initThdDataVO(frequencyGroupList,frequencyLimit);
|
ThdDataVO tdv = initThdDataVO(frequencyGroupList, frequencyLimit);
|
||||||
if (tdv != null) {
|
if (tdv != null) {
|
||||||
tdv.setAnotherName(name + (((frequencyNum - finalC) + "").replace(".0", "")) + "次");
|
tdv.setAnotherName(name + (((frequencyNum - finalC) + "").replace(".0", "")) + "次");
|
||||||
tdv.setLimit((Float) reflexObjValue(overlimit, finalField + frequencyNum));
|
tdv.setLimit((Float) reflexObjValue(overlimit, finalField + frequencyNum));
|
||||||
@@ -479,7 +475,7 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//无谐波次数
|
//无谐波次数
|
||||||
ThdDataVO tdv = initThdDataVO(list,limit);
|
ThdDataVO tdv = initThdDataVO(list, limit);
|
||||||
if (tdv != null) {
|
if (tdv != null) {
|
||||||
tdv.setAnotherName(name);
|
tdv.setAnotherName(name);
|
||||||
tdv.setLimit(limit);
|
tdv.setLimit(limit);
|
||||||
@@ -489,7 +485,7 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
return thdDataVOS.stream().sorted(Comparator.comparing(ThdDataVO::getFrequency)).collect(Collectors.toList());
|
return thdDataVOS.stream().sorted(Comparator.comparing(ThdDataVO::getFrequency)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
private ThdDataVO initThdDataVO(List<StatisticalDataDTO> list,Float limit) {
|
private ThdDataVO initThdDataVO(List<StatisticalDataDTO> list, Float limit) {
|
||||||
ThdDataVO tdv = new ThdDataVO();
|
ThdDataVO tdv = new ThdDataVO();
|
||||||
boolean isF = false;
|
boolean isF = false;
|
||||||
//list包含了一组不同相别不同统计方式的数据(最多12条,因为统计方式和相别自由组合最多12条)
|
//list包含了一组不同相别不同统计方式的数据(最多12条,因为统计方式和相别自由组合最多12条)
|
||||||
@@ -500,7 +496,7 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
if (statisticalDataDTO.getValue() != null) {
|
if (statisticalDataDTO.getValue() != null) {
|
||||||
value = df.format(statisticalDataDTO.getValue());
|
value = df.format(statisticalDataDTO.getValue());
|
||||||
//判断是否有指标越界(不管哪一个相别及统计方式的指标,)
|
//判断是否有指标越界(不管哪一个相别及统计方式的指标,)
|
||||||
if(Double.compare(statisticalDataDTO.getValue(), limit) > 0){
|
if (Double.compare(statisticalDataDTO.getValue(), limit) > 0) {
|
||||||
isF = true;
|
isF = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -567,7 +563,7 @@ public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRan
|
|||||||
|| tdv.getMINPhaseA() != null || tdv.getMINPhaseB() != null
|
|| tdv.getMINPhaseA() != null || tdv.getMINPhaseB() != null
|
||||||
|| tdv.getMINPhaseC() != null || tdv.getMAXPhaseA() != null
|
|| tdv.getMINPhaseC() != null || tdv.getMAXPhaseA() != null
|
||||||
|| tdv.getMAXPhaseB() != null || tdv.getMAXPhaseC() != null) {
|
|| tdv.getMAXPhaseB() != null || tdv.getMAXPhaseC() != null) {
|
||||||
if(isF){
|
if (isF) {
|
||||||
return tdv;
|
return tdv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,9 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.device.biz.commApi.CommLineClient;
|
|
||||||
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.device.pq.api.DeptLineFeignClient;
|
import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.api.NewStationClient;
|
|
||||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||||
import com.njcn.event.api.EventDetailFeignClient;
|
import com.njcn.event.api.EventDetailFeignClient;
|
||||||
import com.njcn.event.api.TransientFeignClient;
|
import com.njcn.event.api.TransientFeignClient;
|
||||||
@@ -54,8 +52,6 @@ import java.util.stream.Collectors;
|
|||||||
public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThroughPO> implements SpThroughService {
|
public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThroughPO> implements SpThroughService {
|
||||||
|
|
||||||
private final EventDetailFeignClient eventDetailFeignClient;
|
private final EventDetailFeignClient eventDetailFeignClient;
|
||||||
private final CommLineClient commLineClient;
|
|
||||||
private final NewStationClient newStationClient;
|
|
||||||
private final TransientFeignClient transientFeignClient;
|
private final TransientFeignClient transientFeignClient;
|
||||||
private final DeptLineFeignClient deptLineFeignClient;
|
private final DeptLineFeignClient deptLineFeignClient;
|
||||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||||
@@ -129,17 +125,17 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
|
|||||||
if (rmpEventDetailPO.getEventType().equals(rise.getId())) {
|
if (rmpEventDetailPO.getEventType().equals(rise.getId())) {
|
||||||
//风电场
|
//风电场
|
||||||
if (line.getBigObjType().equals(windFarms.getId())) {
|
if (line.getBigObjType().equals(windFarms.getId())) {
|
||||||
if (isThrough(waveDataDTO, 125, 130, 500, voltageLevel.floatValue(), newListRmsData)
|
if (isThrough(125, 130, 500, voltageLevel.floatValue(), newListRmsData)
|
||||||
&& isThrough(waveDataDTO, 120, 125, 1000, voltageLevel.floatValue(), newListRmsData)
|
&& isThrough(120, 125, 1000, voltageLevel.floatValue(), newListRmsData)
|
||||||
&& isThrough(waveDataDTO, 110, 120, 10000, voltageLevel.floatValue(), newListRmsData)) {
|
&& isThrough(110, 120, 10000, voltageLevel.floatValue(), newListRmsData)) {
|
||||||
spThroughPO.setIsOrNot(1);
|
spThroughPO.setIsOrNot(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//光伏电站
|
//光伏电站
|
||||||
if (line.getBigObjType().equals(powerStation.getId())) {
|
if (line.getBigObjType().equals(powerStation.getId())) {
|
||||||
if (isThrough(waveDataDTO, 125, 130, 500, voltageLevel.floatValue(), newListRmsData)
|
if (isThrough(125, 130, 500, voltageLevel.floatValue(), newListRmsData)
|
||||||
&& isThrough(waveDataDTO, 120, 125, 1000, voltageLevel.floatValue(), newListRmsData)
|
&& isThrough(120, 125, 1000, voltageLevel.floatValue(), newListRmsData)
|
||||||
&& isThrough(waveDataDTO, 110, 120, 10000, voltageLevel.floatValue(), newListRmsData)) {
|
&& isThrough(110, 120, 10000, voltageLevel.floatValue(), newListRmsData)) {
|
||||||
spThroughPO.setIsOrNot(1);
|
spThroughPO.setIsOrNot(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,15 +144,15 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
|
|||||||
if (rmpEventDetailPO.getEventType().equals(dip.getId())) {
|
if (rmpEventDetailPO.getEventType().equals(dip.getId())) {
|
||||||
//风电场
|
//风电场
|
||||||
if (line.getBigObjType().equals(windFarms.getId())) {
|
if (line.getBigObjType().equals(windFarms.getId())) {
|
||||||
if (isThrough(waveDataDTO, 20, -1, 625, voltageLevel.floatValue(), newListRmsData)) {
|
if (isThrough(20, -1, 625, voltageLevel.floatValue(), newListRmsData)) {
|
||||||
spThroughPO.setIsOrNot(1);
|
spThroughPO.setIsOrNot(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//光伏电站
|
//光伏电站
|
||||||
if (line.getBigObjType().equals(powerStation.getId())) {
|
if (line.getBigObjType().equals(powerStation.getId())) {
|
||||||
if (isThrough(waveDataDTO, 0, -1, 150, voltageLevel.floatValue(), newListRmsData)
|
if (isThrough(0, -1, 150, voltageLevel.floatValue(), newListRmsData)
|
||||||
&& isThrough(waveDataDTO, 20, -1, 625, voltageLevel.floatValue(), newListRmsData)
|
&& isThrough(20, -1, 625, voltageLevel.floatValue(), newListRmsData)
|
||||||
&& isThrough(waveDataDTO, 20, 90, -1, voltageLevel.floatValue(), newListRmsData)) {
|
&& isThrough(20, 90, -1, voltageLevel.floatValue(), newListRmsData)) {
|
||||||
spThroughPO.setIsOrNot(1);
|
spThroughPO.setIsOrNot(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,8 +160,6 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
|
|||||||
spThroughPO.setCreateTime(currentTime);
|
spThroughPO.setCreateTime(currentTime);
|
||||||
this.baseMapper.insert(spThroughPO);
|
this.baseMapper.insert(spThroughPO);
|
||||||
}
|
}
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,7 +168,7 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isThrough(WaveDataDTO waveDataDTO, int start, int end, int ms, float voltageLevel, List<List<Float>> newListRmsData) {
|
private boolean isThrough(int start, int end, int ms, float voltageLevel, List<List<Float>> newListRmsData) {
|
||||||
boolean isThrough = false;
|
boolean isThrough = false;
|
||||||
//格式化RMS源数据
|
//格式化RMS源数据
|
||||||
float startVoltageLevel = voltageLevel * (start / 100F);
|
float startVoltageLevel = voltageLevel * (start / 100F);
|
||||||
@@ -187,11 +181,9 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
|
|||||||
float curValue = newListRmsData.get(i).get(j);
|
float curValue = newListRmsData.get(i).get(j);
|
||||||
//当电压达到目标值时
|
//当电压达到目标值时
|
||||||
if (endVoltageLevel != -1 && startVoltageLevel < curValue && curValue <= endVoltageLevel) {
|
if (endVoltageLevel != -1 && startVoltageLevel < curValue && curValue <= endVoltageLevel) {
|
||||||
isContinuity(newListRmsData, i + 1, newListRmsData.get(i).get(0).intValue(), ms, j);
|
isThrough = isContinuity(newListRmsData, i + 1, newListRmsData.get(i).get(0).intValue(), ms, j);
|
||||||
isThrough = true;
|
|
||||||
} else if (startVoltageLevel == curValue) {
|
} else if (startVoltageLevel == curValue) {
|
||||||
isContinuity(newListRmsData, i + 1, newListRmsData.get(i).get(0).intValue(), ms, j);
|
isThrough = isContinuity(newListRmsData, i + 1, newListRmsData.get(i).get(0).intValue(), ms, j);
|
||||||
isThrough = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -327,7 +319,7 @@ public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThro
|
|||||||
|
|
||||||
private String dicTreeId(SpThroughParam spThroughParam) {
|
private String dicTreeId(SpThroughParam spThroughParam) {
|
||||||
String dictTreeId = "";
|
String dictTreeId = "";
|
||||||
if (spThroughParam.getStationType().equals("1")) {
|
if ("1".equals(spThroughParam.getStationType())) {
|
||||||
DictTreeVO windFarms = dictTreeFeignClient.queryByCode(DicTreeEnum.Wind_Farms.getCode()).getData();
|
DictTreeVO windFarms = dictTreeFeignClient.queryByCode(DicTreeEnum.Wind_Farms.getCode()).getData();
|
||||||
if (ObjectUtil.isNotNull(windFarms)) {
|
if (ObjectUtil.isNotNull(windFarms)) {
|
||||||
dictTreeId = windFarms.getId();
|
dictTreeId = windFarms.getId();
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public interface EpdFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/findListByShowName")
|
@PostMapping("/findListByShowName")
|
||||||
HttpResult<List<EleEpdPqd>> findListByShowName(@RequestParam("name") String name);
|
HttpResult<List<EleEpdPqd>> findListByShowName(@RequestParam("name") String name);
|
||||||
|
|
||||||
@PostMapping("/selectByClassId")
|
@PostMapping("/selectByClassId")
|
||||||
HttpResult<List<EleEpdPqd>> selectByClassId(@RequestParam("classId") String classId);
|
HttpResult<List<EleEpdPqd>> selectByClassId(@RequestParam("classId") String classId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user