|
|
|
|
@@ -16,6 +16,7 @@ import com.njcn.prepare.harmonic.mapper.mysql.line.*;
|
|
|
|
|
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatEventDPOMapper;
|
|
|
|
|
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatEventMPOMapper;
|
|
|
|
|
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatSubstationDPOMapper;
|
|
|
|
|
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatSubstationMPOMapper;
|
|
|
|
|
import com.njcn.prepare.harmonic.pojo.po.*;
|
|
|
|
|
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.*;
|
|
|
|
|
import com.njcn.system.api.DicDataFeignClient;
|
|
|
|
|
@@ -65,17 +66,23 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|
|
|
|
|
|
|
|
|
private final RStatSubstationMPOService rStatSubstationMPOService;
|
|
|
|
|
|
|
|
|
|
private final RStatSubstationQPOService rStatSubstationQPOService;
|
|
|
|
|
|
|
|
|
|
private final RStatSubstationYPOService rStatSubstationYPOService;
|
|
|
|
|
|
|
|
|
|
private final RStatSubstationDPOMapper rStatSubstationDPOMapper;
|
|
|
|
|
|
|
|
|
|
private final RStatSubstationMPOMapper rStatSubstationMPOMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void handler(List<DeptGetSubStationDTO> data, String dataDate, Integer type) {
|
|
|
|
|
switch (type) {
|
|
|
|
|
/* case 1:
|
|
|
|
|
this.rStartEventYHandler (data, dataDate, type);
|
|
|
|
|
case 1:
|
|
|
|
|
this.rStatSubstationYHandler(data, dataDate, type);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
this.rStartEventQHandler(data, dataDate, type);
|
|
|
|
|
break;*/
|
|
|
|
|
this.rStatSubstationQHandler(data, dataDate, type);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
this.rStatSubstationMHandler(data, dataDate, type);
|
|
|
|
|
break;
|
|
|
|
|
@@ -377,9 +384,9 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|
|
|
|
//r_mp_part_harmonic_detail_m 表中字段求和
|
|
|
|
|
Map<String, Object> partSum = rMpPartHarmonicDetailMMapper.getPartSum(startTime, endTime, lineIds);
|
|
|
|
|
//r_mp_surplus_harmonic_detail_m 表中字段求和
|
|
|
|
|
Map<String, Object> surplusSum = mpSurplusHarmonicDetailMMapper.getSurplusSum(dataDate, dataDate, lineIds);
|
|
|
|
|
Map<String, Object> surplusSum = mpSurplusHarmonicDetailMMapper.getSurplusSum(startTime, endTime, lineIds);
|
|
|
|
|
//r_stat_substation_d 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCount = rStatSubstationDPOMapper.getSumAndCount(dataDate, dataDate, z);
|
|
|
|
|
Map<String, Object> eventDetailSumAndCount = rStatSubstationDPOMapper.getSumAndCount(startTime, endTime, z);
|
|
|
|
|
|
|
|
|
|
RStatSubstationMPO rStatSubstationMPO = new RStatSubstationMPO();
|
|
|
|
|
rStatSubstationMPO.setDataDate(localDate);
|
|
|
|
|
@@ -532,9 +539,9 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|
|
|
|
//r_mp_part_harmonic_detail_m 表中字段求和
|
|
|
|
|
Map<String, Object> partSum = rMpPartHarmonicDetailMMapper.getPartSum(startTime, endTime, lineIds);
|
|
|
|
|
//r_mp_surplus_harmonic_detail_m 表中字段求和
|
|
|
|
|
Map<String, Object> surplusSum = mpSurplusHarmonicDetailMMapper.getSurplusSum(dataDate, dataDate, lineIds);
|
|
|
|
|
Map<String, Object> surplusSum = mpSurplusHarmonicDetailMMapper.getSurplusSum(startTime, endTime, lineIds);
|
|
|
|
|
//r_stat_substation_d 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCount = rStatSubstationDPOMapper.getSumAndCount(dataDate, dataDate, p);
|
|
|
|
|
Map<String, Object> eventDetailSumAndCount = rStatSubstationDPOMapper.getSumAndCount(startTime, endTime, p);
|
|
|
|
|
|
|
|
|
|
RStatSubstationMPO rStatSubstationMPO = new RStatSubstationMPO();
|
|
|
|
|
rStatSubstationMPO.setDataDate(localDate);
|
|
|
|
|
@@ -677,4 +684,589 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//季表
|
|
|
|
|
public void rStatSubstationQHandler(List<DeptGetSubStationDTO> data, String dataDate, Integer type) {
|
|
|
|
|
List<RStatSubstationQPO> rStatSubstationQPOS = new ArrayList<>();
|
|
|
|
|
Date date = DateUtil.parse(dataDate);
|
|
|
|
|
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
// 计算季度的开始日期和结束日期
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
calendar.setTime(date);
|
|
|
|
|
int quarter = (calendar.get(Calendar.MONTH) / 3) + 1; // 计算日期所在的季度
|
|
|
|
|
calendar.set(Calendar.MONTH, (quarter - 1) * 3); // 设置季度开始的月份
|
|
|
|
|
calendar.set(Calendar.DAY_OF_MONTH, 1); // 设置季度开始的日期
|
|
|
|
|
String startTime = sdf.format(calendar.getTime());// 季度开始日期
|
|
|
|
|
calendar.add(Calendar.MONTH, 2); // 添加两个月,使其到季度结束的月份
|
|
|
|
|
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); // 设置季度结束的日期 - 月份最后一天
|
|
|
|
|
String endTime = sdf.format(calendar.getTime()); // 季度结束日期
|
|
|
|
|
|
|
|
|
|
List<String> zwList = new ArrayList<>();
|
|
|
|
|
List<String> pwList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (DeptGetSubStationDTO datum : data) {
|
|
|
|
|
if (!CollectionUtils.isEmpty(datum.getStationIds())) {
|
|
|
|
|
zwList.addAll(datum.getStationIds());
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(datum.getPwStationIds())) {
|
|
|
|
|
pwList.addAll(datum.getPwStationIds());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> zw = zwList.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
List<String> pw = pwList.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
//主网
|
|
|
|
|
if (!CollectionUtils.isEmpty(zw)) {
|
|
|
|
|
|
|
|
|
|
zw.forEach(z -> {
|
|
|
|
|
//获取监测点对象集合
|
|
|
|
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
|
|
|
|
//获取监测点id集合
|
|
|
|
|
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
|
|
|
|
//判空
|
|
|
|
|
if (!CollectionUtils.isEmpty(lineIds)) {
|
|
|
|
|
//r_mp_target_warn_d 表中字段求和
|
|
|
|
|
Map<String, Object> warnSum = rMpTargetWarnDMapper.getSumDate(startTime, endTime, lineIds);
|
|
|
|
|
//r_stat_substation_d 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCountD = rStatSubstationDPOMapper.getSumAndCountQ(startTime, endTime, z);
|
|
|
|
|
//r_stat_substation_m 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCountM = rStatSubstationMPOMapper.getSumAndCount(startTime, endTime, z);
|
|
|
|
|
|
|
|
|
|
RStatSubstationQPO rStatSubstationQPO = new RStatSubstationQPO();
|
|
|
|
|
rStatSubstationQPO.setDataDate(localDate);
|
|
|
|
|
rStatSubstationQPO.setSubstationId(z);
|
|
|
|
|
if (!CollectionUtils.isEmpty(warnSum)) {
|
|
|
|
|
rStatSubstationQPO.setEffectiveMeasurementAccrued(warnSum.containsKey("iECount") ?
|
|
|
|
|
Integer.parseInt(warnSum.get("iECount").toString()) : 0);
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setEffectiveMeasurementAccrued(0);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(eventDetailSumAndCountM)) {
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setEffectiveMeasurementAverage(eventDetailSumAndCountM.containsKey("effectiveMeasurementCountAvg") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("effectiveMeasurementCountAvg").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setHarmonicAverageOverDay(eventDetailSumAndCountM.containsKey("harmonicAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("harmonicAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setFreqAverageOverDay(eventDetailSumAndCountM.containsKey("freqAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("freqAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setVDevAverageOverDay(eventDetailSumAndCountM.containsKey("vDevAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("vDevAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setVAverageOverDay(eventDetailSumAndCountM.containsKey("vAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("vAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setIAverageOverDay(eventDetailSumAndCountM.containsKey("iAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("iAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setUnbalanceAverageOverDay(eventDetailSumAndCountM.containsKey("unbalanceAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("unbalanceAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setINegAverageOverDay(eventDetailSumAndCountM.containsKey("iNegAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("iNegAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setFlickerAverageOverDay(eventDetailSumAndCountM.containsKey("flickerAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("flickerAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setInuharmAverageOverDay(eventDetailSumAndCountM.containsKey("inuharmAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("inuharmAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setEventCount(eventDetailSumAndCountM.containsKey("eventCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("eventCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("eventMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("eventCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("eventMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationQPO.setEventFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setEventFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setSagCount(eventDetailSumAndCountM.containsKey("sagCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("sagCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("sagMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("sagCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("sagMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationQPO.setSagFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setSagFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setSwellCount(eventDetailSumAndCountM.containsKey("swellCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("swellCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("swellMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("swellCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("swellMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationQPO.setSwellFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setSwellFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setInterruptCount(eventDetailSumAndCountM.containsKey("interruptCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("interruptCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("interruptMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("interruptCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("interruptMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationQPO.setInterruptFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setInterruptFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setEffectiveMeasurementAverage(0.0f);
|
|
|
|
|
rStatSubstationQPO.setHarmonicAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setFreqAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setVDevAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setVAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setIAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setUnbalanceAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setINegAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setFlickerAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setInuharmAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setEventCount(0);
|
|
|
|
|
rStatSubstationQPO.setEventFreq(0.0f);
|
|
|
|
|
rStatSubstationQPO.setSagCount(0);
|
|
|
|
|
rStatSubstationQPO.setSagFreq(0.0f);
|
|
|
|
|
rStatSubstationQPO.setSwellCount(0);
|
|
|
|
|
rStatSubstationQPO.setSwellFreq(0.0f);
|
|
|
|
|
rStatSubstationQPO.setInterruptCount(0);
|
|
|
|
|
rStatSubstationQPO.setInterruptFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
rStatSubstationQPOS.add(rStatSubstationQPO);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//配网
|
|
|
|
|
if (!CollectionUtils.isEmpty(pw)) {
|
|
|
|
|
|
|
|
|
|
pw.forEach(p -> {
|
|
|
|
|
//获取监测点对象集合
|
|
|
|
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
|
|
|
|
//获取监测点id集合
|
|
|
|
|
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
|
|
|
|
//判空
|
|
|
|
|
if (!CollectionUtils.isEmpty(lineIds)) {
|
|
|
|
|
//r_mp_target_warn_d 表中字段求和
|
|
|
|
|
Map<String, Object> warnSum = rMpTargetWarnDMapper.getSumDate(startTime, endTime, lineIds);
|
|
|
|
|
//r_stat_substation_d 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCountD = rStatSubstationDPOMapper.getSumAndCountQ(startTime, endTime, p);
|
|
|
|
|
//r_stat_substation_m 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCountM = rStatSubstationMPOMapper.getSumAndCount(startTime, endTime, p);
|
|
|
|
|
|
|
|
|
|
RStatSubstationQPO rStatSubstationQPO = new RStatSubstationQPO();
|
|
|
|
|
rStatSubstationQPO.setDataDate(localDate);
|
|
|
|
|
rStatSubstationQPO.setSubstationId(p);
|
|
|
|
|
if (!CollectionUtils.isEmpty(warnSum)) {
|
|
|
|
|
rStatSubstationQPO.setEffectiveMeasurementAccrued(warnSum.containsKey("iECount") ?
|
|
|
|
|
Integer.parseInt(warnSum.get("iECount").toString()) : 0);
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setEffectiveMeasurementAccrued(0);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(eventDetailSumAndCountM)) {
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setEffectiveMeasurementAverage(eventDetailSumAndCountM.containsKey("effectiveMeasurementCountAvg") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("effectiveMeasurementCountAvg").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setHarmonicAverageOverDay(eventDetailSumAndCountM.containsKey("harmonicAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("harmonicAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setFreqAverageOverDay(eventDetailSumAndCountM.containsKey("freqAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("freqAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setVDevAverageOverDay(eventDetailSumAndCountM.containsKey("vDevAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("vDevAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setVAverageOverDay(eventDetailSumAndCountM.containsKey("vAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("vAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setIAverageOverDay(eventDetailSumAndCountM.containsKey("iAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("iAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setUnbalanceAverageOverDay(eventDetailSumAndCountM.containsKey("unbalanceAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("unbalanceAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setINegAverageOverDay(eventDetailSumAndCountM.containsKey("iNegAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("iNegAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setFlickerAverageOverDay(eventDetailSumAndCountM.containsKey("flickerAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("flickerAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setInuharmAverageOverDay(eventDetailSumAndCountM.containsKey("inuharmAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("inuharmAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setEventCount(eventDetailSumAndCountM.containsKey("eventCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("eventCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("eventMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("eventCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("eventMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationQPO.setEventFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setEventFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setSagCount(eventDetailSumAndCountM.containsKey("sagCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("sagCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("sagMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("sagCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("sagMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationQPO.setSagFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setSagFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setSwellCount(eventDetailSumAndCountM.containsKey("swellCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("swellCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("swellMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("swellCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("swellMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationQPO.setSwellFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setSwellFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationQPO.setInterruptCount(eventDetailSumAndCountM.containsKey("interruptCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("interruptCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("interruptMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("interruptCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("interruptMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationQPO.setInterruptFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setInterruptFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationQPO.setEffectiveMeasurementAverage(0.0f);
|
|
|
|
|
rStatSubstationQPO.setHarmonicAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setFreqAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setVDevAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setVAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setIAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setUnbalanceAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setINegAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setFlickerAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setInuharmAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationQPO.setEventCount(0);
|
|
|
|
|
rStatSubstationQPO.setEventFreq(0.0f);
|
|
|
|
|
rStatSubstationQPO.setSagCount(0);
|
|
|
|
|
rStatSubstationQPO.setSagFreq(0.0f);
|
|
|
|
|
rStatSubstationQPO.setSwellCount(0);
|
|
|
|
|
rStatSubstationQPO.setSwellFreq(0.0f);
|
|
|
|
|
rStatSubstationQPO.setInterruptCount(0);
|
|
|
|
|
rStatSubstationQPO.setInterruptFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
rStatSubstationQPOS.add(rStatSubstationQPO);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(rStatSubstationQPOS)) {
|
|
|
|
|
rStatSubstationQPOService.saveOrUpdateBatchByMultiId(rStatSubstationQPOS, 500);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//年表
|
|
|
|
|
public void rStatSubstationYHandler(List<DeptGetSubStationDTO> data, String dataDate, Integer type) {
|
|
|
|
|
List<RStatSubstationYPO> rStatSubstationYPOS = new ArrayList<>();
|
|
|
|
|
Date date = DateUtil.parse(dataDate);
|
|
|
|
|
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
|
|
|
|
|
|
// 获取当前年的起始日期和结束日期
|
|
|
|
|
LocalDate date1 = LocalDate.parse(dataDate, DateTimeFormatter.ISO_DATE); // 将字符串解析为LocalDate对象
|
|
|
|
|
|
|
|
|
|
// 获取当年的开始天
|
|
|
|
|
LocalDate yearStartDate = date1.withDayOfYear(1);
|
|
|
|
|
String startTime = yearStartDate.format(DateTimeFormatter.ISO_DATE); // 将LocalDate对象转换为字符串日期
|
|
|
|
|
|
|
|
|
|
// 获取当年的结束天
|
|
|
|
|
LocalDate yearEndDate = date1.withDayOfYear(date1.lengthOfYear());
|
|
|
|
|
String endTime = yearEndDate.format(DateTimeFormatter.ISO_DATE); // 将LocalDate对象转换为字符串日期
|
|
|
|
|
|
|
|
|
|
List<String> zwList = new ArrayList<>();
|
|
|
|
|
List<String> pwList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (DeptGetSubStationDTO datum : data) {
|
|
|
|
|
if (!CollectionUtils.isEmpty(datum.getStationIds())) {
|
|
|
|
|
zwList.addAll(datum.getStationIds());
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(datum.getPwStationIds())) {
|
|
|
|
|
pwList.addAll(datum.getPwStationIds());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> zw = zwList.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
List<String> pw = pwList.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
//主网
|
|
|
|
|
if (!CollectionUtils.isEmpty(zw)) {
|
|
|
|
|
|
|
|
|
|
zw.forEach(z -> {
|
|
|
|
|
//获取监测点对象集合
|
|
|
|
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
|
|
|
|
//获取监测点id集合
|
|
|
|
|
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
|
|
|
|
//判空
|
|
|
|
|
if (!CollectionUtils.isEmpty(lineIds)) {
|
|
|
|
|
//r_mp_target_warn_d 表中字段求和
|
|
|
|
|
Map<String, Object> warnSum = rMpTargetWarnDMapper.getSumDate(startTime, endTime, lineIds);
|
|
|
|
|
//r_stat_substation_d 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCountD = rStatSubstationDPOMapper.getSumAndCountQ(startTime, endTime, z);
|
|
|
|
|
//r_stat_substation_m 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCountM = rStatSubstationMPOMapper.getSumAndCount(startTime, endTime, z);
|
|
|
|
|
|
|
|
|
|
RStatSubstationYPO rStatSubstationYPO = new RStatSubstationYPO();
|
|
|
|
|
rStatSubstationYPO.setDataDate(localDate);
|
|
|
|
|
rStatSubstationYPO.setSubstationId(z);
|
|
|
|
|
if (!CollectionUtils.isEmpty(warnSum)) {
|
|
|
|
|
rStatSubstationYPO.setEffectiveMeasurementAccrued(warnSum.containsKey("iECount") ?
|
|
|
|
|
Integer.parseInt(warnSum.get("iECount").toString()) : 0);
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setEffectiveMeasurementAccrued(0);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(eventDetailSumAndCountM)) {
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setEffectiveMeasurementAverage(eventDetailSumAndCountM.containsKey("effectiveMeasurementCountAvg") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("effectiveMeasurementCountAvg").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setHarmonicAverageOverDay(eventDetailSumAndCountM.containsKey("harmonicAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("harmonicAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setFreqAverageOverDay(eventDetailSumAndCountM.containsKey("freqAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("freqAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setVDevAverageOverDay(eventDetailSumAndCountM.containsKey("vDevAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("vDevAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setVAverageOverDay(eventDetailSumAndCountM.containsKey("vAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("vAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setIAverageOverDay(eventDetailSumAndCountM.containsKey("iAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("iAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setUnbalanceAverageOverDay(eventDetailSumAndCountM.containsKey("unbalanceAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("unbalanceAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setINegAverageOverDay(eventDetailSumAndCountM.containsKey("iNegAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("iNegAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setFlickerAverageOverDay(eventDetailSumAndCountM.containsKey("flickerAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("flickerAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setInuharmAverageOverDay(eventDetailSumAndCountM.containsKey("inuharmAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("inuharmAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setEventCount(eventDetailSumAndCountM.containsKey("eventCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("eventCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("eventMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("eventCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("eventMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationYPO.setEventFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setEventFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setSagCount(eventDetailSumAndCountM.containsKey("sagCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("sagCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("sagMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("sagCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("sagMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationYPO.setSagFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setSagFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setSwellCount(eventDetailSumAndCountM.containsKey("swellCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("swellCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("swellMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("swellCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("swellMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationYPO.setSwellFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setSwellFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setInterruptCount(eventDetailSumAndCountM.containsKey("interruptCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("interruptCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("interruptMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("interruptCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("interruptMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationYPO.setInterruptFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setInterruptFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setEffectiveMeasurementAverage(0.0f);
|
|
|
|
|
rStatSubstationYPO.setHarmonicAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setFreqAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setVDevAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setVAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setIAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setUnbalanceAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setINegAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setFlickerAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setInuharmAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setEventCount(0);
|
|
|
|
|
rStatSubstationYPO.setEventFreq(0.0f);
|
|
|
|
|
rStatSubstationYPO.setSagCount(0);
|
|
|
|
|
rStatSubstationYPO.setSagFreq(0.0f);
|
|
|
|
|
rStatSubstationYPO.setSwellCount(0);
|
|
|
|
|
rStatSubstationYPO.setSwellFreq(0.0f);
|
|
|
|
|
rStatSubstationYPO.setInterruptCount(0);
|
|
|
|
|
rStatSubstationYPO.setInterruptFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
rStatSubstationYPOS.add(rStatSubstationYPO);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//配网
|
|
|
|
|
if (!CollectionUtils.isEmpty(pw)) {
|
|
|
|
|
|
|
|
|
|
pw.forEach(p -> {
|
|
|
|
|
//获取监测点对象集合
|
|
|
|
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
|
|
|
|
//获取监测点id集合
|
|
|
|
|
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
|
|
|
|
//判空
|
|
|
|
|
if (!CollectionUtils.isEmpty(lineIds)) {
|
|
|
|
|
//r_mp_target_warn_d 表中字段求和
|
|
|
|
|
Map<String, Object> warnSum = rMpTargetWarnDMapper.getSumDate(startTime, endTime, lineIds);
|
|
|
|
|
//r_stat_substation_d 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCountD = rStatSubstationDPOMapper.getSumAndCountQ(startTime, endTime, p);
|
|
|
|
|
//r_stat_substation_m 表中字段求和及计数
|
|
|
|
|
Map<String, Object> eventDetailSumAndCountM = rStatSubstationMPOMapper.getSumAndCount(startTime, endTime, p);
|
|
|
|
|
|
|
|
|
|
RStatSubstationYPO rStatSubstationYPO = new RStatSubstationYPO();
|
|
|
|
|
rStatSubstationYPO.setDataDate(localDate);
|
|
|
|
|
rStatSubstationYPO.setSubstationId(p);
|
|
|
|
|
if (!CollectionUtils.isEmpty(warnSum)) {
|
|
|
|
|
rStatSubstationYPO.setEffectiveMeasurementAccrued(warnSum.containsKey("iECount") ?
|
|
|
|
|
Integer.parseInt(warnSum.get("iECount").toString()) : 0);
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setEffectiveMeasurementAccrued(0);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(eventDetailSumAndCountM)) {
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setEffectiveMeasurementAverage(eventDetailSumAndCountM.containsKey("effectiveMeasurementCountAvg") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("effectiveMeasurementCountAvg").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setHarmonicAverageOverDay(eventDetailSumAndCountM.containsKey("harmonicAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("harmonicAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setFreqAverageOverDay(eventDetailSumAndCountM.containsKey("freqAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("freqAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setVDevAverageOverDay(eventDetailSumAndCountM.containsKey("vDevAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("vDevAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setVAverageOverDay(eventDetailSumAndCountM.containsKey("vAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("vAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setIAverageOverDay(eventDetailSumAndCountM.containsKey("iAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("iAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setUnbalanceAverageOverDay(eventDetailSumAndCountM.containsKey("unbalanceAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("unbalanceAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setINegAverageOverDay(eventDetailSumAndCountM.containsKey("iNegAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("iNegAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setFlickerAverageOverDay(eventDetailSumAndCountM.containsKey("flickerAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("flickerAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setInuharmAverageOverDay(eventDetailSumAndCountM.containsKey("inuharmAverageOverDay") ?
|
|
|
|
|
Float.parseFloat(eventDetailSumAndCountM.get("inuharmAverageOverDay").toString()) : 0.0f);
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setEventCount(eventDetailSumAndCountM.containsKey("eventCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("eventCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("eventMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("eventCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("eventMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationYPO.setEventFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setEventFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setSagCount(eventDetailSumAndCountM.containsKey("sagCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("sagCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("sagMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("sagCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("sagMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationYPO.setSagFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setSagFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setSwellCount(eventDetailSumAndCountM.containsKey("swellCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("swellCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("swellMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("swellCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("swellMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationYPO.setSwellFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setSwellFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rStatSubstationYPO.setInterruptCount(eventDetailSumAndCountM.containsKey("interruptCountSum") ?
|
|
|
|
|
Integer.parseInt(eventDetailSumAndCountM.get("interruptCountSum").toString()) : 0);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(0, eventDetailSumAndCountD.get("interruptMeasurementCountSum"))) {
|
|
|
|
|
String value = df.format(Float.parseFloat(eventDetailSumAndCountM.get("interruptCountSum").toString())
|
|
|
|
|
/ Float.parseFloat(eventDetailSumAndCountD.get("interruptMeasurementCountSum").toString()));
|
|
|
|
|
rStatSubstationYPO.setInterruptFreq(Float.parseFloat(value));
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setInterruptFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
rStatSubstationYPO.setEffectiveMeasurementAverage(0.0f);
|
|
|
|
|
rStatSubstationYPO.setHarmonicAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setFreqAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setVDevAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setVAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setIAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setUnbalanceAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setINegAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setFlickerAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setInuharmAverageOverDay(0.0f);
|
|
|
|
|
rStatSubstationYPO.setEventCount(0);
|
|
|
|
|
rStatSubstationYPO.setEventFreq(0.0f);
|
|
|
|
|
rStatSubstationYPO.setSagCount(0);
|
|
|
|
|
rStatSubstationYPO.setSagFreq(0.0f);
|
|
|
|
|
rStatSubstationYPO.setSwellCount(0);
|
|
|
|
|
rStatSubstationYPO.setSwellFreq(0.0f);
|
|
|
|
|
rStatSubstationYPO.setInterruptCount(0);
|
|
|
|
|
rStatSubstationYPO.setInterruptFreq(0.0f);
|
|
|
|
|
}
|
|
|
|
|
rStatSubstationYPOS.add(rStatSubstationYPO);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(rStatSubstationYPOS)) {
|
|
|
|
|
rStatSubstationYPOService.saveOrUpdateBatchByMultiId(rStatSubstationYPOS, 500);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|