zbj//1.变电站指标统计_季/年统计 算法
This commit is contained in:
@@ -1,16 +1,10 @@
|
|||||||
package com.njcn.prepare.harmonic.pojo.po;
|
package com.njcn.prepare.harmonic.pojo.po;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.njcn.prepare.harmonic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zbj
|
||||||
|
* @since 2023-06-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("r_stat_substation_q")
|
||||||
|
public class RStatSubstationQPO {
|
||||||
|
|
||||||
|
@MppMultiId(value = "data_date")
|
||||||
|
private LocalDate dataDate;
|
||||||
|
|
||||||
|
@MppMultiId(value = "substation_id")
|
||||||
|
private String substationId;
|
||||||
|
|
||||||
|
@TableField(value = "effective_measurement_average")
|
||||||
|
private Float effectiveMeasurementAverage;
|
||||||
|
|
||||||
|
@TableField(value = "effective_measurement_accrued")
|
||||||
|
private Integer effectiveMeasurementAccrued;
|
||||||
|
|
||||||
|
@TableField(value = "harmonic_average_over_day")
|
||||||
|
private Float harmonicAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "freq_average_over_day")
|
||||||
|
private Float freqAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "v_dev_average_over_day")
|
||||||
|
private Float vDevAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "v_average_over_day")
|
||||||
|
private Float vAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "i_average_over_day")
|
||||||
|
private Float iAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "unbalance_average_over_day")
|
||||||
|
private Float unbalanceAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "i_neg_average_over_day")
|
||||||
|
private Float iNegAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "flicker_average_over_day")
|
||||||
|
private Float flickerAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "inuharm_average_over_day")
|
||||||
|
private Float inuharmAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "event_count")
|
||||||
|
private Integer eventCount;
|
||||||
|
|
||||||
|
@TableField(value = "event_freq")
|
||||||
|
private Float eventFreq;
|
||||||
|
|
||||||
|
@TableField(value = "sag_count")
|
||||||
|
private Integer sagCount;
|
||||||
|
|
||||||
|
@TableField(value = "sag_freq")
|
||||||
|
private Float sagFreq;
|
||||||
|
|
||||||
|
@TableField(value = "swell_count")
|
||||||
|
private Integer swellCount;
|
||||||
|
|
||||||
|
@TableField(value = "swell_freq")
|
||||||
|
private Float swellFreq;
|
||||||
|
|
||||||
|
@TableField(value = "interrupt_count")
|
||||||
|
private Integer interruptCount;
|
||||||
|
|
||||||
|
@TableField(value = "interrupt_freq")
|
||||||
|
private Float interruptFreq;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.njcn.prepare.harmonic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zbj
|
||||||
|
* @since 2023-06-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("r_stat_substation_y")
|
||||||
|
public class RStatSubstationYPO {
|
||||||
|
|
||||||
|
@MppMultiId(value = "data_date")
|
||||||
|
private LocalDate dataDate;
|
||||||
|
|
||||||
|
@MppMultiId(value = "substation_id")
|
||||||
|
private String substationId;
|
||||||
|
|
||||||
|
@TableField(value = "effective_measurement_average")
|
||||||
|
private Float effectiveMeasurementAverage;
|
||||||
|
|
||||||
|
@TableField(value = "effective_measurement_accrued")
|
||||||
|
private Integer effectiveMeasurementAccrued;
|
||||||
|
|
||||||
|
@TableField(value = "harmonic_over_day")
|
||||||
|
private Float harmonicAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "freq_average_over_day")
|
||||||
|
private Float freqAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "v_dev_average_over_day")
|
||||||
|
private Float vDevAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "v_average_over_day")
|
||||||
|
private Float vAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "i_average_over_day")
|
||||||
|
private Float iAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "unbalance_average_over_day")
|
||||||
|
private Float unbalanceAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "i_neg_average_over_day")
|
||||||
|
private Float iNegAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "flicker_average_over_day")
|
||||||
|
private Float flickerAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "inuharm_average_over_day")
|
||||||
|
private Float inuharmAverageOverDay;
|
||||||
|
|
||||||
|
@TableField(value = "event_count")
|
||||||
|
private Integer eventCount;
|
||||||
|
|
||||||
|
@TableField(value = "event_freq")
|
||||||
|
private Float eventFreq;
|
||||||
|
|
||||||
|
@TableField(value = "sag_count")
|
||||||
|
private Integer sagCount;
|
||||||
|
|
||||||
|
@TableField(value = "sag_freq")
|
||||||
|
private Float sagFreq;
|
||||||
|
|
||||||
|
@TableField(value = "swell_count")
|
||||||
|
private Integer swellCount;
|
||||||
|
|
||||||
|
@TableField(value = "swell_freq")
|
||||||
|
private Float swellFreq;
|
||||||
|
|
||||||
|
@TableField(value = "interrupt_count")
|
||||||
|
private Integer interruptCount;
|
||||||
|
|
||||||
|
@TableField(value = "interrupt_freq")
|
||||||
|
private Float interruptFreq;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,4 +21,6 @@ public interface RStatSubstationDPOMapper extends MppBaseMapper<RStatSubstationD
|
|||||||
|
|
||||||
Map<String, Object> getSumAndCount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("substationId") String substationId);
|
Map<String, Object> getSumAndCount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("substationId") String substationId);
|
||||||
|
|
||||||
|
Map<String, Object> getSumAndCountQ(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("substationId") String substationId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,9 @@ package com.njcn.prepare.harmonic.mapper.mysql.newalgorithm;
|
|||||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationMPO;
|
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationMPO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
@@ -14,4 +17,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface RStatSubstationMPOMapper extends MppBaseMapper<RStatSubstationMPO> {
|
public interface RStatSubstationMPOMapper extends MppBaseMapper<RStatSubstationMPO> {
|
||||||
|
|
||||||
|
Map<String, Object> getSumAndCount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("substationId") String substationId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.prepare.harmonic.mapper.mysql.newalgorithm;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationQPO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2022/12/13 15:39【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RStatSubstationQPOMapper extends MppBaseMapper<RStatSubstationQPO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.prepare.harmonic.mapper.mysql.newalgorithm;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationYPO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2022/12/13 15:39【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RStatSubstationYPOMapper extends MppBaseMapper<RStatSubstationYPO> {
|
||||||
|
}
|
||||||
@@ -66,4 +66,13 @@
|
|||||||
) t
|
) t
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getSumAndCountQ" resultType="java.util.Map">
|
||||||
|
SELECT sum(event_measurement_count) "eventMeasurementCountSum",
|
||||||
|
sum(sag_measurement_count) "sagMeasurementCountSum",
|
||||||
|
sum(swell_measurement_count) "swellMeasurementCountSum",
|
||||||
|
sum(interrupt_measurement_count) "interruptMeasurementCountSum"
|
||||||
|
FROM r_stat_substation_d
|
||||||
|
WHERE data_date between #{startTime} and #{endTime}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<?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.newalgorithm.RStatSubstationMPOMapper">
|
||||||
|
|
||||||
|
<select id="getSumAndCount" resultType="java.util.Map">
|
||||||
|
SELECT t.effectiveMeasurementAverageAvg,
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.harmonicCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.harmonicOverDaySum / t.harmonicCountSum, 2)
|
||||||
|
END "harmonicAverageOverDay",
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.freqCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.freqOverDaySum / t.freqCountSum, 2)
|
||||||
|
END "freqAverageOverDay",
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.vDevCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.vDevOverDaySum / t.vDevCountSum, 2)
|
||||||
|
END "vDevAverageOverDay",
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.vCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.vOverDaySum / t.vCountSum, 2)
|
||||||
|
END "vAverageOverDay",
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.iCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.iOverDaySum / t.iCountSum, 2)
|
||||||
|
END "iAverageOverDay",
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.unbalanceCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.unbalanceOverDaySum / t.unbalanceCountSum, 2)
|
||||||
|
END "unbalanceAverageOverDay",
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.iNegCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.iNegOverDaySum / t.iNegCountSum, 2)
|
||||||
|
END "iNegAverageOverDay",
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.flickerCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.flickerOverDaySum / t.flickerCountSum, 2)
|
||||||
|
END "flickerAverageOverDay",
|
||||||
|
CASE
|
||||||
|
|
||||||
|
WHEN t.inuharmCountSum = 0 THEN
|
||||||
|
0.00
|
||||||
|
ELSE round(t.inuharmOverDaySum / t.inuharmCountSum, 2)
|
||||||
|
END "inuharmAverageOverDay",
|
||||||
|
t.eventCountSum,
|
||||||
|
t.sagCountSum,
|
||||||
|
t.swellCountSum,
|
||||||
|
t.interruptCountSum
|
||||||
|
FROM (
|
||||||
|
SELECT round(avg(effective_measurement_average), 2) "effectiveMeasurementAverageAvg",
|
||||||
|
sum(harmonic_over_day) "harmonicOverDaySum",
|
||||||
|
sum(harmonic_count) "harmonicCountSum",
|
||||||
|
sum(freq_over_day) "freqOverDaySum",
|
||||||
|
sum(freq_count) "freqCountSum",
|
||||||
|
sum(v_dev_over_day) "vDevOverDaySum",
|
||||||
|
sum(v_dev_count) "vDevCountSum",
|
||||||
|
sum(v_over_day) "vOverDaySum",
|
||||||
|
sum(v_count) "vCountSum",
|
||||||
|
sum(i_over_day) "iOverDaySum",
|
||||||
|
sum(i_count) "iCountSum",
|
||||||
|
sum(unbalance_over_day) "unbalanceOverDaySum",
|
||||||
|
sum(unbalance_count) "unbalanceCountSum",
|
||||||
|
sum(i_neg_over_day) "iNegOverDaySum",
|
||||||
|
sum(i_neg_count) "iNegCountSum",
|
||||||
|
sum(flicker_over_day) "flickerOverDaySum",
|
||||||
|
sum(flicker_count) "flickerCountSum",
|
||||||
|
sum(inuharm_over_day) "inuharmOverDaySum",
|
||||||
|
sum(inuharm_count) "inuharmCountSum",
|
||||||
|
|
||||||
|
sum(event_count) "eventCountSum",
|
||||||
|
sum(sag_count) "sagCountSum",
|
||||||
|
sum(swell_count) "swellCountSum",
|
||||||
|
sum(interrupt_count) "interruptCountSum"
|
||||||
|
FROM r_stat_substation_m
|
||||||
|
WHERE substation_id = #{substationId}
|
||||||
|
AND data_date between #{startTime} and #{endTime}
|
||||||
|
) t
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.njcn.prepare.harmonic.service.mysql.newalgorithm;
|
||||||
|
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationQPO;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zbj
|
||||||
|
* @since 2023-06-30
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface RStatSubstationQPOService extends IMppService<RStatSubstationQPO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.njcn.prepare.harmonic.service.mysql.newalgorithm;
|
||||||
|
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationYPO;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zbj
|
||||||
|
* @since 2023-06-30
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface RStatSubstationYPOService extends IMppService<RStatSubstationYPO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.prepare.harmonic.service.mysql.newalgorithm.impl;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatSubstationQPOMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationQPO;
|
||||||
|
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationQPOService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author zbj
|
||||||
|
* @since 2023-06-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RStatSubstationQPOServiceImpl extends MppServiceImpl<RStatSubstationQPOMapper, RStatSubstationQPO> implements RStatSubstationQPOService {
|
||||||
|
}
|
||||||
@@ -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.RStatEventDPOMapper;
|
||||||
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatEventMPOMapper;
|
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.RStatSubstationDPOMapper;
|
||||||
|
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatSubstationMPOMapper;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.*;
|
import com.njcn.prepare.harmonic.pojo.po.*;
|
||||||
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.*;
|
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.*;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
@@ -65,17 +66,23 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
|
|
||||||
private final RStatSubstationMPOService rStatSubstationMPOService;
|
private final RStatSubstationMPOService rStatSubstationMPOService;
|
||||||
|
|
||||||
|
private final RStatSubstationQPOService rStatSubstationQPOService;
|
||||||
|
|
||||||
|
private final RStatSubstationYPOService rStatSubstationYPOService;
|
||||||
|
|
||||||
private final RStatSubstationDPOMapper rStatSubstationDPOMapper;
|
private final RStatSubstationDPOMapper rStatSubstationDPOMapper;
|
||||||
|
|
||||||
|
private final RStatSubstationMPOMapper rStatSubstationMPOMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handler(List<DeptGetSubStationDTO> data, String dataDate, Integer type) {
|
public void handler(List<DeptGetSubStationDTO> data, String dataDate, Integer type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
/* case 1:
|
case 1:
|
||||||
this.rStartEventYHandler (data, dataDate, type);
|
this.rStatSubstationYHandler(data, dataDate, type);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.rStartEventQHandler(data, dataDate, type);
|
this.rStatSubstationQHandler(data, dataDate, type);
|
||||||
break;*/
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
this.rStatSubstationMHandler(data, dataDate, type);
|
this.rStatSubstationMHandler(data, dataDate, type);
|
||||||
break;
|
break;
|
||||||
@@ -377,9 +384,9 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
//r_mp_part_harmonic_detail_m 表中字段求和
|
//r_mp_part_harmonic_detail_m 表中字段求和
|
||||||
Map<String, Object> partSum = rMpPartHarmonicDetailMMapper.getPartSum(startTime, endTime, lineIds);
|
Map<String, Object> partSum = rMpPartHarmonicDetailMMapper.getPartSum(startTime, endTime, lineIds);
|
||||||
//r_mp_surplus_harmonic_detail_m 表中字段求和
|
//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 表中字段求和及计数
|
//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 rStatSubstationMPO = new RStatSubstationMPO();
|
||||||
rStatSubstationMPO.setDataDate(localDate);
|
rStatSubstationMPO.setDataDate(localDate);
|
||||||
@@ -532,9 +539,9 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
//r_mp_part_harmonic_detail_m 表中字段求和
|
//r_mp_part_harmonic_detail_m 表中字段求和
|
||||||
Map<String, Object> partSum = rMpPartHarmonicDetailMMapper.getPartSum(startTime, endTime, lineIds);
|
Map<String, Object> partSum = rMpPartHarmonicDetailMMapper.getPartSum(startTime, endTime, lineIds);
|
||||||
//r_mp_surplus_harmonic_detail_m 表中字段求和
|
//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 表中字段求和及计数
|
//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 rStatSubstationMPO = new RStatSubstationMPO();
|
||||||
rStatSubstationMPO.setDataDate(localDate);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.prepare.harmonic.service.mysql.newalgorithm.impl;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatSubstationQPOMapper;
|
||||||
|
import com.njcn.prepare.harmonic.mapper.mysql.newalgorithm.RStatSubstationYPOMapper;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationQPO;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.RStatSubstationYPO;
|
||||||
|
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationQPOService;
|
||||||
|
import com.njcn.prepare.harmonic.service.mysql.newalgorithm.RStatSubstationYPOService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author zbj
|
||||||
|
* @since 2023-06-30
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RStatSubstationYPOServiceImpl extends MppServiceImpl<RStatSubstationYPOMapper, RStatSubstationYPO> implements RStatSubstationYPOService {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user