1.限制算法,污区图监测点修改
This commit is contained in:
@@ -1,29 +1,23 @@
|
||||
package com.njcn.device.biz.commApi;
|
||||
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.commApi.fallback.CommTerminalGeneralClientFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/4/24
|
||||
*/
|
||||
@@ -37,6 +31,7 @@ public interface CommTerminalGeneralClient {
|
||||
|
||||
/**
|
||||
* 通过部门获取所有子级部门详情
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/15
|
||||
*/
|
||||
@@ -46,6 +41,7 @@ public interface CommTerminalGeneralClient {
|
||||
|
||||
/**
|
||||
* 根据单位获取监测点信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@@ -53,10 +49,9 @@ public interface CommTerminalGeneralClient {
|
||||
HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据单位获取所有变电站
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@@ -65,6 +60,7 @@ public interface CommTerminalGeneralClient {
|
||||
|
||||
/**
|
||||
* 根据单位获取所有变电站
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@@ -74,6 +70,7 @@ public interface CommTerminalGeneralClient {
|
||||
|
||||
/**
|
||||
* 根据单位获取所有装置
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@@ -83,20 +80,22 @@ public interface CommTerminalGeneralClient {
|
||||
|
||||
/**
|
||||
* 根据单站id获取监测点信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@PostMapping("substationGetLine")
|
||||
HttpResult<LineDevGetBandDTO> substationGetLine(@RequestParam("substationId")String substationId);
|
||||
HttpResult<LineDevGetBandDTO> substationGetLine(@RequestParam("substationId") String substationId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据母线id获取监测点信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@PostMapping("busBarGetLine")
|
||||
public HttpResult<List<LineDevGetDTO>> busBarGetLine(@RequestParam("busBarId")String busBarId);
|
||||
HttpResult<List<LineDevGetDTO>> busBarGetLine(@RequestParam("busBarId") String busBarId);
|
||||
|
||||
|
||||
/**
|
||||
@@ -109,10 +108,31 @@ public interface CommTerminalGeneralClient {
|
||||
HttpResult<List<DeptGetChildrenDTO>> deptGetLineList(@RequestBody DeptGetLineParam deptGetLineParam);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @Description: 获取监测点限值
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/21 10:56
|
||||
*/
|
||||
@PostMapping("/getOverLimitData")
|
||||
HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* @Description: 获取所有监测点限值
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/21 10:56
|
||||
*/
|
||||
@PostMapping("/getAllLineOverLimit")
|
||||
HttpResult<List<Overlimit>> getAllLineOverLimit();
|
||||
|
||||
/**
|
||||
* @Description: 获取变电站下监测点信息
|
||||
* @param devDataType
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/21 13:27
|
||||
*/
|
||||
@PostMapping("/getLineBySubstationRelation")
|
||||
HttpResult<Map<String, List<String>>> getLineBySubstationRelation(@RequestParam("devDataType") Integer devDataType);
|
||||
|
||||
@GetMapping("/getRunMonitorIds")
|
||||
HttpResult<List<String>> getRunMonitorIds();
|
||||
@@ -122,6 +142,7 @@ public interface CommTerminalGeneralClient {
|
||||
HttpResult<List<LineDevGetDTO>> getMonitorDetailList(@RequestBody List<String> list);
|
||||
|
||||
|
||||
|
||||
@GetMapping("/lineUnitDetail")
|
||||
HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId);
|
||||
|
||||
@@ -130,6 +151,7 @@ public interface CommTerminalGeneralClient {
|
||||
HttpResult<LineDevGetDTO> getMonitorDetail(@RequestParam("lineId") String lineId);
|
||||
/**
|
||||
* 用于返回pq 还是pms系统
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/8/3
|
||||
*/
|
||||
|
||||
@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 公共台账
|
||||
@@ -87,6 +88,18 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<Overlimit>> getAllLineOverLimit() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取所有监测点限值", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Map<String, List<String>>> getLineBySubstationRelation(Integer devDataType) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取变电站下监测点信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getRunMonitorIds() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取投运监测点索引", throwable.toString());
|
||||
|
||||
@@ -26,6 +26,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -56,7 +57,9 @@ public class CommTerminalController extends BaseController {
|
||||
@ApiImplicitParam(name = "param", value = "请求参数", required = true)
|
||||
public HttpResult<List<DeptGetChildrenDTO>> deptGetLineList(@RequestBody @Validated DeptGetLineParam param) {
|
||||
String methodDescribe = getMethodDescribe("deptGetLineList");
|
||||
TimeInterval timer = new TimeInterval();
|
||||
List<DeptGetChildrenDTO> monitor = monitorService.deptMonitor(param);
|
||||
log.info("运行时长" + timer.intervalRestart());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -225,6 +228,23 @@ public class CommTerminalController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllLineOverLimit")
|
||||
@ApiOperation("获取投运在线的监测点的限值")
|
||||
public HttpResult<List<Overlimit>> getAllLineOverLimit() {
|
||||
String methodDescribe = getMethodDescribe("getAllLineOverLimit");
|
||||
List<Overlimit> result = monitorService.getAllLineOverLimit();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
@PostMapping("/getLineBySubstationRelation")
|
||||
@ApiOperation("获取变电站和监测点的关系")
|
||||
@ApiImplicitParam(name = "devDataType", value = "数据类型(0:暂态系统;1:稳态系统;)", required = true)
|
||||
public HttpResult<Map<String,List<String>>> getLineBySubstationRelation(@RequestParam("devDataType") Integer devDataType) {
|
||||
String methodDescribe = getMethodDescribe("getLineBySubstationRelation");
|
||||
Map<String,List<String>> map= monitorService.getLineBySubstationRelation(0);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getRunMonitorIds")
|
||||
@ApiOperation("获取投运谐波系统所有监测点")
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -154,5 +155,21 @@ public interface IMonitorService extends IService<Monitor> {
|
||||
String importOracleLedgerToMysql(MultipartFile file, HttpServletResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 获取所有监测点限值
|
||||
* @param
|
||||
* @return: java.util.List<com.njcn.device.biz.pojo.po.Overlimit>
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/21 11:07
|
||||
*/
|
||||
List<Overlimit> getAllLineOverLimit();
|
||||
|
||||
/**
|
||||
* @Description: 获取变电信息
|
||||
* @param devDataType
|
||||
* @return: java.util.Map<java.lang.String,java.util.List<java.lang.String>>
|
||||
* @Author: wr
|
||||
* @Date: 2023/9/21 13:19
|
||||
*/
|
||||
Map<String, List<String>> getLineBySubstationRelation(Integer devDataType);
|
||||
}
|
||||
|
||||
@@ -34,10 +34,7 @@ import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
||||
import com.njcn.device.pms.service.majornetwork.IDistributionMonitorService;
|
||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||
import com.njcn.device.pms.service.majornetwork.IPowerDistributionareaService;
|
||||
|
||||
import com.njcn.device.pq.pojo.bo.excel.OracleTerminalExcel;
|
||||
|
||||
import com.njcn.device.pq.pojo.po.LineBak;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
@@ -60,7 +57,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -367,28 +363,32 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
//返回主网和配网监测信息
|
||||
List<DeptGetChildrenDTO> deviceInfos = new ArrayList<>();
|
||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(param.getDeptId(), Stream.of(0, 1).collect(Collectors.toList())).getData();
|
||||
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getPid().equals(param.getDeptId()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(directDeptInfos)) {
|
||||
//没有直接子部门,获取当前部门所有信息
|
||||
List<DeptDTO> dept = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getId().equals(param.getDeptId()))
|
||||
|
||||
for (DeptDTO deptInfo : deptInfos) {
|
||||
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getPid().equals(deptInfo.getId()))
|
||||
.collect(Collectors.toList());
|
||||
deviceInfos.add(getPmsMonitor(dept.get(0), Collections.singletonList(dept.get(0).getCode())));
|
||||
} else {
|
||||
for (DeptDTO deptDTO : directDeptInfos) {
|
||||
//筛选上级部门pids包含该id的所有部门
|
||||
List<DeptDTO> descendantDeptDTO = deptInfos.stream()
|
||||
.filter(d -> d.getPids().contains(deptDTO.getId()))
|
||||
if (CollUtil.isEmpty(directDeptInfos)) {
|
||||
//没有直接子部门,获取当前部门所有信息
|
||||
List<DeptDTO> dept = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getId().equals(deptInfo.getId()))
|
||||
.collect(Collectors.toList());
|
||||
//形成需要查询监测点的部门索引
|
||||
List<String> deptIdList = descendantDeptDTO.stream()
|
||||
.map(DeptDTO::getCode)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
deptIdList.add(deptDTO.getCode());
|
||||
deviceInfos.add(getPmsMonitor(deptDTO, deptIdList));
|
||||
deviceInfos.add(getPmsMonitor(dept.get(0), Collections.singletonList(dept.get(0).getCode())));
|
||||
} else {
|
||||
List<String> deptIdList = new ArrayList<>();
|
||||
for (DeptDTO deptDTO : directDeptInfos) {
|
||||
//筛选上级部门pids包含该id的所有部门
|
||||
List<DeptDTO> descendantDeptDTO = deptInfos.stream()
|
||||
.filter(d -> d.getPids().contains(deptDTO.getId()))
|
||||
.collect(Collectors.toList());
|
||||
//形成需要查询监测点的部门索引
|
||||
deptIdList.addAll( descendantDeptDTO.stream()
|
||||
.map(DeptDTO::getCode)
|
||||
.distinct()
|
||||
.collect(Collectors.toList()));
|
||||
deptIdList.add(deptDTO.getCode());
|
||||
}
|
||||
deviceInfos.add(getPmsMonitor(deptInfo, deptIdList));
|
||||
}
|
||||
}
|
||||
return deviceInfos;
|
||||
@@ -420,6 +420,22 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Overlimit> getAllLineOverLimit() {
|
||||
return overlimitMapper.selectList(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<String>> getLineBySubstationRelation(Integer devDataType) {
|
||||
//获取主网监测点信息
|
||||
if(devDataType==0){
|
||||
List<Monitor> list = this.list();
|
||||
return list.stream()
|
||||
.collect(Collectors.groupingBy(Monitor::getPowerrId, Collectors.mapping(Monitor::getId, Collectors.toList())));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取主配网监测点id集合
|
||||
@@ -439,10 +455,11 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
pmsDeptGetChildrenDTO.setDeptChildren(deptIdList);
|
||||
if (CollUtil.isNotEmpty(deptIdList)) {
|
||||
//主网监测点
|
||||
List<Monitor> monitorList = this.list(new LambdaQueryWrapper<Monitor>().in(CollUtil.isNotEmpty(deptIdList), Monitor::getOrgId, deptIdList));
|
||||
List<Monitor> monitorList = this.list(new LambdaQueryWrapper<Monitor>()
|
||||
.select(Monitor::getId)
|
||||
.in(CollUtil.isNotEmpty(deptIdList), Monitor::getOrgId, deptIdList));
|
||||
//配网监测点
|
||||
List<PmsMonitorBaseDTO> pwMonitorList = iDistributionMonitorService.getMonitorByCondition(deptIdList, null);
|
||||
|
||||
pmsDeptGetChildrenDTO.setLineIds(monitorList.stream().map(Monitor::getId).distinct().collect(Collectors.toList()));
|
||||
pmsDeptGetChildrenDTO.setPwMonitorIds(pwMonitorList.stream().map(PmsMonitorBaseDTO::getMonitorId).distinct().collect(Collectors.toList()));
|
||||
} else {
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IPqsDeviceUnitService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
@@ -31,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -243,6 +240,24 @@ public class CommTerminalController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllLineOverLimit")
|
||||
@ApiOperation("获取投运在线的监测点的限值")
|
||||
public HttpResult<List<Overlimit>> getAllLineOverLimit() {
|
||||
String methodDescribe = getMethodDescribe("getAllLineOverLimit");
|
||||
List<Overlimit> result = lineService.getAllLineOverLimit("harmonic-boot", null);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getLineBySubstationRelation")
|
||||
@ApiOperation("获取变电站和监测点的关系")
|
||||
@ApiImplicitParam(name = "devDataType", value = "数据类型(0:暂态系统;1:稳态系统;)", required = true)
|
||||
public HttpResult<Map<String,List<String>>> getLineBySubstationRelation(@RequestParam("devDataType") Integer devDataType) {
|
||||
String methodDescribe = getMethodDescribe("getLineBySubstationRelation");
|
||||
Map<String,List<String>> map= lineService.getLineBySubstationRelation(devDataType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getRunMonitorIds")
|
||||
@ApiOperation("获取投运谐波系统所有监测点")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
|
||||
Reference in New Issue
Block a user