稳态综合评估
This commit is contained in:
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
@@ -14,27 +15,21 @@ import java.io.Serializable;
|
||||
public class ComAssessVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
/**
|
||||
* data
|
||||
*/
|
||||
|
||||
@ApiModelProperty("评估分值")
|
||||
private Float data =3.14159f;
|
||||
/**
|
||||
* level
|
||||
*/
|
||||
|
||||
@ApiModelProperty("评估等级")
|
||||
private String level ="暂无数据";
|
||||
/**
|
||||
* monitors
|
||||
*/
|
||||
|
||||
@ApiModelProperty("监测点数量")
|
||||
private Integer monitors;
|
||||
|
||||
@ApiModelProperty("子集")
|
||||
private List<ComAssessVO> children;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ import org.springframework.util.CollectionUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: chenchao
|
||||
@@ -38,8 +40,10 @@ public class ComAssessServiceImpl implements ComAssessService {
|
||||
public List<ComAssessVO> getComAccessData(DeviceInfoParam.BusinessParam comAccessParam) {
|
||||
List<ComAssessVO> comAssessVOList = new ArrayList<>();
|
||||
List<ComAssessDTO> comAssessDTOS = new ArrayList<>();
|
||||
//按照条件获取实际运行终端综合信息
|
||||
//按部门分类的实际运行终端综合信息
|
||||
List<GeneralDeviceDTO> deviceDataList = generalDeviceInfoClient.getPracticalRunDeviceInfo(comAccessParam).getData();
|
||||
//按变电站分类的实际运行终端综合信息
|
||||
List<GeneralDeviceDTO> subDataList = generalDeviceInfoClient.getPracticalRunDeviceInfoAsSubstation(comAccessParam).getData();
|
||||
if (!CollectionUtils.isEmpty(deviceDataList)) {
|
||||
for (GeneralDeviceDTO generalDeviceDTO: deviceDataList){
|
||||
List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
||||
@@ -56,10 +60,38 @@ public class ComAssessServiceImpl implements ComAssessService {
|
||||
comAssessVO.setLevel(lv);
|
||||
}
|
||||
}
|
||||
List<ComAssessVO> children = new ArrayList<>();
|
||||
List<ComAssessDTO> childrenDTOS = new ArrayList<>();
|
||||
|
||||
List<GeneralDeviceDTO> tempList = new ArrayList<>();
|
||||
List<String> subIndexes = generalDeviceDTO.getSubIndexes();
|
||||
if (!CollectionUtils.isEmpty(subIndexes)) {
|
||||
for (String s: subIndexes) {
|
||||
GeneralDeviceDTO subData = subDataList.stream().filter(item -> item.getIndex().equals(s)).collect(Collectors.toList()).get(0);
|
||||
tempList.add(subData);
|
||||
}
|
||||
for (GeneralDeviceDTO generalSubDTO: tempList){
|
||||
List<String> lines = generalSubDTO.getLineIndexes();
|
||||
ComAssessVO assessVO = new ComAssessVO();
|
||||
assessVO.setName(generalSubDTO.getName());
|
||||
assessVO.setMonitors(lines.size());
|
||||
if (!CollectionUtils.isEmpty(lines)) {
|
||||
List<PQSComAssesPO> pqsComAssesPOS = getComAccessData(lines, comAccessParam.getSearchBeginTime(), comAccessParam.getSearchEndTime());
|
||||
if (!CollectionUtils.isEmpty(pqsComAssesPOS)) {
|
||||
setResults(pqsComAssesPOS,childrenDTOS);
|
||||
float allComAss = comAssesUtil.getAllComAss(childrenDTOS);
|
||||
String lv = getLevel(allComAss);
|
||||
assessVO.setData(allComAss);
|
||||
assessVO.setLevel(lv);
|
||||
}
|
||||
}
|
||||
children.add(assessVO);
|
||||
comAssessVO.setChildren(children);
|
||||
}
|
||||
}
|
||||
comAssessVOList.add(comAssessVO);
|
||||
}
|
||||
}
|
||||
|
||||
return comAssessVOList;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user