合并代码
This commit is contained in:
@@ -77,7 +77,7 @@ public class PwRStatOrgController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("稳态指标超标明细表")
|
||||
@ApiImplicitParam(name = "param", value = "超标明细参数", required = true)
|
||||
public HttpResult<List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO>> getPwRMpPartHarmonicDetail(@RequestBody StatSubstationBizBaseParam param) {
|
||||
public HttpResult<List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO>> getPwRMpPartHarmonicDetail(@RequestBody RStatOrgParam.PwRStatOrgParam param) {
|
||||
String methodDescribe = getMethodDescribe("getPwRMpPartHarmonicDetail");
|
||||
List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> rMpPartHarmonicDetail = pwRStatOrgService.getRMpPartHarmonicDetail(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rMpPartHarmonicDetail, methodDescribe);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
select
|
||||
org_no,
|
||||
data_date,
|
||||
measurement_type_class,
|
||||
measurement_type_class as monitorSort,
|
||||
all_count,
|
||||
effective_measurement_average,
|
||||
effective_measurement_accrued,
|
||||
@@ -25,6 +25,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND measurement_type_class IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
@@ -37,7 +43,7 @@
|
||||
select
|
||||
org_no,
|
||||
data_date,
|
||||
measurement_type_class,
|
||||
measurement_type_class as monitorSort,
|
||||
all_count,
|
||||
effective_measurement_average,
|
||||
effective_measurement_accrued,
|
||||
@@ -55,6 +61,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND measurement_type_class IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
@@ -67,12 +79,12 @@
|
||||
select
|
||||
org_no,
|
||||
data_date,
|
||||
measurement_type_class,
|
||||
measurement_type_class as monitorSort,
|
||||
all_count,
|
||||
effective_measurement_average,
|
||||
effective_measurement_accrued,
|
||||
harmonic_measurement_average,
|
||||
harmonic_measurement_accrued,
|
||||
harmonic_measurement_average as overLimitMeasurementAverage,
|
||||
harmonic_measurement_accrued as overLimitMeasurementAccrued,
|
||||
harmonic_measurement_ratio_average,
|
||||
TRUNCATE(harmonic_measurement_accrued / effective_measurement_accrued ,2) as harmonicMeasurementRatioAccrued,
|
||||
TRUNCATE(over_day_accrued / effective_measurement_accrued ,2) as averageOverDay
|
||||
@@ -85,6 +97,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND measurement_type_class IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.harmonic.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicD;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +17,16 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicD;
|
||||
*/
|
||||
public interface RStatHarmonicDMapper extends BaseMapper<RStatHarmonicD> {
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
* @param param
|
||||
* @param dataType
|
||||
* @param measurementId
|
||||
* @param harmonicId
|
||||
* @return
|
||||
*/
|
||||
List<RStatHarmonicD> selectInfoList(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("dataType") String dataType,
|
||||
@Param("measurementId") String measurementId,
|
||||
@Param("harmonicId") String harmonicId);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.harmonic.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicM;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,5 +17,12 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicM;
|
||||
*/
|
||||
public interface RStatHarmonicMMapper extends BaseMapper<RStatHarmonicM> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询监测点
|
||||
* @param param
|
||||
* @param dataType
|
||||
* @return
|
||||
*/
|
||||
List<RStatHarmonicM> selectInfoList(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("dataType") String dataType);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.harmonic.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicQ;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +17,12 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicQ;
|
||||
*/
|
||||
public interface RStatHarmonicQMapper extends BaseMapper<RStatHarmonicQ> {
|
||||
|
||||
/**
|
||||
* 查询监测点
|
||||
* @param param
|
||||
* @param dataType
|
||||
* @return
|
||||
*/
|
||||
List<RStatHarmonicQ> selectInfoList(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("dataType") String dataType);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.njcn.harmonic.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicVoltageM;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicY;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +18,16 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicVoltageM;
|
||||
*/
|
||||
public interface RStatHarmonicVoltageMMapper extends BaseMapper<RStatHarmonicVoltageM> {
|
||||
|
||||
/**
|
||||
* 监测点数据查询
|
||||
* @param param
|
||||
* @param dataType
|
||||
* @param measurementId
|
||||
* @param harmonicId
|
||||
* @return
|
||||
*/
|
||||
List<RStatHarmonicVoltageM> selectInfoList(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("dataType") String dataType,
|
||||
@Param("measurementId") String measurementId,
|
||||
@Param("harmonicId") String harmonicId);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.harmonic.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicY;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +17,12 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicY;
|
||||
*/
|
||||
public interface RStatHarmonicYMapper extends BaseMapper<RStatHarmonicY> {
|
||||
|
||||
/**
|
||||
* 监测点数据查询
|
||||
* @param param
|
||||
* @param dataType
|
||||
* @return
|
||||
*/
|
||||
List<RStatHarmonicY> selectInfoList(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("dataType") String dataType);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public interface RStatOrgMMapper extends BaseMapper<RStatOrgM> {
|
||||
* @return
|
||||
*/
|
||||
List<RStatSubstationOrgVO> getMonthRStatHarmonicOrgInfo(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("deptIds") List<String> deptIds,
|
||||
@Param("dataType") String dataType);
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@ public interface RStatOrgQMapper extends BaseMapper<RStatOrgQ> {
|
||||
* @return
|
||||
*/
|
||||
List<RStatSubstationOrgVO> getQuarterRStatHarmonicOrgInfo(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("deptIds") List<String> deptIds,
|
||||
@Param("dataType") String dataType);
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,10 +23,12 @@ public interface RStatOrgYMapper extends BaseMapper<RStatOrgY> {
|
||||
/**
|
||||
* 区域稳态指标超标分类统计表--年表数据
|
||||
* @param param
|
||||
* @param deptIds
|
||||
* @param dataType
|
||||
* @return
|
||||
*/
|
||||
List<RStatSubstationOrgVO> getYearRStatHarmonicOrgInfo(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("deptIds") List<String> deptIds,
|
||||
@Param("dataType") String dataType);
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,5 +12,36 @@
|
||||
<result column="over_limit_measurement_ratio" property="overLimitMeasurementRatio" />
|
||||
<result column="data_type" property="dataType" />
|
||||
</resultMap>
|
||||
<select id="selectInfoList" resultType="com.njcn.harmonic.pojo.po.RStatHarmonicD">
|
||||
SELECT
|
||||
data_date,
|
||||
measurement_type_class,
|
||||
harmonic_type,
|
||||
sum(over_limit_measurement) as overLimitMeasurement,
|
||||
sum(over_limit_measurement_ratio) as overLimitMeasurementRatio
|
||||
FROM
|
||||
r_stat_harmonic_d
|
||||
<where>
|
||||
and data_Type=#{dataType}
|
||||
and measurement_type_class=#{measurementId}
|
||||
and harmonic_type=#{harmonicId}
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND data_date <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
data_date,
|
||||
measurement_type_class,
|
||||
harmonic_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -15,5 +15,35 @@
|
||||
<result column="over_limit_measurement_ratio_accrued" property="overLimitMeasurementRatioAccrued" />
|
||||
<result column="data_type" property="dataType" />
|
||||
</resultMap>
|
||||
<select id="selectInfoList" resultType="com.njcn.harmonic.pojo.po.RStatHarmonicM">
|
||||
SELECT
|
||||
measurement_type_class,
|
||||
harmonic_type,
|
||||
sum(over_limit_measurement_average)/count(*) as overLimitMeasurementAverage ,
|
||||
sum(over_limit_measurement_accrued) as overLimitMeasurementAccrued,
|
||||
sum(over_Day) as overDay,
|
||||
sum(over_limit_measurement_ratio_average)/count(*) as overLimitMeasurementRatioAverage,
|
||||
sum(over_limit_measurement_ratio_accrued) as overLimitMeasurementRatioAccrued
|
||||
FROM
|
||||
r_stat_harmonic_m
|
||||
<where>
|
||||
and data_Type=#{dataType}
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND data_date <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
measurement_type_class,
|
||||
harmonic_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -15,5 +15,35 @@
|
||||
<result column="over_limit_measurement_ratio_accrued" property="overLimitMeasurementRatioAccrued" />
|
||||
<result column="data_type" property="dataType" />
|
||||
</resultMap>
|
||||
<select id="selectInfoList" resultType="com.njcn.harmonic.pojo.po.RStatHarmonicQ">
|
||||
SELECT
|
||||
measurement_type_class,
|
||||
harmonic_type,
|
||||
sum(over_limit_measurement_average)/count(*) as overLimitMeasurementAverage ,
|
||||
sum(over_limit_measurement_accrued) as overLimitMeasurementAccrued,
|
||||
sum(average_over_day)/count(*) as averageOverDay,
|
||||
sum(over_limit_measurement_ratio_average)/count(*) as overLimitMeasurementRatioAverage,
|
||||
sum(over_limit_measurement_ratio_accrued) as overLimitMeasurementRatioAccrued
|
||||
FROM
|
||||
r_stat_harmonic_q
|
||||
<where>
|
||||
and data_Type=#{dataType}
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND data_date <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
measurement_type_class,
|
||||
harmonic_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -16,5 +16,39 @@
|
||||
<result column="over_limit_measurement_ratio_accrued" property="overLimitMeasurementRatioAccrued" />
|
||||
<result column="data_type" property="dataType" />
|
||||
</resultMap>
|
||||
<select id="selectInfoList" resultType="com.njcn.harmonic.pojo.po.RStatHarmonicVoltageM">
|
||||
SELECT
|
||||
measurement_type_class,
|
||||
harmonic_type,
|
||||
voltage_type,
|
||||
sum(over_limit_measurement_average)/count(*) as overLimitMeasurementAverage ,
|
||||
sum(over_limit_measurement_accrued) as overLimitMeasurementAccrued,
|
||||
sum(over_Day) as overDay,
|
||||
sum(over_limit_measurement_ratio_average)/count(*) as overLimitMeasurementRatioAverage,
|
||||
sum(over_limit_measurement_ratio_accrued) as overLimitMeasurementRatioAccrued
|
||||
FROM
|
||||
r_stat_harmonic_voltage_m
|
||||
<where>
|
||||
and data_Type=#{dataType}
|
||||
and measurement_type_class=#{measurementId}
|
||||
and harmonic_type=#{harmonicId}
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND data_date <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
voltage_type,
|
||||
measurement_type_class,
|
||||
harmonic_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -15,5 +15,35 @@
|
||||
<result column="over_limit_measurement_ratio_accrued" property="overLimitMeasurementRatioAccrued" />
|
||||
<result column="data_type" property="dataType" />
|
||||
</resultMap>
|
||||
<select id="selectInfoList" resultType="com.njcn.harmonic.pojo.po.RStatHarmonicY">
|
||||
SELECT
|
||||
measurement_type_class,
|
||||
harmonic_type,
|
||||
sum(over_limit_measurement_average)/count(*) as overLimitMeasurementAverage ,
|
||||
sum(over_limit_measurement_accrued) as overLimitMeasurementAccrued,
|
||||
sum(average_over_day)/count(*) as averageOverDay,
|
||||
sum(over_limit_measurement_ratio_average)/count(*) as overLimitMeasurementRatioAverage,
|
||||
sum(over_limit_measurement_ratio_accrued) as overLimitMeasurementRatioAccrued
|
||||
FROM
|
||||
r_stat_harmonic_y
|
||||
<where>
|
||||
and data_Type=#{dataType}
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND data_date <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
measurement_type_class,
|
||||
harmonic_type
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<select id="getMonthRStatHarmonicOrgInfo" resultType="com.njcn.harmonic.pojo.vo.RStatSubstationOrgVO">
|
||||
SELECT
|
||||
rso.org_no AS orgNo,
|
||||
rso.measurement_type_class,
|
||||
rso.data_date AS dataDate,
|
||||
rso.effective_measurement_average AS effectiveMeasurementAverage,
|
||||
rso.effective_measurement_accrued AS effectiveMeasurementAccrued,
|
||||
@@ -118,11 +119,17 @@
|
||||
<where>
|
||||
c.data_Type=#{dataType} and rso.data_Type=#{dataType}
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND rso.org_no IN
|
||||
AND rso.measurement_type_class IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deptIds != null and deptIds.size > 0">
|
||||
AND rso.org_no IN
|
||||
<foreach collection='deptIds' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND rso.data_date >= #{param.startTime} AND c.data_date >= #{param.startTime}
|
||||
</if>
|
||||
@@ -163,7 +170,7 @@
|
||||
<select id="getPwMonthRStatOrgIndex" resultType="com.njcn.harmonic.pojo.vo.PwRStatOrgVO">
|
||||
select
|
||||
org_no,
|
||||
measurement_type_class,
|
||||
measurement_type_class as monitorSort,
|
||||
effective_measurement_accrued as allCount,
|
||||
freq_pass_rate,
|
||||
v_dev_pass_rate,
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<select id="getQuarterRStatHarmonicOrgInfo" resultType="com.njcn.harmonic.pojo.vo.RStatSubstationOrgVO">
|
||||
SELECT
|
||||
rso.org_no AS orgNo,
|
||||
rso.measurement_type_class,
|
||||
rso.data_date AS dataDate,
|
||||
rso.effective_measurement_average AS effectiveMeasurementAverage,
|
||||
rso.effective_measurement_accrued AS effectiveMeasurementAccrued,
|
||||
@@ -118,11 +119,17 @@
|
||||
<where>
|
||||
c.data_Type=#{dataType} and rso.data_Type=#{dataType}
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND rso.org_no IN
|
||||
AND rso.measurement_type_class IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deptIds != null and deptIds.size > 0">
|
||||
AND rso.org_no IN
|
||||
<foreach collection='deptIds' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND rso.data_date >= #{param.startTime} AND c.data_date >= #{param.startTime}
|
||||
</if>
|
||||
@@ -163,7 +170,7 @@
|
||||
<select id="getPwQuarterRStatOrgIndex" resultType="com.njcn.harmonic.pojo.vo.PwRStatOrgVO">
|
||||
select
|
||||
org_no,
|
||||
measurement_type_class,
|
||||
measurement_type_class as monitorSort,
|
||||
effective_measurement_accrued as allCount,
|
||||
freq_pass_rate,
|
||||
v_dev_pass_rate,
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<select id="getYearRStatHarmonicOrgInfo" resultType="com.njcn.harmonic.pojo.vo.RStatSubstationOrgVO">
|
||||
SELECT
|
||||
rso.org_no AS orgNo,
|
||||
rso.measurement_type_class,
|
||||
rso.data_date AS dataDate,
|
||||
rso.effective_measurement_average AS effectiveMeasurementAverage,
|
||||
rso.effective_measurement_accrued AS effectiveMeasurementAccrued,
|
||||
@@ -118,11 +119,17 @@
|
||||
<where>
|
||||
c.data_Type=#{dataType} and rso.data_Type=#{dataType}
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND rso.org_no IN
|
||||
AND rso.measurement_type_class IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deptIds != null and deptIds.size > 0">
|
||||
AND rso.org_no IN
|
||||
<foreach collection='deptIds' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND rso.data_date >= #{param.startTime} and c.data_date >= #{param.startTime}
|
||||
</if>
|
||||
@@ -163,7 +170,7 @@
|
||||
<select id="getPwYearRStatOrgIndex" resultType="com.njcn.harmonic.pojo.vo.PwRStatOrgVO">
|
||||
select
|
||||
org_no,
|
||||
measurement_type_class,
|
||||
measurement_type_class as monitorSort,
|
||||
effective_measurement_accrued as allCount,
|
||||
freq_pass_rate,
|
||||
v_dev_pass_rate,
|
||||
|
||||
@@ -55,5 +55,5 @@ public interface PwRStatOrgService extends IService<RStatOrgQ> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> getRMpPartHarmonicDetail(StatSubstationBizBaseParam param);
|
||||
List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> getRMpPartHarmonicDetail(RStatOrgParam.PwRStatOrgParam param);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.mapper.distribution.PwRMpBenchmarkLevelQMapper;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelQService;
|
||||
@@ -20,7 +19,6 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.mapper.distribution.PwRMpBenchmarkLevelYMapper;
|
||||
import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelQ;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelY;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelYService;
|
||||
@@ -20,7 +19,6 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -19,6 +19,9 @@ import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -51,18 +54,16 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
private final RMpPassRateQMapper rMpPassRateQMapper;
|
||||
private final RMpPassRateMMapper rMpPassRateMMapper;
|
||||
private final RMpSurplusHarmonicDetailMMapper rMpSurplusHarmonicDetailMMapper;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
public List<RStatOrgVO.PwRStatOrgVO> getRStatHarmonicAll(StatSubstationBizBaseParam param) {
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
pwPmsMonitorParam.setMonitorSort(param.getIds());
|
||||
List<PwPmsMonitorDTO> data = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
//获取部门id集合
|
||||
List<String> deptIds = data.stream().map(PwPmsMonitorDTO::getOrgId).collect(Collectors.toList());
|
||||
Map<String, PwPmsMonitorDTO> deptMap = data.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getOrgId, Function.identity()));
|
||||
//获取配网信息
|
||||
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
List<RStatOrgVO.PwRStatOrgVO> info = new ArrayList<>();
|
||||
@@ -89,9 +90,8 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
collect.forEach((key, value) -> {
|
||||
if (deptMap.containsKey(key)) {
|
||||
for (RStatOrgVO.PwRStatOrgVO org : value) {
|
||||
PwPmsMonitorDTO deptDTO = deptMap.get(key);
|
||||
org.setOrgName(deptDTO.getOrgName());
|
||||
org.setMonitorSort(deptDTO.getMonitorSort());
|
||||
DeptDTO deptDTO = deptMap.get(key);
|
||||
org.setOrgName(deptDTO.getName());
|
||||
newList.add(org);
|
||||
}
|
||||
}
|
||||
@@ -104,16 +104,19 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
@Override
|
||||
public List<PwRStatOrgVO> getRStatOrgIndex(StatSubstationBizBaseParam param) {
|
||||
// 获取当前用户的部门的子部门信息
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
pwPmsMonitorParam.setMonitorSort(param.getIds());
|
||||
List<PwPmsMonitorDTO> data = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
// PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
// pwPmsMonitorParam.setOrgId(param.getId());
|
||||
// pwPmsMonitorParam.setMonitorSort(param.getIds());
|
||||
// List<PwPmsMonitorDTO> data = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
//获取配网信息
|
||||
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
List<PwRStatOrgVO> info=new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
if (CollectionUtil.isNotEmpty(deptDTOList)) {
|
||||
// 过滤出部门id
|
||||
List<String> deptIds = data.stream().map(PwPmsMonitorDTO::getOrgId).collect(Collectors.toList());
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
// 类型(1年 2季度 3月份 4日
|
||||
@@ -135,12 +138,10 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
}
|
||||
}
|
||||
//匹配名称
|
||||
for (PwPmsMonitorDTO dto : data) {
|
||||
for (DeptDTO dto : deptDTOList) {
|
||||
for (PwRStatOrgVO vo : info) {
|
||||
if (dto.getOrgId().equals(vo.getOrgNo())) {
|
||||
vo.setOrgNo(dto.getOrgId());
|
||||
vo.setMonitorSort(dto.getMonitorSort());
|
||||
vo.setOrgName(dto.getOrgName());
|
||||
if (dto.getCode().equals(vo.getOrgNo())) {
|
||||
vo.setOrgName(dto.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,7 +166,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
pwPmsMonitorParam.setMonitorName(param.getMonitorName());
|
||||
List<PwPmsMonitorDTO> monitorDTOList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> monitorDTOMap = monitorDTOList.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity()));
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(),(key1,key2) ->key2));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(monitorDTOList)) {
|
||||
//获取最新过滤的监测点id
|
||||
@@ -222,42 +223,33 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
|
||||
@Override
|
||||
public List<RStatSubstationOrg2VO.PwRStatSubstationOrgVO> getRStatSubstationOrg(StatSubstationBizBaseParam param) {
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//监测点类别
|
||||
pwPmsMonitorParam.setMonitorSort(param.getIds());
|
||||
//获取配网监测点信息
|
||||
List<PwPmsMonitorDTO> monitorDTOList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> monitorDTOMap = monitorDTOList.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getOrgId, Function.identity()));
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
//初始化
|
||||
List<RStatSubstationOrg2VO.PwRStatSubstationOrgVO> info = new ArrayList<>();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(monitorDTOList)) {
|
||||
if (CollectionUtil.isNotEmpty(deptDTOList)) {
|
||||
// 根据暂态指标枚举查询暂态指标
|
||||
List<DictData> steadyStatis = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
List<RStatSubstationOrgVO> temp = new ArrayList<>();
|
||||
// 过滤出部门id
|
||||
List<String> deptIds = monitorDTOList.stream().map(PwPmsMonitorDTO::getOrgId).collect(Collectors.toList());
|
||||
param.setIds(deptIds);
|
||||
|
||||
//获取配网信息
|
||||
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
|
||||
//选择数据时间范围
|
||||
switch (param.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// 获取年区域暂态指标分类统计表
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(param, distributionData.getId());
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(param,deptIds, distributionData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// 获取季区域暂态指标分类统计表
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(param, distributionData.getId());
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(param,deptIds,distributionData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// 获取月区域暂态指标分类统计表
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(param, distributionData.getId());
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(param,deptIds,distributionData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -267,12 +259,12 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
map.forEach((key, value) -> {
|
||||
RStatSubstationOrg2VO.PwRStatSubstationOrgVO vo = new RStatSubstationOrg2VO.PwRStatSubstationOrgVO();
|
||||
//获取部门信息
|
||||
if (monitorDTOMap.containsKey(key)) {
|
||||
PwPmsMonitorDTO pwPmsMonitorDTO = monitorDTOMap.get(key);
|
||||
vo.setOrgName(pwPmsMonitorDTO.getOrgName());
|
||||
vo.setMonitorSort(pwPmsMonitorDTO.getMonitorSort());
|
||||
if (deptMap.containsKey(key)) {
|
||||
DeptDTO deptDTO = deptMap.get(key);
|
||||
vo.setOrgName(deptDTO.getName());
|
||||
}
|
||||
vo.setOrgNo(value.get(0).getOrgNo());
|
||||
vo.setMonitorSort(value.get(0).getMeasurementTypeClass());
|
||||
vo.setDataDate(value.get(0).getDataDate());
|
||||
vo.setEffectiveMeasurementAverage(value.get(0).getEffectiveMeasurementAverage());
|
||||
vo.setEffectiveMeasurementAccrued(value.get(0).getEffectiveMeasurementAccrued());
|
||||
@@ -396,16 +388,20 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> getRMpPartHarmonicDetail(StatSubstationBizBaseParam param) {
|
||||
public List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> getRMpPartHarmonicDetail(RStatOrgParam.PwRStatOrgParam param) {
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//电压等级
|
||||
pwPmsMonitorParam.setVoltageLevels(param.getVoltageLevels());
|
||||
//监测点类别
|
||||
pwPmsMonitorParam.setMonitorSort(param.getIds());
|
||||
pwPmsMonitorParam.setMonitorSort(param.getMonitorSort());
|
||||
//监测点名称
|
||||
pwPmsMonitorParam.setMonitorName(param.getMonitorName());
|
||||
//获取配网监测点信息
|
||||
List<PwPmsMonitorDTO> pwPmsMonitorDTOS = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> pwPmsMonitorDTOMap = pwPmsMonitorDTOS.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity()));
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId,Function.identity(),(key1, key2) -> key2));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(pwPmsMonitorDTOS)) {
|
||||
//获取监测点id
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -233,7 +233,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (Integer.parseInt(contion) != 60 || Integer.parseInt(contion) != 61 || Integer.parseInt(contion) != 62) {
|
||||
if (!Integer.valueOf(contion).equals(60) && !Integer.valueOf(contion).equals(61) && !Integer.valueOf(contion).equals(62)) {
|
||||
stringBuilder.append(" and ").append(InfluxDBPublicParam.VALUETYPE + "='").append(valueTypeName).append("'");
|
||||
}
|
||||
String sql = "";
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
@@ -48,8 +47,6 @@ implements RMpBenchmarkLevelMService {
|
||||
|
||||
private final MonitorClient monitorClient;
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
@Override
|
||||
public List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
@@ -48,8 +47,6 @@ implements RMpBenchmarkLevelQService {
|
||||
|
||||
private final MonitorClient monitorClient;
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
@Override
|
||||
public List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
@@ -48,8 +47,6 @@ implements RMpBenchmarkLevelYService {
|
||||
|
||||
private final MonitorClient monitorClient;
|
||||
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
|
||||
@Override
|
||||
public List<RMpBenchmarkLevelVO> getRMpBenchmarkLevelList(RMpBenchmarkLevelParam rMpBenchmarkLevelParam) {
|
||||
//提取查询条件
|
||||
|
||||
@@ -6,13 +6,13 @@ import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatHarmonicDMapper;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatHarmonicMMapper;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatHarmonicVoltageMMapper;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicD;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicM;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicVoltageM;
|
||||
@@ -28,7 +28,6 @@ import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
@@ -78,15 +77,13 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectList(new LambdaQueryWrapper<RStatHarmonicM>()
|
||||
.in(RStatHarmonicM::getOrgNo,deptIds)
|
||||
.eq(RStatHarmonicM::getDataType, mainnetData.getId())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatHarmonicM::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatHarmonicM::getDataDate, param.getEndTime()));
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
@@ -157,9 +154,9 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
@Override
|
||||
public List<RIconVO> getRStatHarmonicIconVoltage(RStatHarmonicMParam param) {
|
||||
//干扰数据类型(监测对象)
|
||||
DictData measurementDate = null;
|
||||
DictData measurementDate;
|
||||
//指标对象类型属性
|
||||
DictData harmonicDate = null;
|
||||
DictData harmonicDate;
|
||||
//判断是是否传入检测点信息值(电压)
|
||||
if (StrUtil.isBlank(param.getStasisID()) && StrUtil.isBlank(param.getMonitorID())) {
|
||||
//干扰数据类型(监测对象)
|
||||
@@ -196,17 +193,15 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<RIconVO> arrayVOList = new ArrayList<>();
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
List<RStatHarmonicVoltageM> rStatHarmonicVoltageMS = rStatHarmonicVoltageMMapper.selectList(new LambdaQueryWrapper<RStatHarmonicVoltageM>()
|
||||
.in(RStatHarmonicVoltageM::getOrgNo,deptIds)
|
||||
.eq(RStatHarmonicVoltageM::getDataType, mainnetData.getId())
|
||||
.eq(RStatHarmonicVoltageM::getMeasurementTypeClass, measurementDate.getId())
|
||||
.eq(RStatHarmonicVoltageM::getHarmonicType, harmonicDate.getId())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatHarmonicVoltageM::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatHarmonicVoltageM::getDataDate, param.getEndTime())
|
||||
);
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicVoltageM> rStatHarmonicVoltageMS = rStatHarmonicVoltageMMapper
|
||||
.selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
|
||||
//将数据转换为map进行便利
|
||||
Map<String, RStatHarmonicVoltageM> voltageMMap = rStatHarmonicVoltageMS.stream()
|
||||
.collect(Collectors.toMap(RStatHarmonicVoltageM::getVoltageType, Function.identity()));
|
||||
@@ -230,6 +225,20 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
}
|
||||
});
|
||||
}
|
||||
//处理主节点不存在的集合
|
||||
List<DictData> notMeasurementList = devVoltageData.stream().filter(r -> !voltageMMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
for (DictData notData : notMeasurementList) {
|
||||
RIconVO iconVO = new RIconVO();
|
||||
iconVO.setRowName(notData.getName());
|
||||
iconVO.setSort(notData.getSort());
|
||||
iconVO.setOverLimitMeasurementAverage(0);
|
||||
iconVO.setOverLimitMeasurementAccrued(0);
|
||||
iconVO.setOverLimitMeasurementRatioAverage(0f);
|
||||
iconVO.setOverLimitMeasurementRatioAccrued(0f);
|
||||
iconVO.setAverageOverDay(0f);
|
||||
arrayVOList.add(iconVO);
|
||||
}
|
||||
arrayVOList.sort(Comparator.comparing(rIconVO -> rIconVO.getSort()));
|
||||
return arrayVOList;
|
||||
}
|
||||
@@ -271,17 +280,15 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper.selectList(new LambdaQueryWrapper<RStatHarmonicD>()
|
||||
.in(RStatHarmonicD::getOrgNo,deptIds)
|
||||
.eq(RStatHarmonicD::getDataType, mainnetData.getId())
|
||||
.eq(RStatHarmonicD::getMeasurementTypeClass, measurementDate.getId())
|
||||
.eq(RStatHarmonicD::getHarmonicType, harmonicDate.getId())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatHarmonicD::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatHarmonicD::getDataDate, param.getEndTime())
|
||||
);
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper
|
||||
.selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
|
||||
Map<LocalDate, List<RStatHarmonicD>> collect =
|
||||
rStatHarmonicVoltageMS.stream().collect(Collectors.groupingBy(RStatHarmonicD::getDataDate));
|
||||
|
||||
@@ -339,15 +346,13 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectList(new LambdaQueryWrapper<RStatHarmonicM>()
|
||||
.in(RStatHarmonicM::getOrgNo,deptIds)
|
||||
.eq(RStatHarmonicM::getDataType, distributionData.getId())
|
||||
.ge(param.getStartTime() != null, RStatHarmonicM::getDataDate, param.getStartTime())
|
||||
.le(param.getEndTime() != null, RStatHarmonicM::getDataDate, param.getEndTime()));
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicM>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicM::getHarmonicType));
|
||||
@@ -437,17 +442,15 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper.selectList(new LambdaQueryWrapper<RStatHarmonicD>()
|
||||
.in(RStatHarmonicD::getOrgNo,deptIds)
|
||||
.eq(RStatHarmonicD::getDataType, distributionData.getId())
|
||||
.eq(RStatHarmonicD::getMeasurementTypeClass, measurementDate.getId())
|
||||
.eq(RStatHarmonicD::getHarmonicType, harmonicDate.getId())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatHarmonicD::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatHarmonicD::getDataDate, param.getEndTime())
|
||||
);
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper
|
||||
.selectInfoList(baseParam,distributionData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
|
||||
Map<LocalDate, List<RStatHarmonicD>> collect =
|
||||
rStatHarmonicVoltageMS.stream().collect(Collectors.groupingBy(RStatHarmonicD::getDataDate));
|
||||
|
||||
|
||||
@@ -198,6 +198,20 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
}
|
||||
});
|
||||
}
|
||||
//处理主节点不存在的集合
|
||||
List<DeptDTO> notMeasurementList = deptDTOList.stream().filter(r -> !voltageMMap.containsKey(r.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
for (DeptDTO notData : notMeasurementList) {
|
||||
RIconVO iconVO = new RIconVO();
|
||||
iconVO.setRowName(notData.getName());
|
||||
iconVO.setSort(notData.getSort());
|
||||
iconVO.setOverLimitMeasurementAverage(0);
|
||||
iconVO.setOverLimitMeasurementAccrued(0);
|
||||
iconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
iconVO.setOverLimitMeasurementRatioAccrued(0.0F);
|
||||
iconVO.setAverageOverDay(0.0F);
|
||||
arrayVOList.add(iconVO);
|
||||
}
|
||||
arrayVOList.sort(Comparator.comparing(rIconVO -> rIconVO.getSort()));
|
||||
return arrayVOList;
|
||||
}
|
||||
@@ -341,6 +355,20 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
}
|
||||
});
|
||||
}
|
||||
//处理主节点不存在的集合
|
||||
List<DeptDTO> notMeasurementList = deptDTOList.stream().filter(r -> !voltageMMap.containsKey(r.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
for (DeptDTO notData : notMeasurementList) {
|
||||
RIconVO iconVO = new RIconVO();
|
||||
iconVO.setRowName(notData.getName());
|
||||
iconVO.setSort(notData.getSort());
|
||||
iconVO.setOverLimitMeasurementAverage(0);
|
||||
iconVO.setOverLimitMeasurementAccrued(0);
|
||||
iconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
iconVO.setOverLimitMeasurementRatioAccrued(0.0F);
|
||||
iconVO.setAverageOverDay(0.0F);
|
||||
arrayVOList.add(iconVO);
|
||||
}
|
||||
arrayVOList.sort(Comparator.comparing(rIconVO -> rIconVO.getSort()));
|
||||
return arrayVOList;
|
||||
}
|
||||
|
||||
@@ -191,6 +191,20 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
}
|
||||
});
|
||||
}
|
||||
//处理主节点不存在的集合
|
||||
List<DeptDTO> notMeasurementList = deptDTOList.stream().filter(r -> !voltageMMap.containsKey(r.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
for (DeptDTO notData : notMeasurementList) {
|
||||
RIconVO iconVO = new RIconVO();
|
||||
iconVO.setRowName(notData.getName());
|
||||
iconVO.setSort(notData.getSort());
|
||||
iconVO.setOverLimitMeasurementAverage(0);
|
||||
iconVO.setOverLimitMeasurementAccrued(0);
|
||||
iconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
iconVO.setOverLimitMeasurementRatioAccrued(0.0F);
|
||||
iconVO.setAverageOverDay(0.0F);
|
||||
arrayVOList.add(iconVO);
|
||||
}
|
||||
arrayVOList.sort(Comparator.comparing(rIconVO -> rIconVO.getSort()));
|
||||
return arrayVOList;
|
||||
}
|
||||
@@ -327,6 +341,20 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
}
|
||||
});
|
||||
}
|
||||
//处理主节点不存在的集合
|
||||
List<DeptDTO> notMeasurementList = deptDTOList.stream().filter(r -> !voltageMMap.containsKey(r.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
for (DeptDTO notData : notMeasurementList) {
|
||||
RIconVO iconVO = new RIconVO();
|
||||
iconVO.setRowName(notData.getName());
|
||||
iconVO.setSort(notData.getSort());
|
||||
iconVO.setOverLimitMeasurementAverage(0);
|
||||
iconVO.setOverLimitMeasurementAccrued(0);
|
||||
iconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
iconVO.setOverLimitMeasurementRatioAccrued(0.0F);
|
||||
iconVO.setAverageOverDay(0.0F);
|
||||
arrayVOList.add(iconVO);
|
||||
}
|
||||
arrayVOList.sort(Comparator.comparing(rIconVO -> rIconVO.getSort()));
|
||||
return arrayVOList;
|
||||
}
|
||||
|
||||
@@ -192,6 +192,20 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
});
|
||||
}
|
||||
//处理主节点不存在的集合
|
||||
List<DeptDTO> notMeasurementList = deptDTOList.stream().filter(r -> !voltageMMap.containsKey(r.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
for (DeptDTO notData : notMeasurementList) {
|
||||
RIconVO iconVO = new RIconVO();
|
||||
iconVO.setRowName(notData.getName());
|
||||
iconVO.setSort(notData.getSort());
|
||||
iconVO.setOverLimitMeasurementAverage(0);
|
||||
iconVO.setOverLimitMeasurementAccrued(0);
|
||||
iconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
iconVO.setOverLimitMeasurementRatioAccrued(0.0F);
|
||||
iconVO.setAverageOverDay(0.0F);
|
||||
arrayVOList.add(iconVO);
|
||||
}
|
||||
arrayVOList.sort(Comparator.comparing(rIconVO -> rIconVO.getSort()));
|
||||
return arrayVOList;
|
||||
}
|
||||
@@ -328,6 +342,20 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
});
|
||||
}
|
||||
//处理主节点不存在的集合
|
||||
List<DeptDTO> notMeasurementList = deptDTOList.stream().filter(r -> !voltageMMap.containsKey(r.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
for (DeptDTO notData : notMeasurementList) {
|
||||
RIconVO iconVO = new RIconVO();
|
||||
iconVO.setRowName(notData.getName());
|
||||
iconVO.setSort(notData.getSort());
|
||||
iconVO.setOverLimitMeasurementAverage(0);
|
||||
iconVO.setOverLimitMeasurementAccrued(0);
|
||||
iconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
iconVO.setOverLimitMeasurementRatioAccrued(0.0F);
|
||||
iconVO.setAverageOverDay(0.0F);
|
||||
arrayVOList.add(iconVO);
|
||||
}
|
||||
arrayVOList.sort(Comparator.comparing(rIconVO -> rIconVO.getSort()));
|
||||
return arrayVOList;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ package com.njcn.harmonic.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatHarmonicQMapper;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicQ;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
|
||||
@@ -17,7 +16,6 @@ import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -59,15 +57,13 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectList(new LambdaQueryWrapper<RStatHarmonicQ>()
|
||||
.in(RStatHarmonicQ::getOrgNo,deptIds)
|
||||
.eq(RStatHarmonicQ::getDataType, mainnetData.getId())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatHarmonicQ::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatHarmonicQ::getDataDate, param.getEndTime()));
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
@@ -153,15 +149,13 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectList(new LambdaQueryWrapper<RStatHarmonicQ>()
|
||||
.in(RStatHarmonicQ::getOrgNo,deptIds )
|
||||
.eq(RStatHarmonicQ::getDataType, distributionData.getId())
|
||||
.ge(param.getStartTime() != null, RStatHarmonicQ::getDataDate, param.getStartTime())
|
||||
.le(param.getEndTime() != null, RStatHarmonicQ::getDataDate, param.getEndTime()));
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicQ>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicQ::getHarmonicType));
|
||||
|
||||
@@ -2,11 +2,10 @@ package com.njcn.harmonic.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatHarmonicYMapper;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicY;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
|
||||
@@ -58,20 +57,17 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectList(new LambdaQueryWrapper<RStatHarmonicY>()
|
||||
.in(RStatHarmonicY::getOrgNo,deptIds)
|
||||
.eq(RStatHarmonicY::getDataType, mainnetData.getId())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatHarmonicY::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatHarmonicY::getDataDate, param.getEndTime()));
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
|
||||
|
||||
List<RStatHarmonicMVO> rm = new ArrayList<>();
|
||||
for (DictData lineTypeDatum : interferenceSourceTypeData) {
|
||||
RStatHarmonicMVO r = new RStatHarmonicMVO();
|
||||
@@ -93,7 +89,9 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
arrayVOList.add(r);
|
||||
}
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicY>> MeasurementTypeClassMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicY::getHarmonicType));
|
||||
Map<String, List<RStatHarmonicY>> MeasurementTypeClassMap = list.stream().collect(
|
||||
Collectors.groupingBy(RStatHarmonicY::getHarmonicType));
|
||||
|
||||
//重新生成数据结构
|
||||
MeasurementTypeClassMap.forEach((key, value) -> {
|
||||
if (lineTypeMap.containsKey(key)) {
|
||||
@@ -112,7 +110,6 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
r.setOverDay(0);
|
||||
b.add(r);
|
||||
}
|
||||
|
||||
}
|
||||
Map<String, RStatHarmonicMVO> linkedHashMap = new LinkedHashMap<>();
|
||||
for (RStatHarmonicMVO harmonicMVO : b) {
|
||||
@@ -154,15 +151,14 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectList(new LambdaQueryWrapper<RStatHarmonicY>()
|
||||
.in(RStatHarmonicY::getOrgNo, deptIds)
|
||||
.eq(RStatHarmonicY::getDataType, distributionData.getId())
|
||||
.ge(param.getStartTime() != null, RStatHarmonicY::getDataDate, param.getStartTime())
|
||||
.le(param.getEndTime() != null, RStatHarmonicY::getDataDate, param.getEndTime()));
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicY>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicY::getHarmonicType));
|
||||
|
||||
|
||||
@@ -81,57 +81,63 @@ public class RStatLoadTypeServiceImpl extends ServiceImpl<RStatLoadTypeMMapper,
|
||||
break;
|
||||
|
||||
}
|
||||
// 匹配单位名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatLoadTypeVO vo : temp) {
|
||||
if (dto.getId().equals(vo.getOrgNo())) {
|
||||
vo.setOrgName(dto.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
//根据部门id进行分组
|
||||
Map<String, List<RStatLoadTypeVO>> map = temp
|
||||
.stream().collect(Collectors.groupingBy(RStatLoadTypeVO::getOrgNo));
|
||||
map.forEach((key, value) -> {
|
||||
RArrayVO arrayVO = new RArrayVO();
|
||||
arrayVO.setRowName(value.get(0).getOrgName());
|
||||
//属性赋值监测点名称
|
||||
for (DictData dictDatum : dictData) {
|
||||
for (RStatLoadTypeVO rStatLoadTypeVO : value) {
|
||||
if (dictDatum.getId().equals(rStatLoadTypeVO.getLoadType())) {
|
||||
rStatLoadTypeVO.setLoadName(dictDatum.getName());
|
||||
rStatLoadTypeVO.setSort(dictDatum.getSort());
|
||||
|
||||
if(CollectionUtil.isNotEmpty(temp)){
|
||||
// 匹配单位名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatLoadTypeVO vo : temp) {
|
||||
if (dto.getCode().equals(vo.getOrgNo())) {
|
||||
vo.setOrgName(dto.getName());
|
||||
vo.setSort(dto.getSort());
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取差集(数据在字典里面没有的集合)
|
||||
Map<String, List<RStatLoadTypeVO>> listMap = value.stream().collect(Collectors.groupingBy(RStatLoadTypeVO::getLoadType));
|
||||
List<DictData> differenceList = dictData.stream().filter(r -> !listMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
for (DictData data4 : differenceList) {
|
||||
RStatLoadTypeVO vo = new RStatLoadTypeVO();
|
||||
vo.setSort(data4.getSort());
|
||||
vo.setOrgNo(key);
|
||||
vo.setOrgName(value.get(0).getOrgName());
|
||||
vo.setLoadType(data4.getId());
|
||||
vo.setLoadName(data4.getName());
|
||||
vo.setVAverage(0.0f);
|
||||
vo.setVAccrued(0.0f);
|
||||
vo.setIAverage(0.0f);
|
||||
vo.setIAccrued(0.0f);
|
||||
vo.setUnbalanceAverage(0.0f);
|
||||
vo.setUnbalanceAccrued(0.0f);
|
||||
vo.setINegAverage(0.0f);
|
||||
vo.setINegAccrued(0.0f);
|
||||
vo.setFlickerAverage(0.0f);
|
||||
vo.setFlickerAccrued(0.0f);
|
||||
value.add(vo);
|
||||
}
|
||||
value.sort(Comparator.comparing(r -> r.getSort()));
|
||||
arrayVO.setColumns(value);
|
||||
info.add(arrayVO);
|
||||
});
|
||||
//根据部门id进行分组
|
||||
Map<String, List<RStatLoadTypeVO>> map = temp
|
||||
.stream().collect(Collectors.groupingBy(RStatLoadTypeVO::getOrgNo));
|
||||
map.forEach((key, value) -> {
|
||||
RArrayVO arrayVO = new RArrayVO();
|
||||
arrayVO.setRowName(value.get(0).getOrgName());
|
||||
arrayVO.setSort(value.get(0).getSort());
|
||||
//属性赋值监测点名称
|
||||
for (DictData dictDatum : dictData) {
|
||||
for (RStatLoadTypeVO rStatLoadTypeVO : value) {
|
||||
if (dictDatum.getId().equals(rStatLoadTypeVO.getLoadType())) {
|
||||
rStatLoadTypeVO.setLoadName(dictDatum.getName());
|
||||
rStatLoadTypeVO.setSort(dictDatum.getSort());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取差集(数据在字典里面没有的集合)
|
||||
Map<String, List<RStatLoadTypeVO>> listMap = value.stream().collect(Collectors.groupingBy(RStatLoadTypeVO::getLoadType));
|
||||
List<DictData> differenceList = dictData.stream().filter(r -> !listMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
for (DictData data4 : differenceList) {
|
||||
RStatLoadTypeVO vo = new RStatLoadTypeVO();
|
||||
vo.setSort(data4.getSort());
|
||||
vo.setOrgNo(key);
|
||||
vo.setOrgName(value.get(0).getOrgName());
|
||||
vo.setLoadType(data4.getId());
|
||||
vo.setLoadName(data4.getName());
|
||||
vo.setVAverage(0.0f);
|
||||
vo.setVAccrued(0.0f);
|
||||
vo.setIAverage(0.0f);
|
||||
vo.setIAccrued(0.0f);
|
||||
vo.setUnbalanceAverage(0.0f);
|
||||
vo.setUnbalanceAccrued(0.0f);
|
||||
vo.setINegAverage(0.0f);
|
||||
vo.setINegAccrued(0.0f);
|
||||
vo.setFlickerAverage(0.0f);
|
||||
vo.setFlickerAccrued(0.0f);
|
||||
value.add(vo);
|
||||
}
|
||||
value.sort(Comparator.comparing(r -> r.getSort()));
|
||||
arrayVO.setColumns(value);
|
||||
info.add(arrayVO);
|
||||
});
|
||||
}
|
||||
info.sort(Comparator.comparing(r -> r.getSort()));
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
|
||||
// 过滤出部门id
|
||||
List<String> deptIds = data.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
|
||||
//获取主网id信息
|
||||
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
|
||||
@@ -130,150 +130,153 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
|
||||
switch (param.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// 获取年区域暂态指标分类统计表
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(baseParam, mainnetData.getId());
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// 获取季区域暂态指标分类统计表
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(baseParam, mainnetData.getId());
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// 获取月区域暂态指标分类统计表
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(baseParam, mainnetData.getId());
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Map<String, List<RStatSubstationOrgVO>> map = temp
|
||||
.stream().collect(Collectors.groupingBy(RStatSubstationOrgVO::getOrgNo));
|
||||
map.forEach((key, value) -> {
|
||||
RStatSubstationOrg2VO vo = new RStatSubstationOrg2VO();
|
||||
vo.setOrgNo(value.get(0).getOrgNo());
|
||||
vo.setOrgName(value.get(0).getOrgName());
|
||||
vo.setDataDate(value.get(0).getDataDate());
|
||||
vo.setEffectiveMeasurementAverage(value.get(0).getEffectiveMeasurementAverage());
|
||||
vo.setEffectiveMeasurementAccrued(value.get(0).getEffectiveMeasurementAccrued());
|
||||
vo.setHarmonicMeasurementAverage(value.get(0).getHarmonicMeasurementAverage());
|
||||
vo.setHarmonicMeasurementAccrued(value.get(0).getHarmonicMeasurementAccrued());
|
||||
vo.setHarmonicMeasurementRatioAverage(value.get(0).getHarmonicMeasurementRatioAverage());
|
||||
vo.setHarmonicMeasurementRatioAccrued(value.get(0).getHarmonicMeasurementRatioAccrued());
|
||||
//遍历赋值
|
||||
for (RStatSubstationOrgVO orgVO : value) {
|
||||
for (DictData eventStati : eventStatis) {
|
||||
if (eventStati.getId().equals(orgVO.getHarmonicType())) {
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.FREQUENCY_DEV)) {
|
||||
vo.setTAverage(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage(orgVO.getChainAverage());
|
||||
vo.setChainAccrued(orgVO.getChainAccrued());
|
||||
vo.setSameAverage(orgVO.getSameAverage());
|
||||
vo.setSameAccrued(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.VOLTAGE_DEV)) {
|
||||
vo.setTAverage1(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued1(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage1(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued1(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage1(orgVO.getChainAverage());
|
||||
vo.setChainAccrued1(orgVO.getChainAccrued());
|
||||
vo.setSameAverage1(orgVO.getSameAverage());
|
||||
vo.setSameAccrued1(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay1(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.FLICKER)) {
|
||||
vo.setTAverage2(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued2(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage2(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued2(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage2(orgVO.getChainAverage());
|
||||
vo.setChainAccrued2(orgVO.getChainAccrued());
|
||||
vo.setSameAverage2(orgVO.getSameAverage());
|
||||
vo.setSameAccrued2(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay2(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.HARMONIC_VOLTAGE)) {
|
||||
vo.setTAverage3(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued3(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage3(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued3(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage3(orgVO.getChainAverage());
|
||||
vo.setChainAccrued3(orgVO.getChainAccrued());
|
||||
vo.setSameAverage3(orgVO.getSameAverage());
|
||||
vo.setSameAccrued3(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay3(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.HARMONIC_CURRENT)) {
|
||||
vo.setTAverage4(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued4(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage4(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued4(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage4(orgVO.getChainAverage());
|
||||
vo.setChainAccrued4(orgVO.getChainAccrued());
|
||||
vo.setSameAverage4(orgVO.getSameAverage());
|
||||
vo.setSameAccrued4(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay4(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.INTERHARMONIC_VOLTAGE)) {
|
||||
vo.setTAverage5(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued5(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage5(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued5(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage5(orgVO.getChainAverage());
|
||||
vo.setChainAccrued5(orgVO.getChainAccrued());
|
||||
vo.setSameAverage5(orgVO.getSameAverage());
|
||||
vo.setSameAccrued5(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay5(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.PHASE_VOLTAGE)) {
|
||||
vo.setTAverage6(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued6(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage6(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued6(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage6(orgVO.getChainAverage());
|
||||
vo.setChainAccrued6(orgVO.getChainAccrued());
|
||||
vo.setSameAverage6(orgVO.getSameAverage());
|
||||
vo.setSameAccrued6(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay6(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.NEG_CURRENT)) {
|
||||
vo.setTAverage7(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued7(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage7(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued7(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage7(orgVO.getChainAverage());
|
||||
vo.setChainAccrued7(orgVO.getChainAccrued());
|
||||
vo.setSameAverage7(orgVO.getSameAverage());
|
||||
vo.setSameAccrued7(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay7(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.TOTAL_INDICATOR)) {
|
||||
vo.setTAverage8(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued8(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage8(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued8(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage8(orgVO.getChainAverage());
|
||||
vo.setChainAccrued8(orgVO.getChainAccrued());
|
||||
vo.setSameAverage8(orgVO.getSameAverage());
|
||||
vo.setSameAccrued8(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay8(orgVO.getAverageOverDay());
|
||||
if(CollUtil.isNotEmpty(temp)){
|
||||
Map<String, List<RStatSubstationOrgVO>> map = temp
|
||||
.stream().collect(Collectors.groupingBy(RStatSubstationOrgVO::getOrgNo));
|
||||
map.forEach((key, value) -> {
|
||||
RStatSubstationOrg2VO vo = new RStatSubstationOrg2VO();
|
||||
vo.setOrgNo(value.get(0).getOrgNo());
|
||||
vo.setOrgName(value.get(0).getOrgName());
|
||||
vo.setDataDate(value.get(0).getDataDate());
|
||||
vo.setEffectiveMeasurementAverage(value.get(0).getEffectiveMeasurementAverage());
|
||||
vo.setEffectiveMeasurementAccrued(value.get(0).getEffectiveMeasurementAccrued());
|
||||
vo.setHarmonicMeasurementAverage(value.get(0).getHarmonicMeasurementAverage());
|
||||
vo.setHarmonicMeasurementAccrued(value.get(0).getHarmonicMeasurementAccrued());
|
||||
vo.setHarmonicMeasurementRatioAverage(value.get(0).getHarmonicMeasurementRatioAverage());
|
||||
vo.setHarmonicMeasurementRatioAccrued(value.get(0).getHarmonicMeasurementRatioAccrued());
|
||||
//遍历赋值
|
||||
for (RStatSubstationOrgVO orgVO : value) {
|
||||
for (DictData eventStati : eventStatis) {
|
||||
if (eventStati.getId().equals(orgVO.getHarmonicType())) {
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.FREQUENCY_DEV)) {
|
||||
vo.setTAverage(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage(orgVO.getChainAverage());
|
||||
vo.setChainAccrued(orgVO.getChainAccrued());
|
||||
vo.setSameAverage(orgVO.getSameAverage());
|
||||
vo.setSameAccrued(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.VOLTAGE_DEV)) {
|
||||
vo.setTAverage1(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued1(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage1(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued1(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage1(orgVO.getChainAverage());
|
||||
vo.setChainAccrued1(orgVO.getChainAccrued());
|
||||
vo.setSameAverage1(orgVO.getSameAverage());
|
||||
vo.setSameAccrued1(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay1(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.FLICKER)) {
|
||||
vo.setTAverage2(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued2(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage2(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued2(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage2(orgVO.getChainAverage());
|
||||
vo.setChainAccrued2(orgVO.getChainAccrued());
|
||||
vo.setSameAverage2(orgVO.getSameAverage());
|
||||
vo.setSameAccrued2(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay2(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.HARMONIC_VOLTAGE)) {
|
||||
vo.setTAverage3(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued3(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage3(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued3(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage3(orgVO.getChainAverage());
|
||||
vo.setChainAccrued3(orgVO.getChainAccrued());
|
||||
vo.setSameAverage3(orgVO.getSameAverage());
|
||||
vo.setSameAccrued3(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay3(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.HARMONIC_CURRENT)) {
|
||||
vo.setTAverage4(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued4(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage4(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued4(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage4(orgVO.getChainAverage());
|
||||
vo.setChainAccrued4(orgVO.getChainAccrued());
|
||||
vo.setSameAverage4(orgVO.getSameAverage());
|
||||
vo.setSameAccrued4(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay4(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.INTERHARMONIC_VOLTAGE)) {
|
||||
vo.setTAverage5(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued5(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage5(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued5(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage5(orgVO.getChainAverage());
|
||||
vo.setChainAccrued5(orgVO.getChainAccrued());
|
||||
vo.setSameAverage5(orgVO.getSameAverage());
|
||||
vo.setSameAccrued5(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay5(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.PHASE_VOLTAGE)) {
|
||||
vo.setTAverage6(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued6(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage6(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued6(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage6(orgVO.getChainAverage());
|
||||
vo.setChainAccrued6(orgVO.getChainAccrued());
|
||||
vo.setSameAverage6(orgVO.getSameAverage());
|
||||
vo.setSameAccrued6(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay6(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.NEG_CURRENT)) {
|
||||
vo.setTAverage7(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued7(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage7(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued7(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage7(orgVO.getChainAverage());
|
||||
vo.setChainAccrued7(orgVO.getChainAccrued());
|
||||
vo.setSameAverage7(orgVO.getSameAverage());
|
||||
vo.setSameAccrued7(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay7(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.TOTAL_INDICATOR)) {
|
||||
vo.setTAverage8(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued8(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage8(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued8(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage8(orgVO.getChainAverage());
|
||||
vo.setChainAccrued8(orgVO.getChainAccrued());
|
||||
vo.setSameAverage8(orgVO.getSameAverage());
|
||||
vo.setSameAccrued8(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay8(orgVO.getAverageOverDay());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
info.add(vo);
|
||||
});
|
||||
// 匹配单位名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatSubstationOrg2VO vo : info) {
|
||||
if (dto.getId().equals(vo.getOrgNo())) {
|
||||
vo.setOrgName(dto.getName());
|
||||
info.add(vo);
|
||||
});
|
||||
// 匹配单位名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatSubstationOrg2VO vo : info) {
|
||||
if (dto.getCode().equals(vo.getOrgNo())) {
|
||||
vo.setOrgName(dto.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return info;
|
||||
}
|
||||
@@ -297,8 +300,18 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
|
||||
dto.setPowerrIds(param.getIds());
|
||||
//根据变电站分组
|
||||
List<PmsMonitorDTO> pmsMonitorDTOS = monitorClient.getMonitorInfoListByCond(dto).getData();
|
||||
Map<String, PmsMonitorDTO> pmsMonitorDTOMap = pmsMonitorDTOS.stream()
|
||||
.collect(Collectors.toMap(PmsMonitorDTO::getPowerrId, Function.identity()));
|
||||
|
||||
//用于临时存储TestValue的getPowerrId(解决去重失效问题)
|
||||
List<String> infoIds = new ArrayList<>();
|
||||
Map<String, PmsMonitorDTO> pmsMonitorDTOMap = pmsMonitorDTOS.stream().filter(
|
||||
v -> {
|
||||
if(infoIds.contains(v.getPowerrId())){
|
||||
return false;
|
||||
}else {
|
||||
infoIds.add(v.getPowerrId());
|
||||
return true;
|
||||
}
|
||||
}).collect(Collectors.toMap(PmsMonitorDTO::getPowerrId, Function.identity()));
|
||||
|
||||
if (CollUtil.isNotEmpty(pmsMonitorDTOS)) {
|
||||
//获取最新过滤的变电站id
|
||||
@@ -374,8 +387,7 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
|
||||
//匹配名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatOrgIndexVO vo : info) {
|
||||
if (dto.getId().equals(vo.getOrgNo())) {
|
||||
vo.setOrgNo(dto.getId());
|
||||
if (dto.getCode().equals(vo.getOrgNo())) {
|
||||
vo.setOrgName(dto.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class RStatSubstationMServiceImpl extends ServiceImpl<RStatSubstationMMap
|
||||
RSubstationIconVO rSubstationIconVO = new RSubstationIconVO();
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
//根据部门获取变电站信息
|
||||
baseParam.setIds(this.powerrIdList(RequestUtil.getDeptIndex()));
|
||||
baseParam.setIds(this.powerrIdList(param.getId()));
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询变电站稳态指标超标分布(按超标天数)-年数据
|
||||
@@ -78,7 +78,7 @@ public class RStatSubstationMServiceImpl extends ServiceImpl<RStatSubstationMMap
|
||||
List<RSubstationIcon2VO> rSubstationIconVO = new ArrayList<>();
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
//根据id进行筛选
|
||||
baseParam.setIds(this.powerrIdList(RequestUtil.getDeptIndex()));
|
||||
baseParam.setIds(this.powerrIdList(param.getId()));
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询变电站稳态指标平均超标天数-年数据
|
||||
|
||||
@@ -5,9 +5,13 @@ import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatSubstationVoltageM;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatSubstationVoltageMMapper;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
import com.njcn.harmonic.pojo.vo.RVoltageIconVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatSubstationVoltageMService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
@@ -16,6 +20,8 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -32,14 +38,34 @@ public class RStatSubstationVoltageMServiceImpl extends ServiceImpl<RStatSubstat
|
||||
|
||||
private final RStatSubstationVoltageMMapper rStatSubstationVoltageMMapper;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
@Override
|
||||
public List<RVoltageIconVO> getStatSubstationIcon(StatisticsBizBaseParam param) {
|
||||
//获取当前部门下所有部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
StatSubstationBizBaseParam baseParam= BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
return rStatSubstationVoltageMMapper.getStatSubstationIcon(baseParam);
|
||||
//获取电压信息
|
||||
List<DictData> devVoltageData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
|
||||
//查询数据库
|
||||
List<RVoltageIconVO> statSubstationIcon = rStatSubstationVoltageMMapper.getStatSubstationIcon(baseParam);
|
||||
Map<String, RVoltageIconVO> devVoltageMap = statSubstationIcon.stream()
|
||||
.collect(Collectors.toMap(RVoltageIconVO::getSubstationVoltage, Function.identity()));
|
||||
|
||||
//处理主节点不存在的集合
|
||||
List<DictData> notMeasurementList = devVoltageData.stream().filter(r -> !devVoltageMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
for (DictData notData : notMeasurementList) {
|
||||
RVoltageIconVO iconVO = new RVoltageIconVO();
|
||||
iconVO.setSubstationVoltage(notData.getId());
|
||||
iconVO.setSubstationCount(0);
|
||||
iconVO.setHarmonicCount(0);
|
||||
statSubstationIcon.add(iconVO);
|
||||
}
|
||||
return statSubstationIcon;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user