|
|
@@ -3,13 +3,17 @@ package com.hdkj.lt.bf.application;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.hdkj.fhzg.optimization.request.StationSvgLocationRequest;
|
|
|
import com.hdkj.fhzg.optimization.response.OperationMetrics;
|
|
|
import com.hdkj.fhzg.optimization.response.StationGridMetrics;
|
|
|
+import com.hdkj.fhzg.optimization.response.StationSvgLocationResponse;
|
|
|
import com.hdkj.fhzg.optimization.response.StationSvgResponse;
|
|
|
import com.hdkj.lt.bf.entity.FhzgOptimizationFeederMetrics;
|
|
|
+import com.hdkj.lt.bf.entity.StationSvgLocation;
|
|
|
import com.hdkj.lt.bf.entity.convert.EntityToVOConvertor;
|
|
|
import com.hdkj.lt.bf.service.FhzgOptimizationFeederMetricsService;
|
|
|
import com.hdkj.lt.bf.service.IXlRelService;
|
|
|
+import com.hdkj.lt.bf.service.StationSvgLocationService;
|
|
|
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;
|
|
|
@@ -17,6 +21,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
@@ -35,6 +40,8 @@ public class OptimizationApplication {
|
|
|
private final IXlRelService xlRelService;
|
|
|
private final DwdShbDsFeederBaseService feederBaseService;
|
|
|
private final FhzgOptimizationFeederMetricsService feederMetricsService;
|
|
|
+ private final StationSvgLocationService stationSvgLocationService;
|
|
|
+
|
|
|
|
|
|
public List<StationSvgResponse> getStationSvg(String maintOrg) {
|
|
|
List<DwdShbDsFeederBase> feederList = feederBaseService.lambdaQuery().eq(DwdShbDsFeederBase::getPsrState, "20")
|
|
|
@@ -81,4 +88,33 @@ public class OptimizationApplication {
|
|
|
String json = byId.getJsonResult();
|
|
|
return JSON.parseObject(json, StationGridMetrics.class);
|
|
|
}
|
|
|
+
|
|
|
+ public List<StationSvgLocationResponse> getStationSvgLocation(String maintOrg) {
|
|
|
+ List<StationSvgLocation> list = stationSvgLocationService.list(new LambdaQueryWrapper<StationSvgLocation>().eq(StationSvgLocation::getCountyId, maintOrg));
|
|
|
+ List<StationSvgLocationResponse> result = new ArrayList<>();
|
|
|
+ list.forEach(i -> {
|
|
|
+ StationSvgLocationResponse response = new StationSvgLocationResponse();
|
|
|
+ response.setCountyId(i.getCountyId());
|
|
|
+ response.setX(i.getX());
|
|
|
+ response.setY(i.getY());
|
|
|
+ response.setId(i.getPsrId());
|
|
|
+ result.add(response);
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String saveStationSvgLocation(List<StationSvgLocationRequest> request) {
|
|
|
+ stationSvgLocationService.remove(new LambdaQueryWrapper<StationSvgLocation>().eq(StationSvgLocation::getCountyId, request.get(0).getCountyId()));
|
|
|
+ List<StationSvgLocation> list = new ArrayList<>();
|
|
|
+ request.forEach(i -> {
|
|
|
+ StationSvgLocation stationSvgLocation = new StationSvgLocation();
|
|
|
+ stationSvgLocation.setCountyId(i.getCountyId());
|
|
|
+ stationSvgLocation.setX(i.getX());
|
|
|
+ stationSvgLocation.setY(i.getY());
|
|
|
+ stationSvgLocation.setPsrId(i.getId());
|
|
|
+ list.add(stationSvgLocation);
|
|
|
+ });
|
|
|
+ stationSvgLocationService.saveBatch(list);
|
|
|
+ return "保存成功";
|
|
|
+ }
|
|
|
}
|