pms单位修改同步修改台账中的单位信息

bug
This commit is contained in:
2023-05-17 20:23:40 +08:00
parent b4938a8345
commit 13b6ae6f13
22 changed files with 484 additions and 102 deletions

View File

@@ -1,18 +1,22 @@
package com.njcn.event.controller.majornetwork;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.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.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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@@ -28,7 +32,7 @@ import java.util.List;
@RestController
@RequestMapping("/rmpEventDetail")
@Api(tags = "主网-暂态事件明细")
@Api(tags = "暂态事件明细")
@RequiredArgsConstructor
public class RmpEventDetailController extends BaseController {
@@ -69,4 +73,23 @@ public class RmpEventDetailController extends BaseController {
}
}
/**
* 根据暂降事件id获取详情
* @author cdf
* @date 2023/5/17
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getTransientDetailById")
@ApiOperation("根据条件查询暂态事件")
@ApiImplicitParams({
@ApiImplicitParam(name = "eventId", value = "暂降事件id", required = true),
@ApiImplicitParam(name = "sysType", value = "系统类型 pq,pms", required = true),
@ApiImplicitParam(name = "smallType", value = "主网,配网, 0.主网 1.配网 不填默认主网"),
})
public HttpResult<RmpEventDetailVO> getTransientDetailById(@RequestParam("eventId")String eventId,@RequestParam("sysType")String sysType,@RequestParam(value = "smallType",required = false)Integer smallType){
String methodDescribe = getMethodDescribe("getTransientDetailById");
RmpEventDetailVO rmpEventDetailVO = rmpEventDetailService.getTransientDetailById(eventId,sysType,smallType);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rmpEventDetailVO, methodDescribe);
}
}

View File

@@ -81,4 +81,6 @@ public class TransientController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
}

View File

@@ -15,7 +15,7 @@ import java.util.List;
* @date 2022/10/12
*/
@Mapper
public interface RmpEventDetailMapper extends BaseMapper<RmpEventDetailVO> {
public interface RmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
/**
* 获取暂态事件明细

View File

@@ -4,19 +4,27 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.dto.SimpleDTO;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.pms.api.DistributionMonitorClient;
import com.njcn.device.pms.api.MonitorClient;
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
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.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.RmpEventDetailVO;
import com.njcn.event.pojo.vo.TransientVO;
import com.njcn.event.service.majornetwork.RmpEventDetailService;
import com.njcn.system.api.DicDataFeignClient;
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 lombok.RequiredArgsConstructor;
@@ -28,7 +36,9 @@ import org.springframework.util.StringUtils;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 暂态事件明细
@@ -39,7 +49,7 @@ import java.util.stream.Collectors;
@Service
@Slf4j
@RequiredArgsConstructor
public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, RmpEventDetailVO> implements RmpEventDetailService {
public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, RmpEventDetailPO> implements RmpEventDetailService {
private final RmpEventDetailMapper rmpEventDetailMapper;
@@ -51,6 +61,10 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
private final MonitorClient monitorClient;
private final LineFeignClient lineFeignClient;
private final DistributionMonitorClient distributionMonitorClient;
/**
* 获取暂态事件明细
*
@@ -82,7 +96,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
}
// 查询监测点信息
PmsMonitorParam pmsMonitorParam = new PmsMonitorParam();
if (!StringUtils.isEmpty(param.getMonitorName())){
if (!StringUtils.isEmpty(param.getMonitorName())) {
pmsMonitorParam.setMonitorName(param.getMonitorName());
}
pmsMonitorParam.setMonitorIds(monitorIds);
@@ -131,6 +145,45 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
return dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
}
@Override
public RmpEventDetailVO getTransientDetailById(String eventId, String sysType, Integer smallType) {
RmpEventDetailVO rmpEventDetailVO = new RmpEventDetailVO();
RmpEventDetailPO rmpEventDetailPO = this.getById(eventId);
if (Objects.isNull(rmpEventDetailPO)) {
throw new BusinessException(EventResponseEnum.EVENT_NOT_FOUND);
}
List<String> monitorIds = Stream.of(rmpEventDetailPO.getLineId()).collect(Collectors.toList());
BeanUtils.copyProperties(rmpEventDetailPO, rmpEventDetailVO);
if ("pms".equals(sysType)) {
if(Objects.isNull(smallType) || smallType == 0){
List<Monitor> monitorList = monitorClient.getMonitorList(monitorIds).getData();
if (CollectionUtil.isNotEmpty(monitorList)) {
rmpEventDetailVO.setMeasurementPointName(monitorList.get(0).getName());
rmpEventDetailVO.setPowerStationName(monitorList.get(0).getPowerrName());
}
}else {
//配网
List<PwPmsMonitorDTO> pwPmsMonitorDTOList = distributionMonitorClient.pwMonitorAreaDetailInfo(monitorIds).getData();
if (CollectionUtil.isNotEmpty(pwPmsMonitorDTOList)) {
rmpEventDetailVO.setMeasurementPointName(pwPmsMonitorDTOList.get(0).getMonitorName());
rmpEventDetailVO.setPowerStationName(pwPmsMonitorDTOList.get(0).getPowerName());
}
}
} else {
List<AreaLineInfoVO> lineRes = lineFeignClient.getBaseLineAreaInfo(monitorIds).getData();
if (CollectionUtil.isNotEmpty(lineRes)) {
rmpEventDetailVO.setMeasurementPointName(lineRes.get(0).getLineName());
rmpEventDetailVO.setPowerStationName(lineRes.get(0).getSubName());
}
}
return rmpEventDetailVO;
}
}

View File

@@ -310,22 +310,7 @@ public class TransientServiceImpl implements TransientService {
List<AreaLineInfoVO> filteredLines = lineInfoVOList.stream().filter(item -> filterSearchValue(item, transientParam.getSearchValue())).collect(Collectors.toList());
List<String> lines = filteredLines.stream().map(AreaLineInfoVO::getLineId).collect(Collectors.toList());
if (CollUtil.isNotEmpty(lines)) {
// page = pwRmpEventDetailMapper.selectByIdAndValue(
// page,
// lines,
// DateUtil.beginOfDay(DateUtil.parse(transientParam.getSearchBeginTime())),
// DateUtil.endOfDay(DateUtil.parse(transientParam.getSearchEndTime())),
// transientParam.getWaveType(),
// transientParam.getEventReason(),
// transientParam.getEventType(),
// transientParam.getEventValueMin(),
// transientParam.getEventValueMax(),
// transientParam.getPersistMin(),
// transientParam.getPersistMax(),
// transientParam.getSeverityMin(),
// transientParam.getSeverityMax(),
// transientParam.getFileFlag()
// );
LambdaQueryWrapper<RmpEventDetailPO> wrapper = new LambdaQueryWrapper<RmpEventDetailPO>()
.in(RmpEventDetailPO::getMeasurementPointId, lines)
.ge(StringUtils.isNotBlank(transientParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(transientParam.getSearchBeginTime())))
@@ -406,6 +391,7 @@ public class TransientServiceImpl implements TransientService {
return page;
}
private boolean filterSearchValue(AreaLineInfoVO item, String searchValue) {
if (StringUtils.isBlank(searchValue)) {
return true;

View File

@@ -2,8 +2,11 @@ package com.njcn.event.service.majornetwork;
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.RmpEventDetailVO;
import com.njcn.event.pojo.vo.TransientVO;
import com.njcn.system.pojo.po.DictData;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@@ -14,7 +17,7 @@ import java.util.List;
* @date 2022/10/12
*/
public interface RmpEventDetailService extends IService<RmpEventDetailVO> {
public interface RmpEventDetailService extends IService<RmpEventDetailPO> {
/**
* 获取暂态事件明细
@@ -32,4 +35,12 @@ public interface RmpEventDetailService extends IService<RmpEventDetailVO> {
List<DictData> getEventStatisList();
/**
*
* @author cdf
* @date 2023/5/17
*/
RmpEventDetailVO getTransientDetailById(String eventId,String sysType,Integer smallType);
}

View File

@@ -43,4 +43,8 @@ public interface TransientService {
* @return
*/
Page<EventDetailNew> getTransientValue(TransientParam transientParam);
}