1.pqs9000-》区域-》终端状态统计,添加监测性质条件(电网侧||非电网侧)

2.pqs9000-》区域-》数据完整性统计,添加监测性质条件(电网侧||非电网侧)
3.pqs9000-》详细分析-》区域稳态超标分类,添加监测性质条件(电网侧||非电网侧)
4.电压偏差限制判断
This commit is contained in:
xy
2024-07-22 18:46:21 +08:00
parent 41fec04cb7
commit 500b6c66bb
24 changed files with 262 additions and 109 deletions

View File

@@ -103,11 +103,11 @@ public interface LineMapper extends Mapper<Line> {
List<Legder.Data> getMonitorData(@Param("list") List<Integer> list, @Param("appear") String appear, @Param("nature") Integer nature);
List<Integer> siftLineIndexs(@Param("list") List<Integer> list, @Param("scale") String scale, @Param("manc") String manc, @Param("loadtype") String loadtype);
List<Integer> siftLineIndexs(@Param("list") List<Integer> list, @Param("scale") String scale, @Param("manc") String manc, @Param("loadtype") String loadtype, @Param("monitorNature") Integer monitorNature);
List<Integer> siftLineIndexsByLineGrade(@Param("list") List<Integer> list, @Param("scale") String scale, @Param("manc") String manc, @Param("loadtype") String loadtype,@Param("lineGrade") Integer lineGrade);
List<IndexsCount> siftAllIndexs(@Param("list") List<Integer> list, @Param("scale") String scale, @Param("manc") String manc, @Param("loadtype") String loadtype);
List<IndexsCount> siftAllIndexs(@Param("list") List<Integer> list, @Param("scale") String scale, @Param("manc") String manc, @Param("loadtype") String loadtype, @Param("devLocation") String devLocation);
List<IndexsCount> siftAllIndexsByLineGrade(@Param("list") List<Integer> list, @Param("scale") String scale, @Param("manc") String manc, @Param("loadtype") String loadtype,@Param("lineGrade") Integer lineGrade);

View File

@@ -69,14 +69,14 @@ public interface DeviceService {
DeviceGeneral getDeviceData(String overview, String area, Date startTime, Date endTime);
//区域统计---》终端状态(筛)
DeviceGeneral getDeviceSiftData(String overview, String area, String scale, String manc, String loadtype, Date startTime, Date endTime);
DeviceGeneral getDeviceSiftData(String overview, String area, String scale, String manc, String loadtype, Integer monitorNature, Date startTime, Date endTime);
//区域统计---》在线率
DeviceGeneral getDeviceOnlineRate(Date startTime, Date endTime, String overview, String area);
//区域统计---》数据完整性
DeviceGeneral getDataIntegrality(Date startTime, Date endTime, String overview, String area,
String scale, String manc, String loadtype);
String scale, String manc, String loadtype, Integer monitorNature);
//运行管理---》终端在线率数据查询展示
List<OnlineRateData> getOnlineRate(Date startTime, Date endTime, String area);

View File

@@ -28,6 +28,7 @@ import com.njcn.utils.*;
import com.njcn.utils.redis.JedisManager;
import com.njcn.utils.redis.RedisCacheUtil;
import net.sf.json.JSONArray;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -201,8 +202,9 @@ public class DeviceServiceImpl implements DeviceService {
* @param area 区域
*/
@Override
public DeviceGeneral getDeviceSiftData(String overview, String area, String scale, String manc, String loadtype,
public DeviceGeneral getDeviceSiftData(String overview, String area, String scale, String manc, String loadtype, Integer monitorNature,
Date startTime, Date endTime) {
String devLocation = null;
DeviceGeneral deviceGeneral;
List<AreaGeneralData> areaGeneralDatasTemp;
if ("overview".equalsIgnoreCase(area)) {
@@ -210,7 +212,12 @@ public class DeviceServiceImpl implements DeviceService {
} else {
areaGeneralDatasTemp = userUtil.getAreaDataByInfo(area);
}
areaGeneralDatasTemp = userUtil.siftAreaGeneralData(areaGeneralDatasTemp, scale, manc, loadtype);
if (!Objects.isNull(monitorNature) && monitorNature == 0) {
devLocation = "电网侧";
} else if (!Objects.isNull(monitorNature) && monitorNature == 1) {
devLocation = "用户侧";
}
areaGeneralDatasTemp = userUtil.siftAreaGeneralData(areaGeneralDatasTemp, scale, manc, loadtype, devLocation);
if (CollectionUtils.isEmpty(areaGeneralDatasTemp)) {
return null;
}
@@ -611,41 +618,44 @@ public class DeviceServiceImpl implements DeviceService {
*/
@Override
public DeviceGeneral getDataIntegrality(Date startTime, Date endTime, String overview, String area,
String scale, String manc, String loadtype) {
String scale, String manc, String loadtype, Integer monitorNature) {
DeviceGeneral deviceGeneral;
List<AreaGeneralData> areaGeneralDatasTemp = userUtil.getAreaDataByInfoRun(area);
if (CollectionUtils.isEmpty(areaGeneralDatasTemp)) {
return null;
}
deviceGeneral = getDataIntegrality(startTime, endTime, overview, areaGeneralDatasTemp, scale, manc, loadtype);
deviceGeneral = getDataIntegrality(startTime, endTime, overview, areaGeneralDatasTemp, scale, manc, loadtype, monitorNature);
return deviceGeneral;
}
private DeviceGeneral getDataIntegrality(Date startTime, Date endTime, String overview, List<AreaGeneralData> areaGeneralDatas,
String scale, String manc, String loadtype) {
String scale, String manc, String loadtype, Integer monitorNature) {
DeviceGeneral deviceGeneral = new DeviceGeneral();
List<DeviceValue> area = new ArrayList<>();
List<Integer> deviceLindexs = new ArrayList<>();
if (CollectionUtils.isEmpty(areaGeneralDatas)) {
return null;
}
if (!Objects.isNull(monitorNature) && monitorNature == -1) {
monitorNature = null;
}
//区域
for (AreaGeneralData areaGeneralData : areaGeneralDatas) {
if (CollectionUtils.isEmpty(areaGeneralData.getLineIndexs())) {
continue;
}
area.add(getDataIntegralityArea(areaGeneralData, startTime, endTime, scale, manc, loadtype));
area.add(getDataIntegralityArea(areaGeneralData, startTime, endTime, scale, manc, loadtype, monitorNature));
deviceLindexs.addAll(areaGeneralData.getDeviceIndexs());
}
deviceGeneral.setArea(area);
if (StringUtils.isEmpty(overview)) {
//电压等级
deviceGeneral.setVol(getDataIntegralityVol(deviceLindexs, startTime, endTime, scale, manc, loadtype));
deviceGeneral.setVol(getDataIntegralityVol(deviceLindexs, startTime, endTime, scale, manc, loadtype, monitorNature));
//终端厂家
deviceGeneral.setInterval(getDataIntegralityCompany(deviceLindexs, startTime, endTime, scale, manc, loadtype));
deviceGeneral.setInterval(getDataIntegralityCompany(deviceLindexs, startTime, endTime, scale, manc, loadtype, monitorNature));
//干扰源类型终
deviceGeneral.setLoadtype(getDataIntegralityLoadType(deviceLindexs, startTime, endTime, scale, manc, loadtype));
deviceGeneral.setLoadtype(getDataIntegralityLoadType(deviceLindexs, startTime, endTime, scale, manc, loadtype, monitorNature));
}
return deviceGeneral;
}
@@ -848,7 +858,7 @@ public class DeviceServiceImpl implements DeviceService {
}
private List<DeviceValue> getDataIntegralityCompany(List<Integer> deviceLindexs, Date startTime, Date endTime,
String scale, String manc, String loadtype) {
String scale, String manc, String loadtype, Integer monitorNature) {
List<DeviceValue> deviceValues = new ArrayList<>();
List<CompanyValue> companyValues = userUtil.getCompanyData(deviceLindexs);
if (CollectionUtils.isEmpty(companyValues)) {
@@ -861,7 +871,7 @@ public class DeviceServiceImpl implements DeviceService {
if (CollectionUtils.isEmpty(lineIndexs)) {
continue;
}
lineIndexs = lineMapper.siftLineIndexs(lineIndexs, scale, manc, loadtype);
lineIndexs = lineMapper.siftLineIndexs(lineIndexs, scale, manc, loadtype, monitorNature);
if (CollectionUtils.isEmpty(lineIndexs)) {
deviceValue.setAmounts("0");
deviceValue.setDataIntegrity("3.1415");
@@ -917,7 +927,7 @@ public class DeviceServiceImpl implements DeviceService {
}
private List<DeviceValue> getDataIntegralityVol(List<Integer> deviceLindexs, Date startTime, Date endTime,
String scale, String manc, String loadtype) {
String scale, String manc, String loadtype, Integer monitorNature) {
List<DeviceValue> deviceValues = new ArrayList<>();
List<VoltageData> voltageDatas = userUtil.getVoltageData(deviceLindexs);
if (CollectionUtils.isEmpty(voltageDatas)) {
@@ -926,7 +936,7 @@ public class DeviceServiceImpl implements DeviceService {
for (VoltageData voltageData : voltageDatas) {
List<Integer> lines = voltageData.getLineIndexs();
if (!CollectionUtils.isEmpty(lines)) {
lines = lineMapper.siftLineIndexs(lines, scale, manc, loadtype);
lines = lineMapper.siftLineIndexs(lines, scale, manc, loadtype, monitorNature);
DeviceValue deviceValue = new DeviceValue();
deviceValue.setName(voltageData.getVol());
deviceValue.setAmounts(String.valueOf(lines.size()));
@@ -952,7 +962,7 @@ public class DeviceServiceImpl implements DeviceService {
* 根据用户当前的身份,获取按电压等级的数据完整性
*/
private List<DeviceValue> getDataIntegralityLoadType(List<Integer> deviceLindexs, Date startTime, Date endTime,
String scale, String manc, String loadtype) {
String scale, String manc, String loadtype, Integer monitorNature) {
List<DeviceValue> deviceValues = new ArrayList<>();
List<LoadTypeValue> loadtypes = userUtil.getLoadTypeValue(deviceLindexs);
if (CollectionUtils.isEmpty(loadtypes)) {
@@ -961,7 +971,7 @@ public class DeviceServiceImpl implements DeviceService {
for (LoadTypeValue type : loadtypes) {
List<Integer> lines = type.getLineIndexs();
if (!CollectionUtils.isEmpty(lines)) {
lines = lineMapper.siftLineIndexs(lines, scale, manc, loadtype);
lines = lineMapper.siftLineIndexs(lines, scale, manc, loadtype, monitorNature);
DeviceValue deviceValue = new DeviceValue();
deviceValue.setName(type.getType());
deviceValue.setAmounts(String.valueOf(lines.size()));
@@ -1008,10 +1018,10 @@ public class DeviceServiceImpl implements DeviceService {
}
private DeviceValue getDataIntegralityArea(AreaGeneralData areaGeneralData, Date startTime, Date endTime,
String scale, String manc, String loadtype) {
String scale, String manc, String loadtype, Integer monitorNature) {
DeviceValue deviceValue = new DeviceValue();
List<Integer> lines = areaGeneralData.getLineIndexs();
lines = lineMapper.siftLineIndexs(lines, scale, manc, loadtype);
lines = lineMapper.siftLineIndexs(lines, scale, manc, loadtype, monitorNature);
String name = areaGeneralData.getName();
deviceValue.setName(name);
deviceValue.setAmounts(lines.size() + "");

View File

@@ -50,36 +50,57 @@ public class COverlimitUtil {
return overlimit;
}
/**
* 电压偏差限值
*
* 电压偏差限值-冀北现场
* 220V 上偏差 +7% 下偏差 -10%
* 220V以上35kV以下 上偏差 +7% 下偏差 -7%
* 35kV及以上 上偏差 +7% 下偏差 -3%
*/
public static void voltageDeviation(OverLimit overlimit,Float voltageLevel) {
float voltageDev = 3.14159f,uvoltageDev = 3.14159f;
if(voltageLevel <= Float.parseFloat(DicDataEnum.V220.getCode())){
voltageDev = 7.0f;
uvoltageDev=-10.0f;
}else if(voltageLevel>Float.parseFloat(DicDataEnum.V220.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV20.getCode())){
}else if(voltageLevel>Float.parseFloat(DicDataEnum.V220.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV35.getCode())){
voltageDev = 7.0f;
uvoltageDev=-7.0f;
}else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV20.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV35.getCode())){
voltageDev = 7.0f;
uvoltageDev=-7.0f;
}else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV35.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV66.getCode())){
voltageDev = 10.0f;
uvoltageDev=-10.0f;
}else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV66.getCode())&&voltageLevel<=Float.parseFloat(DicDataEnum.KV110.getCode())){
}else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV35.getCode())){
voltageDev = 7.0f;
uvoltageDev=-3.0f;
}else if(voltageLevel>Float.parseFloat(DicDataEnum.KV110.getCode())){
voltageDev = 10.0f;
uvoltageDev=-10.0f;
}
overlimit.setVoltageDev(voltageDev);
overlimit.setUvoltageDev(uvoltageDev);
}
// /**
// * 电压偏差限值
// *
// */
// public static void voltageDeviation(OverLimit overlimit,Float voltageLevel) {
// float voltageDev = 3.14159f,uvoltageDev = 3.14159f;
// if(voltageLevel <= Float.parseFloat(DicDataEnum.V220.getCode())){
// voltageDev = 7.0f;
// uvoltageDev=-10.0f;
// }else if(voltageLevel>Float.parseFloat(DicDataEnum.V220.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV20.getCode())){
// voltageDev = 7.0f;
// uvoltageDev=-7.0f;
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV20.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV35.getCode())){
// voltageDev = 7.0f;
// uvoltageDev=-7.0f;
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV35.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV66.getCode())){
// voltageDev = 10.0f;
// uvoltageDev=-10.0f;
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV66.getCode())&&voltageLevel<=Float.parseFloat(DicDataEnum.KV110.getCode())){
// voltageDev = 7.0f;
// uvoltageDev=-3.0f;
// }else if(voltageLevel>Float.parseFloat(DicDataEnum.KV110.getCode())){
// voltageDev = 10.0f;
// uvoltageDev=-10.0f;
// }
// overlimit.setVoltageDev(voltageDev);
// overlimit.setUvoltageDev(uvoltageDev);
// }
/**
* 频率偏差

View File

@@ -1961,7 +1961,7 @@ public class UserUtil {
/**
* 根据电压等级、干扰源类型、终端厂家筛选
*/
public List<AreaGeneralData> siftAreaGeneralData(List<AreaGeneralData> areaGeneralDatas, String scale, String manc, String loadType) {
public List<AreaGeneralData> siftAreaGeneralData(List<AreaGeneralData> areaGeneralDatas, String scale, String manc, String loadType, String devLocation) {
List<AreaGeneralData> result = new ArrayList<>();
for (AreaGeneralData areaGeneralData : areaGeneralDatas) {
@@ -1970,7 +1970,7 @@ public class UserUtil {
if (CollectionUtils.isEmpty(lineIndexs)) {
continue;
}
List<IndexsCount> indexs = lineMapper.siftAllIndexs(lineIndexs, scale, manc, loadType);
List<IndexsCount> indexs = lineMapper.siftAllIndexs(lineIndexs, scale, manc, loadType, devLocation);
if (CollectionUtils.isEmpty(indexs)) {
areaGeneralDataTmp.setMonitors(0);
} else {