1.限制算法,污区图监测点修改
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user