波形代码提交

This commit is contained in:
wurui
2023-03-23 14:51:15 +08:00
parent 50107edbe9
commit 49744fdf85
20 changed files with 353 additions and 42 deletions

View File

@@ -7,6 +7,7 @@ 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.device.pms.pojo.param.MonitorTerminalParam;
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
import com.njcn.event.pojo.param.TransientParam;
import com.njcn.event.pojo.param.WaveFileParam;
@@ -54,13 +55,9 @@ public class TransientController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getTransientAnalyseWave")
@ApiOperation("暂态事件波形分析")
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "暂态时刻", required = true),
@ApiImplicitParam(name = "lineId", value = "暂态监测点Id", required = true)
})
public HttpResult<WaveDataDTO> getTransientAnalyseWave(@RequestParam("timeId") String timeId, @RequestParam("lineId") String lineId){
public HttpResult<WaveDataDTO> getTransientAnalyseWave(@RequestBody MonitorTerminalParam param){
String methodDescribe = getMethodDescribe("getTransientAnalyseWave");
WaveDataDTO wave = transientService.getTransientAnalyseWave(timeId, lineId);
WaveDataDTO wave = transientService.getTransientAnalyseWave(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, wave, methodDescribe);
}

View File

@@ -45,4 +45,7 @@ public interface RmpEventDetailMapper extends BaseMapper<RmpEventDetailVO> {
@Param("eventType") List<String> eventType,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
RmpEventDetailPO getbyName(@Param("id") String id);
}

View File

@@ -65,4 +65,10 @@
AND DATE_FORMAT(start_time, '%Y-%m') &lt;= SUBSTRING(#{endTime}, 1, 7)
</if>
</select>
<select id="getbyName" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
SELECT
*from
r_mp_event_detail
where event_id=#{id}
</select>
</mapper>

View File

@@ -8,6 +8,14 @@ import com.njcn.common.config.GeneralInfo;
import com.njcn.common.pojo.enums.common.ServerEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.utils.PubUtils;
import com.njcn.device.pms.api.MonitorClient;
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import com.njcn.event.mapper.majornetwork.RmpEventDetailMapper;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.RmpEventDetailVO;
import com.njcn.event.service.majornetwork.RmpEventDetailService;
import com.njcn.oss.constant.GeneralConstant;
import com.njcn.oss.constant.OssPath;
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
@@ -81,6 +89,9 @@ public class TransientServiceImpl implements TransientService {
private final WaveUtil waveUtil;
private final MonitorClient monitorClient;
private final RmpEventDetailMapper rmpEventDetailMapper;
@Override
public Page<TransientVO> getTransientData(TransientParam transientParam) {
@@ -173,15 +184,28 @@ public class TransientServiceImpl implements TransientService {
}
@Override
public WaveDataDTO getTransientAnalyseWave(String timeId, String lineId) {
public WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param) {
//EventDetail eventDetailByTime = eventDetailService.getEventDetailByTime(lineId, timeId);
WaveDataDTO waveDataDTO;
//原始数据
WaveDataDTO originalData;
//根据监测点id获取监测点详情
LineDetailDataVO lineDetailData = lineFeignClient.getLineDetailData(lineId).getData();
EventDetail eventDetailByTime = eventDetailService.getEventDetailByTime(lineId, timeId);
String ip = lineDetailData.getIp();
String waveName = eventDetailByTime.getWaveName();
//获取暂降事件
RmpEventDetailPO eventDetail = rmpEventDetailMapper.getbyName(param.getId());
LineDetailDataVO lineDetailData=new LineDetailDataVO();
MonitorVO monitorVO=new MonitorVO();
String ip;
if(param.getSystemType()==0){
lineDetailData = lineFeignClient.getLineDetailData(eventDetail.getMeasurementPointId()).getData();
ip=lineDetailData.getIp();
}else{
param.setId(eventDetail.getMeasurementPointId());
monitorVO = monitorClient.getMonitorTerminal(param).getData();
ip=monitorVO.getIp();
}
String waveName = eventDetail.getWavePath();
String cfgPath, datPath;
if (generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK) {
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
@@ -209,14 +233,21 @@ public class TransientServiceImpl implements TransientService {
}
}
waveDataDTO = waveUtil.getValidData(originalData);
waveDataDTO.setPtType(PubUtils.ptTypeName(lineDetailData.getPtType()));
double pt1 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[0]);
double pt2 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[1]);
double ct1 = Double.parseDouble(lineDetailData.getCt().split(StrUtil.SLASH)[0]);
double ct2 = Double.parseDouble(lineDetailData.getCt().split(StrUtil.SLASH)[1]);
waveDataDTO.setPt(pt1 / pt2);
waveDataDTO.setCt(ct1 / ct2);
if(param.getSystemType()==0){
waveDataDTO.setPtType(PubUtils.ptTypeName(lineDetailData.getPtType()));
double pt1 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[0]);
double pt2 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[1]);
double ct1 = Double.parseDouble(lineDetailData.getCt().split(StrUtil.SLASH)[0]);
double ct2 = Double.parseDouble(lineDetailData.getCt().split(StrUtil.SLASH)[1]);
waveDataDTO.setPt(pt1 / pt2);
waveDataDTO.setCt(ct1 / ct2);
return waveDataDTO;
}
waveDataDTO.setPtType(Integer.valueOf(monitorVO.getTerminalWiringMethod()));
waveDataDTO.setPt(monitorVO.getPt1() / monitorVO.getPt2());
waveDataDTO.setCt(monitorVO.getCt1() / monitorVO.getCt2());
return waveDataDTO;
}

View File

@@ -1,6 +1,7 @@
package com.njcn.event.service.majornetwork;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
import com.njcn.event.pojo.param.TransientParam;
import com.njcn.event.pojo.param.WaveFileParam;
@@ -26,11 +27,10 @@ public interface TransientService {
Page<TransientVO> getTransientData(TransientParam transientParam);
/**
* 功能描述: 暂态事件波形分析
* @param timeId
* @param lineId
* @param param
* @return
*/
WaveDataDTO getTransientAnalyseWave(String timeId, String lineId);
WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param);
/**
* 功能描述: 暂态事件波形文件下载
* @param waveFileParam