高级算法特征值,暂降事件范围分析代码提交
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
package com.njcn.event.controller.majornetwork;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* pqs-event
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/6/23
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/advance")
|
||||
@Api(tags = "高级分析")
|
||||
@AllArgsConstructor
|
||||
public class AdvancedAnalysisController {
|
||||
}
|
||||
@@ -9,11 +9,13 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.TransientVO;
|
||||
import com.njcn.event.service.majornetwork.RmpEventDetailService;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@@ -22,6 +24,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 主网-暂态事件明细
|
||||
@@ -92,4 +95,38 @@ public class RmpEventDetailController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rmpEventDetailVO, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 高级算法-暂降事件关联分析主列表
|
||||
* @author cdf
|
||||
* @date 2023/7/20
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/querySagEvents")
|
||||
@ApiOperation("高级算法-暂降事件关联分析主列表")
|
||||
public HttpResult<Page<AdvanceEventDetailVO>> querySagEvents(@RequestBody BaseParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("querySagEvents");
|
||||
Page<AdvanceEventDetailVO> page = rmpEventDetailService.querySagEvents(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取暂态事件明细
|
||||
* @author cdf
|
||||
* @date 2023/7/28
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/queryEventDetailByEventId")
|
||||
@ApiOperation("获取暂态事件明细")
|
||||
public HttpResult<RmpEventDetailPO> queryEventDetailByEventId(@RequestParam("eventId")String eventId){
|
||||
String methodDescribe = getMethodDescribe("queryEventDetailByEventId");
|
||||
RmpEventDetailPO objResult = rmpEventDetailService.queryEventDetailByEventId(eventId);
|
||||
if(Objects.nonNull(objResult)){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, objResult, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.njcn.event.service.majornetwork.Impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -14,11 +17,14 @@ import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.event.mapper.majornetwork.RmpEventDetailMapper;
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.AreaLineVO;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.TransientVO;
|
||||
import com.njcn.event.service.majornetwork.RmpEventDetailService;
|
||||
@@ -27,16 +33,17 @@ import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.event.enums.EventResponseEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -65,6 +72,8 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
|
||||
private final DistributionMonitorClient distributionMonitorClient;
|
||||
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
|
||||
/**
|
||||
* 获取暂态事件明细
|
||||
*
|
||||
@@ -183,6 +192,90 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
return rmpEventDetailVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<AdvanceEventDetailVO> querySagEvents(BaseParam baseParam) {
|
||||
Page<AdvanceEventDetailVO> pageResult = new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam));
|
||||
List<String> lineIds = generalDeviceInfoClient.deptGetRunLineEvent(RequestUtil.getDeptIndex()).getData();
|
||||
if(CollUtil.isNotEmpty(lineIds)){
|
||||
LambdaQueryWrapper<RmpEventDetailPO> lambdaQueryWrapper =new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.isNull(RmpEventDetailPO::getEventassIndex);
|
||||
Page<RmpEventDetailPO> poPage = this.page(new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam)),lambdaQueryWrapper);
|
||||
|
||||
List<String> tempLineIds = poPage.getRecords().stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
|
||||
|
||||
List<AreaLineInfoVO> temLine = lineFeignClient.getBaseLineAreaInfo(tempLineIds).getData();
|
||||
Map<String, AreaLineInfoVO> map = temLine.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
|
||||
|
||||
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(poPage.getRecords(),AdvanceEventDetailVO.class);
|
||||
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item->{
|
||||
if(map.containsKey(item.getLineId())){
|
||||
item.setGdName(map.get(item.getLineId()).getGdName());
|
||||
item.setSubName(map.get(item.getLineId()).getSubName());
|
||||
switch (item.getDealFlag()) {
|
||||
case 0:
|
||||
item.setFeatureAmplitudeFlag(EnumFlag.UNTREATED.getDescription());
|
||||
break;
|
||||
case 1:
|
||||
item.setFeatureAmplitudeFlag(EnumFlag.PROCESSED.getDescription());
|
||||
break;
|
||||
case 2:
|
||||
item.setFeatureAmplitudeFlag(EnumFlag.NODATA.getDescription());
|
||||
break;
|
||||
case 3:
|
||||
item.setFeatureAmplitudeFlag(EnumFlag.PROCESSFAIL.getDescription());
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("未发现的类型: " + item.getDealFlag());
|
||||
}
|
||||
//录波文件
|
||||
if(Objects.nonNull(item.getFileFlag()) && item.getFileFlag() == 1){
|
||||
item.setBoFileFlag(EnumFlag.EXIST.description);
|
||||
}else {
|
||||
item.setBoFileFlag(EnumFlag.ABSENCE.description);
|
||||
}
|
||||
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
pageResult.setRecords(advanceEventDetailVOList);
|
||||
pageResult.setTotal(poPage.getTotal());
|
||||
pageResult.setPages(poPage.getPages());
|
||||
pageResult.setSize(poPage.getSize());
|
||||
pageResult.setCurrent(poPage.getCurrent());
|
||||
return pageResult;
|
||||
}
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public RmpEventDetailPO queryEventDetailByEventId(String eventId) {
|
||||
return this.getById(eventId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部枚举类:高级算法处理事件的标识描述
|
||||
*/
|
||||
enum EnumFlag {
|
||||
PROCESSED(1, "计算成功"), UNTREATED(0, "未计算"), EXIST(1, "存在"), ABSENCE(0, "不存在"), NODATA(2, "无结果"), PROCESSFAIL(3, "计算失败");
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
|
||||
EnumFlag(Integer code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.njcn.event.service.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.TransientVO;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
@@ -43,4 +46,14 @@ public interface RmpEventDetailService extends IService<RmpEventDetailPO> {
|
||||
RmpEventDetailVO getTransientDetailById(String eventId,String sysType,Integer smallType);
|
||||
|
||||
|
||||
Page<AdvanceEventDetailVO> querySagEvents(BaseParam baseParam);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/7/28
|
||||
*/
|
||||
RmpEventDetailPO queryEventDetailByEventId(String eventId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user