Merge remote-tracking branch 'origin/master'

This commit is contained in:
Lee
2023-03-23 16:12:53 +08:00
29 changed files with 450 additions and 76 deletions

View File

@@ -5,9 +5,11 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import com.njcn.device.pq.pojo.po.Overlimit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@@ -44,7 +46,7 @@ public interface MonitorClient {
* @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.device.pms.pojo.dto.PmsMonitorDTO>>
*/
@PostMapping("/getMonitorInfoListByCond")
public HttpResult<List<PmsMonitorDTO>> getMonitorInfoListByCond(@RequestBody PmsMonitorParam pmsMonitorParam);
HttpResult<List<PmsMonitorDTO>> getMonitorInfoListByCond(@RequestBody PmsMonitorParam pmsMonitorParam);
/**
@@ -66,4 +68,13 @@ public interface MonitorClient {
HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds);
/***
* 获取台账和终端信息(波形专用)
* @author wr
* @date 2023-03-23 10:53
* @param param
* @return HttpResult<List<Monitor>>
*/
@PostMapping("getMonitorTerminal")
HttpResult<MonitorVO> getMonitorTerminal(@RequestBody MonitorTerminalParam param);
}

View File

@@ -6,9 +6,11 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pms.api.MonitorClient;
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
import com.njcn.device.pq.pojo.po.Overlimit;
import feign.hystrix.FallbackFactory;
@@ -59,6 +61,12 @@ public class MonitorClientFallbackFactory implements FallbackFactory<MonitorClie
log.error("{}异常,降级处理,异常为:{}", "获取主网监测点数据 ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<MonitorVO> getMonitorTerminal(MonitorTerminalParam param) {
log.error("{}异常,降级处理,异常为:{}", "获取台账和终端信息(波形专用) ", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -0,0 +1,30 @@
package com.njcn.device.pms.pojo.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* <监测点波形入参>
*
* @author wr
* @createTime: 2023-03-23
*/
@Data
public class MonitorTerminalParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@NotBlank(message = "id不能为空")
private String id;
@ApiModelProperty(value = "区分主配网0:主网 1:配网)")
@NotNull(message = "区分类别不能为空")
private Integer type;
@ApiModelProperty(value = "区分系统0:pq 1:pms")
@NotNull(message = "区分系统不能为空")
private Integer systemType;
}

View File

@@ -0,0 +1,60 @@
package com.njcn.device.pms.pojo.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <功能描述>
*
* @author wr
* @createTime: 2023-03-23
*/
@Data
public class MonitorVO {
/**
* 监测点ID
*/
@ApiModelProperty(name = "id", value = "监测点ID")
private String id;
/**
* 监测点名称
*/
@ApiModelProperty(name = "name", value = "监测点名称")
private String name;
/**
* 监测终端接线方式(字典)
*/
private String terminalWiringMethod;
/**
* IP地址
*/
private String ip;
/**
* 通信端口
*/
private String port;
/**
* pt变比
*/
private Double pt1;
/**
* pt变比
*/
private Double pt2;
/**
* ct变比
*/
private Double ct1;
/**
* ct变比
*/
private Double ct2;
}

View File

@@ -1,6 +1,7 @@
package com.njcn.device.pms.controller.ledgerManger;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
@@ -11,12 +12,9 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
import com.njcn.device.pms.pojo.param.MonitorParam;
import com.njcn.device.pms.pojo.param.MonitorStatus;
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
import com.njcn.device.pms.pojo.param.*;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
import com.njcn.device.pms.service.majornetwork.IMonitorService;
@@ -270,5 +268,18 @@ public class PmsMonitorController extends BaseController {
}
@PostMapping("/getMonitorTerminal")
@ApiOperation("获取台账和终端信息(波形专用)")
@ApiImplicitParam(name = "monitorParam", value = "主网监测点实体", required = true)
public HttpResult<MonitorVO> getMonitorTerminal(@RequestBody MonitorTerminalParam param) {
String methodDescribe = getMethodDescribe("getMonitorTerminal");
MonitorVO monitorVO = monitorService.monitorTerminal(param);
if (ObjectUtil.isEmpty(monitorVO)) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
} else {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorVO, methodDescribe);
}
}
}

View File

@@ -10,6 +10,7 @@ import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -56,4 +57,22 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
List<PmsMonitorInfoDTO> getMonitorInfo(@Param("pmsMonitorInfoParam") PmsMonitorInfoParam pmsMonitorInfoParam);
/***
* 主网监测点和终端信息(波形查看专用)
* @author wr
* @date 2023-03-23 10:21
* @param id
* @return MonitorVO
*/
MonitorVO getMonitorTerminal(@Param("id")String id);
/***
* 配网监测点和终端信息(波形查看专用)
* @author wr
* @date 2023-03-23 10:21
* @param id
* @return MonitorVO
*/
MonitorVO getPwMonitorTerminal(@Param("id")String id);
}

View File

@@ -131,7 +131,37 @@
AND pm.`Name` LIKE CONCAT('%',#{pmsMonitorInfoParam.monitorName},'%')
</if>
</select>
<select id="getMonitorTerminal" resultType="com.njcn.device.pms.pojo.vo.MonitorVO">
SELECT
pm.Id,
pm.NAME,
pm.Terminal_Wiring_Method,
pt.Ip,
pt.Port,
pm.Pt1,
pm.Pt2,
pm.Ct1,
pm.Ct2
FROM
pms_monitor pm
INNER JOIN pms_terminal pt on pt.Id=pm.Terminal_Id
where pm.id = #{id}
</select>
<select id="getPwMonitorTerminal" resultType="com.njcn.device.pms.pojo.vo.MonitorVO">
SELECT
pm.Monitor_Id,
pm.Terminal_Wiring_Method,
pt.Ip,
pt.PORT,
pm.Pt1,
pm.Pt2,
pm.Ct1,
pm.Ct2
FROM
pms_distribution_monitor pm
INNER JOIN pms_terminal pt ON pt.Id = pm.Terminal_Id
where pm.Monitor_Id = #{id}
</select>
</mapper>

View File

@@ -8,6 +8,7 @@ import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
import com.njcn.device.pms.pojo.param.*;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
import com.njcn.device.pq.pojo.po.Overlimit;
@@ -124,4 +125,12 @@ public interface IMonitorService extends IService<Monitor> {
*/
boolean updateStatus(MonitorStatus monitorParam);
/***
* 获取台账和终端信息
* @author wr
* @date 2023-03-23 10:17
* @param param
* @return MonitorVO
*/
MonitorVO monitorTerminal(MonitorTerminalParam param);
}

View File

@@ -16,6 +16,7 @@ import com.njcn.device.pms.pojo.dto.PmsMonitorDTO;
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
import com.njcn.device.pms.pojo.param.*;
import com.njcn.device.pms.pojo.po.*;
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;
@@ -149,7 +150,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper
.eq(StrUtil.isNotBlank(baseParam.getMonitorState()), Monitor::getMonitorState, baseParam.getMonitorState())
.eq(StrUtil.isNotBlank(baseParam.getMonitorTag()),Monitor::getMonitorTag,baseParam.getMonitorTag())
.eq(StrUtil.isNotBlank(baseParam.getMonitorTag()), Monitor::getMonitorTag, baseParam.getMonitorTag())
.and(StrUtil.isNotBlank(baseParam.getSearchValue()), i -> i.like(Monitor::getName, baseParam.getSearchValue())
.or()
.like(Monitor::getId, baseParam.getSearchValue())
@@ -272,6 +273,31 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
return this.update(update);
}
@Override
public MonitorVO monitorTerminal(MonitorTerminalParam param) {
//type 0:主网 1:配网
MonitorVO monitorTerminal;
if (param.getType() == 0) {
monitorTerminal = this.baseMapper.getMonitorTerminal(param.getId());
} else {
monitorTerminal = this.baseMapper.getPwMonitorTerminal(param.getId());
}
String terminalWiringMethod = monitorTerminal.getTerminalWiringMethod();
DictData data = dicDataFeignClient.getDicDataById(terminalWiringMethod).getData();
if( DicDataEnum.STAR.getCode().equals(data.getCode())){
monitorTerminal.setTerminalWiringMethod("0");
}
if( DicDataEnum.STAR_TRIANGLE.getCode().equals(data.getCode())){
monitorTerminal.setTerminalWiringMethod("1");
}
if( DicDataEnum.OPEN_DELTA.getCode().equals(data.getCode())){
monitorTerminal.setTerminalWiringMethod("2");
}else{
monitorTerminal.setTerminalWiringMethod("-1");
}
return monitorTerminal;
}
private void checkParam(MonitorParam monitorParam, boolean update) {

View File

@@ -416,4 +416,5 @@ public interface LineMapper extends BaseMapper<Line> {
List<LineFlowMealDetailVO> getDeviceRunStatistics(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
Page<LineFlowMealDetailVO> getNewDeviceRunStatistics(Page<LineFlowMealDetailVO> page,@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
Page<LineFlowMealDetailVO> getNewDeviceFlowStatistics(Page<LineFlowMealDetailVO> page,@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
}

View File

@@ -798,7 +798,7 @@
#{item}
</foreach>
and
m.Create_Time between #{startTime} and #{endTime}
a.Create_Time between #{startTime} and #{endTime}
) t
</select>
@@ -836,10 +836,38 @@
#{item}
</foreach>
and
m.Create_Time between #{startTime} and #{endTime}
a.Create_Time between #{startTime} and #{endTime}
) t
</select>
<select id="getNewDeviceFlowStatistics" resultType="LineFlowMealDetailVO">
select t.*,
(t.statisValue)/t.flowMeal flowProportion
from (SELECT
a.id,
a.Name name,
a.level,
a.update_Time updateTime,
b.run_flag runFlag,
b.com_flag comFlag,
b.id deviceId,
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
ifnull(m.Actual_Value,0) statisValue
FROM pq_line a
INNER JOIN pq_device b ON a.id = b.id
LEFT JOIN pqs_month_flow m ON b.id = m.Dev_Id
LEFT JOIN cld_dev_meal c ON b.id = c.line_id
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
where a.id in
<foreach item="item" collection="devs" separator="," open="(" close=")">
#{item}
</foreach>
and
a.Create_Time between #{startTime} and #{endTime}
) t ORDER BY flowProportion DESC
</select>
<select id="getFlowLineInfoByTableList" resultType="LineFlowMealDetailVO">
SELECT
Id,

View File

@@ -392,29 +392,15 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
@Override
public Page<LineFlowMealDetailVO> getNewDeviceRunStatistics( PqsParam deviceInfoParam) {
List<LineFlowMealDetailVO> deviceList = new ArrayList<>();
List<String> deviceIndexes = new ArrayList<>();
Page<LineFlowMealDetailVO> page = new Page();
List<GeneralDeviceDTO> deviceInfoList = generalDeviceService.getDeviceInfo(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
for (GeneralDeviceDTO generalDeviceDTO : deviceInfoList) {
List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
List<String> deviceIndexes = generalDeviceDTO.getDeviceIndexes();
if (CollectionUtils.isEmpty(deviceIndexes)) {
continue;
}
page = lineMapper.getNewDeviceRunStatistics(
deviceInfoList.stream().map(GeneralDeviceDTO::getDeviceIndexes).forEach(deviceIndexes::addAll);
page = lineMapper.getNewDeviceFlowStatistics(
new Page(deviceInfoParam.getPageNum(), deviceInfoParam.getPageSize()),
lineIndexes,
deviceIndexes,
DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())),
DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())));
if (CollectionUtil.isNotEmpty(page.getRecords())){
for (LineFlowMealDetailVO device : page.getRecords()) {
BigDecimal b = new BigDecimal((device.getFlowMeal()-device.getStatisValue())/device.getFlowMeal()*100);
device.setFlowProportion(b.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue());
}
}
}
return page;
}

View File

@@ -0,0 +1,25 @@
package com.njcn.event.pojo.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* <功能描述>
*
* @author wr
* @createTime: 2023-03-23
*/
@Data
public class MTransientParam {
@ApiModelProperty(value = "监测点id")
@NotBlank(message = "监测点id不能为空")
private String id;
@ApiModelProperty(value = "区分主配网0:主网 1:配网)")
@NotNull(message = "区分类别不能为空")
private Integer type;
}

View File

@@ -66,6 +66,12 @@ public class PwRmpEventDetailVO implements Serializable {
@ApiModelProperty(name = "monitorVoltageLevel",value = "监测点电压等级")
private String monitorVoltageLevel;
/**
* 暂时事件ID
*/
@ApiModelProperty(name = "eventId",value = "暂时事件ID")
private String eventId;
/**
* 暂态事件类型
*/
@@ -91,6 +97,12 @@ public class PwRmpEventDetailVO implements Serializable {
@ApiModelProperty(name = "featureAmplitude", value = "特征幅值")
private Double featureAmplitude;
/**
* 系统名称
*/
@ApiModelProperty(name = "系统名称")
private String systemType="pms";
/**
* 波形路径
*/

View File

@@ -86,11 +86,21 @@ public class RmpEventDetailVO implements Serializable {
@ApiModelProperty(name = "featureAmplitude",value = "特征幅值")
private Double featureAmplitude;
/**
* 系统名称
*/
@ApiModelProperty(name = "系统名称")
private String systemType="pms";
/**
* 波形路径
*/
@ApiModelProperty(name = "wavePath",value = "波形路径")
private String wavePath;
@ApiModelProperty(name = "powerStationName",value = "电站名称")
private String powerStationName;
}

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

@@ -81,6 +81,7 @@ public class PwRmpEventDetailServiceImpl implements PwRmpEventDetailService {
PwRmpEventDetailVO vo = new PwRmpEventDetailVO();
BeanUtils.copyProperties(po, vo);
vo.setMonitorId(po.getMeasurementPointId());
vo.setEventId(po.getEventId());
vo.setOrgId(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getOrgId());
vo.setOrgName(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getOrgName());
vo.setMonitorSort(pwPmsMonitorDTOMap.get(po.getMeasurementPointId()).getMonitorSort());

View File

@@ -106,13 +106,14 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
// 属性赋值
return detailsOfTransientEvents.stream().map(po -> {
RmpEventDetailVO vo = new RmpEventDetailVO();
for (PmsGeneralDeviceDTO dto : data) {
if (dto.getMonitorIdList().contains(po.getMeasurementPointId())) {
BeanUtils.copyProperties(po, vo);
vo.setDeptName(dto.getName());
for (PmsMonitorDTO dto : monitorInfo) {
if (dto.getId().equals(po.getMeasurementPointId())) {
vo.setDeptName(dto.getOrgName());
vo.setMonitorSort(monitorSort);
vo.setMeasurementPointName(monitorInfoMap.get(po.getMeasurementPointId()));
vo.setMeasurementPointName(dto.getName());
vo.setEventType(eventStatisDataMap.get(po.getEventType()));
vo.setPowerStationName(dto.getPowerrName());
}
}
return vo;

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,6 +233,7 @@ public class TransientServiceImpl implements TransientService {
}
}
waveDataDTO = waveUtil.getValidData(originalData);
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]);
@@ -218,6 +243,12 @@ public class TransientServiceImpl implements TransientService {
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;
}
@Override

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

View File

@@ -36,7 +36,7 @@ public class StrategyParam {
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("等级0一级1二级2三级")
@ApiModelProperty("等级0:自动策略 1:手动策略 2:排除策略")
private Integer grade;
@ApiModelProperty(value = "区分预警单/告警单0预警单 1告警单")
@@ -142,9 +142,6 @@ public class StrategyParam {
@ApiModelProperty("名称")
private String name;
// @ApiModelProperty("变电站信息")
// private List<Power> childPower;
@ApiModelProperty("子节点详细信息")
private List<?> children;
}

View File

@@ -38,8 +38,8 @@ public class SurveyPlanExcel implements Serializable {
@Excel(name = "变电站数量", width = 15)
private Long subCount;
@Excel(name = "母线数量", width = 15)
private Long busCount;
// @Excel(name = "母线数量", width = 15)
// private Long busCount;
@Excel(name = "计划状态", width = 15)
private String status;

View File

@@ -48,6 +48,15 @@ public class ThsWarnStrategyController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@PostMapping("/getStrategyList")
@ApiOperation("数据查询")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
public HttpResult<List<ThsWarnStrategy>> strategyList(@RequestBody @Validated StrategyParam.StrategyPageParam param) {
String methodDescribe = getMethodDescribe("getStrategyPage");
List<ThsWarnStrategy> list = thsWarnStrategyService.strategyList(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@PostMapping("/insertStrategy")
@ApiOperation(value = "数据添加")
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
@@ -113,10 +122,10 @@ public class ThsWarnStrategyController extends BaseController {
@GetMapping("/echoMonitor")
@ApiOperation(value = "监测点回显")
public HttpResult<List<String>> echoMonitor(@Param("deptId") String deptId,@Param("type") Integer type) {
public HttpResult<StrategyParam.MonitorTree> echoMonitor(@Param("deptId") String deptId,@Param("type") Integer type) {
String methodDescribe = getMethodDescribe("echoMonitor");
List<String> strings = thsWarnStrategyService.echoMonitor(deptId, type);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, strings, methodDescribe);
StrategyParam.MonitorTree info = thsWarnStrategyService.echoMonitor(deptId, type);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, info, methodDescribe);
}
@PostMapping("/delStrategy")

View File

@@ -27,6 +27,14 @@ public interface ThsWarnStrategyService extends IService<ThsWarnStrategy> {
*/
Page<ThsWarnStrategy> strategyPage(StrategyParam.StrategyPageParam param);
/***
* 预警单/告警单集合
* @author wr
* @date 2023-02-27 13:58
* @param param
* @return Page<?>
*/
List<ThsWarnStrategy> strategyList(StrategyParam.StrategyPageParam param);
/***
* 预警单/告警单单条新增
@@ -101,7 +109,7 @@ public interface ThsWarnStrategyService extends IService<ThsWarnStrategy> {
* @param type
* @return List<ThsDeptAlarm>
*/
List<String> echoMonitor(String org,Integer type);
StrategyParam.MonitorTree echoMonitor(String org,Integer type);
/***
* 预警单/告警单删除

View File

@@ -325,22 +325,46 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
SurveyPlanExcel surveyPlanExcel = new SurveyPlanExcel ( );
BeanUtils.copyProperties (temp, surveyPlanExcel);
long Busbarcount = rGeneralSurveyPlanDetails.stream ( ).
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( );
// long Busbarcount = rGeneralSurveyPlanDetails.stream ( ).
// filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
// map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( );
long Subcount = rGeneralSurveyPlanDetails.stream ( ).
filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))).
map (RGeneralSurveyPlanDetail::getSubId).distinct ( ).count ( );
surveyPlanExcel.setBusCount (Busbarcount);
// surveyPlanExcel.setBusCount (Busbarcount);
surveyPlanExcel.setSubCount (Subcount);
surveyPlanExcel.setOrgNo (pvTerminalTreeVOMap.get (surveyPlanExcel.getOrgNo ( )));
surveyPlanExcel.setStatus (getPlanStatus(temp.getStatus ()));
surveyPlanExcels.add (surveyPlanExcel);
});
return surveyPlanExcels;
}
private String getPlanStatus(int status) {
String result = "";
switch (status) {
case 0:
result = "新建";
break;
case 1:
result = "待审核";
break;
case 2:
result = "审核未通过";
break;
case 3:
result = "已发布";
break;
case 4:
result = "已完成";
break;
default:
result = "";
}
return result;
}
/**
* @param questionQueryParm
* @Description: querySurveyPlanOnQuestion

View File

@@ -1,6 +1,7 @@
package com.njcn.process.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -27,11 +28,13 @@ import com.njcn.user.pojo.dto.DeptDTO;
import com.njcn.web.utils.RequestUtil;
import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.math3.random.RandomDataGenerator;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* <p>
@@ -62,6 +65,17 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
);
}
@Override
public List<ThsWarnStrategy> strategyList(StrategyParam.StrategyPageParam param) {
return this.list(new LambdaQueryWrapper<ThsWarnStrategy>()
.like(StrUtil.isNotBlank(param.getName()), ThsWarnStrategy::getName, param.getName())
.eq(param.getGrade() != null, ThsWarnStrategy::getGrade, param.getGrade())
.eq(param.getType() != null, ThsWarnStrategy::getType, param.getType())
.ne(ThsWarnStrategy::getState, DataStateEnum.DELETED.getCode())
);
}
@Override
@Transactional(rollbackFor = {Exception.class})
public Boolean insertStrategy(StrategyParam.StrategyInsertParam param) {
@@ -196,12 +210,18 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
}
@Override
public List<String> echoMonitor(String org,Integer type) {
public StrategyParam.MonitorTree echoMonitor(String org,Integer type) {
List<ThsDeptAlarm> list = thsDeptAlarmService.list(new LambdaQueryWrapper<ThsDeptAlarm>()
.eq(ThsDeptAlarm::getDeptId, org)
.eq(ThsDeptAlarm::getType, type)
);
return list.stream().map(ThsDeptAlarm::getMonitorId).distinct().collect(Collectors.toList());
StrategyParam.MonitorTree tree=new StrategyParam.MonitorTree();
List<String> collect = list.stream().map(ThsDeptAlarm::getAlarmId).distinct().collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(collect)){
tree.setId(collect.get(0));
}
tree.setChildren(list.stream().map(ThsDeptAlarm::getMonitorId).distinct().collect(Collectors.toList()));
return tree;
}
@Override
@@ -283,7 +303,9 @@ public class ThsWarnStrategyServiceImpl extends ServiceImpl<ThsWarnStrategyMappe
collect.forEach((key, value) -> {
String[] split = key.split("_");
StrategyParam.MonitorTree power = new StrategyParam.MonitorTree();
power.setId(split[0]);
//生成随机数
RandomDataGenerator randomDataGenerator = new RandomDataGenerator();
power.setId(split[0]+randomDataGenerator.nextInt(1,9));
power.setName("变电站名称: "+split[1]);
//监测点信息
List<StrategyParam.Monitor> monitors = new ArrayList();

View File

@@ -252,7 +252,16 @@ public enum DicDataEnum {
/**
* 一级业务类型
*/
TRANS_BUSINESS("运检业务","Trans_Business");
TRANS_BUSINESS("运检业务","Trans_Business"),
/**
* 接线方式
*/
STAR("星型接线","Trans_Business"),
STAR_TRIANGLE("星三角","Star_Triangle"),
OPEN_DELTA("开口三角","Open_Delta"),;
private final String name;