This commit is contained in:
cdf
2023-04-11 16:18:14 +08:00
parent eb8daa6f8f
commit 3af30403b7
2 changed files with 41 additions and 72 deletions

View File

@@ -17,6 +17,7 @@ public interface THDistortionService {
/**
* 功能描述: 获取谐波总畸变率
*
* @param thDistortionParam
* @return
*/
@@ -25,10 +26,12 @@ public interface THDistortionService {
/**
* 功能描述: 获取总畸变率图表
*
* @param thDistortionCensusParam
* @return
*/
THDistortionCensusVO getTHDistortionCensus(DeviceInfoParam.BusinessParam thDistortionCensusParam);
/**
* @Description: 谐波总畸变率前topNum列表
* @Param: [statisticsBizBaseParam]

View File

@@ -57,6 +57,7 @@ public class THDistortionServiceImpl implements THDistortionService {
private final RMpVThdMapper rMpVThdMapper;
private final LineFeignClient lineFeignClient;
private final IRStatDataVDService statDataVDService;
@Override
public List<THDistortionVO> getTHDistortionData(DeviceInfoParam.BusinessParam thDistortionParam) {
List<THDistortionVO> thDistortionVOS = new ArrayList<>();
@@ -174,6 +175,7 @@ public class THDistortionServiceImpl implements THDistortionService {
private List<THDistortionVO> getChildCategoryList(THDistortionVO item, List<THDistortionVO> child) {
return child.stream().filter(allItem -> allItem.getPid().equals(item.getId())).collect(Collectors.toList());
}
private void setChildesList(List<THDistortionVO> item, List<THDistortionVO> childes) {
//groupLine变电站索引和监测点集合
Map<String, List<THDistortionVO>> groupLine;
@@ -227,6 +229,7 @@ public class THDistortionServiceImpl implements THDistortionService {
/**
* influxDB查询畸变率
*
* @param lineIndexes
* @param startTime
* @param endTime
@@ -260,43 +263,6 @@ public class THDistortionServiceImpl implements THDistortionService {
}
}
return publicDTOList;
//组装sql语句
// StringBuilder string = new StringBuilder();
// string.append(Param.QualityFlag + "='1' and (" + Param.PHASIC_TYPE + "='" + Param.PHASIC_TYPEA + "' or " + Param.PHASIC_TYPE + "='" + Param.PHASIC_TYPEB + "' or " + Param.PHASIC_TYPE + "='" + Param.PHASIC_TYPEC + "') and "+ Param.VALUETYPE + "='AVG' and ");
// StringBuilder timeId = new StringBuilder();
// timeId.append(Param.TIME + " >= '" + startTime + Param.START_TIME + "' and " + Param.TIME + " <= '" + endTime + Param.END_TIME + "' and (");
// for (int i = 0; i < lineIndexes.size(); i++) {
// if (lineIndexes.size() - i != 1) {
// timeId.append(Param.LINE_ID + "='").append(lineIndexes.get(i)).append("' or ");
// } else {
// timeId.append(Param.LINE_ID + "='").append(lineIndexes.get(i)).append("')");
// }
// }
// // String a = "SELECT MEAN(V_THD) AS distortion FROM Data_V WHERE QualityFlag='1' and (phasic_type='A' or phasic_type='B' or phasic_type='C')and value_type='AVG' and time >= '2022-03-20 00:00:00' and time <= '2022-03-21 23:59:59' and (lineid ='1e3b8531483b2a8cbee6747f1f641cf9') group by lineid;";
// //sql语句
// String sql = "SELECT MEAN(" + Param.V_THD + ")*100 AS distortion FROM Data_V WHERE " + string + timeId + " group by " + Param.LINE_ID;
// //结果集
// QueryResult result = influxDbUtils.query(sql);
// //处理结果集
// List<QueryResult.Series> list = result.getResults().get(0).getSeries();
// if (!CollectionUtils.isEmpty(list)){
// list.forEach(po->{
// PublicDTO publicDTO = new PublicDTO();
// List<List<Object>> valueList = po.getValues();
// String index = po.getTags().get(Param.LINE_ID);
// if (!CollectionUtils.isEmpty(valueList)){
// for (List<Object> value : valueList) {
// //谐波畸变率 保留两位小数
// Double distortion = value.get(1) == null ? null : BigDecimal.valueOf(Double.parseDouble(value.get(1).toString())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
// publicDTO.setId(index);
// publicDTO.setData(distortion);
// }
// }
// publicDTOList.add(publicDTO);
// });
// }
// return publicDTOList;
}