合并代码
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
package com.njcn.harmonic.controller.algorithm;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
|
||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||
import com.njcn.harmonic.pojo.param.RStatFileVO;
|
||||
import com.njcn.harmonic.pojo.po.RStatFile;
|
||||
import com.njcn.harmonic.pojo.vo.PwRStatOrgVO;
|
||||
import com.njcn.harmonic.service.algorithm.RStatFileService;
|
||||
import com.njcn.minio.bo.MinIoUploadResDTO;
|
||||
import com.njcn.minio.config.MinIoProperties;
|
||||
import com.njcn.minio.utils.MinIoUtils;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "算法")
|
||||
@RequestMapping("/algorithm")
|
||||
public class AlgorithmController extends BaseController {
|
||||
|
||||
private final RStatFileService rStatFileService;
|
||||
|
||||
@Resource
|
||||
private MinIoUtils minIoUtils;
|
||||
@Resource
|
||||
private MinIoProperties minIoProperties;
|
||||
|
||||
/**
|
||||
* 算法保存
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getAlgorithmSave")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("算法保存")
|
||||
@ApiImplicitParam(name = "param", value = "算发内容", required = true)
|
||||
public HttpResult<Boolean> getAlgorithmSave(@RequestBody RStatFileVO param) {
|
||||
String methodDescribe = getMethodDescribe("getAlgorithmSave");
|
||||
RStatFile rStatFile = BeanUtil.copyProperties(param, RStatFile.class);
|
||||
boolean b = rStatFileService.updateById(rStatFile);
|
||||
if(b){
|
||||
// minIoUtils.removeObjects( minIoProperties.getBucket(),param.getAddress());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}else{
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/getAlgorithmAll")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("算法查询")
|
||||
public HttpResult<List<RStatFile>> getAlgorithmAll() {
|
||||
String methodDescribe = getMethodDescribe("getAlgorithmAll");
|
||||
List<RStatFile> list = rStatFileService.list();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求
|
||||
*/
|
||||
@PostMapping("/common/upload")
|
||||
@ResponseBody
|
||||
public HttpResult<MinIoUploadResDTO> uploadFile(MultipartFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
//把名称存入数据
|
||||
MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), "algorithm/");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, upload, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用删除请求
|
||||
*/
|
||||
// @PostMapping("/common/delete")
|
||||
// @ResponseBody
|
||||
// public HttpResult<MinIoUploadResDTO> delete()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// List<String> aaa=new ArrayList<>();
|
||||
// aaa.add("algorithm/0CA99CB427A94A8A833499A41C557405.png");
|
||||
// aaa.add("algorithm/07D8A0FD304A42CDB73F514FBEE641BC.png");
|
||||
// minIoUtils.removeObjects( minIoProperties.getBucket(),aaa);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, null);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, null);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.harmonic.controller.distribution;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicOrgMService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <分布式光伏概览>
|
||||
*
|
||||
* @author wr
|
||||
* @createTime: 2022-12-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pwOverview")
|
||||
@Slf4j
|
||||
@Api(tags = "分布式光伏概览")
|
||||
@RequiredArgsConstructor
|
||||
public class PwOverviewController extends BaseController {
|
||||
|
||||
private final RStatHarmonicOrgMService rStatHarmonicOrgMService;
|
||||
|
||||
|
||||
@PostMapping("/getAlarmProportion")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("告警监测点数占比")
|
||||
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
||||
public HttpResult<List<OverviewVO.GroupVO>> getAlarmProportion(@RequestBody OverviewParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAlarmProportion");
|
||||
List<OverviewVO.GroupVO> monitorYoY = rStatHarmonicOrgMService.getExcessiveProportion(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorYoY, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,10 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 配网指标分类概览-监测点分类总览
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @author wr
|
||||
* @since 2022-10-09
|
||||
*/
|
||||
@RestController
|
||||
|
||||
@@ -55,7 +55,7 @@ public class PwRStatHarmonicOrgController extends BaseController {
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
org = rStatHarmonicOrgYService.getPwRStatHarmonicYOldAll(param,2);
|
||||
org = rStatHarmonicOrgYService.getPwRStatHarmonicYOldAll(param, 2);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
@@ -81,12 +81,12 @@ public class PwRStatHarmonicOrgController extends BaseController {
|
||||
@ApiImplicitParam(name = "param", value = "各单位超标监测统计参数", required = true)
|
||||
public HttpResult<List<RIconVO>> getPwRStatHarmonicOrgIcon(@RequestBody RStatHarmonicMParam param) {
|
||||
String methodDescribe = getMethodDescribe("getPwRStatHarmonicOrgIcon");
|
||||
List<RIconVO> icon= null;
|
||||
List<RIconVO> icon = null;
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数统计图-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
icon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYOldIcon(param,2);
|
||||
icon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYOldIcon(param, 2);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RStatHarmonicOrgController extends BaseController {
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
rStatHarmonicOrgMAll = rStatHarmonicOrgYService.getPwRStatHarmonicYOldAll(param,1);
|
||||
rStatHarmonicOrgMAll = rStatHarmonicOrgYService.getPwRStatHarmonicYOldAll(param, 1);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
@@ -86,7 +86,7 @@ public class RStatHarmonicOrgController extends BaseController {
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数统计图-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
getAllRStatHarmonicOrgIcon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYOldIcon(param,1);
|
||||
getAllRStatHarmonicOrgIcon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYOldIcon(param, 1);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
|
||||
@@ -82,7 +82,7 @@ public class RStatOrgController extends BaseController {
|
||||
@GetMapping("/getRStatSubstation")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("区域稳态指标超标分类统计表")
|
||||
public HttpResult<List<RStatSubstationOrg2VO> > getRStatSubstation(StatisticsBizBaseParam param) {
|
||||
public HttpResult<List<RStatSubstationOrg2VO>> getRStatSubstation(StatisticsBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRStatSubstation");
|
||||
List<RStatSubstationOrg2VO> statSubstationIcon = rStatOrgYService.getRStatSubstationOrg(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, statSubstationIcon, methodDescribe);
|
||||
|
||||
@@ -38,6 +38,7 @@ public class RStatOrgPvPowerQualityController extends BaseController {
|
||||
|
||||
/**
|
||||
* 低功率因数统计
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -53,6 +54,7 @@ public class RStatOrgPvPowerQualityController extends BaseController {
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -40,6 +40,7 @@ public class WindFarmController extends BaseController {
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -55,6 +56,7 @@ public class WindFarmController extends BaseController {
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.njcn.harmonic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgM;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatHarmonicVO;
|
||||
import com.njcn.harmonic.pojo.vo.StatHarmonicOrgVO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
@@ -33,4 +35,15 @@ public interface StatHarmonicOrgMMapper extends BaseMapper<RStatHarmonicOrgM> {
|
||||
List<RStatHarmonicVO> selectInfoList(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("ids") List<String> ids,
|
||||
@Param("dataType") String dataType);
|
||||
|
||||
/**
|
||||
* 分布式光伏概览-超标监测点占比
|
||||
* @param param
|
||||
* @param ids
|
||||
* @param dataType
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO> selectYoY(@Param("param") OverviewParam param,
|
||||
@Param("ids") List<String> ids,
|
||||
@Param("dataType") String dataType);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.harmonic.mapper.algorithm;
|
||||
|
||||
import com.njcn.harmonic.pojo.po.RStatFile;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2022-12-28
|
||||
*/
|
||||
public interface RStatFileMapper extends BaseMapper<RStatFile> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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.harmonic.mapper.algorithm.RStatFileMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.njcn.harmonic.pojo.po.RStatFile">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_Time" property="createTime" />
|
||||
<result column="update_Time" property="updateTime" />
|
||||
<result column="file_content" property="fileContent" />
|
||||
<result column="create_By" property="createBy" />
|
||||
<result column="update_By" property="updateBy" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
@@ -52,5 +52,103 @@
|
||||
GROUP BY
|
||||
harmonic_type
|
||||
</select>
|
||||
<select id="selectYoY" resultType="com.njcn.harmonic.pojo.vo.OverviewVO">
|
||||
SELECT
|
||||
concat(ta.yy,'-',ta.mm) dateTime,
|
||||
ta.measurement_type_class as monitorSort,
|
||||
ta.harmonic_type as harmonicType,
|
||||
ta.num as sumNum,
|
||||
IFNULL(tb.num,0) as ytbSumNum,
|
||||
IFNULL(tc.num,0) as yhbSumNum,
|
||||
ifnull(round((ta.num-tb.num)/tb.num*100,2),0) as sameNum,
|
||||
ifnull(round((ta.num-tc.num)/tc.num*100,2),0) as ringNum
|
||||
|
||||
FROM (
|
||||
SELECT
|
||||
t.measurement_type_class,
|
||||
t.harmonic_type,
|
||||
year(t.data_date) as yy,
|
||||
month(t.data_date) as mm,
|
||||
TRUNCATE(SUM(over_limit_measurement_ratio_accrued)/count(over_limit_measurement_ratio_accrued),2) as num
|
||||
|
||||
|
||||
FROM r_stat_harmonic_m t
|
||||
<where>
|
||||
and data_Type=#{dataType}
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY t.measurement_type_class,t.harmonic_type,yy,mm
|
||||
) ta
|
||||
-- 同比:上年同月
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
t.measurement_type_class,
|
||||
t.harmonic_type,
|
||||
year(t.data_date) as yy,
|
||||
month(t.data_date) as mm,
|
||||
TRUNCATE(SUM(over_limit_measurement_ratio_accrued)/count(over_limit_measurement_ratio_accrued),2) as num
|
||||
|
||||
|
||||
FROM r_stat_harmonic_m t
|
||||
<where>
|
||||
and data_Type=#{dataType}
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY t.measurement_type_class,t.harmonic_type,yy,mm
|
||||
) tb
|
||||
ON tb.mm = ta.mm and tb.yy = ta.yy-1 and tb.measurement_type_class = ta.measurement_type_class and tb.harmonic_type = ta.harmonic_type
|
||||
|
||||
-- 环比:上月
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
t.measurement_type_class,
|
||||
t.harmonic_type,
|
||||
year(t.data_date) as yy,
|
||||
month(t.data_date) as mm,
|
||||
TRUNCATE(SUM(over_limit_measurement_ratio_accrued)/count(over_limit_measurement_ratio_accrued),2) as num
|
||||
|
||||
|
||||
FROM r_stat_harmonic_m t
|
||||
<where>
|
||||
and data_Type=#{dataType}
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY t.measurement_type_class,t.harmonic_type,yy,mm
|
||||
) tc
|
||||
ON ( (tc.yy = ta.yy and tc.mm = ta.mm - 1 and tc.measurement_type_class = ta.measurement_type_class and tc.harmonic_type = ta.harmonic_type)
|
||||
OR
|
||||
(tc.yy=ta.yy - 1 AND tc.mm = 12 AND ta.mm = 1 and tc.measurement_type_class = ta.measurement_type_class and tc.harmonic_type = ta.harmonic_type)
|
||||
)
|
||||
|
||||
<where>
|
||||
<if test="param.year != null and param.year!=''">
|
||||
AND ta.yy = #{param.year}
|
||||
</if>
|
||||
<if test="param.month != null and param.month.size > 0">
|
||||
AND ta.mm IN
|
||||
<foreach collection='param.month' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgPvPowerQualityMPO;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.StreamReverseOrgVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -18,6 +20,15 @@ import java.util.Map;
|
||||
public interface RStatOrgPvPowerQualityMMapper extends BaseMapper<RStatOrgPvPowerQualityMPO> {
|
||||
|
||||
Page<StreamReverseOrgVO> getStreamReverseByOrg(IPage<StreamReverseOrgVO> page, @Param("condMap")Map<String, Object> condMap);
|
||||
|
||||
/**
|
||||
* 分布式光伏概览-电压问题
|
||||
* @param deptCodes
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO.VoltageVO> selectVoltage(@Param("deptCodes") List<String> deptCodes,
|
||||
@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,4 +43,36 @@
|
||||
|
||||
GROUP BY org_no,monitoring_object
|
||||
</select>
|
||||
<select id="selectVoltage" resultType="com.njcn.harmonic.pojo.vo.OverviewVO$VoltageVO">
|
||||
SELECT
|
||||
monitoring_object,
|
||||
area_pq_event_type,
|
||||
TRUNCATE ( SUM( total_monitor_num )/ count( total_monitor_num ), 2 ) AS totalMonitorNum
|
||||
FROM
|
||||
r_stat_org_pv_power_quality_m
|
||||
<where>
|
||||
<if test="deptCodes != null and deptCodes.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='deptCodes' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND area_pq_event_type IN
|
||||
<foreach collection='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
|
||||
monitoring_object,
|
||||
area_pq_event_type
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.harmonic.service.algorithm;
|
||||
|
||||
import com.njcn.harmonic.pojo.po.RStatFile;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2022-12-28
|
||||
*/
|
||||
public interface RStatFileService extends IService<RStatFile> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.harmonic.service.algorithm.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.harmonic.mapper.algorithm.RStatFileMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatFile;
|
||||
|
||||
import com.njcn.harmonic.service.algorithm.RStatFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2022-12-28
|
||||
*/
|
||||
@Service
|
||||
public class RStatFileServiceImpl extends ServiceImpl<RStatFileMapper, RStatFile> implements RStatFileService {
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public interface PwRStatOrgService extends IService<RStatOrgQ> {
|
||||
|
||||
/**
|
||||
* 配网查询区域超标统计
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -38,6 +39,7 @@ public interface PwRStatOrgService extends IService<RStatOrgQ> {
|
||||
|
||||
/**
|
||||
* 配网稳态指标合格率明细表
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -45,13 +47,15 @@ public interface PwRStatOrgService extends IService<RStatOrgQ> {
|
||||
|
||||
/**
|
||||
* 配网区域稳态指标超标分类统计表
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RStatSubstationOrg2VO.PwRStatSubstationOrgVO> getRStatSubstationOrg(StatSubstationBizBaseParam param);
|
||||
|
||||
/**
|
||||
*配网区域稳态指标超标明细
|
||||
* 配网区域稳态指标超标明细
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -71,20 +71,20 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
switch (String.valueOf(param.getType())) {
|
||||
//查询区域超标统计-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
info = pwRStatOrgMapper.selectListY(param,deptIds,distributionData.getId());
|
||||
info = pwRStatOrgMapper.selectListY(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
//查询区域超标统计-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
info = pwRStatOrgMapper.selectListQ(param,deptIds,distributionData.getId());
|
||||
info = pwRStatOrgMapper.selectListQ(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
//查询各区域超标统计-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
info = pwRStatOrgMapper.selectListM(param,deptIds,distributionData.getId());
|
||||
info = pwRStatOrgMapper.selectListM(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(info)){
|
||||
if (CollectionUtil.isNotEmpty(info)) {
|
||||
Map<String, List<RStatOrgVO.PwRStatOrgVO>> collect = info.stream().collect(
|
||||
Collectors.groupingBy(RStatOrgVO.PwRStatOrgVO::getOrgNo));
|
||||
collect.forEach((key, value) -> {
|
||||
@@ -98,7 +98,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
});
|
||||
return newList;
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,7 +114,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
|
||||
//获取配网信息
|
||||
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
List<PwRStatOrgVO> info=new ArrayList<>();
|
||||
List<PwRStatOrgVO> info = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(deptDTOList)) {
|
||||
// 过滤出部门id
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
@@ -153,7 +153,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
//初始化对象
|
||||
List<RStatOrgIndexVO> info = new ArrayList<>();
|
||||
// 获取当前用户的部门的子部门信息
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//变电站
|
||||
@@ -165,10 +165,10 @@ 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(),(key1,key2) ->key2));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(monitorDTOList)) {
|
||||
Map<String, PwPmsMonitorDTO> monitorDTOMap = monitorDTOList.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key2));
|
||||
//获取最新过滤的监测点id
|
||||
List<String> ids = monitorDTOList.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
@@ -201,7 +201,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
if (monitorDTOMap.containsKey(Key)) {
|
||||
//根据监测点信息,进行属性赋值
|
||||
PwPmsMonitorDTO pwPmsMonitorDTO = monitorDTOMap.get(Key);
|
||||
PwRStatOrgVO.PwRStatOrgDetailVO pwRStatOrgVO=new PwRStatOrgVO.PwRStatOrgDetailVO();
|
||||
PwRStatOrgVO.PwRStatOrgDetailVO pwRStatOrgVO = new PwRStatOrgVO.PwRStatOrgDetailVO();
|
||||
pwRStatOrgVO.setMeasurementPointId(pwPmsMonitorDTO.getMonitorId());
|
||||
pwRStatOrgVO.setMeasurementPointName(pwPmsMonitorDTO.getMonitorName());
|
||||
pwRStatOrgVO.setMonitorVoltageName(pwPmsMonitorDTO.getVoltageLevel());
|
||||
@@ -241,15 +241,15 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
switch (param.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// 获取年区域暂态指标分类统计表
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(param,deptIds, distributionData.getId());
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// 获取季区域暂态指标分类统计表
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(param,deptIds,distributionData.getId());
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// 获取月区域暂态指标分类统计表
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(param,deptIds,distributionData.getId());
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -389,7 +389,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
|
||||
@Override
|
||||
public List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> getRMpPartHarmonicDetail(RStatOrgParam.PwRStatOrgParam param) {
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//电压等级
|
||||
@@ -401,7 +401,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
//获取配网监测点信息
|
||||
List<PwPmsMonitorDTO> pwPmsMonitorDTOS = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> pwPmsMonitorDTOMap = pwPmsMonitorDTOS.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId,Function.identity(),(key1, key2) -> key2));
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key2));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(pwPmsMonitorDTOS)) {
|
||||
//获取监测点id
|
||||
@@ -410,8 +410,8 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(ids);
|
||||
List<RMpPartHarmonicDetailVO> rMpPartHarmonicDetail = rMpSurplusHarmonicDetailMMapper.getRMpPartHarmonicDetail(baseParam);
|
||||
List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> newList=BeanUtil.copyToList(
|
||||
rMpPartHarmonicDetail,RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO.class);
|
||||
List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> newList = BeanUtil.copyToList(
|
||||
rMpPartHarmonicDetail, RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO.class);
|
||||
if (CollectionUtil.isNotEmpty(newList)) {
|
||||
//因为只有月表,数据进行查询可能出现重复数据。进行分组
|
||||
Map<String, List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO>> detailVOMap = newList.stream()
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
@@ -22,6 +22,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 主网查询查询监测点稳态指标 日/月点数
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -29,6 +30,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 主网稳态电铁-频率偏差-电压统计图
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -36,6 +38,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 主网稳态电铁-频率偏差-越线日期统计图
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -43,6 +46,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 配网查询监测点稳态指标(月)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -50,6 +54,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 配网监测点-频率偏差-越线日期统计图
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.njcn.harmonic.service.majornetwork;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgM;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
|
||||
@@ -50,4 +52,13 @@ public interface RStatHarmonicOrgMService extends IService<RStatHarmonicOrgM> {
|
||||
* @return
|
||||
*/
|
||||
List<RIconVO> getPwRStatHarmonicOrgMIcon(RStatHarmonicMParam param);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分布式光伏概览-稳态指标超标占比
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO.GroupVO> getExcessiveProportion(OverviewParam param);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface RStatHarmonicOrgYService extends IService<RStatHarmonicOrgY> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RIconVO> getPwRStatHarmonicOrgYOldIcon(RStatHarmonicMParam param,Integer type);
|
||||
List<RIconVO> getPwRStatHarmonicOrgYOldIcon(RStatHarmonicMParam param, Integer type);
|
||||
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ public interface RStatHarmonicOrgYService extends IService<RStatHarmonicOrgY> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RArrayVO> getPwRStatHarmonicYOldAll(StatisticsBizBaseParam param,Integer type);
|
||||
List<RArrayVO> getPwRStatHarmonicYOldAll(StatisticsBizBaseParam param, Integer type);
|
||||
|
||||
/**
|
||||
* 配网查询各单位稳态指标(年 )统计暂不使用
|
||||
@@ -69,5 +69,4 @@ public interface RStatHarmonicOrgYService extends IService<RStatHarmonicOrgY> {
|
||||
List<RIconVO> getPwRStatHarmonicOrgYIcon(RStatHarmonicMParam param);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,23 +9,25 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @author wr
|
||||
* @since 2022-10-12
|
||||
*/
|
||||
public interface RStatHarmonicQService extends IService<RStatHarmonicQ> {
|
||||
|
||||
/**
|
||||
* 主网查询监测点稳态指标(季)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RArrayVO> getRStatHarmonicQAll(StatisticsBizBaseParam param);
|
||||
|
||||
/**
|
||||
* 配网查询监测点稳态指标(季)
|
||||
* 配网查询监测点稳态指标(季)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -9,10 +9,10 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 配网指标分类概览-监测点分类总览
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @author wr
|
||||
* @since 2022-10-12
|
||||
*/
|
||||
public interface RStatHarmonicYService extends IService<RStatHarmonicY> {
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
@@ -19,6 +19,7 @@ public interface RStatLoadTypeService extends IService<RStatLoadTypeM> {
|
||||
|
||||
/**
|
||||
* 区域干扰源电流类指标超标统计
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface RStatOrgMService extends IService<RStatOrgM> {
|
||||
|
||||
/**
|
||||
* 查询区域超标统计-月数据
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface RStatOrgQService extends IService<RStatOrgQ> {
|
||||
|
||||
/**
|
||||
* 查询区域超标统计-季数据
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -80,10 +80,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam, mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
@@ -119,7 +119,7 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
b.addAll(rm);
|
||||
for (RStatHarmonicM rStatHarmonicM : value) {
|
||||
if(interferenceMap.containsKey(rStatHarmonicM.getMeasurementTypeClass())){
|
||||
if (interferenceMap.containsKey(rStatHarmonicM.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(rStatHarmonicM, RStatHarmonicMVO.class);
|
||||
DictData data1 = interferenceMap.get(rStatHarmonicM.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
@@ -196,11 +196,11 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicVoltageM> rStatHarmonicVoltageMS = rStatHarmonicVoltageMMapper
|
||||
.selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
.selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId());
|
||||
|
||||
//将数据转换为map进行便利
|
||||
Map<String, RStatHarmonicVoltageM> voltageMMap = rStatHarmonicVoltageMS.stream()
|
||||
@@ -283,11 +283,11 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper
|
||||
.selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
.selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId());
|
||||
|
||||
Map<LocalDate, List<RStatHarmonicD>> collect =
|
||||
rStatHarmonicVoltageMS.stream().collect(Collectors.groupingBy(RStatHarmonicD::getDataDate));
|
||||
@@ -349,10 +349,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam, distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicM>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicM::getHarmonicType));
|
||||
@@ -368,7 +368,7 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicM statHarmonic : value) {
|
||||
if(lineMap.containsKey(statHarmonic.getMeasurementTypeClass())){
|
||||
if (lineMap.containsKey(statHarmonic.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DictData data1 = lineMap.get(statHarmonic.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
@@ -445,11 +445,11 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper
|
||||
.selectInfoList(baseParam,distributionData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
.selectInfoList(baseParam, distributionData.getId(), measurementDate.getId(), harmonicDate.getId());
|
||||
|
||||
Map<LocalDate, List<RStatHarmonicD>> collect =
|
||||
rStatHarmonicVoltageMS.stream().collect(Collectors.groupingBy(RStatHarmonicD::getDataDate));
|
||||
|
||||
@@ -2,14 +2,18 @@ package com.njcn.harmonic.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
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.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgM;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgMMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgQ;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
|
||||
@@ -24,8 +28,10 @@ import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.checkerframework.checker.units.qual.K;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.security.Key;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
@@ -51,7 +57,7 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
public List<RArrayVO> getRStatHarmonicMAll(StatisticsBizBaseParam param) {
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -142,7 +148,7 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
public List<RIconVO> getRStatHarmonicOrgMIcon(RStatHarmonicMParam param) {
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
@@ -231,7 +237,7 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -260,7 +266,7 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicOrgM statHarmonic : value) {
|
||||
if(deptMap.containsKey(statHarmonic.getOrgNo())){
|
||||
if (deptMap.containsKey(statHarmonic.getOrgNo())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DeptDTO deptDTO = deptMap.get(statHarmonic.getOrgNo());
|
||||
r.setHarmonicName(deptDTO.getName());
|
||||
@@ -303,8 +309,8 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
public List<RIconVO> getPwRStatHarmonicOrgMIcon(RStatHarmonicMParam param) {
|
||||
//各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -382,6 +388,81 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
return arrayVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OverviewVO.GroupVO> getExcessiveProportion(OverviewParam param) {
|
||||
List<OverviewVO.GroupVO> info=new ArrayList<>();
|
||||
//指标类型
|
||||
List<DictData> steadyData = dicDataFeignClient.getDicDataByTypeCode
|
||||
(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
//监测点类型
|
||||
List<DictData> lineData = dicDataFeignClient.getDicDataByTypeCode
|
||||
(DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||
|
||||
//获取部门数据
|
||||
List<DeptDTO> deptDTOS = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
if(CollectionUtil.isNotEmpty(deptDTOS)){
|
||||
List<String> collect = deptDTOS.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
//获取配网数据类型
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
List<OverviewVO> overviewVOS = statHarmonicOrgMMapper.selectYoY(param, collect, data.getId());
|
||||
|
||||
Map<String, List<OverviewVO>> overviewVOMap = overviewVOS.stream().collect(
|
||||
Collectors.groupingBy(OverviewVO::getMonitorSort));
|
||||
|
||||
overviewVOMap.forEach((key,value)->{
|
||||
OverviewVO.GroupVO groupVO = new OverviewVO.GroupVO();
|
||||
|
||||
Map<String, List<OverviewVO>> listMap = value.stream().collect(Collectors.groupingBy(OverviewVO::getHarmonicType));
|
||||
List<DictData> notDict = steadyData.stream().filter(r -> !listMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
//生成默认值
|
||||
if(CollectionUtil.isNotEmpty(notDict)){
|
||||
groupVO.setMonitorSort(key);
|
||||
OverviewVO overviewVO;
|
||||
for (DictData dictData : notDict) {
|
||||
overviewVO=new OverviewVO();
|
||||
overviewVO.setMonitorSort(key);
|
||||
overviewVO.setHarmonicType(dictData.getId());
|
||||
overviewVO.setSumNum("0");
|
||||
overviewVO.setYtbSumNum("0");
|
||||
overviewVO.setYhbSumNum("0");
|
||||
overviewVO.setSameNum("0");
|
||||
overviewVO.setRingNum("0");
|
||||
value.add(overviewVO);
|
||||
}
|
||||
groupVO.setSubset(value);
|
||||
}
|
||||
info.add(groupVO);
|
||||
});
|
||||
|
||||
List<DictData> notDict = lineData.stream().filter(r -> !overviewVOMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(notDict)){
|
||||
OverviewVO.GroupVO overviewVO;
|
||||
OverviewVO vo;
|
||||
for (DictData dictData : notDict) {
|
||||
overviewVO=new OverviewVO.GroupVO();
|
||||
overviewVO.setMonitorSort(dictData.getId());
|
||||
List<OverviewVO> vos=new ArrayList<>();
|
||||
for (DictData lineDatum : steadyData) {
|
||||
vo=new OverviewVO();
|
||||
vo.setMonitorSort(dictData.getId());
|
||||
vo.setHarmonicType(lineDatum.getId());
|
||||
vo.setSumNum("0");
|
||||
vo.setYtbSumNum("0");
|
||||
vo.setYhbSumNum("0");
|
||||
vo.setSameNum("0");
|
||||
vo.setRingNum("0");
|
||||
vos.add(vo);
|
||||
}
|
||||
overviewVO.setSubset(vos);
|
||||
info.add(overviewVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 便利赋值
|
||||
*
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -85,7 +85,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicOrgQ statHarmonic : value) {
|
||||
if(deptMap.containsKey(statHarmonic.getOrgNo())){
|
||||
if (deptMap.containsKey(statHarmonic.getOrgNo())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DeptDTO deptDTO = deptMap.get(statHarmonic.getOrgNo());
|
||||
r.setHarmonicName(deptDTO.getName());
|
||||
@@ -124,7 +124,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
public List<RIconVO> getRStatHarmonicOrgQIcon(RStatHarmonicMParam param) {
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
@@ -210,7 +210,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -239,7 +239,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicOrgQ statHarmonic : value) {
|
||||
if(deptMap.containsKey(statHarmonic.getOrgNo())){
|
||||
if (deptMap.containsKey(statHarmonic.getOrgNo())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DeptDTO deptDTO = deptMap.get(statHarmonic.getOrgNo());
|
||||
r.setHarmonicName(deptDTO.getName());
|
||||
@@ -278,7 +278,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
public List<RIconVO> getPwRStatHarmonicOrgQIcon(RStatHarmonicMParam param) {
|
||||
//各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
@@ -73,15 +73,15 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
StatSubstationBizBaseParam baseParam;
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
List<RStatHarmonicVO> newList=new ArrayList<>();
|
||||
List<RStatHarmonicVO> newList = new ArrayList<>();
|
||||
for (DeptLevelVO deptLevelVO : deptLevelVOList) {
|
||||
//数据库查询
|
||||
baseParam=BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
//没有子部门说明就是最底层部门
|
||||
if(CollUtil.isNotEmpty(deptLevelVO.getDeptList())){
|
||||
if (CollUtil.isNotEmpty(deptLevelVO.getDeptList())) {
|
||||
List<String> deptCodeS = deptLevelVO.getDeptList().stream().map(DeptLevelVO::getCode).collect(Collectors.toList());
|
||||
baseParam.setIds(deptCodeS);
|
||||
}else{
|
||||
} else {
|
||||
baseParam.setIds(Arrays.asList(deptLevelVO.getCode()));
|
||||
}
|
||||
//区分 年 季 月
|
||||
@@ -90,15 +90,15 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
list = statHarmonicOrgYMapper.selectInfoList(baseParam,steadyDataIds,mainnetData.getId());
|
||||
list = statHarmonicOrgYMapper.selectInfoList(baseParam, steadyDataIds, mainnetData.getId());
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
list = statHarmonicOrgQMapper.selectInfoList(baseParam,steadyDataIds,mainnetData.getId());
|
||||
list = statHarmonicOrgQMapper.selectInfoList(baseParam, steadyDataIds, mainnetData.getId());
|
||||
break;
|
||||
//查询各单位累计超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
list = statHarmonicOrgMMapper.selectInfoList(baseParam,steadyDataIds,mainnetData.getId());
|
||||
list = statHarmonicOrgMMapper.selectInfoList(baseParam, steadyDataIds, mainnetData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -114,7 +114,7 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
RStatHarmonicVO org;
|
||||
for (DictData notData : notMeasurementList) {
|
||||
org=new RStatHarmonicVO();
|
||||
org = new RStatHarmonicVO();
|
||||
org.setOrgNo(deptLevelVO.getCode());
|
||||
org.setHarmonicType(notData.getId());
|
||||
org.setOverLimitMeasurementAverage(0);
|
||||
@@ -132,16 +132,16 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
//重新生成数据结构
|
||||
harmonicMap.forEach((key, value) -> {
|
||||
if(lineTypeMap.containsKey(key)){
|
||||
RArrayVO arrayVO=new RArrayVO();
|
||||
if (lineTypeMap.containsKey(key)) {
|
||||
RArrayVO arrayVO = new RArrayVO();
|
||||
DictData data = lineTypeMap.get(key);
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
List<RStatHarmonicMVO> b=new ArrayList<>();
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
for (RStatHarmonicVO orgY : value) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(orgY, RStatHarmonicMVO.class);
|
||||
DeptLevelVO data1 = deptMap.get(orgY.getOrgNo());
|
||||
if (ObjectUtil.isNotNull(data1)){
|
||||
if (ObjectUtil.isNotNull(data1)) {
|
||||
r.setHarmonicName(data1.getName());
|
||||
r.setSort(data1.getSort());
|
||||
r.setOverDay(0);
|
||||
@@ -172,21 +172,21 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
DictData harmonicData;
|
||||
//判断是是否传入检测点信息值(电压)
|
||||
if(StrUtil.isBlank(param.getStasisID())&&StrUtil.isBlank(param.getMonitorID())){
|
||||
if (StrUtil.isBlank(param.getStasisID()) && StrUtil.isBlank(param.getMonitorID())) {
|
||||
//指标对象类型
|
||||
List<DictData> indicatorTypeDate = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
indicatorTypeDate.sort(Comparator.comparing(data -> data.getSort()));
|
||||
harmonicData =indicatorTypeDate.get(0);
|
||||
}else{
|
||||
harmonicData = indicatorTypeDate.get(0);
|
||||
} else {
|
||||
//获取指标对象(频率偏差)
|
||||
harmonicData= dicDataFeignClient.getDicDataById(
|
||||
harmonicData = dicDataFeignClient.getDicDataById(
|
||||
param.getStasisID()).getData();
|
||||
}
|
||||
|
||||
//初始化指标类型(横向)
|
||||
StatSubstationBizBaseParam baseParam;
|
||||
List<RIconVO> arrayVOList=new ArrayList<>();
|
||||
List<RIconVO> arrayVOList = new ArrayList<>();
|
||||
for (DeptLevelVO deptLevelVO : deptLevelVOList) {
|
||||
//数据库查询
|
||||
baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
@@ -220,13 +220,13 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
RIconVO rIconVO = new RIconVO();
|
||||
rIconVO.setRowName(deptLevelVO.getName());
|
||||
rIconVO.setSort(deptLevelVO.getSort());
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
rIconVO.setOverLimitMeasurementAccrued(list.get(0).getOverLimitMeasurementAccrued());
|
||||
rIconVO.setOverLimitMeasurementAverage(list.get(0).getOverLimitMeasurementAverage());
|
||||
rIconVO.setOverLimitMeasurementRatioAccrued(list.get(0).getOverLimitMeasurementRatioAccrued());
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(list.get(0).getOverLimitMeasurementRatioAverage());
|
||||
rIconVO.setAverageOverDay(list.get(0).getAverageOverDay());
|
||||
}else{
|
||||
} else {
|
||||
rIconVO.setOverLimitMeasurementAverage(0);
|
||||
rIconVO.setOverLimitMeasurementAccrued(0);
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
@@ -263,15 +263,15 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
StatSubstationBizBaseParam baseParam;
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
List<RStatHarmonicVO> newList=new ArrayList<>();
|
||||
List<RStatHarmonicVO> newList = new ArrayList<>();
|
||||
for (DeptLevelVO deptLevelVO : deptLevelVOList) {
|
||||
//数据库查询
|
||||
baseParam=BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
//没有子部门说明就是最底层部门
|
||||
if(CollUtil.isNotEmpty(deptLevelVO.getDeptList())){
|
||||
if (CollUtil.isNotEmpty(deptLevelVO.getDeptList())) {
|
||||
List<String> deptCodeS = deptLevelVO.getDeptList().stream().map(DeptLevelVO::getCode).collect(Collectors.toList());
|
||||
baseParam.setIds(deptCodeS);
|
||||
}else{
|
||||
} else {
|
||||
baseParam.setIds(Arrays.asList(deptLevelVO.getCode()));
|
||||
}
|
||||
//区分 年 季 月
|
||||
@@ -280,15 +280,15 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
list = statHarmonicOrgYMapper.selectInfoList(baseParam,steadyDataIds,distributionData.getId());
|
||||
list = statHarmonicOrgYMapper.selectInfoList(baseParam, steadyDataIds, distributionData.getId());
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
list = statHarmonicOrgQMapper.selectInfoList(baseParam,steadyDataIds,distributionData.getId());
|
||||
list = statHarmonicOrgQMapper.selectInfoList(baseParam, steadyDataIds, distributionData.getId());
|
||||
break;
|
||||
//查询各单位累计超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
list = statHarmonicOrgMMapper.selectInfoList(baseParam,steadyDataIds,distributionData.getId());
|
||||
list = statHarmonicOrgMMapper.selectInfoList(baseParam, steadyDataIds, distributionData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -305,7 +305,7 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
RStatHarmonicVO org;
|
||||
for (DictData notData : notMeasurementList) {
|
||||
org=new RStatHarmonicVO();
|
||||
org = new RStatHarmonicVO();
|
||||
org.setOrgNo(deptLevelVO.getCode());
|
||||
org.setHarmonicType(notData.getId());
|
||||
org.setOverLimitMeasurementAverage(0);
|
||||
@@ -323,16 +323,16 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
//重新生成数据结构
|
||||
harmonicMap.forEach((key, value) -> {
|
||||
if(lineTypeMap.containsKey(key)){
|
||||
RArrayVO arrayVO=new RArrayVO();
|
||||
if (lineTypeMap.containsKey(key)) {
|
||||
RArrayVO arrayVO = new RArrayVO();
|
||||
DictData data = lineTypeMap.get(key);
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
List<RStatHarmonicMVO> b=new ArrayList<>();
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
for (RStatHarmonicVO orgY : value) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(orgY, RStatHarmonicMVO.class);
|
||||
DeptLevelVO data1 = deptMap.get(orgY.getOrgNo());
|
||||
if (ObjectUtil.isNotNull(data1)){
|
||||
if (ObjectUtil.isNotNull(data1)) {
|
||||
r.setHarmonicName(data1.getName());
|
||||
r.setSort(data1.getSort());
|
||||
r.setOverDay(0);
|
||||
@@ -350,7 +350,7 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RArrayVO> getPwRStatHarmonicYOldAll(StatisticsBizBaseParam param,Integer type) {
|
||||
public List<RArrayVO> getPwRStatHarmonicYOldAll(StatisticsBizBaseParam param, Integer type) {
|
||||
//对象主节点 获取所有的稳态类型
|
||||
List<DictData> steadyData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
@@ -359,17 +359,17 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
|
||||
DictData dictData ;
|
||||
if(type==1){
|
||||
DictData dictData;
|
||||
if (type == 1) {
|
||||
//获取主网信息
|
||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
}else{
|
||||
} else {
|
||||
//获取配网信息
|
||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
}
|
||||
@@ -395,7 +395,7 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicOrgY statHarmonic : value) {
|
||||
if(deptMap.containsKey(statHarmonic.getOrgNo())){
|
||||
if (deptMap.containsKey(statHarmonic.getOrgNo())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DeptDTO deptDTO = deptMap.get(statHarmonic.getOrgNo());
|
||||
r.setHarmonicName(deptDTO.getName());
|
||||
@@ -443,21 +443,21 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
DictData harmonicData;
|
||||
//判断是是否传入检测点信息值(电压)
|
||||
if(StrUtil.isBlank(param.getStasisID())&&StrUtil.isBlank(param.getMonitorID())){
|
||||
if (StrUtil.isBlank(param.getStasisID()) && StrUtil.isBlank(param.getMonitorID())) {
|
||||
//指标对象类型
|
||||
List<DictData> indicatorTypeDate = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
indicatorTypeDate.sort(Comparator.comparing(data -> data.getSort()));
|
||||
harmonicData =indicatorTypeDate.get(0);
|
||||
}else{
|
||||
harmonicData = indicatorTypeDate.get(0);
|
||||
} else {
|
||||
//获取指标对象(频率偏差)
|
||||
harmonicData= dicDataFeignClient.getDicDataById(
|
||||
harmonicData = dicDataFeignClient.getDicDataById(
|
||||
param.getStasisID()).getData();
|
||||
}
|
||||
|
||||
//初始化指标类型(横向)
|
||||
StatSubstationBizBaseParam baseParam;
|
||||
List<RIconVO> arrayVOList=new ArrayList<>();
|
||||
List<RIconVO> arrayVOList = new ArrayList<>();
|
||||
for (DeptLevelVO deptLevelVO : deptLevelVOList) {
|
||||
//数据库查询
|
||||
baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
@@ -491,13 +491,13 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
RIconVO rIconVO = new RIconVO();
|
||||
rIconVO.setRowName(deptLevelVO.getName());
|
||||
rIconVO.setSort(deptLevelVO.getSort());
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
rIconVO.setOverLimitMeasurementAccrued(list.get(0).getOverLimitMeasurementAccrued());
|
||||
rIconVO.setOverLimitMeasurementAverage(list.get(0).getOverLimitMeasurementAverage());
|
||||
rIconVO.setOverLimitMeasurementRatioAccrued(list.get(0).getOverLimitMeasurementRatioAccrued());
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(list.get(0).getOverLimitMeasurementRatioAverage());
|
||||
rIconVO.setAverageOverDay(list.get(0).getAverageOverDay());
|
||||
}else{
|
||||
} else {
|
||||
rIconVO.setOverLimitMeasurementAverage(0);
|
||||
rIconVO.setOverLimitMeasurementAccrued(0);
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
@@ -512,10 +512,10 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RIconVO> getPwRStatHarmonicOrgYOldIcon(RStatHarmonicMParam param,Integer type) {
|
||||
public List<RIconVO> getPwRStatHarmonicOrgYOldIcon(RStatHarmonicMParam param, Integer type) {
|
||||
//各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
@@ -538,11 +538,11 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
Assert.isTrue(
|
||||
CollUtil.isNotEmpty(deptDTOList) || ObjectUtil.isNotNull(harmonicData)
|
||||
, "各单位或者指标类型为空,请检查入参是否准确");
|
||||
DictData dictData ;
|
||||
if(type==1){
|
||||
DictData dictData;
|
||||
if (type == 1) {
|
||||
//获取主网信息
|
||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
}else{
|
||||
} else {
|
||||
//获取配网信息
|
||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam, mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
@@ -100,7 +100,7 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
b.addAll(rm);
|
||||
for (RStatHarmonicQ rStatHarmonicQ : value) {
|
||||
if(interferenceMap.containsKey(rStatHarmonicQ.getMeasurementTypeClass())){
|
||||
if (interferenceMap.containsKey(rStatHarmonicQ.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(rStatHarmonicQ, RStatHarmonicMVO.class);
|
||||
DictData data1 = interferenceMap.get(rStatHarmonicQ.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
@@ -152,10 +152,10 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam, distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicQ>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicQ::getHarmonicType));
|
||||
@@ -171,7 +171,7 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicQ statHarmonic : value) {
|
||||
if(lineMap.containsKey(statHarmonic.getMeasurementTypeClass())){
|
||||
if (lineMap.containsKey(statHarmonic.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DictData data1 = lineMap.get(statHarmonic.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
|
||||
@@ -16,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;
|
||||
@@ -30,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @author wr
|
||||
* @since 2022-10-12
|
||||
*/
|
||||
@Service
|
||||
@@ -60,10 +59,10 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam, mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
@@ -102,7 +101,7 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
b.addAll(rm);
|
||||
for (RStatHarmonicY rStatHarmonicY : value) {
|
||||
if(interferenceMap.containsKey(rStatHarmonicY.getMeasurementTypeClass())){
|
||||
if (interferenceMap.containsKey(rStatHarmonicY.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(rStatHarmonicY, RStatHarmonicMVO.class);
|
||||
DictData data1 = interferenceMap.get(rStatHarmonicY.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
@@ -154,16 +153,16 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
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);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam, distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicY>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicY::getHarmonicType));
|
||||
|
||||
//判断对象是否为空
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
//重新生成数据结构
|
||||
measurementMap.forEach((key, value) -> {
|
||||
List<RStatHarmonicMVO> eventVO = new ArrayList<>();
|
||||
@@ -173,7 +172,7 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicY statHarmonic : value) {
|
||||
if(lineMap.containsKey(statHarmonic.getMeasurementTypeClass())){
|
||||
if (lineMap.containsKey(statHarmonic.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DictData data1 = lineMap.get(statHarmonic.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
|
||||
@@ -82,7 +82,7 @@ public class RStatLoadTypeServiceImpl extends ServiceImpl<RStatLoadTypeMMapper,
|
||||
|
||||
}
|
||||
|
||||
if(CollectionUtil.isNotEmpty(temp)){
|
||||
if (CollectionUtil.isNotEmpty(temp)) {
|
||||
// 匹配单位名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatLoadTypeVO vo : temp) {
|
||||
|
||||
@@ -78,7 +78,7 @@ public class RStatOrgBusbarVoltageServiceImpl extends ServiceImpl<RStatOrgBusbar
|
||||
if (CollectionUtil.isNotEmpty(temp)) {
|
||||
//获取母线集合
|
||||
List<String> busbarIds = temp.stream().map(RStatOrgBusbarVoltageVO::getBusbarId).collect(Collectors.toList());
|
||||
PmsGeneratrixParam generatrixParam=new PmsGeneratrixParam();
|
||||
PmsGeneratrixParam generatrixParam = new PmsGeneratrixParam();
|
||||
generatrixParam.setGeneratrixIds(busbarIds);
|
||||
generatrixParam.setGeneratrixVoltageLevel(param.getIds());
|
||||
List<GeneratrixAndPowerStationDTO> generatrixDTO = pmsGeneratrixClient.getGeneratrixAndPowerStationInfo(generatrixParam).getData();
|
||||
@@ -89,7 +89,7 @@ public class RStatOrgBusbarVoltageServiceImpl extends ServiceImpl<RStatOrgBusbar
|
||||
if (deptMap.containsKey(key)) {
|
||||
DeptDTO deptDTO = deptMap.get(key);
|
||||
value.setOrgName(deptDTO.getName());
|
||||
if(generatrixMap.containsKey(value.getBusbarId())){
|
||||
if (generatrixMap.containsKey(value.getBusbarId())) {
|
||||
GeneratrixAndPowerStationDTO dto = generatrixMap.get(value.getBusbarId());
|
||||
value.setBusbarVoltageLevel(dto.getGeneratrixVoltageLevel());
|
||||
value.setPowerStationName(dto.getPowerName());
|
||||
|
||||
@@ -130,20 +130,20 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
|
||||
switch (param.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// 获取年区域暂态指标分类统计表
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(baseParam, deptIds, mainnetData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// 获取季区域暂态指标分类统计表
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(baseParam, deptIds, mainnetData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// 获取月区域暂态指标分类统计表
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(baseParam, deptIds, mainnetData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(CollUtil.isNotEmpty(temp)){
|
||||
if (CollUtil.isNotEmpty(temp)) {
|
||||
Map<String, List<RStatSubstationOrgVO>> map = temp
|
||||
.stream().collect(Collectors.groupingBy(RStatSubstationOrgVO::getOrgNo));
|
||||
map.forEach((key, value) -> {
|
||||
@@ -305,9 +305,9 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
|
||||
List<String> infoIds = new ArrayList<>();
|
||||
Map<String, PmsMonitorDTO> pmsMonitorDTOMap = pmsMonitorDTOS.stream().filter(
|
||||
v -> {
|
||||
if(infoIds.contains(v.getPowerrId())){
|
||||
if (infoIds.contains(v.getPowerrId())) {
|
||||
return false;
|
||||
}else {
|
||||
} else {
|
||||
infoIds.add(v.getPowerrId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.njcn.harmonic.service.specialanalysis;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface RMpWpPowerDetailMService extends IService<RMpWpPowerDetailM> {
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -26,6 +27,7 @@ public interface RMpWpPowerDetailMService extends IService<RMpWpPowerDetailM> {
|
||||
|
||||
/**
|
||||
* 电气化铁路分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -2,11 +2,15 @@ package com.njcn.harmonic.service.specialanalysis;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgPvPowerQualityQPO;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgPvDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgPvPowerStreamVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分布式光伏_台区电能质量明细
|
||||
*
|
||||
@@ -17,6 +21,7 @@ public interface RStatOrgPvPowerQualityService extends IService<RStatOrgPvPowerQ
|
||||
|
||||
/**
|
||||
* 低功率因数统计分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -24,8 +29,17 @@ public interface RStatOrgPvPowerQualityService extends IService<RStatOrgPvPowerQ
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Page<RStatOrgPvDetailVO> getPowerQualityInfo(PowerQualityParam.PowerQualityDetailInfoParam param);
|
||||
|
||||
|
||||
/**
|
||||
* 分布式光伏概览-电压问题
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO.GroupVO> getVoltage(OverviewParam param);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,14 +4,12 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpPvPowerDetailMPO;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.RMpWpPowerDetailVO;
|
||||
import com.njcn.harmonic.service.specialanalysis.DistributedPvVolOverService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -81,47 +81,47 @@ public class RMpWpPowerDetailMServiceImpl extends ServiceImpl<RMpWpPowerDetailMM
|
||||
//查询区域超标统计-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
Page<RMpWpPowerDetailY> pageY = rMpWpPowerDetailYMapper.selectPage(new Page<>(param.getPageNum(), param.getPageSize())
|
||||
,new LambdaQueryWrapper<RMpWpPowerDetailY>()
|
||||
.in(RMpWpPowerDetailY::getMeasurementPointId,monitorIds)
|
||||
.eq(RMpWpPowerDetailY::getMonitorTag,param.getMonitorTag())
|
||||
, new LambdaQueryWrapper<RMpWpPowerDetailY>()
|
||||
.in(RMpWpPowerDetailY::getMeasurementPointId, monitorIds)
|
||||
.eq(RMpWpPowerDetailY::getMonitorTag, param.getMonitorTag())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RMpWpPowerDetailY::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RMpWpPowerDetailY::getDataDate, param.getEndTime())
|
||||
);
|
||||
List<RMpWpPowerDetailVO> rMpWpPowerDetailVOS = BeanUtil.copyToList(pageY.getRecords(), RMpWpPowerDetailVO.class);
|
||||
page=BeanUtil.copyProperties(pageY,Page.class);
|
||||
page = BeanUtil.copyProperties(pageY, Page.class);
|
||||
page.setRecords(rMpWpPowerDetailVOS);
|
||||
break;
|
||||
//查询区域超标统计-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
Page<RMpWpPowerDetailQ> pageList = rMpWpPowerDetailQMapper.selectPage(new Page<>(param.getPageNum(), param.getPageSize())
|
||||
,new LambdaQueryWrapper<RMpWpPowerDetailQ>()
|
||||
.in(RMpWpPowerDetailQ::getMeasurementPointId,monitorIds)
|
||||
.eq(RMpWpPowerDetailQ::getMonitorTag,param.getMonitorTag())
|
||||
, new LambdaQueryWrapper<RMpWpPowerDetailQ>()
|
||||
.in(RMpWpPowerDetailQ::getMeasurementPointId, monitorIds)
|
||||
.eq(RMpWpPowerDetailQ::getMonitorTag, param.getMonitorTag())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RMpWpPowerDetailQ::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RMpWpPowerDetailQ::getDataDate, param.getEndTime())
|
||||
);
|
||||
List<RMpWpPowerDetailVO> rMpWpPowerDetailVOS2 = BeanUtil.copyToList(pageList.getRecords(), RMpWpPowerDetailVO.class);
|
||||
page=BeanUtil.copyProperties(pageList,Page.class);
|
||||
page = BeanUtil.copyProperties(pageList, Page.class);
|
||||
page.setRecords(rMpWpPowerDetailVOS2);
|
||||
break;
|
||||
//查询各区域超标统计-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
Page<RMpWpPowerDetailM> page1= this.page(new Page<>(param.getPageNum(), param.getPageSize())
|
||||
,new LambdaQueryWrapper<RMpWpPowerDetailM>()
|
||||
.in(RMpWpPowerDetailM::getMeasurementPointId,monitorIds)
|
||||
.eq(RMpWpPowerDetailM::getMonitorTag,param.getMonitorTag())
|
||||
Page<RMpWpPowerDetailM> page1 = this.page(new Page<>(param.getPageNum(), param.getPageSize())
|
||||
, new LambdaQueryWrapper<RMpWpPowerDetailM>()
|
||||
.in(RMpWpPowerDetailM::getMeasurementPointId, monitorIds)
|
||||
.eq(RMpWpPowerDetailM::getMonitorTag, param.getMonitorTag())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RMpWpPowerDetailM::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RMpWpPowerDetailM::getDataDate, param.getEndTime())
|
||||
);
|
||||
List<RMpWpPowerDetailVO> rMpWpPowerDetailVOS3 = BeanUtil.copyToList(page1.getRecords(), RMpWpPowerDetailVO.class);
|
||||
page=BeanUtil.copyProperties(page1,Page.class);
|
||||
page = BeanUtil.copyProperties(page1, Page.class);
|
||||
page.setRecords(rMpWpPowerDetailVOS3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
page.getRecords().stream().forEach(vo->{
|
||||
if(monitorMap.containsKey(vo.getMeasurementPointId())){
|
||||
page.getRecords().stream().forEach(vo -> {
|
||||
if (monitorMap.containsKey(vo.getMeasurementPointId())) {
|
||||
PmsMonitorDTO monitorDTO = monitorMap.get(vo.getMeasurementPointId());
|
||||
vo.setOrgName(monitorDTO.getOrgName());
|
||||
vo.setMeasurementPointName(monitorDTO.getName());
|
||||
@@ -137,7 +137,7 @@ public class RMpWpPowerDetailMServiceImpl extends ServiceImpl<RMpWpPowerDetailMM
|
||||
List<String> deptIds = deptDTOS.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
|
||||
//根据部门信息,获取牵引站信息
|
||||
PmsTractionStationParam stationParam=new PmsTractionStationParam();
|
||||
PmsTractionStationParam stationParam = new PmsTractionStationParam();
|
||||
stationParam.setOrgIds(deptIds);
|
||||
List<PmsTractionStationDTO> tractionStationDTOS = tractionStationClient.getPmsTractionStationInfo(stationParam).getData();
|
||||
|
||||
@@ -153,18 +153,18 @@ public class RMpWpPowerDetailMServiceImpl extends ServiceImpl<RMpWpPowerDetailMM
|
||||
);
|
||||
|
||||
List<RMpRailwayTractionDetailVO> newList = BeanUtil.copyToList(oldPage.getRecords(), RMpRailwayTractionDetailVO.class);
|
||||
newList.stream().forEach(vo->{
|
||||
if(dtoMap.containsKey(vo.getTractionStationId())){
|
||||
PmsTractionStationDTO dto = dtoMap.get(vo.getTractionStationId());
|
||||
vo.setOrgName(dto.getOrgName());
|
||||
vo.setRailwayType(dto.getRailwayType());
|
||||
vo.setTractionStationName(dto.getName());
|
||||
vo.setRailwayLineName(dto.getRailwayLineName());
|
||||
vo.setVoltageLevel(dto.getVoltageLevel());
|
||||
vo.setRatedCapacity(dto.getRatedCapacity());
|
||||
}
|
||||
newList.stream().forEach(vo -> {
|
||||
if (dtoMap.containsKey(vo.getTractionStationId())) {
|
||||
PmsTractionStationDTO dto = dtoMap.get(vo.getTractionStationId());
|
||||
vo.setOrgName(dto.getOrgName());
|
||||
vo.setRailwayType(dto.getRailwayType());
|
||||
vo.setTractionStationName(dto.getName());
|
||||
vo.setRailwayLineName(dto.getRailwayLineName());
|
||||
vo.setVoltageLevel(dto.getVoltageLevel());
|
||||
vo.setRatedCapacity(dto.getRatedCapacity());
|
||||
}
|
||||
});
|
||||
Page<RMpRailwayTractionDetailVO> page=BeanUtil.copyProperties(oldPage,Page.class);
|
||||
Page<RMpRailwayTractionDetailVO> page = BeanUtil.copyProperties(oldPage, Page.class);
|
||||
page.setRecords(newList);
|
||||
return page;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -12,10 +13,14 @@ import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.mapper.specialanalysis.*;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgPvPowerQualityMPO;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgPvPowerQualityQPO;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgPvDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgPvPowerStreamVO;
|
||||
import com.njcn.harmonic.service.specialanalysis.RStatOrgPvPowerQualityMService;
|
||||
import com.njcn.harmonic.service.specialanalysis.RStatOrgPvPowerQualityService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
@@ -46,42 +51,43 @@ public class RStatOrgPvPowerQualityServiceImpl extends ServiceImpl<RStatOrgPvPow
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
private final RStatOrgPvPowerQualityMMapper rStatOrgPvPowerQualityMMapper;
|
||||
|
||||
@Override
|
||||
public Page<RStatOrgPvPowerStreamVO> getPowerQualityStream(PowerQualityParam param) {
|
||||
PowerQualityParam.PowerQualityDetailParam bearParam= BeanUtil.copyProperties(param, PowerQualityParam.PowerQualityDetailParam.class);
|
||||
Map<String,String> list=new HashMap<>(3);
|
||||
PowerQualityParam.PowerQualityDetailParam bearParam = BeanUtil.copyProperties(param, PowerQualityParam.PowerQualityDetailParam.class);
|
||||
Map<String, String> list = new HashMap<>(3);
|
||||
List<DictData> dictDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.AREA_PQ_EVENT_TYPE.getCode()).getData();
|
||||
if(CollectionUtil.isEmpty(dictDataList)){
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "台区电能质量事件类型为空");
|
||||
if (CollectionUtil.isEmpty(dictDataList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "台区电能质量事件类型为空");
|
||||
}
|
||||
//获取部门id集合
|
||||
List<Dept> deptDTOS = deptFeignClient.getDirectSonSelf(param.getId()).getData();
|
||||
if(CollectionUtil.isEmpty(deptDTOS)){
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "获取部门信息为空");
|
||||
if (CollectionUtil.isEmpty(deptDTOS)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "获取部门信息为空");
|
||||
}
|
||||
Map<String, Dept> deptDTOMap = deptDTOS.stream().collect
|
||||
(Collectors.toMap(Dept::getCode, Function.identity(), (key, key2) -> key2));
|
||||
List<String> OrgNOS = deptDTOS.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
//根据字典Code,取出字典id,拼入sql中
|
||||
dictDataList.stream().forEach(dictData ->{
|
||||
if(DicDataEnum.EVENT_TYPE_L.getCode().equals(dictData.getCode())){
|
||||
list.put("eventTypeL",dictData.getId());
|
||||
}
|
||||
if(DicDataEnum.EVENT_TYPE_P.getCode().equals(dictData.getCode())){
|
||||
Console.log(list);
|
||||
list.put("eventTypeP",dictData.getId());
|
||||
}
|
||||
if(DicDataEnum.EVENT_TYPE_O.getCode().equals(dictData.getCode())){
|
||||
list.put("eventTypeO",dictData.getId());
|
||||
}
|
||||
});
|
||||
dictDataList.stream().forEach(dictData -> {
|
||||
if (DicDataEnum.EVENT_TYPE_L.getCode().equals(dictData.getCode())) {
|
||||
list.put("eventTypeL", dictData.getId());
|
||||
}
|
||||
if (DicDataEnum.EVENT_TYPE_P.getCode().equals(dictData.getCode())) {
|
||||
Console.log(list);
|
||||
list.put("eventTypeP", dictData.getId());
|
||||
}
|
||||
if (DicDataEnum.EVENT_TYPE_O.getCode().equals(dictData.getCode())) {
|
||||
list.put("eventTypeO", dictData.getId());
|
||||
}
|
||||
});
|
||||
bearParam.setMapId(list);
|
||||
bearParam.setOrgNos(OrgNOS);
|
||||
//数据分页查询
|
||||
Page<RStatOrgPvPowerStreamVO> page = rStatOrgPvPowerQualityYPOMapper.selectListPage(new Page<>(param.getPageNum(), param.getPageSize()), bearParam);
|
||||
page.getRecords().stream().forEach(vo->{
|
||||
if(deptDTOMap.containsKey(vo.getOrgNo())){
|
||||
page.getRecords().stream().forEach(vo -> {
|
||||
if (deptDTOMap.containsKey(vo.getOrgNo())) {
|
||||
Dept deptDTO = deptDTOMap.get(vo.getOrgNo());
|
||||
vo.setOrgNo(deptDTO.getName());
|
||||
}
|
||||
@@ -98,7 +104,7 @@ public class RStatOrgPvPowerQualityServiceImpl extends ServiceImpl<RStatOrgPvPow
|
||||
//监测点类别
|
||||
pwPmsMonitorParam.setMonitorSort(param.getMonitorSort());
|
||||
//获取监测点信息
|
||||
PowerQualityParam.PowerQualityDetailParam bearParam= BeanUtil.copyProperties(param, PowerQualityParam.PowerQualityDetailParam.class);
|
||||
PowerQualityParam.PowerQualityDetailParam bearParam = BeanUtil.copyProperties(param, PowerQualityParam.PowerQualityDetailParam.class);
|
||||
List<PwPmsMonitorDTO> pwMonitorList = pwMonitorClient.getPwPhotovoltaicMonitorList(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(pwMonitorList)) {
|
||||
return new Page<>();
|
||||
@@ -112,8 +118,8 @@ public class RStatOrgPvPowerQualityServiceImpl extends ServiceImpl<RStatOrgPvPow
|
||||
bearParam.setOrgNos(monitorIds);
|
||||
//数据库分页查询
|
||||
Page<RStatOrgPvDetailVO> page = rStatOrgPvPowerQualityYPOMapper.selectDetailListPage(new Page<>(param.getPageNum(), param.getPageSize()), bearParam);
|
||||
page.getRecords().stream().forEach(vo->{
|
||||
if(monitorMap.containsKey(vo.getMeasurementPointId())){
|
||||
page.getRecords().stream().forEach(vo -> {
|
||||
if (monitorMap.containsKey(vo.getMeasurementPointId())) {
|
||||
PwPmsMonitorDTO monitorDTO = monitorMap.get(vo.getMeasurementPointId());
|
||||
vo.setOrgNo(monitorDTO.getOrgId());
|
||||
vo.setOrgName(monitorDTO.getOrgName());
|
||||
@@ -124,4 +130,58 @@ public class RStatOrgPvPowerQualityServiceImpl extends ServiceImpl<RStatOrgPvPow
|
||||
});
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OverviewVO.GroupVO> getVoltage(OverviewParam param) {
|
||||
List<OverviewVO.GroupVO> vos=new ArrayList<>();
|
||||
//获取部门信息
|
||||
List<DeptDTO> deptDTOS = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
if(CollectionUtil.isNotEmpty(deptDTOS)){
|
||||
//获取台区电能质量事件类型
|
||||
List<DictData> areaType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.AREA_PQ_EVENT_TYPE.getCode()).getData();
|
||||
if(CollectionUtil.isNotEmpty(deptDTOS)){
|
||||
List<String> typeID=new ArrayList<>();
|
||||
//取出电压相关的字典
|
||||
for (DictData dictData : areaType) {
|
||||
//电压 电压越上限15%以上
|
||||
if(DicDataEnum.EVENT_TYPE_T.getCode().equals(dictData.getCode())){
|
||||
typeID.add(dictData.getId());
|
||||
}
|
||||
//电压 电压越上限7%-15%
|
||||
if(DicDataEnum.EVENT_TYPE_R.getCode().equals(dictData.getCode())){
|
||||
typeID.add(dictData.getId());
|
||||
}
|
||||
//电压 超标3%-10%
|
||||
if(DicDataEnum.EVENT_TYPE_Z.getCode().equals(dictData.getCode())){
|
||||
typeID.add(dictData.getId());
|
||||
}
|
||||
//电压 超标10%以下
|
||||
if(DicDataEnum.EVENT_TYPE_X.getCode().equals(dictData.getCode())){
|
||||
typeID.add(dictData.getId());
|
||||
}
|
||||
|
||||
}
|
||||
//数据库查询
|
||||
List<String> deptCodes = deptDTOS.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
List<OverviewVO.VoltageVO> voltageVOS = rStatOrgPvPowerQualityMMapper.selectVoltage(deptCodes, typeID);
|
||||
if(CollectionUtil.isNotEmpty(voltageVOS)){
|
||||
Map<String, List<OverviewVO.VoltageVO>> voltageMap = voltageVOS.stream().collect(
|
||||
Collectors.groupingBy(OverviewVO.VoltageVO::getMonitoringObject));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user