1.试运行报告微调
2.全景展示稳态超标9指标扩展 3.技术监督变电站台账调整 4.调整登录名正则表达式增加._
This commit is contained in:
@@ -41,7 +41,7 @@ public interface PatternRegex {
|
||||
/**
|
||||
* 登录名只能输入3-16位的英文字母或数字
|
||||
*/
|
||||
String LOGIN_NAME_REGEX = "[a-zA-Z0-9_]{3,16}";
|
||||
String LOGIN_NAME_REGEX = "^[a-zA-Z_.]{1}[a-zA-Z0-9_.]{2,15}$";
|
||||
|
||||
/**
|
||||
* 手机号必须有11位,并且为数字,是正常的手机·号码开头
|
||||
|
||||
@@ -356,9 +356,9 @@ public interface LineFeignClient {
|
||||
|
||||
/**
|
||||
* 根据监测点名称和电网侧变电站名称模糊搜索
|
||||
* @param name
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getByName")
|
||||
HttpResult<List<LineDetail>> getByName(@RequestParam("name") String name);
|
||||
HttpResult<List<LineDetail>> getByName(@RequestBody LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<LineDetail>> getByName(String name) {
|
||||
public HttpResult<List<LineDetail>> getByName(LineBaseQueryParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据监测点名称和电网侧变电站名称模糊搜索: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -537,9 +537,9 @@ public class LineController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据监测点名称和电网侧变电站名称模糊搜索")
|
||||
@PostMapping("/getByName")
|
||||
HttpResult<List<LineDetail>> getByName(@RequestParam("name") String name){
|
||||
HttpResult<List<LineDetail>> getByName(@RequestBody LineBaseQueryParam param){
|
||||
String methodDescribe = getMethodDescribe("getByName");
|
||||
List<LineDetail> list = lineService.getByName(name);
|
||||
List<LineDetail> list = lineService.getByName(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.njcn.device.pq.pojo.dto.OverLimitLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.WarningSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
@@ -558,6 +559,6 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
|
||||
List<Line> getSubByCondition(@Param("subIds") List<String> subIds, @Param("scale") List<SimpleDTO> scale);
|
||||
|
||||
List<LineDetail> selectByName(@Param("name") String name);
|
||||
List<LineDetail> selectByName(@Param("param") LineBaseQueryParam param);
|
||||
|
||||
}
|
||||
|
||||
@@ -1751,9 +1751,15 @@
|
||||
pq_line t1 ,
|
||||
pq_line_detail t2
|
||||
<where>
|
||||
t1.id = t2.id
|
||||
<if test="name!=null and name!=''">
|
||||
AND (t1.name like CONCAT('%', #{name}, '%') or t2.Power_Substation_Name like CONCAT('%', #{name}, '%'))
|
||||
t1.id = t2.id and t2.Run_Flag=0
|
||||
<if test="param.lineIds!=null and param.lineIds.size()!=0">
|
||||
AND t1.id in
|
||||
<foreach collection="param.lineIds" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.searchValue!=null and param.searchValue!=''">
|
||||
AND (t1.name like CONCAT('%', #{param.searchValue}, '%') or t2.Power_Substation_Name like CONCAT('%', #{param.searchValue}, '%'))
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
@@ -7,10 +7,7 @@ import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.DataParam;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.PqsParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
@@ -226,5 +223,5 @@ public interface LineService extends IService<Line> {
|
||||
|
||||
List<ReportLineInfoVo> getReportLineInfo(List<String> ids);
|
||||
|
||||
List<LineDetail> getByName(String name);
|
||||
List<LineDetail> getByName(LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
} else {
|
||||
groupLine = childrenData.stream().collect(Collectors.groupingBy(LineIntegrityDataVO::getPid));
|
||||
}
|
||||
targetData = targetData.stream().peek(lineAdministrationTree -> {
|
||||
targetData.stream().peek(lineAdministrationTree -> {
|
||||
List<Double> data = new ArrayList<>();
|
||||
List<LineIntegrityDataVO> childList = new ArrayList<>();
|
||||
Set<String> pids = groupLine.keySet();
|
||||
@@ -514,7 +514,8 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
}
|
||||
//父级完整性匹配
|
||||
if (CollectionUtil.isNotEmpty(data)){
|
||||
double avg = data.stream().collect(Collectors.averagingDouble(x -> x));
|
||||
BigDecimal reduce = data.stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
double avg = reduce.divide(new BigDecimal(data.size())).doubleValue();
|
||||
lineAdministrationTree.setIntegrityData(DataStatisticsUtil.dataLimits(avg));
|
||||
} else {
|
||||
lineAdministrationTree.setIntegrityData(3.14159);
|
||||
|
||||
@@ -26,10 +26,7 @@ import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.DataParam;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.PqsParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
@@ -695,8 +692,8 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineDetail> getByName(String name) {
|
||||
return this.baseMapper.selectByName(name);
|
||||
public List<LineDetail> getByName(LineBaseQueryParam param) {
|
||||
return this.baseMapper.selectByName(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -99,6 +99,19 @@ public class EvaluationLevelVo {
|
||||
|
||||
@ApiModelProperty("闪变合格率")
|
||||
private Double plt = 3.14159;
|
||||
|
||||
@ApiModelProperty("谐波电压含有率")
|
||||
private Double uHarm = 3.14159;
|
||||
|
||||
@ApiModelProperty("谐波电流")
|
||||
private Double iHarm = 3.14159;
|
||||
|
||||
@ApiModelProperty("闪变合格率")
|
||||
private Double inuHarm = 3.14159;
|
||||
|
||||
@ApiModelProperty("负序电流")
|
||||
private Double iNeg = 3.14159;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
@@ -30,6 +31,7 @@ import com.njcn.harmonic.pojo.po.report.ReportTarget;
|
||||
import com.njcn.harmonic.pojo.vo.ReportValue;
|
||||
import com.njcn.harmonic.service.ReportService;
|
||||
import com.njcn.harmonic.utils.WordUtil2;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.ThemeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
@@ -87,7 +89,7 @@ public class ExportModelJBController extends BaseController {
|
||||
private final DeviceUnitClient deviceUnitClient;
|
||||
private final WordUtil2 wordUtil2;
|
||||
private final EventDetailFeignClient eventDetailFeignClient;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
/**
|
||||
* @param response
|
||||
* @param startTime 开始时间
|
||||
@@ -199,7 +201,7 @@ public class ExportModelJBController extends BaseController {
|
||||
}
|
||||
|
||||
String rtfPath;
|
||||
String picPath = "file/default.jpg";
|
||||
String picPath = "file/jxt.jpg";
|
||||
|
||||
Theme theme = themeFeignClient.getTheme().getData();
|
||||
if (theme.getRemark().equals("国网")) {
|
||||
@@ -262,7 +264,12 @@ public class ExportModelJBController extends BaseController {
|
||||
InputStream inStream = null;
|
||||
byte[] data = null;
|
||||
try {
|
||||
inStream = picPathResource.getInputStream();
|
||||
if(StrUtil.isNotBlank(lineDto.getWiringDiagram())){
|
||||
String wiringDiagram = lineDto.getWiringDiagram();
|
||||
inStream = fileStorageUtil.getFileStream(wiringDiagram.substring(wiringDiagram.indexOf("/")));
|
||||
}else{
|
||||
inStream = picPathResource.getInputStream();
|
||||
}
|
||||
data = new byte[inStream.available()];
|
||||
inStream.read(data);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataIDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +18,14 @@ import com.njcn.harmonic.pojo.po.day.RStatDataIDPO;
|
||||
*/
|
||||
public interface RStatDataIDMapper extends BaseMapper<RStatDataIDPO> {
|
||||
|
||||
/**
|
||||
* 获取监测点负序电流
|
||||
* @return
|
||||
*/
|
||||
List<RStatDataIDPO> getINeg(@Param("list") List<String> lineList, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 谐波电流
|
||||
*/
|
||||
List<RStatDataIDPO> getI(@Param("list") List<String> lineList, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
@@ -10,4 +13,5 @@ import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
*/
|
||||
public interface RStatDataInharmVDMapper extends BaseMapper<RStatDataInharmVDPO> {
|
||||
|
||||
List<RStatDataInharmVDPO> getV(@Param("list") List<String> lineList, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -36,4 +37,8 @@ public interface RStatDataVDMapper extends BaseMapper<RStatDataVD> {
|
||||
*/
|
||||
List<RStatDataVD> getUnbalance(@Param("list") List<String> lineList, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 获取谐波电压
|
||||
*/
|
||||
List<RStatDataVD> getV(@Param("list") List<String> lineList, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,42 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.harmonic.mapper.RStatDataIDMapper">
|
||||
|
||||
<select id="getINeg" resultType="com.njcn.harmonic.pojo.po.day.RStatDataIDPO">
|
||||
select
|
||||
`time` time,
|
||||
line_id lineId,
|
||||
avg(i_neg) iNeg
|
||||
from
|
||||
r_stat_data_i_d
|
||||
where
|
||||
`time` between #{startTime} and #{endTime}
|
||||
and phasic_type in ('A','B','C')
|
||||
and value_type = 'MAX'
|
||||
and line_id IN
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and quality_flag = 0
|
||||
group by
|
||||
`time`,line_id
|
||||
</select>
|
||||
<select id="getI" resultType="com.njcn.harmonic.pojo.po.day.RStatDataIDPO">
|
||||
select
|
||||
`time` time,
|
||||
line_id lineId,
|
||||
avg(i_neg) iNeg
|
||||
from
|
||||
r_stat_data_i_d
|
||||
where
|
||||
`time` between #{startTime} and #{endTime}
|
||||
and phasic_type in ('A','B','C')
|
||||
and value_type = 'MAX'
|
||||
and line_id IN
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and quality_flag = 0
|
||||
group by
|
||||
`time`,line_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -3,5 +3,23 @@
|
||||
<mapper namespace="com.njcn.harmonic.mapper.RStatDataInharmVDMapper">
|
||||
|
||||
|
||||
|
||||
<select id="getV" resultType="com.njcn.harmonic.pojo.po.day.RStatDataInharmVDPO">
|
||||
select
|
||||
`time` time,
|
||||
line_id lineId,
|
||||
avg(v_1) v1
|
||||
from
|
||||
r_stat_data_inharm_v_d
|
||||
where
|
||||
`time` between #{startTime} and #{endTime}
|
||||
and phasic_type in ('A','B','C')
|
||||
and value_type = 'MAX'
|
||||
and line_id IN
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and quality_flag = 0
|
||||
group by
|
||||
`time`,line_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -82,5 +82,24 @@
|
||||
group by
|
||||
`time`,line_id
|
||||
</select>
|
||||
<select id="getV" resultType="com.njcn.harmonic.pojo.po.RStatDataVD">
|
||||
select
|
||||
`time` time,
|
||||
line_id lineId,
|
||||
avg(v_1) v1
|
||||
from
|
||||
r_stat_data_v_d
|
||||
where
|
||||
`time` between #{startTime} and #{endTime}
|
||||
and phasic_type = 'T'
|
||||
and value_type = 'CP95'
|
||||
and line_id IN
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and quality_flag = 0
|
||||
group by
|
||||
`time`,line_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -16,10 +16,7 @@ import com.njcn.harmonic.pojo.param.hebeinorth.AssessParam;
|
||||
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
||||
import com.njcn.harmonic.pojo.po.PqsComasses;
|
||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatAssesDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatDataPltDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.*;
|
||||
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||
import com.njcn.harmonic.pojo.vo.hebeinorth.AssessDetailVo;
|
||||
import com.njcn.harmonic.pojo.vo.hebeinorth.AssessVo;
|
||||
@@ -34,6 +31,7 @@ import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Year;
|
||||
import java.time.YearMonth;
|
||||
@@ -62,7 +60,9 @@ public class GridServiceImpl implements IGridService {
|
||||
private final ComAssesUtil comAssesUtil;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final RStatDataVDMapper statDataVDMapper;
|
||||
private final RStatDataIDMapper statDataIDMapper;
|
||||
private final RStatDataPltDMapper statDataPltDMapper;
|
||||
private final RStatDataInharmVDMapper rStatDataInharmVDMapper;
|
||||
private final RStatLimitTargetDMapper rStatLimitTargetDMapper;
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
@@ -76,7 +76,7 @@ public class GridServiceImpl implements IGridService {
|
||||
deptGetLineParam.setLineRunFlag(0);
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取监测点集合
|
||||
Map<String,List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
Map<String, List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
List<String> lineList = lineMap.values().stream()
|
||||
.flatMap(List::stream)
|
||||
.distinct()
|
||||
@@ -85,22 +85,22 @@ public class GridServiceImpl implements IGridService {
|
||||
List<PqsComasses> comasses = new ArrayList<>();
|
||||
//获取监测点详细信息
|
||||
List<LineDetail> lineDetailList = lineFeignClient.getLineDetail(lineList).getData();
|
||||
Map<String,List<LineDetail>> lineDetailMap = lineDetailList.stream().collect(Collectors.groupingBy(LineDetail::getActualArea));
|
||||
Map<String, List<LineDetail>> lineDetailMap = lineDetailList.stream().collect(Collectors.groupingBy(LineDetail::getActualArea));
|
||||
//获取综合评估
|
||||
List<PQSComAssesPO> assesList = rStatComassesDMapper.getAvgCount(lineList,param.getStartTime(),param.getEndTime());
|
||||
List<PQSComAssesPO> assesList = rStatComassesDMapper.getAvgCount(lineList, param.getStartTime(), param.getEndTime());
|
||||
//获取部门
|
||||
List<DeptDTO> deptList = deptFeignClient.getDepSonDetailByDeptId(param.getDeptIndex()).getData();
|
||||
deptList.forEach(item->{
|
||||
deptList.forEach(item -> {
|
||||
if (lineDetailMap.containsKey(item.getArea())) {
|
||||
AssessVo assessVo = new AssessVo();
|
||||
assessVo.setName(item.getName());
|
||||
assessVo.setCode(item.getCode());
|
||||
List<String> ll = lineDetailMap.get(item.getArea()).stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||
List<PQSComAssesPO> deptAssessList = assesList.stream().filter(it->ll.contains(it.getLineId())).collect(Collectors.toList());
|
||||
List<PqsComasses> communicateList = BeanUtil.copyToList(deptAssessList,PqsComasses.class);
|
||||
if (CollUtil.isNotEmpty(communicateList)){
|
||||
List<PQSComAssesPO> deptAssessList = assesList.stream().filter(it -> ll.contains(it.getLineId())).collect(Collectors.toList());
|
||||
List<PqsComasses> communicateList = BeanUtil.copyToList(deptAssessList, PqsComasses.class);
|
||||
if (CollUtil.isNotEmpty(communicateList)) {
|
||||
float synData = comAssesUtil.getAllComAss(communicateList);
|
||||
assessVo.setScore(PubUtils.floatRound(2,synData));
|
||||
assessVo.setScore(PubUtils.floatRound(2, synData));
|
||||
assessVo.setLevel(getLevel(synData));
|
||||
comasses.addAll(communicateList);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class GridServiceImpl implements IGridService {
|
||||
//计算冀北整体
|
||||
if (CollUtil.isNotEmpty(comasses)) {
|
||||
float synData = comAssesUtil.getAllComAss(comasses);
|
||||
overview.setScore(PubUtils.floatRound(2,synData));
|
||||
overview.setScore(PubUtils.floatRound(2, synData));
|
||||
overview.setLevel(getLevel(synData));
|
||||
}
|
||||
overview.setChildren(children);
|
||||
@@ -127,30 +127,30 @@ public class GridServiceImpl implements IGridService {
|
||||
deptGetLineParam.setLineRunFlag(0);
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取监测点集合
|
||||
Map<String,List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
Map<String, List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
List<String> lineList = lineMap.values().stream()
|
||||
.flatMap(List::stream)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(lineList)){
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
//获取监测点详细信息
|
||||
List<LineDetail> lineDetailList = lineFeignClient.getLineDetail(lineList).getData();
|
||||
Map<String,List<LineDetail>> lineDetailMap = lineDetailList.stream().collect(Collectors.groupingBy(LineDetail::getActualArea));
|
||||
Map<String, List<LineDetail>> lineDetailMap = lineDetailList.stream().collect(Collectors.groupingBy(LineDetail::getActualArea));
|
||||
//获取部门
|
||||
List<DeptDTO> deptList = deptFeignClient.getDepSonDetailByDeptId(param.getDeptIndex()).getData();
|
||||
//获取所有监测点r_stat_asses_d数据
|
||||
List<RStatAssesDPO> list1 = rStatAssesDMapper.getData(param.getStartTime(),param.getEndTime(),lineList);
|
||||
List<RStatAssesDPO> list1 = rStatAssesDMapper.getData(param.getStartTime(), param.getEndTime(), lineList);
|
||||
//获取所有监测点r_stat_comasses_d数据
|
||||
List<PQSComAssesPO> list2 = rStatComassesDMapper.getAvgCount(lineList,param.getStartTime(),param.getEndTime());
|
||||
List<PQSComAssesPO> list2 = rStatComassesDMapper.getAvgCount(lineList, param.getStartTime(), param.getEndTime());
|
||||
//获取所有监测点r_stat_limit_rate_d数据
|
||||
List<RStatLimitRateDPO> list3 = rStatLimitRateDMapper.getAssessTargetRate(lineList,param.getStartTime(),param.getEndTime());
|
||||
List<RStatLimitRateDPO> list3 = rStatLimitRateDMapper.getAssessTargetRate(lineList, param.getStartTime(), param.getEndTime());
|
||||
//数据处理
|
||||
deptList.forEach(item->{
|
||||
deptList.forEach(item -> {
|
||||
if (lineDetailMap.containsKey(item.getArea())) {
|
||||
AssessVo assessVo = new AssessVo();
|
||||
assessVo.setName(item.getName());
|
||||
List<String> ll = lineDetailMap.get(item.getArea()).stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||
AssessDetailVo comAssess = getAssessData(item.getId(),item.getName(), ll, list1, list2, list3);
|
||||
AssessDetailVo comAssess = getAssessData(item.getId(), item.getName(), ll, list1, list2, list3);
|
||||
result.add(comAssess);
|
||||
}
|
||||
});
|
||||
@@ -161,74 +161,74 @@ public class GridServiceImpl implements IGridService {
|
||||
@Override
|
||||
public List<AssessVo.AssessTrendVo> getAssessTrend(AssessParam param) {
|
||||
List<AssessVo.AssessTrendVo> result = new ArrayList<>();
|
||||
LinkedHashMap<String,List<PQSComAssesPO>> map = new LinkedHashMap<>();
|
||||
LinkedHashMap<String, List<PQSComAssesPO>> map = new LinkedHashMap<>();
|
||||
//查询部门监测点关系
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||
deptGetLineParam.setLineRunFlag(0);
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取监测点集合
|
||||
Map<String,List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
Map<String, List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
List<String> lineList = lineMap.values().stream()
|
||||
.flatMap(List::stream)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(lineList)){
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
//获取监测点详细信息
|
||||
List<LineDetail> lineDetailList = lineFeignClient.getLineDetail(lineList).getData();
|
||||
Map<String,List<LineDetail>> lineDetailMap = lineDetailList.stream().collect(Collectors.groupingBy(LineDetail::getActualArea));
|
||||
Map<String, List<LineDetail>> lineDetailMap = lineDetailList.stream().collect(Collectors.groupingBy(LineDetail::getActualArea));
|
||||
//获取部门
|
||||
List<DeptDTO> deptList = deptFeignClient.getDepSonDetailByDeptId(param.getDeptIndex()).getData();
|
||||
//按月、年来展示数据
|
||||
if (Objects.equals(param.getType(),1)) {
|
||||
if (Objects.equals(param.getType(), 1)) {
|
||||
List<Integer> yearList = TimeUtil.getLastFiveYear(2);
|
||||
yearList.forEach(year->{
|
||||
yearList.forEach(year -> {
|
||||
String firstDayOfYear = TimeUtil.getYearFirst(year);
|
||||
String lastDayOfYear = TimeUtil.getYearLast(year);
|
||||
List<PQSComAssesPO> comAssesList = rStatComassesDMapper.getAvgCount(lineList,firstDayOfYear,lastDayOfYear);
|
||||
map.put(year.toString(),comAssesList);
|
||||
List<PQSComAssesPO> comAssesList = rStatComassesDMapper.getAvgCount(lineList, firstDayOfYear, lastDayOfYear);
|
||||
map.put(year.toString(), comAssesList);
|
||||
});
|
||||
} else if (Objects.equals(param.getType(),3)){
|
||||
} else if (Objects.equals(param.getType(), 3)) {
|
||||
List<YearMonth> monthList = TimeUtil.getLastThreeMonth(5);
|
||||
monthList.forEach(month->{
|
||||
monthList.forEach(month -> {
|
||||
String firstDayOfMonth = month.atDay(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
String lastDayOfMonth = month.atEndOfMonth().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
List<PQSComAssesPO> comAssesList = rStatComassesDMapper.getAvgCount(lineList,firstDayOfMonth,lastDayOfMonth);
|
||||
map.put(month.toString(),comAssesList);
|
||||
String lastDayOfMonth = month.atEndOfMonth().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
List<PQSComAssesPO> comAssesList = rStatComassesDMapper.getAvgCount(lineList, firstDayOfMonth, lastDayOfMonth);
|
||||
map.put(month.toString(), comAssesList);
|
||||
});
|
||||
}
|
||||
//数据处理
|
||||
if (param.getAreaType() == 0) {
|
||||
AssessVo.AssessTrendVo vo = new AssessVo.AssessTrendVo();
|
||||
AssessVo.AssessTrendVo vo = new AssessVo.AssessTrendVo();
|
||||
vo.setDeptId(param.getDeptIndex());
|
||||
vo.setDeptName("冀北");
|
||||
List<AssessVo> children = new ArrayList<>();
|
||||
map.forEach((k1,v1)->{
|
||||
map.forEach((k1, v1) -> {
|
||||
AssessVo assessVo = new AssessVo();
|
||||
assessVo.setDataTime(k1);
|
||||
List<PqsComasses> communicateList = BeanUtil.copyToList(v1,PqsComasses.class);
|
||||
List<PqsComasses> communicateList = BeanUtil.copyToList(v1, PqsComasses.class);
|
||||
float synData = comAssesUtil.getAllComAss(communicateList);
|
||||
assessVo.setScore(CollUtil.isEmpty(communicateList)?3.14159f:PubUtils.floatRound(2,synData));
|
||||
assessVo.setScore(CollUtil.isEmpty(communicateList) ? 3.14159f : PubUtils.floatRound(2, synData));
|
||||
assessVo.setLevel(getLevel(assessVo.getScore()));
|
||||
children.add(assessVo);
|
||||
});
|
||||
vo.setChildren(children);
|
||||
result.add(vo);
|
||||
} else {
|
||||
deptList.forEach(item->{
|
||||
deptList.forEach(item -> {
|
||||
if (lineDetailMap.containsKey(item.getArea())) {
|
||||
AssessVo.AssessTrendVo vo = new AssessVo.AssessTrendVo();
|
||||
AssessVo.AssessTrendVo vo = new AssessVo.AssessTrendVo();
|
||||
vo.setDeptId(item.getId());
|
||||
vo.setDeptName(item.getName());
|
||||
List<AssessVo> children = new ArrayList<>();
|
||||
List<String> ll = lineDetailMap.get(item.getArea()).stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||
map.forEach((k1,v1)->{
|
||||
map.forEach((k1, v1) -> {
|
||||
AssessVo assessVo = new AssessVo();
|
||||
assessVo.setDataTime(k1);
|
||||
List<PQSComAssesPO> poList = v1.stream().filter(it->ll.contains(it.getLineId())).collect(Collectors.toList());
|
||||
List<PqsComasses> communicateList = BeanUtil.copyToList(poList,PqsComasses.class);
|
||||
List<PQSComAssesPO> poList = v1.stream().filter(it -> ll.contains(it.getLineId())).collect(Collectors.toList());
|
||||
List<PqsComasses> communicateList = BeanUtil.copyToList(poList, PqsComasses.class);
|
||||
float synData = comAssesUtil.getAllComAss(communicateList);
|
||||
assessVo.setScore(CollUtil.isEmpty(communicateList)?3.14159f:PubUtils.floatRound(2,synData));
|
||||
assessVo.setScore(CollUtil.isEmpty(communicateList) ? 3.14159f : PubUtils.floatRound(2, synData));
|
||||
assessVo.setLevel(getLevel(assessVo.getScore()));
|
||||
children.add(assessVo);
|
||||
});
|
||||
@@ -247,16 +247,16 @@ public class GridServiceImpl implements IGridService {
|
||||
vo.setDeptId(lineId);
|
||||
List<String> lineList = Collections.singletonList(lineId);
|
||||
//获取监测点r_stat_asses_d数据 各指标评估
|
||||
List<RStatAssesDPO> list1 = rStatAssesDMapper.getData(startTime,endTime,lineList);
|
||||
List<RStatAssesDPO> list1 = rStatAssesDMapper.getData(startTime, endTime, lineList);
|
||||
//获取监测点r_stat_comasses_d数据 综合评估
|
||||
List<PQSComAssesPO> list2 = rStatComassesDMapper.getAvgCount(lineList,startTime,endTime);
|
||||
List<PQSComAssesPO> list2 = rStatComassesDMapper.getAvgCount(lineList, startTime, endTime);
|
||||
if (CollUtil.isNotEmpty(list1)) {
|
||||
this.chanelTargetAssess(list1,vo);
|
||||
this.chanelTargetAssess(list1, vo);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(list2)) {
|
||||
List<PqsComasses> communicateList = BeanUtil.copyToList(list2,PqsComasses.class);
|
||||
List<PqsComasses> communicateList = BeanUtil.copyToList(list2, PqsComasses.class);
|
||||
float synData = comAssesUtil.getAllComAss(communicateList);
|
||||
vo.setAssessData(PubUtils.floatRound(2,synData));
|
||||
vo.setAssessData(PubUtils.floatRound(2, synData));
|
||||
vo.setAssessLevel(getLevel(synData));
|
||||
}
|
||||
return vo;
|
||||
@@ -271,26 +271,26 @@ public class GridServiceImpl implements IGridService {
|
||||
deptGetLineParam.setLineRunFlag(0);
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取监测点集合
|
||||
Map<String,List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
Map<String, List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
List<String> lineList = lineMap.values().stream()
|
||||
.flatMap(List::stream)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
//获取监测点所有指标数据
|
||||
List<RStatLimitRateDPO> limitRateList = rStatLimitRateDMapper.getAssessTargetRate(lineList,param.getStartTime(),param.getEndTime());
|
||||
List<RStatLimitRateDPO> limitRateList = rStatLimitRateDMapper.getAssessTargetRate(lineList, param.getStartTime(), param.getEndTime());
|
||||
//获取部门
|
||||
List<DeptDTO> deptList = deptFeignClient.getDepSonDetailByDeptId(param.getDeptIndex()).getData();
|
||||
deptList.forEach(item->{
|
||||
deptList.forEach(item -> {
|
||||
if (lineMap.containsKey(item.getId())) {
|
||||
EvaluationVo.Children children = new EvaluationVo.Children();
|
||||
children.setDeptId(item.getId());
|
||||
children.setDeptName(item.getName());
|
||||
List<String> ll = lineMap.get(item.getId());
|
||||
if (CollUtil.isNotEmpty(limitRateList)) {
|
||||
List<RStatLimitRateDPO> l1 = limitRateList.stream().filter(it->ll.contains(it.getLineId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(l1)){
|
||||
this.getDataByTarget(param.getHarmonicType(),l1,children);
|
||||
List<RStatLimitRateDPO> l1 = limitRateList.stream().filter(it -> ll.contains(it.getLineId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(l1)) {
|
||||
this.getDataByTarget(param.getHarmonicType(), l1, children);
|
||||
}
|
||||
}
|
||||
childrenList.add(children);
|
||||
@@ -319,7 +319,7 @@ public class GridServiceImpl implements IGridService {
|
||||
deptGetLineParam.setLineRunFlag(0);
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取监测点集合
|
||||
Map<String,List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), param.getVoltageLevel());
|
||||
Map<String, List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), param.getVoltageLevel());
|
||||
List<String> lineList = lineMap.values().stream()
|
||||
.flatMap(List::stream)
|
||||
.distinct()
|
||||
@@ -384,7 +384,7 @@ public class GridServiceImpl implements IGridService {
|
||||
deptGetLineParam.setLineRunFlag(0);
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取监测点集合
|
||||
Map<String,List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
Map<String, List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), null);
|
||||
List<String> lineList = lineMap.values().stream()
|
||||
.flatMap(List::stream)
|
||||
.distinct()
|
||||
@@ -394,32 +394,84 @@ public class GridServiceImpl implements IGridService {
|
||||
// 获取当前年份
|
||||
int currentYear = currentDate.getYear();
|
||||
LocalDate beginDay = LocalDate.of(currentYear, 1, 1);
|
||||
List<YearMonth> monthList = TimeUtil.getMonthsBetween(beginDay,currentDate);
|
||||
List<YearMonth> monthList = TimeUtil.getMonthsBetween(beginDay, currentDate);
|
||||
for (YearMonth month : monthList) {
|
||||
String firstDayOfMonth = month.atDay(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
String lastDayOfMonth = month.atEndOfMonth().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
String lastDayOfMonth = month.atEndOfMonth().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
EvaluationLevelVo.EvaluationRatio vo = new EvaluationLevelVo.EvaluationRatio();
|
||||
vo.setTime(month.toString());
|
||||
vo.setTargetList(Arrays.asList(DicDataEnum.FREQUENCY_DEV.getName(),DicDataEnum.VOLTAGE_DEV.getName(),DicDataEnum.THD_V.getName(),DicDataEnum.phase_Voltage.getName(),DicDataEnum.FLICKER.getName()));
|
||||
vo.setTargetList(Arrays.asList(DicDataEnum.FREQUENCY_DEV.getName(),
|
||||
DicDataEnum.VOLTAGE_DEV.getName(),
|
||||
DicDataEnum.THD_V.getName(),
|
||||
DicDataEnum.phase_Voltage.getName(),
|
||||
DicDataEnum.FLICKER.getName(),
|
||||
|
||||
DicDataEnum.HARMONIC_VOLTAGE.getName(),
|
||||
DicDataEnum.HARMONIC_CURRENT.getName(),
|
||||
DicDataEnum.INTERHARMONIC_VOLTAGE.getName(),
|
||||
DicDataEnum.NEG_CURRENT.getName()
|
||||
|
||||
));
|
||||
//获取监测点越限集合
|
||||
List<RStatLimitRateDPO> overLimitList = rStatLimitRateDMapper.getAssessTargetRate(lineList,firstDayOfMonth,lastDayOfMonth);
|
||||
List<RStatLimitRateDPO> overLimitList = rStatLimitRateDMapper.getAssessTargetRate(lineList, firstDayOfMonth, lastDayOfMonth);
|
||||
if (CollUtil.isNotEmpty(overLimitList)) {
|
||||
long freqDev = overLimitList.stream().filter(obj -> obj.getFreqDevOvertime() > 0).count();
|
||||
long vDev = overLimitList.stream().filter(obj -> obj.getVoltageDevOvertime() > 0).count();
|
||||
long vThd = overLimitList.stream().filter(obj -> obj.getUaberranceOvertime() > 0).count();
|
||||
long ubalance = overLimitList.stream().filter(obj -> obj.getUbalanceOvertime() > 0).count();
|
||||
long plt = overLimitList.stream().filter(obj -> obj.getFlickerOvertime() > 0).count();
|
||||
vo.setRatioList(Arrays.asList(PubUtils.doubleRound(2,freqDev*100.0/overLimitList.size())
|
||||
,PubUtils.doubleRound(2,vDev*100.0/overLimitList.size())
|
||||
,PubUtils.doubleRound(2,vThd*100.0/overLimitList.size())
|
||||
,PubUtils.doubleRound(2,ubalance*100.0/overLimitList.size())
|
||||
,PubUtils.doubleRound(2,plt*100.0/overLimitList.size())));
|
||||
|
||||
|
||||
long uHarm = overLimitList.stream().filter(x->getLimitRateStats(x,2,26,"uharm","Overtime")).count();
|
||||
long iHarm = overLimitList.stream().filter(x->getLimitRateStats(x,2,26,"iharm","Overtime")).count();
|
||||
long inuHarm = overLimitList.stream().filter(x->getLimitRateStats(x,1,16,"inuharm","Overtime")).count();
|
||||
long iNeg = overLimitList.stream().filter(obj -> obj.getINegOvertime() > 0).count();
|
||||
vo.setRatioList(Arrays.asList(PubUtils.doubleRound(2, freqDev * 100.0 / overLimitList.size()),
|
||||
PubUtils.doubleRound(2, vDev * 100.0 / overLimitList.size()),
|
||||
PubUtils.doubleRound(2, vThd * 100.0 / overLimitList.size()),
|
||||
PubUtils.doubleRound(2, ubalance * 100.0 / overLimitList.size()),
|
||||
PubUtils.doubleRound(2, plt * 100.0 / overLimitList.size()),
|
||||
|
||||
PubUtils.doubleRound(2, uHarm * 100.0 / overLimitList.size()),
|
||||
PubUtils.doubleRound(2, iHarm * 100.0 / overLimitList.size()),
|
||||
PubUtils.doubleRound(2, inuHarm * 100.0 / overLimitList.size()),
|
||||
PubUtils.doubleRound(2, iNeg * 100.0 / overLimitList.size())));
|
||||
}
|
||||
result.add(vo);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param limitRateDPO 对象
|
||||
* @param startNum 循环开始
|
||||
* @param endNum 循环结束
|
||||
* @param start 属性名开始
|
||||
* @param end 属性名结束
|
||||
* @return
|
||||
*/
|
||||
public Boolean getLimitRateStats(RStatLimitRateDPO limitRateDPO,Integer startNum,Integer endNum,String start,String end){
|
||||
try {
|
||||
for (int i = startNum; i < endNum; i++) {
|
||||
String fieldName = start+i+end;
|
||||
Field field = limitRateDPO.getClass().getDeclaredField(fieldName);
|
||||
//设置对象的访问权限,保证对private的属性的访问
|
||||
field.setAccessible(true);
|
||||
int v = Integer.parseInt(field.get(field).toString());
|
||||
if(v>0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<EvaluationLevelVo.EvaluationDetail> getEvaluationDetail(AssessParam param) {
|
||||
List<EvaluationLevelVo.EvaluationDetail> result = new ArrayList<>();
|
||||
@@ -558,15 +610,7 @@ public class GridServiceImpl implements IGridService {
|
||||
if (map.containsKey(item.getId())) {
|
||||
RStatLimitRateDPO item2 = map.get(item.getId());
|
||||
if (!Objects.isNull(item2) && item2.getAllTime() > 0) {
|
||||
if (item2.getAllTime() > 0) {
|
||||
qualifiedDetail.setFreqDev(PubUtils.doubleRound(2,100.0-(item2.getFreqDevOvertime()*100.0/item2.getAllTime())));
|
||||
qualifiedDetail.setVDev(PubUtils.doubleRound(2,100.0-(item2.getVoltageDevOvertime()*100.0/item2.getAllTime())));
|
||||
qualifiedDetail.setVThd(PubUtils.doubleRound(2,100.0-(item2.getUaberranceOvertime()*100.0/item2.getAllTime())));
|
||||
qualifiedDetail.setUbalance(PubUtils.doubleRound(2,100.0-(item2.getUbalanceOvertime()*100.0/item2.getAllTime())));
|
||||
}
|
||||
if (item2.getFlickerAllTime() > 0) {
|
||||
qualifiedDetail.setPlt(PubUtils.doubleRound(2,100.0-(item2.getFlickerOvertime()*100.0/item2.getFlickerAllTime())));
|
||||
}
|
||||
addQualifiedDetail(qualifiedDetail, item2);
|
||||
}
|
||||
}
|
||||
result.add(qualifiedDetail);
|
||||
@@ -579,6 +623,7 @@ public class GridServiceImpl implements IGridService {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EvaluationLevelVo.QualifiedDetail getLineQualifiedDetail(String lineId, String startTime, String endTime) {
|
||||
EvaluationLevelVo.QualifiedDetail detail = new EvaluationLevelVo.QualifiedDetail();
|
||||
@@ -586,19 +631,86 @@ public class GridServiceImpl implements IGridService {
|
||||
List<RStatLimitRateDPO> overLimitList = rStatLimitRateDMapper.getAssessTargetRate(lineList,startTime,endTime);
|
||||
if (CollUtil.isNotEmpty(overLimitList)) {
|
||||
RStatLimitRateDPO dpo = overLimitList.get(0);
|
||||
if (dpo.getAllTime() > 0) {
|
||||
detail.setFreqDev(PubUtils.doubleRound(2,100.0-(dpo.getFreqDevOvertime()*100.0/dpo.getAllTime())));
|
||||
detail.setVDev(PubUtils.doubleRound(2,100.0-(dpo.getVoltageDevOvertime()*100.0/dpo.getAllTime())));
|
||||
detail.setVThd(PubUtils.doubleRound(2,100.0-(dpo.getUaberranceOvertime()*100.0/dpo.getAllTime())));
|
||||
detail.setUbalance(PubUtils.doubleRound(2,100.0-(dpo.getUbalanceOvertime()*100.0/dpo.getAllTime())));
|
||||
}
|
||||
if (dpo.getFlickerAllTime() > 0) {
|
||||
detail.setPlt(PubUtils.doubleRound(2,100.0-(dpo.getFlickerOvertime()*100.0/dpo.getFlickerAllTime())));
|
||||
}
|
||||
addQualifiedDetail(detail, dpo);
|
||||
}
|
||||
return detail;
|
||||
}
|
||||
|
||||
private void addQualifiedDetail(EvaluationLevelVo.QualifiedDetail qualifiedDetail, RStatLimitRateDPO item2) {
|
||||
if (item2.getAllTime() > 0) {
|
||||
qualifiedDetail.setFreqDev(PubUtils.doubleRound(2, 100.0 - (item2.getFreqDevOvertime() * 100.0 / item2.getAllTime())));
|
||||
qualifiedDetail.setVDev(PubUtils.doubleRound(2, 100.0 - (item2.getVoltageDevOvertime() * 100.0 / item2.getAllTime())));
|
||||
qualifiedDetail.setVThd(PubUtils.doubleRound(2, 100.0 - (item2.getUaberranceOvertime() * 100.0 / item2.getAllTime())));
|
||||
qualifiedDetail.setUbalance(PubUtils.doubleRound(2, 100.0 - (item2.getUbalanceOvertime() * 100.0 / item2.getAllTime())));
|
||||
qualifiedDetail.setUHarm(PubUtils.doubleRound(2, 100.0 - ((item2.getUharm2Overtime() +
|
||||
item2.getUharm3Overtime() +
|
||||
item2.getUharm4Overtime() +
|
||||
item2.getUharm5Overtime() +
|
||||
item2.getUharm6Overtime() +
|
||||
item2.getUharm7Overtime() +
|
||||
item2.getUharm8Overtime() +
|
||||
item2.getUharm9Overtime() +
|
||||
item2.getUharm10Overtime() +
|
||||
item2.getUharm11Overtime() +
|
||||
item2.getUharm12Overtime() +
|
||||
item2.getUharm13Overtime() +
|
||||
item2.getUharm14Overtime() +
|
||||
item2.getUharm15Overtime() +
|
||||
item2.getUharm16Overtime() +
|
||||
item2.getUharm17Overtime() +
|
||||
item2.getUharm18Overtime() +
|
||||
item2.getUharm19Overtime() +
|
||||
item2.getUharm20Overtime() +
|
||||
item2.getUharm21Overtime() +
|
||||
item2.getUharm22Overtime() +
|
||||
item2.getUharm23Overtime() +
|
||||
item2.getUharm24Overtime() +
|
||||
item2.getUharm25Overtime()) * 100.0 / item2.getAllTime())));
|
||||
qualifiedDetail.setIHarm(PubUtils.doubleRound(2, 100.0 - ((item2.getIharm2Overtime() +
|
||||
item2.getIharm4Overtime() +
|
||||
item2.getIharm5Overtime() +
|
||||
item2.getIharm6Overtime() +
|
||||
item2.getIharm7Overtime() +
|
||||
item2.getIharm8Overtime() +
|
||||
item2.getIharm9Overtime() +
|
||||
item2.getIharm10Overtime() +
|
||||
item2.getIharm11Overtime() +
|
||||
item2.getIharm12Overtime() +
|
||||
item2.getIharm13Overtime() +
|
||||
item2.getIharm14Overtime() +
|
||||
item2.getIharm15Overtime() +
|
||||
item2.getIharm16Overtime() +
|
||||
item2.getIharm17Overtime() +
|
||||
item2.getIharm18Overtime() +
|
||||
item2.getIharm19Overtime() +
|
||||
item2.getIharm20Overtime() +
|
||||
item2.getIharm21Overtime() +
|
||||
item2.getIharm22Overtime() +
|
||||
item2.getIharm23Overtime() +
|
||||
item2.getIharm24Overtime() +
|
||||
item2.getIharm25Overtime()) * 100.0 / item2.getAllTime())));
|
||||
qualifiedDetail.setInuHarm(PubUtils.doubleRound(2, 100.0 - ((item2.getInuharm1Overtime() +
|
||||
item2.getInuharm2Overtime() +
|
||||
item2.getInuharm3Overtime() +
|
||||
item2.getInuharm4Overtime() +
|
||||
item2.getInuharm5Overtime() +
|
||||
item2.getInuharm6Overtime() +
|
||||
item2.getInuharm7Overtime() +
|
||||
item2.getInuharm8Overtime() +
|
||||
item2.getInuharm9Overtime() +
|
||||
item2.getInuharm10Overtime() +
|
||||
item2.getInuharm11Overtime() +
|
||||
item2.getInuharm12Overtime() +
|
||||
item2.getInuharm13Overtime() +
|
||||
item2.getInuharm14Overtime() +
|
||||
item2.getInuharm15Overtime() +
|
||||
item2.getInuharm16Overtime()) * 100.0 / item2.getAllTime())));
|
||||
qualifiedDetail.setINeg(PubUtils.doubleRound(2, 100.0 - (item2.getINegOvertime() * 100.0 / item2.getAllTime())));
|
||||
}
|
||||
if (item2.getFlickerAllTime() > 0) {
|
||||
qualifiedDetail.setPlt(PubUtils.doubleRound(2, 100.0 - (item2.getFlickerOvertime() * 100.0 / item2.getFlickerAllTime())));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取监测点频率偏差 T相最大值
|
||||
*/
|
||||
@@ -634,6 +746,34 @@ public class GridServiceImpl implements IGridService {
|
||||
return statDataVDMapper.getUnbalance(lineList,startTime,endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 谐波电压含有率 A、B、C三相最大值的平均值
|
||||
*/
|
||||
private List<RStatDataVD> getList6(List<String> lineList, String startTime, String endTime) {
|
||||
return statDataVDMapper.getV(lineList,startTime,endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 谐波电流 A、B、C三相最大值的平均值
|
||||
*/
|
||||
private List<RStatDataIDPO> getList7(List<String> lineList, String startTime, String endTime) {
|
||||
return statDataIDMapper.getI(lineList,startTime,endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 间谐波电压含有率 A、B、C三相最大值的平均值
|
||||
*/
|
||||
private List<RStatDataInharmVDPO> getList8(List<String> lineList, String startTime, String endTime) {
|
||||
return rStatDataInharmVDMapper.getV(lineList,startTime,endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取监测点负序电流 A、B、C三相最大值的平均值
|
||||
*/
|
||||
public List<RStatDataIDPO> getList9(List<String> lineList, String startTime, String endTime) {
|
||||
return statDataIDMapper.getINeg(lineList,startTime,endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算标准差
|
||||
*/
|
||||
@@ -691,6 +831,34 @@ public class GridServiceImpl implements IGridService {
|
||||
.collect(Collectors.toList());
|
||||
children.setRatio(PubUtils.doubleRound(2,filteredList5.size()*100.0/limitRateList.size()));
|
||||
break;
|
||||
//谐波电压
|
||||
case 6:
|
||||
List<RStatLimitRateDPO> filteredList6 = limitRateList.stream()
|
||||
.filter(x->getLimitRateStats(x,2,26,"uharm","Overtime"))
|
||||
.collect(Collectors.toList());
|
||||
children.setRatio(PubUtils.doubleRound(2,filteredList6.size()*100.0/limitRateList.size()));
|
||||
break;
|
||||
//谐波电流
|
||||
case 7:
|
||||
List<RStatLimitRateDPO> filteredList7 = limitRateList.stream()
|
||||
.filter(x->getLimitRateStats(x,2,26,"iharm","Overtime"))
|
||||
.collect(Collectors.toList());
|
||||
children.setRatio(PubUtils.doubleRound(2,filteredList7.size()*100.0/limitRateList.size()));
|
||||
break;
|
||||
//间谐波电压
|
||||
case 8:
|
||||
List<RStatLimitRateDPO> filteredList8 = limitRateList.stream()
|
||||
.filter(x->getLimitRateStats(x,1,16,"inuharm","Overtime"))
|
||||
.collect(Collectors.toList());
|
||||
children.setRatio(PubUtils.doubleRound(2,filteredList8.size()*100.0/limitRateList.size()));
|
||||
break;
|
||||
//负序电流
|
||||
case 9:
|
||||
List<RStatLimitRateDPO> filteredList9 = limitRateList.stream()
|
||||
.filter(data -> data.getINegOvertime() > 0)
|
||||
.collect(Collectors.toList());
|
||||
children.setRatio(PubUtils.doubleRound(2,filteredList9.size()*100.0/limitRateList.size()));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.api.SubstationFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.GridDiagramParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||
import com.njcn.harmonic.constant.Param;
|
||||
@@ -825,7 +826,10 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
||||
Map<String, String> lineOrgName = lineNameList.stream().collect(Collectors.toMap(LineDevGetDTO::getPointId, LineDevGetDTO::getUnitName));
|
||||
|
||||
//获取监测点集合
|
||||
List<LineDetail> data = lineFeignClient.getByName(searchValue).getData();
|
||||
LineBaseQueryParam param=new LineBaseQueryParam();
|
||||
param.setLineIds(new ArrayList<>(lineOrgName.keySet()));
|
||||
param.setSearchValue(searchValue);
|
||||
List<LineDetail> data = lineFeignClient.getByName(param).getData();
|
||||
List<String> lineList = data.stream().map(LineDetail::getId).distinct().collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
//获取监测点的超标数据
|
||||
@@ -862,9 +866,11 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
||||
}
|
||||
});
|
||||
vo.setAlarmFreq(NumberUtil.round(alarmTime.get() * 1.0 / value.size(), 2).doubleValue());
|
||||
OptionalDouble maxV = harmonicV.stream().filter(x -> value.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
||||
//监测点id集合
|
||||
List<String> ids = value.stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||
OptionalDouble maxV = harmonicV.stream().filter(x -> ids.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
||||
vo.setVPollutionData(maxV.isPresent() ? maxV.getAsDouble() : 0.0D);
|
||||
OptionalDouble maxI = harmonicI.stream().filter(x -> value.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
||||
OptionalDouble maxI = harmonicI.stream().filter(x -> ids.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
||||
vo.setIPollutionData(maxI.isPresent() ? maxV.getAsDouble() : 0.0D);
|
||||
result.add(vo);
|
||||
});
|
||||
|
||||
@@ -292,7 +292,7 @@ public class RStatLimitServiceImpl implements RStatLimitService {
|
||||
//数据完整性≥90% - <90%
|
||||
GridDiagramVO.RunData integrityData=new GridDiagramVO.RunData();
|
||||
List<String> integrityDS90 = integrityDS.stream().filter(x -> 0.9 <= x.getIntegrityData()).map(RStatIntegrityD::getLineIndex).collect(Collectors.toList());
|
||||
List<String> integrity = line.stream().filter(x -> !integrityDS90.contains(x)).distinct().collect(Collectors.toList());
|
||||
List<String> integrity = online.stream().filter(x -> !integrityDS90.contains(x)).distinct().collect(Collectors.toList());
|
||||
integrityData.setLineNumOne(integrityDS90.size());
|
||||
integrityData.setLineListOne(integrityDS90);
|
||||
integrityData.setLineNumTwo(integrity.size());
|
||||
@@ -302,7 +302,7 @@ public class RStatLimitServiceImpl implements RStatLimitService {
|
||||
|
||||
//电能质量指标未超标-超标
|
||||
GridDiagramVO.RunData targetData=new GridDiagramVO.RunData();
|
||||
List<String> integrityS = line.stream().filter(x -> !linesTarget.contains(x)).distinct().collect(Collectors.toList());
|
||||
List<String> integrityS = online.stream().filter(x -> !linesTarget.contains(x)).distinct().collect(Collectors.toList());
|
||||
targetData.setLineNumOne(integrityS.size());
|
||||
targetData.setLineListOne(integrityS);
|
||||
targetData.setLineNumTwo(linesTarget.size());
|
||||
|
||||
BIN
pqs-harmonic/harmonic-boot/src/main/resources/file/jxt.jpg
Normal file
BIN
pqs-harmonic/harmonic-boot/src/main/resources/file/jxt.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
Reference in New Issue
Block a user