1.解决监测点实际安装位置

2.解决稳态合格率统计表和图形数据问题
This commit is contained in:
wr
2025-05-06 16:04:06 +08:00
parent 8e5cab30c9
commit df1f744a7d
4 changed files with 176 additions and 358 deletions

View File

@@ -201,4 +201,6 @@ public class LineParam {
@ApiModelProperty(name = "newStationId",value = "新能源场站信息ID") @ApiModelProperty(name = "newStationId",value = "新能源场站信息ID")
private String newStationId; private String newStationId;
@ApiModelProperty(name = "actualArea",value = "监测点实际安装位置")
private String actualArea;
} }

View File

@@ -5,22 +5,25 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.device.biz.pojo.dto.LineDevGetDTO; import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
import com.njcn.device.biz.pojo.dto.SubGetBase; import com.njcn.device.biz.pojo.dto.SubGetBase;
import com.njcn.device.biz.pojo.dto.TerminalGetBase; import com.njcn.device.biz.pojo.dto.TerminalGetBase;
import com.njcn.device.biz.pojo.param.SubstationParam; import com.njcn.device.biz.pojo.param.SubstationParam;
import com.njcn.device.pq.mapper.DeptLineMapper; import com.njcn.device.pq.mapper.DeptLineMapper;
import com.njcn.device.pq.mapper.LineDetailMapper;
import com.njcn.device.pq.mapper.LineMapper; import com.njcn.device.pq.mapper.LineMapper;
import com.njcn.device.pq.pojo.po.DeptLine; import com.njcn.device.pq.pojo.po.DeptLine;
import com.njcn.device.pq.pojo.po.LineDetail;
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO; import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
import com.njcn.device.pq.service.DeptLineService; import com.njcn.device.pq.service.DeptLineService;
import com.njcn.device.pq.constant.Param;
import com.njcn.system.api.DictTreeFeignClient; import com.njcn.system.api.DictTreeFeignClient;
import com.njcn.system.enums.DicTreeEnum; import com.njcn.system.enums.DicTreeEnum;
import com.njcn.system.pojo.vo.DictTreeVO; import com.njcn.system.pojo.vo.DictTreeVO;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.dto.DeptDTO; import com.njcn.user.pojo.dto.DeptDTO;
import com.njcn.user.pojo.po.Dept;
import com.njcn.web.pojo.param.DeptLineParam; import com.njcn.web.pojo.param.DeptLineParam;
import com.njcn.web.utils.WebUtil; import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -46,6 +49,7 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
private final DeptFeignClient deptFeignClient; private final DeptFeignClient deptFeignClient;
private final LineMapper lineMapper; private final LineMapper lineMapper;
private final DictTreeFeignClient dictTreeFeignClient; private final DictTreeFeignClient dictTreeFeignClient;
private final LineDetailMapper detailMapper;
@Override @Override
@@ -61,6 +65,20 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
deptLine.setLineId(id); deptLine.setLineId(id);
return deptLine; return deptLine;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
List<String> ids = deptLineParam.getIds();
if (CollUtil.isNotEmpty(ids)) {
List<LineDetail> list = detailMapper.selectList(new LambdaQueryWrapper<LineDetail>()
.in(LineDetail::getId, ids)
.isNull(LineDetail::getActualArea)
);
if (CollUtil.isNotEmpty(list)) {
Dept data = deptFeignClient.getDeptById(deptLineParam.getId()).getData();
List<String> lineIds = list.stream().map(LineDetail::getId).collect(Collectors.toList());
detailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
.set(LineDetail::getActualArea, data.getArea())
.in(LineDetail::getId, lineIds));
}
}
this.saveBatch(deptLines); this.saveBatch(deptLines);
} }

View File

@@ -1,5 +1,6 @@
package com.njcn.harmonic.utils; package com.njcn.harmonic.utils;
import cn.hutool.core.util.ObjectUtil;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -87,8 +88,11 @@ public class PubUtils {
} }
} }
public static Double dataLimits(Double data){ public static Double dataLimits(Double data) {
return data>100?100:data; if (ObjectUtil.isNotNull(data)) {
return data > 100 ? 100 : data;
}
return data;
} }
@SneakyThrows @SneakyThrows
@@ -190,7 +194,7 @@ public class PubUtils {
} }
@SneakyThrows @SneakyThrows
public static List<String> getIntervalDateTime(Integer startTime,int beginDay, Integer endTime, Integer dd) { public static List<String> getIntervalDateTime(Integer startTime, int beginDay, Integer endTime, Integer dd) {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
Calendar calendar = Calendar.getInstance(Locale.CHINA); Calendar calendar = Calendar.getInstance(Locale.CHINA);
calendar.set(startTime, endTime - 1, 1); calendar.set(startTime, endTime - 1, 1);

View File

@@ -4,15 +4,14 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.njcn.device.pq.api.GeneralDeviceInfoClient; import com.njcn.device.pq.api.GeneralDeviceInfoClient;
import com.njcn.device.pq.enums.LineBaseEnum; import com.njcn.device.pq.enums.LineBaseEnum;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO; import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.DeviceInfoParam; import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.vo.TerminalTree;
import com.njcn.harmonic.mapper.SteadyQualifyMapper; import com.njcn.harmonic.mapper.SteadyQualifyMapper;
import com.njcn.harmonic.pojo.dto.SteadyQualifyDTO;
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO; import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
import com.njcn.harmonic.pojo.vo.SteadyQualifyCensusVO; import com.njcn.harmonic.pojo.vo.SteadyQualifyCensusVO;
import com.njcn.harmonic.pojo.vo.SteadyQualifyVO; import com.njcn.harmonic.pojo.vo.SteadyQualifyVO;
@@ -26,7 +25,6 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -66,43 +64,11 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO(); SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO();
steadyQualifyVO.setId(generalDeviceDTO.getIndex()); steadyQualifyVO.setId(generalDeviceDTO.getIndex());
steadyQualifyVO.setName(generalDeviceDTO.getName()); steadyQualifyVO.setName(generalDeviceDTO.getName());
List<SteadyQualifyDTO> qualifiesRate = getQualifiesRate(generalDeviceDTO.getLineIndexes(), steadyParam.getSearchBeginTime(), steadyParam.getSearchEndTime()); List<RStatLimitRateDPO> qualifiesRate = getQualifiesRate(generalDeviceDTO.getLineIndexes(), steadyParam.getSearchBeginTime(), steadyParam.getSearchEndTime());
//组装子集级数据树 //组装子集级数据树
List<SteadyQualifyVO> treeList = getTreeData(qualifiesRate, generalDeviceDTO,userMap); List<SteadyQualifyVO> treeList = getTreeData(qualifiesRate, generalDeviceDTO, userMap);
if (CollectionUtil.isNotEmpty(treeList)) { if (CollectionUtil.isNotEmpty(treeList)) {
List<SteadyQualifyVO> flicker = treeList.stream().filter(s -> s.getFlicker() != 3.14159).collect(Collectors.toList()); setFatherDistortion(steadyQualifyVO, treeList);
List<SteadyQualifyVO> freqOffset = treeList.stream().filter(s -> s.getFreqOffset() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> voltageOffset = treeList.stream().filter(s -> s.getVoltageOffset() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> voltageUnbalance = treeList.stream().filter(s -> s.getVoltageUnbalance() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> negativeCurrent = treeList.stream().filter(s -> s.getNegativeCurrent() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicVoltage = treeList.stream().filter(s -> s.getHarmonicVoltage() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicCurrent = treeList.stream().filter(s -> s.getHarmonicCurrent() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> interHarmonic = treeList.stream().filter(s -> s.getInterHarmonic() != 3.14159).collect(Collectors.toList());
//求各项平均值
if (!CollectionUtils.isEmpty(flicker)) {
steadyQualifyVO.setFlicker(PubUtils.dataLimits(NumberUtil.round(flicker.stream().mapToDouble(SteadyQualifyVO::getFlicker).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(freqOffset)) {
steadyQualifyVO.setFreqOffset(PubUtils.dataLimits(NumberUtil.round(freqOffset.stream().mapToDouble(SteadyQualifyVO::getFreqOffset).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(voltageOffset)) {
steadyQualifyVO.setVoltageOffset(PubUtils.dataLimits(NumberUtil.round(voltageOffset.stream().mapToDouble(SteadyQualifyVO::getVoltageOffset).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(voltageUnbalance)) {
steadyQualifyVO.setVoltageUnbalance(PubUtils.dataLimits(NumberUtil.round(voltageUnbalance.stream().mapToDouble(SteadyQualifyVO::getVoltageUnbalance).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(negativeCurrent)) {
steadyQualifyVO.setNegativeCurrent(PubUtils.dataLimits(NumberUtil.round(negativeCurrent.stream().mapToDouble(SteadyQualifyVO::getNegativeCurrent).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(harmonicVoltage)) {
steadyQualifyVO.setHarmonicVoltage(PubUtils.dataLimits(NumberUtil.round(harmonicVoltage.stream().mapToDouble(SteadyQualifyVO::getHarmonicVoltage).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(harmonicCurrent)) {
steadyQualifyVO.setHarmonicCurrent(PubUtils.dataLimits(NumberUtil.round(harmonicCurrent.stream().mapToDouble(SteadyQualifyVO::getHarmonicCurrent).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(interHarmonic)) {
steadyQualifyVO.setInterHarmonic(PubUtils.dataLimits(NumberUtil.round(interHarmonic.stream().mapToDouble(SteadyQualifyVO::getInterHarmonic).average().orElse(100), 2).doubleValue()));
}
} }
steadyQualifyVO.setChildren(treeList); steadyQualifyVO.setChildren(treeList);
steadyQualifyList.add(steadyQualifyVO); steadyQualifyList.add(steadyQualifyVO);
@@ -126,8 +92,8 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
if (CollectionUtils.isEmpty(lineIndexes)) { if (CollectionUtils.isEmpty(lineIndexes)) {
continue; continue;
} }
type.add(generalDeviceDTO.getName()+"\n("+generalDeviceDTO.getLineIndexes().size()+")"); type.add(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
List<SteadyQualifyDTO> qualifiesRate = getQualifiesRate(lineIndexes, steadyCensusParam.getSearchBeginTime(), steadyCensusParam.getSearchEndTime()); List<RStatLimitRateDPO> qualifiesRate = getQualifiesRate(lineIndexes, steadyCensusParam.getSearchBeginTime(), steadyCensusParam.getSearchEndTime());
SteadyQualifyVO dataMoreMonitorMoreDay = getDataMoreMonitorMoreDay(qualifiesRate); SteadyQualifyVO dataMoreMonitorMoreDay = getDataMoreMonitorMoreDay(qualifiesRate);
harmonicVoltage.add(dataMoreMonitorMoreDay.getHarmonicVoltage()); harmonicVoltage.add(dataMoreMonitorMoreDay.getHarmonicVoltage());
voltageOffset.add(dataMoreMonitorMoreDay.getVoltageOffset()); voltageOffset.add(dataMoreMonitorMoreDay.getVoltageOffset());
@@ -167,43 +133,11 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO(); SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO();
steadyQualifyVO.setId(generalDeviceDTO.getIndex()); steadyQualifyVO.setId(generalDeviceDTO.getIndex());
steadyQualifyVO.setName(generalDeviceDTO.getName()); steadyQualifyVO.setName(generalDeviceDTO.getName());
List<SteadyQualifyDTO> qualifiesRate = getQualifiesRate(lineIndexes, steadyParam.getSearchBeginTime(), steadyParam.getSearchEndTime()); List<RStatLimitRateDPO> qualifiesRate = getQualifiesRate(lineIndexes, steadyParam.getSearchBeginTime(), steadyParam.getSearchEndTime());
//组装子集级数据树 //组装子集级数据树
List<SteadyQualifyVO> treeList = getCompanyTreeData(qualifiesRate, lineIndexes); List<SteadyQualifyVO> treeList = getCompanyTreeData(qualifiesRate, lineIndexes);
if (CollectionUtil.isNotEmpty(treeList)) { if (CollectionUtil.isNotEmpty(treeList)) {
List<SteadyQualifyVO> flicker = treeList.stream().filter(s -> s.getFlicker() != 3.14159).collect(Collectors.toList()); setFatherDistortion(steadyQualifyVO, treeList);
List<SteadyQualifyVO> freqOffset = treeList.stream().filter(s -> s.getFreqOffset() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> voltageOffset = treeList.stream().filter(s -> s.getVoltageOffset() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> voltageUnbalance = treeList.stream().filter(s -> s.getVoltageUnbalance() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> negativeCurrent = treeList.stream().filter(s -> s.getNegativeCurrent() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicVoltage = treeList.stream().filter(s -> s.getHarmonicVoltage() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicCurrent = treeList.stream().filter(s -> s.getHarmonicCurrent() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> interHarmonic = treeList.stream().filter(s -> s.getInterHarmonic() != 3.14159).collect(Collectors.toList());
//求各项平均值
if (!CollectionUtils.isEmpty(flicker)) {
steadyQualifyVO.setFlicker(PubUtils.dataLimits(NumberUtil.round(flicker.stream().mapToDouble(SteadyQualifyVO::getFlicker).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(freqOffset)) {
steadyQualifyVO.setFreqOffset(PubUtils.dataLimits(NumberUtil.round(freqOffset.stream().mapToDouble(SteadyQualifyVO::getFreqOffset).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(voltageOffset)) {
steadyQualifyVO.setVoltageOffset(PubUtils.dataLimits(NumberUtil.round(voltageOffset.stream().mapToDouble(SteadyQualifyVO::getVoltageOffset).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(voltageUnbalance)) {
steadyQualifyVO.setVoltageUnbalance(PubUtils.dataLimits(NumberUtil.round(voltageUnbalance.stream().mapToDouble(SteadyQualifyVO::getVoltageUnbalance).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(negativeCurrent)) {
steadyQualifyVO.setNegativeCurrent(PubUtils.dataLimits(NumberUtil.round(negativeCurrent.stream().mapToDouble(SteadyQualifyVO::getNegativeCurrent).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(harmonicVoltage)) {
steadyQualifyVO.setHarmonicVoltage(PubUtils.dataLimits(NumberUtil.round(harmonicVoltage.stream().mapToDouble(SteadyQualifyVO::getHarmonicVoltage).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(harmonicCurrent)) {
steadyQualifyVO.setHarmonicCurrent(PubUtils.dataLimits(NumberUtil.round(harmonicCurrent.stream().mapToDouble(SteadyQualifyVO::getHarmonicCurrent).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(interHarmonic)) {
steadyQualifyVO.setInterHarmonic(PubUtils.dataLimits(NumberUtil.round(interHarmonic.stream().mapToDouble(SteadyQualifyVO::getInterHarmonic).average().orElse(100), 2).doubleValue()));
}
} }
steadyQualifyVO.setChildren(treeList); steadyQualifyVO.setChildren(treeList);
steadyQualifyList.add(steadyQualifyVO); steadyQualifyList.add(steadyQualifyVO);
@@ -214,7 +148,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
/** /**
* 获取父级每层数据 * 获取父级每层数据
*/ */
private List<SteadyQualifyVO> getTreeData(List<SteadyQualifyDTO> qualifiesRate, GeneralDeviceDTO generalDeviceDTO,Map<String, UserLedgerVO> userMap) { private List<SteadyQualifyVO> getTreeData(List<RStatLimitRateDPO> qualifiesRate, GeneralDeviceDTO generalDeviceDTO, Map<String, UserLedgerVO> userMap) {
//监测点集合 //监测点集合
List<SteadyQualifyVO> treeMonitorList = steadyQualifyMapper.getSteadyQualifyData(generalDeviceDTO.getLineIndexes()); List<SteadyQualifyVO> treeMonitorList = steadyQualifyMapper.getSteadyQualifyData(generalDeviceDTO.getLineIndexes());
treeMonitorList.forEach(steadyQualifyVO -> { treeMonitorList.forEach(steadyQualifyVO -> {
@@ -229,11 +163,11 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
steadyQualifyVO.setInterHarmonic(PubUtils.dataLimits(dataSingleMonitorMoreDay.getInterHarmonic())); steadyQualifyVO.setInterHarmonic(PubUtils.dataLimits(dataSingleMonitorMoreDay.getInterHarmonic()));
}); });
List<SteadyQualifyVO> userLineList = treeMonitorList.stream().filter(it->StrUtil.isNotBlank(it.getObjId())).collect(Collectors.toList()); List<SteadyQualifyVO> userLineList = treeMonitorList.stream().filter(it -> StrUtil.isNotBlank(it.getObjId())).collect(Collectors.toList());
List<SteadyQualifyVO> otherLineList = treeMonitorList.stream().filter(it->StrUtil.isBlank(it.getObjId())).collect(Collectors.toList()); List<SteadyQualifyVO> otherLineList = treeMonitorList.stream().filter(it -> StrUtil.isBlank(it.getObjId())).collect(Collectors.toList());
Map<String,List<SteadyQualifyVO>> temMap = new HashMap<>(); Map<String, List<SteadyQualifyVO>> temMap = new HashMap<>();
if(CollUtil.isNotEmpty(userLineList)) { if (CollUtil.isNotEmpty(userLineList)) {
Map<String, List<SteadyQualifyVO>> objMap = userLineList.stream().collect(Collectors.groupingBy(SteadyQualifyVO::getObjId)); Map<String, List<SteadyQualifyVO>> objMap = userLineList.stream().collect(Collectors.groupingBy(SteadyQualifyVO::getObjId));
List<SteadyQualifyVO> temList = new ArrayList<>(); List<SteadyQualifyVO> temList = new ArrayList<>();
objMap.forEach((objId, monitorList) -> { objMap.forEach((objId, monitorList) -> {
@@ -243,7 +177,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
tree.setId(userLedgerVO.getId()); tree.setId(userLedgerVO.getId());
tree.setChildren(monitorList); tree.setChildren(monitorList);
tree.setName(userLedgerVO.getProjectName()); tree.setName(userLedgerVO.getProjectName());
setFatherDistortion(tree,monitorList); setFatherDistortion(tree, monitorList);
temList.add(tree); temList.add(tree);
}); });
temMap = temList.stream().collect(Collectors.groupingBy(SteadyQualifyVO::getPid)); temMap = temList.stream().collect(Collectors.groupingBy(SteadyQualifyVO::getPid));
@@ -252,16 +186,12 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
List<SteadyQualifyVO> substationList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getSubIndexes()); List<SteadyQualifyVO> substationList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getSubIndexes());
//供电公司集合 //供电公司集合
List<SteadyQualifyVO> powerCompanyList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getGdIndexes()); List<SteadyQualifyVO> powerCompanyList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getGdIndexes());
dealChildrenData(substationList, otherLineList, temMap, true);
dealChildrenData(substationList,otherLineList,temMap,true); dealChildrenData(powerCompanyList, substationList, temMap, false);
dealChildrenData(powerCompanyList,substationList,temMap,false);
return powerCompanyList; return powerCompanyList;
} }
/** /**
* 处理变电站 * 处理变电站
* *
@@ -269,7 +199,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
* @param childrenData * @param childrenData
* @param isLine * @param isLine
*/ */
private void dealChildrenData(List<SteadyQualifyVO> targetData, List<SteadyQualifyVO> childrenData, Map<String,List<SteadyQualifyVO>> userLineMap, boolean isLine) { private void dealChildrenData(List<SteadyQualifyVO> targetData, List<SteadyQualifyVO> childrenData, Map<String, List<SteadyQualifyVO>> userLineMap, boolean isLine) {
// 创建一个map集合用于封装对象 // 创建一个map集合用于封装对象
Map<String, List<SteadyQualifyVO>> groupLine; Map<String, List<SteadyQualifyVO>> groupLine;
if (isLine) { if (isLine) {
@@ -285,12 +215,12 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
//变电站 //变电站
targetData.forEach(terminalTree -> { targetData.forEach(terminalTree -> {
List<SteadyQualifyVO> terminalTrees = new ArrayList<>(); List<SteadyQualifyVO> terminalTrees = new ArrayList<>();
if(groupLine.containsKey(terminalTree.getId())) { if (groupLine.containsKey(terminalTree.getId())) {
terminalTrees.addAll(groupLine.get(terminalTree.getId()).stream().sorted(Comparator.comparing(SteadyQualifyVO::getSort)).collect(Collectors.toList())); terminalTrees.addAll(groupLine.get(terminalTree.getId()).stream().sorted(Comparator.comparing(SteadyQualifyVO::getSort)).collect(Collectors.toList()));
} }
if (isLine) { if (isLine) {
//变电站集合 //变电站集合
if(userLineMap.containsKey(terminalTree.getId())){ if (userLineMap.containsKey(terminalTree.getId())) {
List<SteadyQualifyVO> userList = userLineMap.get(terminalTree.getId()); List<SteadyQualifyVO> userList = userLineMap.get(terminalTree.getId());
terminalTrees.addAll(userList); terminalTrees.addAll(userList);
} }
@@ -298,55 +228,53 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
} else { } else {
terminalTree.setChildren(terminalTrees); terminalTree.setChildren(terminalTrees);
} }
setFatherDistortion(terminalTree,terminalTrees); setFatherDistortion(terminalTree, terminalTrees);
}); });
} }
private Boolean isData(Double data) {
return ObjUtil.isNotNull(data) && data != 3.14159;
}
/** /**
* 计算父级合格率 * 计算父级合格率
*/ */
private void setFatherDistortion(SteadyQualifyVO steadyQualifyVO,List<SteadyQualifyVO> children) { private void setFatherDistortion(SteadyQualifyVO steadyQualifyVO, List<SteadyQualifyVO> steadyResults) {
List<SteadyQualifyVO> flicker = children.stream().filter(child -> !Objects.equals(child.getFlicker(), 3.14159)).collect(Collectors.toList()); List<Double> flicker = steadyResults.stream().filter(s -> isData(s.getFlicker())).map(SteadyQualifyVO::getFlicker).collect(Collectors.toList());
List<SteadyQualifyVO> freqOffset = children.stream().filter(child -> !Objects.equals(child.getFreqOffset(), 3.14159)).collect(Collectors.toList()); List<Double> freqOffset = steadyResults.stream().filter(s -> isData(s.getFreqOffset())).map(SteadyQualifyVO::getFreqOffset).collect(Collectors.toList());
List<SteadyQualifyVO> voltageOffset = children.stream().filter(child -> !Objects.equals(child.getVoltageOffset(), 3.14159)).collect(Collectors.toList()); List<Double> voltageOffset = steadyResults.stream().filter(s -> isData(s.getVoltageOffset())).map(SteadyQualifyVO::getVoltageOffset).collect(Collectors.toList());
List<SteadyQualifyVO> voltageUnbalance = children.stream().filter(child -> !Objects.equals(child.getVoltageUnbalance(), 3.14159)).collect(Collectors.toList()); List<Double> voltageUnbalance = steadyResults.stream().filter(s -> isData(s.getVoltageUnbalance())).map(SteadyQualifyVO::getVoltageUnbalance).collect(Collectors.toList());
List<SteadyQualifyVO> negativeCurrent = children.stream().filter(child -> !Objects.equals(child.getNegativeCurrent(), 3.14159)).collect(Collectors.toList()); List<Double> negativeCurrent = steadyResults.stream().filter(s -> isData(s.getNegativeCurrent())).map(SteadyQualifyVO::getNegativeCurrent).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicVoltage = children.stream().filter(child -> !Objects.equals(child.getHarmonicVoltage(), 3.14159)).collect(Collectors.toList()); List<Double> harmonicVoltage = steadyResults.stream().filter(s -> isData(s.getHarmonicVoltage())).map(SteadyQualifyVO::getHarmonicVoltage).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicCurrent = children.stream().filter(child -> !Objects.equals(child.getHarmonicCurrent(), 3.14159)).collect(Collectors.toList()); List<Double> harmonicCurrent = steadyResults.stream().filter(s -> isData(s.getHarmonicCurrent())).map(SteadyQualifyVO::getHarmonicCurrent).collect(Collectors.toList());
List<SteadyQualifyVO> InterHarmonic = children.stream().filter(child -> !Objects.equals(child.getInterHarmonic(), 3.14159)).collect(Collectors.toList()); List<Double> interHarmonic = steadyResults.stream().filter(s -> isData(s.getInterHarmonic())).map(SteadyQualifyVO::getInterHarmonic).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(flicker)) { //求各项平均值
steadyQualifyVO.setFlicker(PubUtils.dataLimits(NumberUtil.round(flicker.stream().mapToDouble(SteadyQualifyVO::getFlicker).average().orElse(100), 2).doubleValue())); if (!CollectionUtils.isEmpty(flicker)) {
} steadyQualifyVO.setFlicker(PubUtils.dataLimits(NumberUtil.round(flicker.stream().mapToDouble(Double::valueOf).average().orElse(100), 2).doubleValue()));
if (!CollectionUtils.isEmpty(freqOffset)) { }
steadyQualifyVO.setFreqOffset(PubUtils.dataLimits(NumberUtil.round(freqOffset.stream().mapToDouble(SteadyQualifyVO::getFreqOffset).average().orElse(100), 2).doubleValue())); if (!CollectionUtils.isEmpty(freqOffset)) {
} steadyQualifyVO.setFreqOffset(PubUtils.dataLimits(NumberUtil.round(freqOffset.stream().mapToDouble(Double::valueOf).average().orElse(100), 2).doubleValue()));
if (!CollectionUtils.isEmpty(voltageOffset)) { }
steadyQualifyVO.setVoltageOffset(PubUtils.dataLimits(NumberUtil.round(voltageOffset.stream().mapToDouble(SteadyQualifyVO::getVoltageOffset).average().orElse(100), 2).doubleValue())); if (!CollectionUtils.isEmpty(voltageOffset)) {
} steadyQualifyVO.setVoltageOffset(PubUtils.dataLimits(NumberUtil.round(voltageOffset.stream().mapToDouble(Double::valueOf).average().orElse(100), 2).doubleValue()));
if (!CollectionUtils.isEmpty(voltageUnbalance)) { }
steadyQualifyVO.setVoltageUnbalance(PubUtils.dataLimits(NumberUtil.round(voltageUnbalance.stream().mapToDouble(SteadyQualifyVO::getVoltageUnbalance).average().orElse(100), 2).doubleValue())); if (!CollectionUtils.isEmpty(voltageUnbalance)) {
} steadyQualifyVO.setVoltageUnbalance(PubUtils.dataLimits(NumberUtil.round(voltageUnbalance.stream().mapToDouble(Double::valueOf).average().orElse(100), 2).doubleValue()));
if (!CollectionUtils.isEmpty(negativeCurrent)) { }
steadyQualifyVO.setNegativeCurrent(PubUtils.dataLimits(NumberUtil.round(negativeCurrent.stream().mapToDouble(SteadyQualifyVO::getNegativeCurrent).average().orElse(100), 2).doubleValue())); if (!CollectionUtils.isEmpty(negativeCurrent)) {
} steadyQualifyVO.setNegativeCurrent(PubUtils.dataLimits(NumberUtil.round(negativeCurrent.stream().mapToDouble(Double::valueOf).average().orElse(100), 2).doubleValue()));
if (!CollectionUtils.isEmpty(harmonicVoltage)) { }
steadyQualifyVO.setHarmonicVoltage(PubUtils.dataLimits(NumberUtil.round(harmonicVoltage.stream().mapToDouble(SteadyQualifyVO::getHarmonicVoltage).average().orElse(100), 2).doubleValue())); if (!CollectionUtils.isEmpty(harmonicVoltage)) {
} steadyQualifyVO.setHarmonicVoltage(PubUtils.dataLimits(NumberUtil.round(harmonicVoltage.stream().mapToDouble(Double::valueOf).average().orElse(100), 2).doubleValue()));
if (!CollectionUtils.isEmpty(harmonicCurrent)) { }
steadyQualifyVO.setHarmonicCurrent(PubUtils.dataLimits(NumberUtil.round(harmonicCurrent.stream().mapToDouble(SteadyQualifyVO::getHarmonicCurrent).average().orElse(100), 2).doubleValue())); if (!CollectionUtils.isEmpty(harmonicCurrent)) {
} steadyQualifyVO.setHarmonicCurrent(PubUtils.dataLimits(NumberUtil.round(harmonicCurrent.stream().mapToDouble(Double::valueOf).average().orElse(100), 2).doubleValue()));
if (!CollectionUtils.isEmpty(InterHarmonic)) { }
steadyQualifyVO.setInterHarmonic(PubUtils.dataLimits(NumberUtil.round(InterHarmonic.stream().mapToDouble(SteadyQualifyVO::getInterHarmonic).average().orElse(100), 2).doubleValue())); if (!CollectionUtils.isEmpty(interHarmonic)) {
} steadyQualifyVO.setInterHarmonic(PubUtils.dataLimits(NumberUtil.round(interHarmonic.stream().mapToDouble(Double::valueOf).average().orElse(100), 2).doubleValue()));
}
} }
/**
* 组装树层级
*/
private List<SteadyQualifyVO> getChildCategoryList(SteadyQualifyVO item, List<SteadyQualifyVO> child) {
return child.stream().filter(allItem -> allItem.getPid().equals(item.getId())).collect(Collectors.toList());
}
private void setChildesList(List<SteadyQualifyVO> item, List<SteadyQualifyVO> childes) { private void setChildesList(List<SteadyQualifyVO> item, List<SteadyQualifyVO> childes) {
Map<String, List<SteadyQualifyVO>> groupLine; Map<String, List<SteadyQualifyVO>> groupLine;
@@ -357,7 +285,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
item.stream().peek(steadyQualifyVO -> { item.stream().peek(steadyQualifyVO -> {
if (!CollectionUtils.isEmpty(groupLine.get(steadyQualifyVO.getId()))) { if (!CollectionUtils.isEmpty(groupLine.get(steadyQualifyVO.getId()))) {
steadyQualifyVO.setChildren(groupLine.get(steadyQualifyVO.getId())); steadyQualifyVO.setChildren(groupLine.get(steadyQualifyVO.getId()));
setFatherDistortion(steadyQualifyVO,steadyQualifyVO.getChildren()); setFatherDistortion(steadyQualifyVO, steadyQualifyVO.getChildren());
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@@ -366,29 +294,90 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
/** /**
* 计算监测点日统计合格率 * 计算监测点日统计合格率
*/ */
public List<SteadyQualifyVO> getDataSingleMonitorSingeDay(List<SteadyQualifyDTO> qualifiesRate) { public List<SteadyQualifyVO> getDataSingleMonitorSingeDay(List<RStatLimitRateDPO> qualifiesRate) {
List<SteadyQualifyVO> list = new ArrayList<>(); List<SteadyQualifyVO> list = new ArrayList<>();
SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO(); SteadyQualifyVO steadyQualifyVO;
if (!CollectionUtil.isEmpty(qualifiesRate)) { if (!CollectionUtil.isEmpty(qualifiesRate)) {
for (SteadyQualifyDTO steadyQualifyDTO : qualifiesRate) { for (RStatLimitRateDPO steadyQualifyDTO : qualifiesRate) {
steadyQualifyVO = new SteadyQualifyVO(); steadyQualifyVO = new SteadyQualifyVO();
//闪变合格率 //闪变合格率
steadyQualifyVO.setFlicker(calculate(steadyQualifyDTO.getFlicker_AllTime(), steadyQualifyDTO.getFlicker_OverTime())); steadyQualifyVO.setFlicker(calculate(steadyQualifyDTO.getFlickerAllTime(), steadyQualifyDTO.getFlickerOvertime()));
//频率偏差合格率 //频率偏差合格率
steadyQualifyVO.setFreqOffset(calculate(steadyQualifyDTO.getAllTime(), steadyQualifyDTO.getFreq_Dev_OverTime())); steadyQualifyVO.setFreqOffset(calculate(steadyQualifyDTO.getAllTime(), steadyQualifyDTO.getFreqDevOvertime()));
//计算电压偏差 //计算电压偏差
steadyQualifyVO.setVoltageOffset(calculate(steadyQualifyDTO.getAllTime(), steadyQualifyDTO.getVoltage_Dev_OverTime())); steadyQualifyVO.setVoltageOffset(calculate(steadyQualifyDTO.getAllTime(), steadyQualifyDTO.getVoltageDevOvertime()));
//相电压不平衡度 //相电压不平衡度
steadyQualifyVO.setVoltageUnbalance(calculate(steadyQualifyDTO.getAllTime(), steadyQualifyDTO.getUBalance_OverTime())); steadyQualifyVO.setVoltageUnbalance(calculate(steadyQualifyDTO.getAllTime(), steadyQualifyDTO.getUbalanceOvertime()));
//负序电流 //负序电流
steadyQualifyVO.setNegativeCurrent(calculate(steadyQualifyDTO.getAllTime(), steadyQualifyDTO.getI_Neg_OverTime())); steadyQualifyVO.setNegativeCurrent(calculate(steadyQualifyDTO.getAllTime(), steadyQualifyDTO.getINegOvertime()));
//谐波电压 //谐波电压
steadyQualifyVO.setHarmonicVoltage(calculateV(steadyQualifyDTO.getAllTime(), (steadyQualifyDTO.getUAberrance_OverTime() + steadyQualifyDTO.getUHarm_2_OverTime() + steadyQualifyDTO.getUHarm_3_OverTime() + steadyQualifyDTO.getUHarm_4_OverTime() + steadyQualifyDTO.getUHarm_5_OverTime() + steadyQualifyDTO.getUHarm_6_OverTime() + steadyQualifyDTO.getUHarm_7_OverTime() + steadyQualifyDTO.getUHarm_8_OverTime() + steadyQualifyDTO.getUHarm_9_OverTime() + steadyQualifyDTO.getUHarm_10_OverTime() + steadyQualifyDTO.getUHarm_11_OverTime() + steadyQualifyDTO.getUHarm_12_OverTime() + steadyQualifyDTO.getUHarm_13_OverTime() + steadyQualifyDTO.getUHarm_14_OverTime() + steadyQualifyDTO.getUHarm_15_OverTime() + steadyQualifyDTO.getUHarm_16_OverTime() + steadyQualifyDTO.getUHarm_17_OverTime() + steadyQualifyDTO.getUHarm_18_OverTime() + steadyQualifyDTO.getUHarm_19_OverTime() + steadyQualifyDTO.getUHarm_20_OverTime() + steadyQualifyDTO.getUHarm_21_OverTime() + steadyQualifyDTO.getUHarm_22_OverTime() + steadyQualifyDTO.getUHarm_23_OverTime() + steadyQualifyDTO.getUHarm_24_OverTime() + steadyQualifyDTO.getUHarm_25_OverTime()))); steadyQualifyVO.setHarmonicVoltage(calculateV(steadyQualifyDTO.getAllTime(), (steadyQualifyDTO.getUaberranceOvertime() +
steadyQualifyDTO.getUharm2Overtime() +
steadyQualifyDTO.getUharm3Overtime() +
steadyQualifyDTO.getUharm4Overtime() +
steadyQualifyDTO.getUharm5Overtime() +
steadyQualifyDTO.getUharm6Overtime() +
steadyQualifyDTO.getUharm7Overtime() +
steadyQualifyDTO.getUharm8Overtime() +
steadyQualifyDTO.getUharm9Overtime() +
steadyQualifyDTO.getUharm10Overtime() +
steadyQualifyDTO.getUharm11Overtime() +
steadyQualifyDTO.getUharm12Overtime() +
steadyQualifyDTO.getUharm13Overtime() +
steadyQualifyDTO.getUharm14Overtime() +
steadyQualifyDTO.getUharm15Overtime() +
steadyQualifyDTO.getUharm16Overtime() +
steadyQualifyDTO.getUharm17Overtime() +
steadyQualifyDTO.getUharm18Overtime() +
steadyQualifyDTO.getUharm19Overtime() +
steadyQualifyDTO.getUharm20Overtime() +
steadyQualifyDTO.getUharm21Overtime() +
steadyQualifyDTO.getUharm22Overtime() +
steadyQualifyDTO.getUharm23Overtime() +
steadyQualifyDTO.getUharm24Overtime() +
steadyQualifyDTO.getUharm25Overtime())));
//谐波电流 //谐波电流
steadyQualifyVO.setHarmonicCurrent(calculateI(steadyQualifyDTO.getAllTime(), (steadyQualifyDTO.getIHarm_2_OverTime() + steadyQualifyDTO.getIHarm_3_OverTime() + steadyQualifyDTO.getIHarm_4_OverTime() + steadyQualifyDTO.getIHarm_5_OverTime() + steadyQualifyDTO.getIHarm_6_OverTime() + steadyQualifyDTO.getIHarm_7_OverTime() + steadyQualifyDTO.getIHarm_8_OverTime() + steadyQualifyDTO.getIHarm_9_OverTime() + steadyQualifyDTO.getIHarm_10_OverTime() + steadyQualifyDTO.getIHarm_11_OverTime() + steadyQualifyDTO.getIHarm_12_OverTime() + steadyQualifyDTO.getIHarm_13_OverTime() + steadyQualifyDTO.getIHarm_14_OverTime() + steadyQualifyDTO.getIHarm_15_OverTime() + steadyQualifyDTO.getIHarm_16_OverTime() + steadyQualifyDTO.getIHarm_17_OverTime() + steadyQualifyDTO.getIHarm_18_OverTime() + steadyQualifyDTO.getIHarm_19_OverTime() + steadyQualifyDTO.getIHarm_20_OverTime() + steadyQualifyDTO.getIHarm_21_OverTime() + steadyQualifyDTO.getIHarm_22_OverTime() + steadyQualifyDTO.getIHarm_23_OverTime() + steadyQualifyDTO.getIHarm_24_OverTime() + steadyQualifyDTO.getIHarm_25_OverTime()))); steadyQualifyVO.setHarmonicCurrent(calculateI(steadyQualifyDTO.getAllTime(), (steadyQualifyDTO.getIharm2Overtime() +
steadyQualifyDTO.getIharm3Overtime() +
steadyQualifyDTO.getIharm4Overtime() +
steadyQualifyDTO.getIharm5Overtime() +
steadyQualifyDTO.getIharm6Overtime() +
steadyQualifyDTO.getIharm7Overtime() +
steadyQualifyDTO.getIharm8Overtime() +
steadyQualifyDTO.getIharm9Overtime() +
steadyQualifyDTO.getIharm10Overtime() +
steadyQualifyDTO.getIharm11Overtime() +
steadyQualifyDTO.getIharm12Overtime() +
steadyQualifyDTO.getIharm13Overtime() +
steadyQualifyDTO.getIharm14Overtime() +
steadyQualifyDTO.getIharm15Overtime() +
steadyQualifyDTO.getIharm16Overtime() +
steadyQualifyDTO.getIharm17Overtime() +
steadyQualifyDTO.getIharm18Overtime() +
steadyQualifyDTO.getIharm19Overtime() +
steadyQualifyDTO.getIharm20Overtime() +
steadyQualifyDTO.getIharm21Overtime() +
steadyQualifyDTO.getIharm22Overtime() +
steadyQualifyDTO.getIharm23Overtime() +
steadyQualifyDTO.getIharm24Overtime() +
steadyQualifyDTO.getIharm25Overtime())));
//间谐波电压含有率 //间谐波电压含有率
steadyQualifyVO.setInterHarmonic(calculateIN(steadyQualifyDTO.getAllTime(), (steadyQualifyDTO.getInUHARM_1_OverTime() + steadyQualifyDTO.getInUHARM_2_OverTime() + steadyQualifyDTO.getInUHARM_3_OverTime() + steadyQualifyDTO.getInUHARM_4_OverTime() + steadyQualifyDTO.getInUHARM_5_OverTime() + steadyQualifyDTO.getInUHARM_6_OverTime() + steadyQualifyDTO.getInUHARM_7_OverTime() + steadyQualifyDTO.getInUHARM_8_OverTime() + steadyQualifyDTO.getInUHARM_9_OverTime() + steadyQualifyDTO.getInUHARM_10_OverTime() + steadyQualifyDTO.getInUHARM_11_OverTime() + steadyQualifyDTO.getInUHARM_12_OverTime() + steadyQualifyDTO.getInUHARM_13_OverTime() + steadyQualifyDTO.getInUHARM_14_OverTime() + steadyQualifyDTO.getInUHARM_15_OverTime() + steadyQualifyDTO.getInUHARM_16_OverTime()))); steadyQualifyVO.setInterHarmonic(calculateIN(steadyQualifyDTO.getAllTime(), (steadyQualifyDTO.getInuharm1Overtime() +
steadyQualifyDTO.getInuharm2Overtime() +
steadyQualifyDTO.getInuharm3Overtime() +
steadyQualifyDTO.getInuharm4Overtime() +
steadyQualifyDTO.getInuharm5Overtime() +
steadyQualifyDTO.getInuharm6Overtime() +
steadyQualifyDTO.getInuharm7Overtime() +
steadyQualifyDTO.getInuharm8Overtime() +
steadyQualifyDTO.getInuharm9Overtime() +
steadyQualifyDTO.getInuharm10Overtime() +
steadyQualifyDTO.getInuharm11Overtime() +
steadyQualifyDTO.getInuharm12Overtime() +
steadyQualifyDTO.getInuharm13Overtime() +
steadyQualifyDTO.getInuharm14Overtime() +
steadyQualifyDTO.getInuharm15Overtime() +
steadyQualifyDTO.getInuharm16Overtime())));
list.add(steadyQualifyVO); list.add(steadyQualifyVO);
} }
} }
@@ -398,49 +387,17 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
/** /**
* 监测点时间范围统计合格率 * 监测点时间范围统计合格率
*/ */
public SteadyQualifyVO getDataSingleMonitorMoreDay(List<SteadyQualifyDTO> qualifiesRate, String lineId) { public SteadyQualifyVO getDataSingleMonitorMoreDay(List<RStatLimitRateDPO> qualifiesRate, String lineId) {
SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO(); SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO();
//从数据里筛选出指定监测点的数据 //从数据里筛选出指定监测点的数据
List<SteadyQualifyDTO> steadyQualifyDTOList = qualifiesRate.stream().filter( List<RStatLimitRateDPO> steadyQualifyDTOList = qualifiesRate.stream().filter(
temp -> temp.getMYINDEX().equalsIgnoreCase(lineId)).collect(Collectors.toList()); temp -> temp.getLineId().equalsIgnoreCase(lineId)).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(steadyQualifyDTOList)) { if (CollectionUtil.isNotEmpty(steadyQualifyDTOList)) {
List<SteadyQualifyVO> steadyQualifyVOS = new ArrayList<>(); List<SteadyQualifyVO> steadyQualifyVOS = new ArrayList<>();
//获取出时间和id调用第一个方法(改展示一条数据,可以不用每天都统计) //获取出时间和id调用第一个方法(改展示一条数据,可以不用每天都统计)
steadyQualifyVOS.addAll(getDataSingleMonitorSingeDay(steadyQualifyDTOList)); steadyQualifyVOS.addAll(getDataSingleMonitorSingeDay(steadyQualifyDTOList));
if (CollectionUtil.isNotEmpty(steadyQualifyVOS)) { if (CollectionUtil.isNotEmpty(steadyQualifyVOS)) {
List<SteadyQualifyVO> flicker = steadyQualifyVOS.stream().filter(s -> s.getFlicker() != 3.14159).collect(Collectors.toList()); setFatherDistortion(steadyQualifyVO, steadyQualifyVOS);
List<SteadyQualifyVO> freqOffset = steadyQualifyVOS.stream().filter(s -> s.getFreqOffset() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> voltageOffset = steadyQualifyVOS.stream().filter(s -> s.getVoltageOffset() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> voltageUnbalance = steadyQualifyVOS.stream().filter(s -> s.getVoltageUnbalance() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> negativeCurrent = steadyQualifyVOS.stream().filter(s -> s.getNegativeCurrent() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicVoltage = steadyQualifyVOS.stream().filter(s -> s.getHarmonicVoltage() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicCurrent = steadyQualifyVOS.stream().filter(s -> s.getHarmonicCurrent() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> interHarmonic = steadyQualifyVOS.stream().filter(s -> s.getInterHarmonic() != 3.14159).collect(Collectors.toList());
//求各项平均值
if (!CollectionUtils.isEmpty(flicker)) {
steadyQualifyVO.setFlicker(NumberUtil.round(flicker.stream().mapToDouble(SteadyQualifyVO::getFlicker).average().orElse(100), 2).doubleValue());
}
if (!CollectionUtils.isEmpty(freqOffset)) {
steadyQualifyVO.setFreqOffset(NumberUtil.round(freqOffset.stream().mapToDouble(SteadyQualifyVO::getFreqOffset).average().orElse(100), 2).doubleValue());
}
if (!CollectionUtils.isEmpty(voltageOffset)) {
steadyQualifyVO.setVoltageOffset(NumberUtil.round(voltageOffset.stream().mapToDouble(SteadyQualifyVO::getVoltageOffset).average().orElse(100), 2).doubleValue());
}
if (!CollectionUtils.isEmpty(voltageUnbalance)) {
steadyQualifyVO.setVoltageUnbalance(NumberUtil.round(voltageUnbalance.stream().mapToDouble(SteadyQualifyVO::getVoltageUnbalance).average().orElse(100), 2).doubleValue());
}
if (!CollectionUtils.isEmpty(negativeCurrent)) {
steadyQualifyVO.setNegativeCurrent(NumberUtil.round(negativeCurrent.stream().mapToDouble(SteadyQualifyVO::getNegativeCurrent).average().orElse(100), 2).doubleValue());
}
if (!CollectionUtils.isEmpty(harmonicVoltage)) {
steadyQualifyVO.setHarmonicVoltage(NumberUtil.round(harmonicVoltage.stream().mapToDouble(SteadyQualifyVO::getHarmonicVoltage).average().orElse(100), 2).doubleValue());
}
if (!CollectionUtils.isEmpty(harmonicCurrent)) {
steadyQualifyVO.setHarmonicCurrent(NumberUtil.round(harmonicCurrent.stream().mapToDouble(SteadyQualifyVO::getHarmonicCurrent).average().orElse(100), 2).doubleValue());
}
if (!CollectionUtils.isEmpty(interHarmonic)) {
steadyQualifyVO.setInterHarmonic(NumberUtil.round(interHarmonic.stream().mapToDouble(SteadyQualifyVO::getInterHarmonic).average().orElse(100), 2).doubleValue());
}
} }
} }
return steadyQualifyVO; return steadyQualifyVO;
@@ -449,96 +406,17 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
/** /**
* 计算区域监测点时间范围统计合格率 * 计算区域监测点时间范围统计合格率
*/ */
public SteadyQualifyVO getDataMoreMonitorMoreDay(List<SteadyQualifyDTO> qualifiesRate) { public SteadyQualifyVO getDataMoreMonitorMoreDay(List<RStatLimitRateDPO> qualifiesRate) {
SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO(); SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO();
List<SteadyQualifyVO> steadyResults = new ArrayList<>(); List<SteadyQualifyVO> steadyResults = new ArrayList<>();
//获取所有监测点每天信息(根本不需要时间分组,只是要所有的统计) //获取所有监测点每天信息(根本不需要时间分组,只是要所有的统计)
steadyResults.addAll(getDataSingleMonitorSingeDay(qualifiesRate)); steadyResults.addAll(getDataSingleMonitorSingeDay(qualifiesRate));
if (CollectionUtil.isNotEmpty(steadyResults)) { if (CollectionUtil.isNotEmpty(steadyResults)) {
List<SteadyQualifyVO> flicker = steadyResults.stream().filter(s -> s.getFlicker() != 3.14159).collect(Collectors.toList()); setFatherDistortion(steadyQualifyVO, steadyResults);
List<SteadyQualifyVO> freqOffset = steadyResults.stream().filter(s -> s.getFreqOffset() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> voltageOffset = steadyResults.stream().filter(s -> s.getVoltageOffset() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> voltageUnbalance = steadyResults.stream().filter(s -> s.getVoltageUnbalance() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> negativeCurrent = steadyResults.stream().filter(s -> s.getNegativeCurrent() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicVoltage = steadyResults.stream().filter(s -> s.getHarmonicVoltage() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> harmonicCurrent = steadyResults.stream().filter(s -> s.getHarmonicCurrent() != 3.14159).collect(Collectors.toList());
List<SteadyQualifyVO> interHarmonic = steadyResults.stream().filter(s -> s.getInterHarmonic() != 3.14159).collect(Collectors.toList());
//求各项平均值
if (!CollectionUtils.isEmpty(flicker)) {
steadyQualifyVO.setFlicker(PubUtils.dataLimits(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getFlicker).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(freqOffset)) {
steadyQualifyVO.setFreqOffset(PubUtils.dataLimits(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getFreqOffset).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(voltageOffset)) {
steadyQualifyVO.setVoltageOffset(PubUtils.dataLimits(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getVoltageOffset).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(voltageUnbalance)) {
steadyQualifyVO.setVoltageUnbalance(PubUtils.dataLimits(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getVoltageUnbalance).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(negativeCurrent)) {
steadyQualifyVO.setNegativeCurrent(PubUtils.dataLimits(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getNegativeCurrent).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(harmonicVoltage)) {
steadyQualifyVO.setHarmonicVoltage(PubUtils.dataLimits(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getHarmonicVoltage).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(harmonicCurrent)) {
steadyQualifyVO.setHarmonicCurrent(PubUtils.dataLimits(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getHarmonicCurrent).average().orElse(100), 2).doubleValue()));
}
if (!CollectionUtils.isEmpty(interHarmonic)) {
steadyQualifyVO.setInterHarmonic(PubUtils.dataLimits(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getInterHarmonic).average().orElse(100), 2).doubleValue()));
}
} }
return steadyQualifyVO; return steadyQualifyVO;
} }
/**
* 计算区域监测点日统计合格率
*/
// public SteadyQualifyVO getDataMoreMonitorSingleDay(List<SteadyQualifyDTO> qualifiesRate, List<String> lineIds, String time) {
// SteadyQualifyVO steadyQualifyVO = new SteadyQualifyVO();
// List<SteadyQualifyVO> steadyResults = new ArrayList<>();
// for (String lineId : lineIds) {
// steadyResults.addAll(getDataSingleMonitorSingeDay(qualifiesRate, lineId, time));
// }
// if (CollectionUtil.isNotEmpty(steadyResults)) {
// List<SteadyQualifyVO> flicker = steadyResults.stream().filter(s -> s.getFlicker() != 3.14159).collect(Collectors.toList());
// List<SteadyQualifyVO> freqOffset = steadyResults.stream().filter(s -> s.getFreqOffset() != 3.14159).collect(Collectors.toList());
// List<SteadyQualifyVO> voltageOffset = steadyResults.stream().filter(s -> s.getVoltageOffset() != 3.14159).collect(Collectors.toList());
// List<SteadyQualifyVO> voltageUnbalance = steadyResults.stream().filter(s -> s.getVoltageUnbalance() != 3.14159).collect(Collectors.toList());
// List<SteadyQualifyVO> negativeCurrent = steadyResults.stream().filter(s -> s.getNegativeCurrent() != 3.14159).collect(Collectors.toList());
// List<SteadyQualifyVO> harmonicVoltage = steadyResults.stream().filter(s -> s.getHarmonicVoltage() != 3.14159).collect(Collectors.toList());
// List<SteadyQualifyVO> harmonicCurrent = steadyResults.stream().filter(s -> s.getHarmonicCurrent() != 3.14159).collect(Collectors.toList());
// List<SteadyQualifyVO> interHarmonic = steadyResults.stream().filter(s -> s.getInterHarmonic() != 3.14159).collect(Collectors.toList());
// //求各项平均值
// if (!CollectionUtils.isEmpty(flicker)) {
// steadyQualifyVO.setFlicker(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getFlicker).average().orElse(100), 2).doubleValue());
// }
// if (!CollectionUtils.isEmpty(freqOffset)) {
// steadyQualifyVO.setFreqOffset(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getFreqOffset).average().orElse(100), 2).doubleValue());
// }
// if (!CollectionUtils.isEmpty(voltageOffset)) {
// steadyQualifyVO.setVoltageOffset(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getVoltageOffset).average().orElse(100), 2).doubleValue());
// }
// if (!CollectionUtils.isEmpty(voltageUnbalance)) {
// steadyQualifyVO.setVoltageUnbalance(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getVoltageUnbalance).average().orElse(100), 2).doubleValue());
// }
// if (!CollectionUtils.isEmpty(negativeCurrent)) {
// steadyQualifyVO.setNegativeCurrent(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getNegativeCurrent).average().orElse(100), 2).doubleValue());
// }
// if (!CollectionUtils.isEmpty(harmonicVoltage)) {
// steadyQualifyVO.setHarmonicVoltage(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getHarmonicVoltage).average().orElse(100), 2).doubleValue());
// }
// if (!CollectionUtils.isEmpty(harmonicCurrent)) {
// steadyQualifyVO.setHarmonicCurrent(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getHarmonicCurrent).average().orElse(100), 2).doubleValue());
// }
// if (!CollectionUtils.isEmpty(interHarmonic)) {
// steadyQualifyVO.setInterHarmonic(NumberUtil.round(steadyResults.stream().mapToDouble(SteadyQualifyVO::getInterHarmonic).average().orElse(100), 2).doubleValue());
// }
// }
// return steadyQualifyVO;
// }
/** /**
* influxDB查询稳态监测点相关信息 * influxDB查询稳态监测点相关信息
@@ -547,106 +425,22 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
* @param startTime * @param startTime
* @param endTime * @param endTime
*/ */
private List<SteadyQualifyDTO> getQualifiesRate(List<String> lineIndexes, String startTime, String endTime) { private List<RStatLimitRateDPO> getQualifiesRate(List<String> lineIndexes, String startTime, String endTime) {
List<SteadyQualifyDTO> qualifyDTOList = new ArrayList<>(); return rateDService.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
List<RStatLimitRateDPO> limitRates = rateDService.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
.in(RStatLimitRateDPO::getLineId, lineIndexes) .in(RStatLimitRateDPO::getLineId, lineIndexes)
.eq(RStatLimitRateDPO::getPhasicType, "T") .eq(RStatLimitRateDPO::getPhasicType, "T")
.ge(StrUtil.isNotBlank(startTime), RStatLimitRateDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(startTime))) .ge(StrUtil.isNotBlank(startTime), RStatLimitRateDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(startTime)))
.le(StrUtil.isNotBlank(endTime), RStatLimitRateDPO::getTime, DateUtil.endOfDay(DateUtil.parse(endTime))) .le(StrUtil.isNotBlank(endTime), RStatLimitRateDPO::getTime, DateUtil.endOfDay(DateUtil.parse(endTime)))
); );
if (CollUtil.isNotEmpty(limitRates)) {
limitRates.forEach(list -> {
SteadyQualifyDTO steadyQualifyDTO = new SteadyQualifyDTO();
steadyQualifyDTO.setTime(list.getTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
steadyQualifyDTO.setMYINDEX(list.getLineId());
steadyQualifyDTO.setPhasic_Type(list.getPhasicType());
steadyQualifyDTO.setAllTime(Double.parseDouble(list.getAllTime().toString()));
steadyQualifyDTO.setFlicker_AllTime(Double.parseDouble(list.getFlickerAllTime().toString()));
steadyQualifyDTO.setFlicker_OverTime(Double.parseDouble(list.getFlickerOvertime().toString()));
steadyQualifyDTO.setFreq_Dev_OverTime(Double.parseDouble(list.getFreqDevOvertime().toString()));
steadyQualifyDTO.setIHarm_2_OverTime(Double.parseDouble(list.getIharm2Overtime().toString()));
steadyQualifyDTO.setIHarm_3_OverTime(Double.parseDouble(list.getIharm3Overtime().toString()));
steadyQualifyDTO.setIHarm_4_OverTime(Double.parseDouble(list.getIharm4Overtime().toString()));
steadyQualifyDTO.setIHarm_5_OverTime(Double.parseDouble(list.getIharm5Overtime().toString()));
steadyQualifyDTO.setIHarm_6_OverTime(Double.parseDouble(list.getIharm6Overtime().toString()));
steadyQualifyDTO.setIHarm_7_OverTime(Double.parseDouble(list.getIharm7Overtime().toString()));
steadyQualifyDTO.setIHarm_8_OverTime(Double.parseDouble(list.getIharm8Overtime().toString()));
steadyQualifyDTO.setIHarm_9_OverTime(Double.parseDouble(list.getIharm9Overtime().toString()));
steadyQualifyDTO.setIHarm_10_OverTime(Double.parseDouble(list.getIharm10Overtime().toString()));
steadyQualifyDTO.setIHarm_11_OverTime(Double.parseDouble(list.getIharm11Overtime().toString()));
steadyQualifyDTO.setIHarm_12_OverTime(Double.parseDouble(list.getIharm12Overtime().toString()));
steadyQualifyDTO.setIHarm_13_OverTime(Double.parseDouble(list.getIharm13Overtime().toString()));
steadyQualifyDTO.setIHarm_14_OverTime(Double.parseDouble(list.getIharm14Overtime().toString()));
steadyQualifyDTO.setIHarm_15_OverTime(Double.parseDouble(list.getIharm15Overtime().toString()));
steadyQualifyDTO.setIHarm_16_OverTime(Double.parseDouble(list.getIharm16Overtime().toString()));
steadyQualifyDTO.setIHarm_17_OverTime(Double.parseDouble(list.getIharm17Overtime().toString()));
steadyQualifyDTO.setIHarm_18_OverTime(Double.parseDouble(list.getIharm18Overtime().toString()));
steadyQualifyDTO.setIHarm_19_OverTime(Double.parseDouble(list.getIharm19Overtime().toString()));
steadyQualifyDTO.setIHarm_20_OverTime(Double.parseDouble(list.getIharm20Overtime().toString()));
steadyQualifyDTO.setIHarm_21_OverTime(Double.parseDouble(list.getIharm21Overtime().toString()));
steadyQualifyDTO.setIHarm_22_OverTime(Double.parseDouble(list.getIharm22Overtime().toString()));
steadyQualifyDTO.setIHarm_23_OverTime(Double.parseDouble(list.getIharm23Overtime().toString()));
steadyQualifyDTO.setIHarm_24_OverTime(Double.parseDouble(list.getIharm24Overtime().toString()));
steadyQualifyDTO.setIHarm_25_OverTime(Double.parseDouble(list.getIharm25Overtime().toString()));
steadyQualifyDTO.setI_Neg_OverTime(Double.parseDouble(list.getINegOvertime().toString()));
steadyQualifyDTO.setInUHARM_1_OverTime(Double.parseDouble(list.getInuharm1Overtime().toString()));
steadyQualifyDTO.setInUHARM_2_OverTime(Double.parseDouble(list.getInuharm2Overtime().toString()));
steadyQualifyDTO.setInUHARM_3_OverTime(Double.parseDouble(list.getInuharm3Overtime().toString()));
steadyQualifyDTO.setInUHARM_4_OverTime(Double.parseDouble(list.getInuharm4Overtime().toString()));
steadyQualifyDTO.setInUHARM_5_OverTime(Double.parseDouble(list.getInuharm5Overtime().toString()));
steadyQualifyDTO.setInUHARM_6_OverTime(Double.parseDouble(list.getInuharm6Overtime().toString()));
steadyQualifyDTO.setInUHARM_7_OverTime(Double.parseDouble(list.getInuharm7Overtime().toString()));
steadyQualifyDTO.setInUHARM_8_OverTime(Double.parseDouble(list.getInuharm8Overtime().toString()));
steadyQualifyDTO.setInUHARM_9_OverTime(Double.parseDouble(list.getInuharm9Overtime().toString()));
steadyQualifyDTO.setInUHARM_10_OverTime(Double.parseDouble(list.getInuharm10Overtime().toString()));
steadyQualifyDTO.setInUHARM_11_OverTime(Double.parseDouble(list.getInuharm11Overtime().toString()));
steadyQualifyDTO.setInUHARM_12_OverTime(Double.parseDouble(list.getInuharm12Overtime().toString()));
steadyQualifyDTO.setInUHARM_13_OverTime(Double.parseDouble(list.getInuharm13Overtime().toString()));
steadyQualifyDTO.setInUHARM_14_OverTime(Double.parseDouble(list.getInuharm14Overtime().toString()));
steadyQualifyDTO.setInUHARM_15_OverTime(Double.parseDouble(list.getInuharm15Overtime().toString()));
steadyQualifyDTO.setInUHARM_16_OverTime(Double.parseDouble(list.getInuharm16Overtime().toString()));
steadyQualifyDTO.setUAberrance_OverTime(Double.parseDouble(list.getUaberranceOvertime().toString()));
steadyQualifyDTO.setUBalance_OverTime(Double.parseDouble(list.getUbalanceOvertime().toString()));
steadyQualifyDTO.setUHarm_2_OverTime(Double.parseDouble(list.getUharm2Overtime().toString()));
steadyQualifyDTO.setUHarm_3_OverTime(Double.parseDouble(list.getUharm3Overtime().toString()));
steadyQualifyDTO.setUHarm_4_OverTime(Double.parseDouble(list.getUharm4Overtime().toString()));
steadyQualifyDTO.setUHarm_5_OverTime(Double.parseDouble(list.getUharm5Overtime().toString()));
steadyQualifyDTO.setUHarm_6_OverTime(Double.parseDouble(list.getUharm6Overtime().toString()));
steadyQualifyDTO.setUHarm_7_OverTime(Double.parseDouble(list.getUharm7Overtime().toString()));
steadyQualifyDTO.setUHarm_8_OverTime(Double.parseDouble(list.getUharm8Overtime().toString()));
steadyQualifyDTO.setUHarm_9_OverTime(Double.parseDouble(list.getUharm9Overtime().toString()));
steadyQualifyDTO.setUHarm_10_OverTime(Double.parseDouble(list.getUharm10Overtime().toString()));
steadyQualifyDTO.setUHarm_11_OverTime(Double.parseDouble(list.getUharm11Overtime().toString()));
steadyQualifyDTO.setUHarm_12_OverTime(Double.parseDouble(list.getUharm12Overtime().toString()));
steadyQualifyDTO.setUHarm_13_OverTime(Double.parseDouble(list.getUharm13Overtime().toString()));
steadyQualifyDTO.setUHarm_14_OverTime(Double.parseDouble(list.getUharm14Overtime().toString()));
steadyQualifyDTO.setUHarm_15_OverTime(Double.parseDouble(list.getUharm15Overtime().toString()));
steadyQualifyDTO.setUHarm_16_OverTime(Double.parseDouble(list.getUharm16Overtime().toString()));
steadyQualifyDTO.setUHarm_17_OverTime(Double.parseDouble(list.getUharm17Overtime().toString()));
steadyQualifyDTO.setUHarm_18_OverTime(Double.parseDouble(list.getUharm18Overtime().toString()));
steadyQualifyDTO.setUHarm_19_OverTime(Double.parseDouble(list.getUharm19Overtime().toString()));
steadyQualifyDTO.setUHarm_20_OverTime(Double.parseDouble(list.getUharm20Overtime().toString()));
steadyQualifyDTO.setUHarm_21_OverTime(Double.parseDouble(list.getUharm21Overtime().toString()));
steadyQualifyDTO.setUHarm_22_OverTime(Double.parseDouble(list.getUharm22Overtime().toString()));
steadyQualifyDTO.setUHarm_23_OverTime(Double.parseDouble(list.getUharm23Overtime().toString()));
steadyQualifyDTO.setUHarm_24_OverTime(Double.parseDouble(list.getUharm24Overtime().toString()));
steadyQualifyDTO.setUHarm_25_OverTime(Double.parseDouble(list.getUharm25Overtime().toString()));
steadyQualifyDTO.setVoltage_Dev_OverTime(Double.parseDouble(list.getVoltageDevOvertime().toString()));
qualifyDTOList.add(steadyQualifyDTO);
});
}
return qualifyDTOList;
} }
private static double calculate(Double allTime, Double overTime) { private static double calculate(Integer allTime, Integer overTime) {
if (allTime == 0) { if (allTime == 0) {
return 3.14159; return 3.14159;
} else { } else {
if (allTime >= overTime) { if (allTime >= overTime) {
return NumberUtil.round((allTime - overTime) / allTime * 100, 2).doubleValue(); return NumberUtil.round((allTime - overTime)*1.0 / allTime * 100.0, 2).doubleValue();
} }
return 0.0; return 0.0;
} }
@@ -659,12 +453,12 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
* @param overTime 相加 * @param overTime 相加
* @return * @return
*/ */
private static double calculateV(Double allTime, Double overTime) { private static double calculateV(Integer allTime, Integer overTime) {
if (allTime == 0) { if (allTime == 0) {
return 3.14159; return 3.14159;
} else { } else {
if (allTime >= overTime) { if (allTime >= overTime) {
return NumberUtil.round((1 - (overTime / (allTime * 25))) * 100, 2).doubleValue(); return NumberUtil.round((1 - (overTime / (allTime * 25.0))) * 100, 2).doubleValue();
} }
return 0.0; return 0.0;
} }
@@ -677,12 +471,12 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
* @param overTime * @param overTime
* @return * @return
*/ */
private static double calculateI(Double allTime, Double overTime) { private static double calculateI(Integer allTime, Integer overTime) {
if (allTime == 0) { if (allTime == 0) {
return 3.14159; return 3.14159;
} else { } else {
if (allTime >= overTime) { if (allTime >= overTime) {
return NumberUtil.round((1 - (overTime / (allTime * 24))) * 100, 2).doubleValue(); return NumberUtil.round((1 - (overTime / (allTime * 24.0))) * 100, 2).doubleValue();
} }
return 0.0; return 0.0;
} }
@@ -695,12 +489,12 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
* @param overTime * @param overTime
* @return * @return
*/ */
private static double calculateIN(Double allTime, Double overTime) { private static double calculateIN(Integer allTime, Integer overTime) {
if (allTime == 0) { if (allTime == 0) {
return 3.14159; return 3.14159;
} else { } else {
if (allTime >= overTime) { if (allTime >= overTime) {
return NumberUtil.round((1 - (overTime / (allTime * 16))) * 100, 2).doubleValue(); return NumberUtil.round((1 - (overTime / (allTime * 16.0))) * 100, 2).doubleValue();
} }
return 0.0; return 0.0;
} }
@@ -710,7 +504,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
/** /**
* 获取父级每层数据 * 获取父级每层数据
*/ */
private List<SteadyQualifyVO> getCompanyTreeData(List<SteadyQualifyDTO> qualifiesRate, List<String> lineIndexes) { private List<SteadyQualifyVO> getCompanyTreeData(List<RStatLimitRateDPO> qualifiesRate, List<String> lineIndexes) {
//监测点集合 //监测点集合
List<SteadyQualifyVO> monitorList = steadyQualifyMapper.getSteadyQualifyData(lineIndexes); List<SteadyQualifyVO> monitorList = steadyQualifyMapper.getSteadyQualifyData(lineIndexes);
//母线集合 //母线集合