监测点评价_日统计接口开发
This commit is contained in:
@@ -24,10 +24,10 @@ public class DataV {
|
|||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
@Column(name = "freq_max")
|
@Column(name = "freq_max")
|
||||||
private Double frepMAX;
|
private Double freqMAX;
|
||||||
|
|
||||||
@Column(name = "freq_min")
|
@Column(name = "freq_min")
|
||||||
private Double frepMIN;
|
private Double freqMIN;
|
||||||
|
|
||||||
@Column(name = "rms_max")
|
@Column(name = "rms_max")
|
||||||
private Double rmsMAX;
|
private Double rmsMAX;
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.njcn.prepare.harmonic.pojo.mysql;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/19 15:42【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 监测点评价表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName(value = "r_mp_monitor_evaluate_d")
|
||||||
|
public class RMpMonitorEvaluateDPO {
|
||||||
|
@MppMultiId(value = "time_id")
|
||||||
|
@ApiModelProperty(value="")
|
||||||
|
private Date timeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId(value = "measurement_point_id")
|
||||||
|
private String measurementPointId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总接入分钟数
|
||||||
|
*/
|
||||||
|
@TableField(value = "all_minute_count")
|
||||||
|
private Integer allMinuteCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 有效接入分钟数
|
||||||
|
*/
|
||||||
|
@TableField(value = "effective_minute_count")
|
||||||
|
private Integer effectiveMinuteCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 频率平均值指标数据个数
|
||||||
|
*/
|
||||||
|
@TableField(value = "freq_count")
|
||||||
|
private Integer freqCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相电压有效值平均值指标数据个数
|
||||||
|
*/
|
||||||
|
@TableField(value = "phase_voltage_count")
|
||||||
|
private Integer phaseVoltageCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线电压有效值平均值指标数据个数
|
||||||
|
*/
|
||||||
|
@TableField(value = "line_voltage_count")
|
||||||
|
private Integer lineVoltageCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压总谐波畸变率平均值指标数据个数
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_thd_count")
|
||||||
|
private Integer vThdCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 三相电压不平衡度平均值指标数据个数
|
||||||
|
*/
|
||||||
|
@TableField(value = "unbalance_count")
|
||||||
|
private Integer unbalanceCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点短时闪变、电压波动类指标数据个数
|
||||||
|
*/
|
||||||
|
@TableField(value = "pst_count")
|
||||||
|
private Integer pstCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长时闪变数据个数
|
||||||
|
*/
|
||||||
|
@TableField(value = "plt_count")
|
||||||
|
private Integer pltCount;
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ import java.util.Date;
|
|||||||
*
|
*
|
||||||
* @author clam
|
* @author clam
|
||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName(value = "PQ_LINEDETAIL")
|
@TableName(value = "PQ_LINEDETAIL")
|
||||||
public class PqLinedetailPO {
|
public class PqLinedetailPO {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.njcn.prepare.harmonic.utils;
|
|||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.njcn.device.pq.constant.Param;
|
import com.njcn.device.pq.constant.Param;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -124,5 +125,20 @@ public class PublicUtil {
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @Description: 根据电压字典获取电压等级
|
||||||
|
* @Param: [id, dictDataList]
|
||||||
|
* @return: java.lang.Double
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/2/23
|
||||||
|
*/
|
||||||
|
public static Double getVoltage(String id, List<DictData> dictDataList) {
|
||||||
|
for (DictData dictData : dictDataList) {
|
||||||
|
if (dictData.getId ( ).equals (id)) {
|
||||||
|
Double result = Double.valueOf (dictData.getValue ( ));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.njcn.prepare.harmonic.controller.newalgorithm;
|
||||||
|
|
||||||
|
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.device.pq.api.LineFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import com.njcn.prepare.harmonic.service.mysql.line.RMpMonitorEvaluateDService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/19 15:45【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/rmpmonitorevaluate")
|
||||||
|
@Api(tags = "监测点评价_日统计")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RMpMonitorEvaluateDController extends BaseController {
|
||||||
|
private final LineFeignClient lineFeignClient;
|
||||||
|
private final RMpMonitorEvaluateDService rMpMonitorEvaluateDService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("监测点评价_日统计(MySQL库)")
|
||||||
|
@ApiImplicitParam(value = "jobParam",name = "jobParam",required = true)
|
||||||
|
@PostMapping("handlerMonitorEvaluate")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||||
|
public HttpResult<Boolean> dataToDayHandler(@RequestBody LineParam jobParam ){
|
||||||
|
|
||||||
|
log.info(LocalDateTime.now()+"handlerMonitorEvaluate开始执行");
|
||||||
|
String methodDescribe = getMethodDescribe("handlerMonitorEvaluate");
|
||||||
|
List<String> indexLists = new ArrayList<> ();
|
||||||
|
if(CollectionUtils.isEmpty (jobParam.getLineIds ())){
|
||||||
|
indexLists = lineFeignClient.getLineList ( ).getData ( );
|
||||||
|
}else{
|
||||||
|
indexLists = jobParam.getLineIds ();
|
||||||
|
}
|
||||||
|
|
||||||
|
rMpMonitorEvaluateDService.dayDataJobHandler (indexLists,jobParam.getDataDate ());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.mysql.RMpMonitorEvaluateDPO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/19 15:42【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface RMpMonitorEvaluateDMapper extends MppBaseMapper<RMpMonitorEvaluateDPO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.prepare.harmonic.mapper.mysql.line.RMpMonitorEvaluateDMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.prepare.harmonic.pojo.mysql.RMpMonitorEvaluateDPO">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table r_mp_monitor_evaluate_d-->
|
||||||
|
<id column="time_id" jdbcType="TIMESTAMP" property="timeId" />
|
||||||
|
<id column="measurement_point_id" jdbcType="VARCHAR" property="measurementPointId" />
|
||||||
|
<result column="effective_minute_count" jdbcType="DECIMAL" property="effectiveMinuteCount" />
|
||||||
|
<result column="freq_count" jdbcType="DECIMAL" property="freqCount" />
|
||||||
|
<result column="phase_voltage_count" jdbcType="DECIMAL" property="phaseVoltageCount" />
|
||||||
|
<result column="line_voltage_count" jdbcType="DECIMAL" property="lineVoltageCount" />
|
||||||
|
<result column="v_thd_count" jdbcType="DECIMAL" property="vThdCount" />
|
||||||
|
<result column="unbalance_count" jdbcType="DECIMAL" property="unbalanceCount" />
|
||||||
|
<result column="pst_count" jdbcType="DECIMAL" property="pstCount" />
|
||||||
|
<result column="plt_count" jdbcType="DECIMAL" property="pltCount" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
time_id, measurement_point_id, effective_minute_count, freq_count, phase_voltage_count,
|
||||||
|
line_voltage_count, v_thd_count, unbalance_count, pst_count, plt_count
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
@@ -2,6 +2,7 @@ package com.njcn.prepare.harmonic.service.influxdb.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.njcn.common.utils.NjcnBeanUtil;
|
||||||
import com.njcn.device.pq.pojo.po.DataV;
|
import com.njcn.device.pq.pojo.po.DataV;
|
||||||
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
import com.njcn.influxdb.param.InfluxDBPublicParam;
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
@@ -11,7 +12,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.influxdb.dto.QueryResult;
|
import org.influxdb.dto.QueryResult;
|
||||||
import org.influxdb.impl.InfluxDBResultMapper;
|
import org.influxdb.impl.InfluxDBResultMapper;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -93,7 +93,7 @@ public class DataVInfluxdbServiceImpl implements DataVInfluxdbService {
|
|||||||
|
|
||||||
List<DataVFiveItemDTO> collect = dataVS.stream ( ).map (temp -> {
|
List<DataVFiveItemDTO> collect = dataVS.stream ( ).map (temp -> {
|
||||||
DataVFiveItemDTO dataVFiveItemDTO = new DataVFiveItemDTO ( );
|
DataVFiveItemDTO dataVFiveItemDTO = new DataVFiveItemDTO ( );
|
||||||
BeanUtils.copyProperties (temp, dataVFiveItemDTO);
|
NjcnBeanUtil.copyPropertiesIgnoreCase (temp,dataVFiveItemDTO);
|
||||||
DataV dataV = dataVS2.stream ( ).filter (temp2 -> Objects.equal (temp.getTime ( ), temp2.getTime ( ))).
|
DataV dataV = dataVS2.stream ( ).filter (temp2 -> Objects.equal (temp.getTime ( ), temp2.getTime ( ))).
|
||||||
collect (Collectors.toList ( )).get (0);
|
collect (Collectors.toList ( )).get (0);
|
||||||
dataVFiveItemDTO.setRmsMax (dataV.getRmsMAX ());
|
dataVFiveItemDTO.setRmsMax (dataV.getRmsMAX ());
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ public class EffectiveMinuteCountServiceImpl implements EffectiveMinuteCountServ
|
|||||||
PmsAbnormalRules v_unbalanceLimit = pmsAbnormalRules.stream ( ).filter (temp -> Objects.equals (temp.getTarget ( ), Param.TARGET_V_UNBALANCE)).collect (Collectors.toList ( )).get (0);
|
PmsAbnormalRules v_unbalanceLimit = pmsAbnormalRules.stream ( ).filter (temp -> Objects.equals (temp.getTarget ( ), Param.TARGET_V_UNBALANCE)).collect (Collectors.toList ( )).get (0);
|
||||||
|
|
||||||
if (freqLimit.getLowerLimit ( ) <= freqMin&&freqMax <= freqLimit.getUpperLimit ( ) &&
|
if (freqLimit.getLowerLimit ( ) <= freqMin&&freqMax <= freqLimit.getUpperLimit ( ) &&
|
||||||
rmsLimit.getLowerLimit ( ) * (voltage / rmsMin) <= rmsMax&&rmsMax <= rmsLimit.getUpperLimit ( ) * (voltage / 1.732) &&
|
rmsLimit.getLowerLimit ( ) * (voltage / 1.732) <= rmsMin&&rmsMax <= rmsLimit.getUpperLimit ( ) * (voltage / 1.732) &&
|
||||||
rms_lvrLimit.getLowerLimit ( )*voltage <= rmsLvrMin&&rmsLvrMax <= rms_lvrLimit.getUpperLimit ( )*voltage &&
|
rms_lvrLimit.getLowerLimit ( )*voltage <= rmsLvrMin&&rmsLvrMax <= rms_lvrLimit.getUpperLimit ( )*voltage &&
|
||||||
v_thdLimit.getLowerLimit ( ) <= vThdMin&&vThdMax <= v_thdLimit.getUpperLimit ( ) &&
|
v_thdLimit.getLowerLimit ( ) <= vThdMin&&vThdMax <= v_thdLimit.getUpperLimit ( ) &&
|
||||||
v_unbalanceLimit.getLowerLimit ( ) <= vUnbalanceMin&&vUnbalanceMax <= v_unbalanceLimit.getUpperLimit ( )
|
v_unbalanceLimit.getLowerLimit ( ) <= vUnbalanceMin&&vUnbalanceMax <= v_unbalanceLimit.getUpperLimit ( )
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ public class DataExceptionServiceImpl implements DataExceptionService {
|
|||||||
switch (pmsAbnormalRule.getTarget()) {
|
switch (pmsAbnormalRule.getTarget()) {
|
||||||
case Param.TARGET_FREQ:
|
case Param.TARGET_FREQ:
|
||||||
//频率:正常比较
|
//频率:正常比较
|
||||||
if (dataV.getFrepMIN() < pmsAbnormalRule.getLowerLimit() || dataV.getFrepMAX() > pmsAbnormalRule.getUpperLimit()){
|
if (dataV.getFreqMIN() < pmsAbnormalRule.getLowerLimit() || dataV.getFreqMAX() > pmsAbnormalRule.getUpperLimit()){
|
||||||
harmonicResponseEnum = DeviceResponseEnum.ALGORITHM_FREP_RULE;
|
harmonicResponseEnum = DeviceResponseEnum.ALGORITHM_FREP_RULE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -0,0 +1,163 @@
|
|||||||
|
package com.njcn.prepare.harmonic.service.mysql.Impl.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
|
import com.njcn.device.pq.constant.Param;
|
||||||
|
import com.njcn.device.pq.pojo.po.PmsAbnormalRules;
|
||||||
|
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||||
|
import com.njcn.prepare.harmonic.mapper.mysql.line.PmsAbnormalRulesMapper;
|
||||||
|
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpMonitorEvaluateDMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.dto.DataVFiveItemDTO;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.mysql.RMpMonitorEvaluateDPO;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.DataFlicker;
|
||||||
|
import com.njcn.prepare.harmonic.service.influxdb.DataIntegrityRateInfluxService;
|
||||||
|
import com.njcn.prepare.harmonic.service.influxdb.DataVInfluxdbService;
|
||||||
|
import com.njcn.prepare.harmonic.service.mysql.line.RMpMonitorEvaluateDService;
|
||||||
|
import com.njcn.prepare.harmonic.utils.PublicUtil;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/19 15:42【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RMpMonitorEvaluateDServiceImpl extends MppServiceImpl<RMpMonitorEvaluateDMapper, RMpMonitorEvaluateDPO> implements RMpMonitorEvaluateDService {
|
||||||
|
|
||||||
|
private final LineFeignClient lineFeignClient;
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
private final DataVInfluxdbService dataVInfluxdbService;
|
||||||
|
private final PmsAbnormalRulesMapper pmsAbnormalRulesMapper;
|
||||||
|
private final DataIntegrityRateInfluxService dataIntegrityRateInfluxService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@Async("asyncExecutor")
|
||||||
|
public void dayDataJobHandler(List<String> indexLists, String dataDate) {
|
||||||
|
|
||||||
|
//1、取出规则
|
||||||
|
List<PmsAbnormalRules> pmsAbnormalRules = pmsAbnormalRulesMapper.selectList (null);
|
||||||
|
|
||||||
|
List<DictData> dictDataList = dicDataFeignClient.getDicDataByTypeName (DicDataTypeEnum.DEV_VOLTAGE.getName ( )).getData ( );
|
||||||
|
|
||||||
|
List<RMpMonitorEvaluateDPO> rMpMonitorEvaluateDPOS = new ArrayList<> ();
|
||||||
|
|
||||||
|
indexLists.forEach (temp -> {
|
||||||
|
LineDetailDataVO data = lineFeignClient.getLineDetailData (temp).getData ( );
|
||||||
|
/*todo 统计间隔,电压等级取值方式后期提供融合版本接口获取不然pms,pqs系统取值方式不一样*/
|
||||||
|
/*统计间隔*/
|
||||||
|
Integer statisticalInterval = data.getTimeInterval ();
|
||||||
|
/*电压等级*/
|
||||||
|
Double voltage = PublicUtil.getVoltage (temp, dictDataList);
|
||||||
|
|
||||||
|
List<DataVFiveItemDTO> fiveItems = dataVInfluxdbService.getFiveItems (temp, dataDate, statisticalInterval);
|
||||||
|
RMpMonitorEvaluateDPO rMpMonitorEvaluateDPO = calculateRMpMonitorEvaluateDPO (fiveItems, pmsAbnormalRules, voltage);
|
||||||
|
Date date = DateUtil.parse(dataDate);
|
||||||
|
|
||||||
|
DataFlicker twoFlickerData = dataIntegrityRateInfluxService.getTwoFlickerData (temp, date, 5);
|
||||||
|
rMpMonitorEvaluateDPO.setAllMinuteCount (fiveItems.size ());
|
||||||
|
rMpMonitorEvaluateDPO.setTimeId (date);
|
||||||
|
rMpMonitorEvaluateDPO.setMeasurementPointId (temp);
|
||||||
|
rMpMonitorEvaluateDPO.setPltCount (twoFlickerData.getPltCount ());
|
||||||
|
rMpMonitorEvaluateDPO.setPstCount (twoFlickerData.getPstCount ());
|
||||||
|
rMpMonitorEvaluateDPOS.add (rMpMonitorEvaluateDPO);
|
||||||
|
|
||||||
|
});
|
||||||
|
this.saveOrUpdateBatchByMultiId (rMpMonitorEvaluateDPOS,500);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 3、频率在【45,55】之间;
|
||||||
|
* 4、相电压有效值在【0.85p.u.,1.2p.u.】之间;p.u=电压等级/1.732
|
||||||
|
* 5、线电压有效值在【0.85p.u.,1.2p.u.】之间;p.u=电压等级
|
||||||
|
* 6、电压总谐波畸变率在【0.1%,20%】之间;
|
||||||
|
* 7、负序电压不平衡度在【0,20%】。满足以上条件则是一条有效数据
|
||||||
|
* @Param: [fiveItems, pmsAbnormalRules, voltage]
|
||||||
|
* @return: java.lang.Integer
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/2/23
|
||||||
|
*/
|
||||||
|
private RMpMonitorEvaluateDPO calculateRMpMonitorEvaluateDPO(List<DataVFiveItemDTO> fiveItems, List<PmsAbnormalRules> pmsAbnormalRules, Double voltage) {
|
||||||
|
RMpMonitorEvaluateDPO rMpMonitorEvaluateDPO = new RMpMonitorEvaluateDPO();
|
||||||
|
|
||||||
|
Integer freqCount = 0;
|
||||||
|
Integer unbalanceCount = 0;
|
||||||
|
Integer phaseVoltageCount = 0;
|
||||||
|
Integer lineVoltageCount = 0;
|
||||||
|
Integer vThdCount = 0;
|
||||||
|
Integer effectiveMinuteCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
for (DataVFiveItemDTO fiveItem : fiveItems) {
|
||||||
|
Double freqMax = fiveItem.getFreqMax ();
|
||||||
|
Double freqMin = fiveItem.getFreqMin ();
|
||||||
|
|
||||||
|
Double rmsMax = fiveItem.getRmsMax ();
|
||||||
|
Double rmsMin = fiveItem.getRmsMin ();
|
||||||
|
Double vThdMax = fiveItem.getVThdMax ();
|
||||||
|
Double vThdMin = fiveItem.getVThdMin ();
|
||||||
|
|
||||||
|
Double vUnbalanceMax = fiveItem.getVUnbalanceMax ();
|
||||||
|
Double vUnbalanceMin = fiveItem.getVUnbalanceMin ();
|
||||||
|
Double rmsLvrMax = fiveItem.getRmsLvrMax ();
|
||||||
|
Double rmsLvrMin = fiveItem.getRmsLvrMin ();
|
||||||
|
|
||||||
|
|
||||||
|
PmsAbnormalRules freqLimit = pmsAbnormalRules.stream ( ).filter (temp -> Objects.equals (temp.getTarget ( ), Param.TARGET_FREQ)).collect (Collectors.toList ( )).get (0);
|
||||||
|
PmsAbnormalRules rmsLimit = pmsAbnormalRules.stream ( ).filter (temp -> Objects.equals (temp.getTarget ( ), Param.TARGET_RMS)).collect (Collectors.toList ( )).get (0);
|
||||||
|
PmsAbnormalRules rms_lvrLimit = pmsAbnormalRules.stream ( ).filter (temp -> Objects.equals (temp.getTarget ( ), Param.TARGET_RMS_LVR)).collect (Collectors.toList ( )).get (0);
|
||||||
|
PmsAbnormalRules v_thdLimit = pmsAbnormalRules.stream ( ).filter (temp -> Objects.equals (temp.getTarget ( ), Param.TARGET_V_THD)).collect (Collectors.toList ( )).get (0);
|
||||||
|
PmsAbnormalRules v_unbalanceLimit = pmsAbnormalRules.stream ( ).filter (temp -> Objects.equals (temp.getTarget ( ), Param.TARGET_V_UNBALANCE)).collect (Collectors.toList ( )).get (0);
|
||||||
|
if(freqLimit.getLowerLimit ( ) <= freqMin&&freqMax <= freqLimit.getUpperLimit ( )){
|
||||||
|
freqCount++;
|
||||||
|
}
|
||||||
|
if(rmsLimit.getLowerLimit ( ) * (voltage / 1.732) <= rmsMin&&rmsMax <= rmsLimit.getUpperLimit ( ) * (voltage / 1.732) ){
|
||||||
|
phaseVoltageCount++;
|
||||||
|
}
|
||||||
|
if(rms_lvrLimit.getLowerLimit ( )*voltage <= rmsLvrMin&&rmsLvrMax <= rms_lvrLimit.getUpperLimit ( )*voltage){
|
||||||
|
lineVoltageCount++;
|
||||||
|
}
|
||||||
|
if(v_thdLimit.getLowerLimit ( ) <= vThdMin&&vThdMax <= v_thdLimit.getUpperLimit ( )){
|
||||||
|
vThdCount++;
|
||||||
|
}
|
||||||
|
if( v_unbalanceLimit.getLowerLimit ( ) <= vUnbalanceMin&&vUnbalanceMax <= v_unbalanceLimit.getUpperLimit ( )){
|
||||||
|
unbalanceCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (freqLimit.getLowerLimit ( ) <= freqMin&&freqMax <= freqLimit.getUpperLimit ( ) &&
|
||||||
|
rmsLimit.getLowerLimit ( ) * (voltage / 1.732) <= rmsMin&&rmsMax <= rmsLimit.getUpperLimit ( ) * (voltage / 1.732) &&
|
||||||
|
rms_lvrLimit.getLowerLimit ( )*voltage <= rmsLvrMin&&rmsLvrMax <= rms_lvrLimit.getUpperLimit ( )*voltage &&
|
||||||
|
v_thdLimit.getLowerLimit ( ) <= vThdMin&&vThdMax <= v_thdLimit.getUpperLimit ( ) &&
|
||||||
|
v_unbalanceLimit.getLowerLimit ( ) <= vUnbalanceMin&&vUnbalanceMax <= v_unbalanceLimit.getUpperLimit ( )
|
||||||
|
|
||||||
|
) {
|
||||||
|
effectiveMinuteCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rMpMonitorEvaluateDPO.setEffectiveMinuteCount (effectiveMinuteCount);
|
||||||
|
rMpMonitorEvaluateDPO.setFreqCount (freqCount);
|
||||||
|
rMpMonitorEvaluateDPO.setPhaseVoltageCount (phaseVoltageCount);
|
||||||
|
rMpMonitorEvaluateDPO.setLineVoltageCount (lineVoltageCount);
|
||||||
|
rMpMonitorEvaluateDPO.setVThdCount (vThdCount);
|
||||||
|
rMpMonitorEvaluateDPO.setUnbalanceCount (unbalanceCount);
|
||||||
|
return rMpMonitorEvaluateDPO;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.prepare.harmonic.service.mysql.line;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.mysql.RMpMonitorEvaluateDPO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/19 15:42【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface RMpMonitorEvaluateDService extends IMppService<RMpMonitorEvaluateDPO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: dayDataJobHandler
|
||||||
|
* @Param: [indexLists, startTime, endTime]
|
||||||
|
* @return: void
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/4/19
|
||||||
|
*/
|
||||||
|
void dayDataJobHandler(List<String> indexLists, String dataDate);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user