|
|
@@ -1,10 +1,15 @@
|
|
|
package com.hdkj.lt.bf.application;
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.hdkj.fhzg.optimization.response.FeederMetricsResponse;
|
|
|
import com.hdkj.fhzg.optimization.response.StationSvgResponse;
|
|
|
+import com.hdkj.lt.bf.entity.*;
|
|
|
import com.hdkj.lt.bf.entity.convert.EntityToVOConvertor;
|
|
|
-import com.hdkj.lt.bf.service.IXlRelService;
|
|
|
+import com.hdkj.lt.bf.entity.dto.FeederSectionDTO;
|
|
|
+import com.hdkj.lt.bf.mapper.FeederTopoMapper;
|
|
|
+import com.hdkj.lt.bf.service.*;
|
|
|
import com.hdkj.lt.core.bizms.modle.po.DwdShbDsFeederBase;
|
|
|
import com.hdkj.lt.core.bizms.modle.po.XlRel;
|
|
|
import com.hdkj.lt.core.sys.service.DwdShbDsFeederBaseService;
|
|
|
@@ -12,7 +17,9 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -28,13 +35,24 @@ public class OptimizationApplication {
|
|
|
|
|
|
private final IXlRelService xlRelService;
|
|
|
private final DwdShbDsFeederBaseService feederBaseService;
|
|
|
-
|
|
|
+ private final FhzgElectricalModelConductorService conductorService;
|
|
|
+ private final FhzgElectricalModelNodeService nodeService;
|
|
|
+ private final FhzgElectricalModelTransformerService transformerService;
|
|
|
+ private final FhzgElectricalModelSwitchService switchService;
|
|
|
+ private final FhzgElectricalModelInjectionService injectionService;
|
|
|
+ private final FhzgElectricalModelSectionService sectionService;
|
|
|
+ private final FeederTopoMapper feederTopoMapper;
|
|
|
|
|
|
public List<StationSvgResponse> getStationSvg() {
|
|
|
List<DwdShbDsFeederBase> feederListByMaintOrg = feederBaseService.getFeederListByMaintOrg("60FDC66B3FC143DC9C39001215DDCC61");
|
|
|
+ Map<String, String> stationMap = feederListByMaintOrg.stream().collect(Collectors.toMap(DwdShbDsFeederBase::getStartStationName, DwdShbDsFeederBase::getStartStation, (i, j) -> i));
|
|
|
List<String> feederIdList = feederListByMaintOrg.stream().map(DwdShbDsFeederBase::getPsrId).collect(Collectors.toList());
|
|
|
//有联络的线路
|
|
|
List<XlRel> contactFeederlist = xlRelService.list(new LambdaQueryWrapper<XlRel>().in(XlRel::getXlIdOne, feederIdList));
|
|
|
+ for (XlRel xlRel : contactFeederlist) {
|
|
|
+ xlRel.setBdzIdOne(stationMap.get(xlRel.getBdzNameOne()));
|
|
|
+ xlRel.setBdzIdTwo(stationMap.get(xlRel.getBdzNameTwo()));
|
|
|
+ }
|
|
|
Set<String> contactFeederIdlist = contactFeederlist.stream().map(XlRel::getXlIdOne).collect(Collectors.toSet());
|
|
|
//单辐射线路
|
|
|
List<DwdShbDsFeederBase> collect = feederListByMaintOrg.stream().filter(i -> !contactFeederIdlist.contains(i.getPsrId())).collect(Collectors.toList());
|
|
|
@@ -49,4 +67,69 @@ public class OptimizationApplication {
|
|
|
}
|
|
|
return EntityToVOConvertor.INSTANCE.toStationSvgResponseList(contactFeederlist);
|
|
|
}
|
|
|
+
|
|
|
+ public FeederMetricsResponse getFeederMetrics(String feederId) {
|
|
|
+ String json = "{\n" +
|
|
|
+ " \"operationIssue\": {\n" +
|
|
|
+ " \"operationIssueScore\": 0.00,\n" +
|
|
|
+ " \"currentLineLoadRate\": 0.00,\n" +
|
|
|
+ " \"currentOverlimitSegmentCount\": 0,\n" +
|
|
|
+ " \"voltageViolationNodeCount\": 0,\n" +
|
|
|
+ " \"insufficientTransferCapacityLineCount\": 0,\n" +
|
|
|
+ " \"lineN1Check\": false\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"reliability\": {\n" +
|
|
|
+ " \"reliabilityScore\": 0.00,\n" +
|
|
|
+ " \"lineStatus\": \"Status_b\",\n" +
|
|
|
+ " \"outageTransformerCount\": 0.00,\n" +
|
|
|
+ " \"theoreticalReliability\": 0.00,\n" +
|
|
|
+ " \"affectedLowVoltageUserCount\": 0,\n" +
|
|
|
+ " \"importantSensitiveUserLossCount\": 0\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"networkLossImpact\": {\n" +
|
|
|
+ " \"networkLossImpactScore\": 0.00,\n" +
|
|
|
+ " \"activePowerLoss\": 0.00,\n" +
|
|
|
+ " \"lossRate\": 0.00,\n" +
|
|
|
+ " \"exportPowerFactor\": 0.00\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"networkStructureIssue\": {\n" +
|
|
|
+ " \"networkStructureIssueScore\": 0.00,\n" +
|
|
|
+ " \"lineConnectionType\": \"Type_f\",\n" +
|
|
|
+ " \"lineContactSwitchCount\": 0,\n" +
|
|
|
+ " \"totalInstalledCapacity\": 0.00,\n" +
|
|
|
+ " \"lineUserCount\": 0,\n" +
|
|
|
+ " \"abnormalLoadGroupCount\": \"Count_b\",\n" +
|
|
|
+ " \"loadGroupSegmentCount\": 0,\n" +
|
|
|
+ " \"largeBranchCount\": 0,\n" +
|
|
|
+ " \"linePowerSupplyRadius\": 0.00\n" +
|
|
|
+ " }\n" +
|
|
|
+ "}";
|
|
|
+ FeederMetricsResponse feederMetrics = JSON.parseObject(json, FeederMetricsResponse.class);
|
|
|
+ //1.获取当前线路的断面数据
|
|
|
+ this.getFeederSectionData("15DKX-5800",new Date());
|
|
|
+ //查询线路的出线开关
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return feederMetrics;
|
|
|
+ }
|
|
|
+
|
|
|
+ public FeederSectionDTO getFeederSectionData(String feederId, Date date) {
|
|
|
+ //目前仅长阳15DKX-5800一条断面
|
|
|
+ FhzgElectricalModelSection section = sectionService.getOne(new LambdaQueryWrapper<FhzgElectricalModelSection>().eq(FhzgElectricalModelSection::getFeederId, feederId));
|
|
|
+ String sectionId = section.getSectionId();
|
|
|
+ List<FhzgElectricalModelConductor> conductorList = conductorService.list(new LambdaQueryWrapper<FhzgElectricalModelConductor>().eq(FhzgElectricalModelConductor::getSectionId, sectionId));
|
|
|
+ List<FhzgElectricalModelNode> nodeList = nodeService.list(new LambdaQueryWrapper<FhzgElectricalModelNode>().eq(FhzgElectricalModelNode::getSectionId, sectionId));
|
|
|
+ List<FhzgElectricalModelTransformer> transformerList = transformerService.list(new LambdaQueryWrapper<FhzgElectricalModelTransformer>().eq(FhzgElectricalModelTransformer::getSectionId, sectionId));
|
|
|
+ List<FhzgElectricalModelSwitch> switchList = switchService.list(new LambdaQueryWrapper<FhzgElectricalModelSwitch>().eq(FhzgElectricalModelSwitch::getSectionId, sectionId));
|
|
|
+ List<FhzgElectricalModelInjection> injectionList = injectionService.list(new LambdaQueryWrapper<FhzgElectricalModelInjection>().eq(FhzgElectricalModelInjection::getSectionId, sectionId));
|
|
|
+ return new FeederSectionDTO().setSection(section)
|
|
|
+ .setNodeList(nodeList)
|
|
|
+ .setTransformerList(transformerList)
|
|
|
+ .setSwitchList(switchList)
|
|
|
+ .setConductorList(conductorList)
|
|
|
+ .setInjectionList(injectionList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|