1.pms3.0主网基准水平和统计报表代码调整
This commit is contained in:
@@ -9,6 +9,7 @@ import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.event.pojo.param.REventMParam;
|
||||
import com.njcn.event.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.event.pojo.vo.*;
|
||||
import com.njcn.event.service.majornetwork.RStatEventMService;
|
||||
import com.njcn.event.service.majornetwork.RStatEventQService;
|
||||
@@ -18,6 +19,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -96,6 +98,17 @@ public class RStatEventController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatHarmonicIcon, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域暂态电能质量水平评估
|
||||
*/
|
||||
@PostMapping("/getEventBenchmarkLevelList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("区域暂态电能质量水平评估")
|
||||
public HttpResult<List<RStatEventMVO.Vo>> getEventBenchmarkLevelList(StatSubstationBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getEventBenchmarkLevelList");
|
||||
List<RStatEventMVO.Vo> eventBenchmarkLevelList = rStatEventYService.getEventBenchmarkLevelList(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eventBenchmarkLevelList, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.njcn.event.mapper.majornetwork;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.event.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.event.pojo.po.RStatEventY;
|
||||
import com.njcn.event.pojo.vo.RStatEventMVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -26,4 +28,20 @@ public interface RStatEventYMapper extends BaseMapper<RStatEventY> {
|
||||
List<RStatEventY> selectInfoList(@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("dataType") String dataType);
|
||||
|
||||
|
||||
/**
|
||||
* 监测点数据查询
|
||||
*
|
||||
* @param ids
|
||||
* @param param
|
||||
* @param map
|
||||
* @param dataType
|
||||
* @return
|
||||
*/
|
||||
List<RStatEventMVO.Vo> selectEventBenchmarkLevel(@Param("ids")List<String> ids,
|
||||
@Param("param") StatSubstationBizBaseParam param,
|
||||
@Param("map")Map<String, String> map,
|
||||
@Param("dataType") String dataType);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
duration,
|
||||
feature_amplitude
|
||||
duration * 1000 as duration,
|
||||
feature_amplitude * 100 as feature_amplitude
|
||||
FROM
|
||||
r_mp_event_detail
|
||||
WHERE
|
||||
@@ -140,7 +140,7 @@
|
||||
(
|
||||
SELECT
|
||||
measurement_point_id,
|
||||
duration
|
||||
duration*1000 as duration
|
||||
FROM
|
||||
r_mp_event_detail
|
||||
WHERE
|
||||
@@ -184,7 +184,7 @@
|
||||
(
|
||||
SELECT
|
||||
measurement_point_id,
|
||||
feature_amplitude
|
||||
feature_amplitude * 100 as feature_amplitude
|
||||
FROM
|
||||
r_mp_event_detail
|
||||
WHERE
|
||||
@@ -383,8 +383,8 @@
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
duration,
|
||||
feature_amplitude
|
||||
duration * 1000 as duration,
|
||||
feature_amplitude * 100 as feature_amplitude
|
||||
FROM
|
||||
r_mp_event_detail
|
||||
WHERE 1 = 1
|
||||
@@ -403,7 +403,6 @@
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND DATE_FORMAT(start_time, '%Y-%m') >= SUBSTRING(#{startTime}, 1, 7)
|
||||
</if>
|
||||
-- 没写错,就是start_time, SUBSTRING第二个参数代表第一个字符开始,取7个字符
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(start_time, '%Y-%m') <= SUBSTRING(#{endTime}, 1, 7)
|
||||
</if>
|
||||
@@ -435,8 +434,8 @@
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
duration,
|
||||
feature_amplitude
|
||||
duration * 1000 as duration,
|
||||
feature_amplitude * 100 as feature_amplitude
|
||||
FROM
|
||||
r_mp_event_detail
|
||||
WHERE 1 = 1
|
||||
@@ -444,7 +443,6 @@
|
||||
<foreach collection="monitorIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
AND event_type IN
|
||||
<foreach collection="eventTypeList" item="type" open="(" close=")" separator=",">
|
||||
#{type}
|
||||
|
||||
@@ -47,5 +47,46 @@
|
||||
measurement_type_class,
|
||||
event_type
|
||||
</select>
|
||||
<select id="selectEventBenchmarkLevel" resultType="com.njcn.event.pojo.vo.RStatEventMVO$Vo">
|
||||
SELECT
|
||||
org_no as orgId,
|
||||
measurement_type_class,
|
||||
SUM(IF(`event_type`=#{map.dip},event_count,0)) as eventCount,
|
||||
SUM(IF(`event_type`=#{map.rise},event_count,0)) as riseCount,
|
||||
SUM(IF(`event_type`=#{map.interrupt},event_count,0)) as interruptCount
|
||||
FROM
|
||||
<if test="param != null and param.type == 1">
|
||||
r_stat_event_y
|
||||
</if>
|
||||
<if test="param != null and param.type == 2">
|
||||
r_stat_event_q
|
||||
</if>
|
||||
<if test="param != null and param.type == 3">
|
||||
r_stat_event_m
|
||||
</if>
|
||||
<where>
|
||||
<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>
|
||||
<if test="param != null and param.ids != null and param.ids.size > 0">
|
||||
AND measurement_type_class IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND data_date <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
GROUP BY
|
||||
org_no,monitoring_object
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(start_time, '%Y-%m') <= SUBSTRING(#{endTime}, 1, 7)
|
||||
</if>
|
||||
order by start_time desc
|
||||
</select>
|
||||
<select id="getByEventId" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
|
||||
SELECT
|
||||
|
||||
@@ -422,7 +422,6 @@ public class EventMonitorReportServiceImpl implements EventMonitorReportService
|
||||
pmsMonitorParam.setMonitorName(monitorName); //监测点名称
|
||||
pmsMonitorParam.setOrgIds(orgCodeList); //单位codes
|
||||
List<PmsMonitorDTO> monitorList = monitorClient.getMonitorInfoListByCond(pmsMonitorParam).getData(); //监测点信息
|
||||
|
||||
return monitorList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@ package com.njcn.event.service.majornetwork.Impl;
|
||||
|
||||
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.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.event.mapper.majornetwork.RStatEventYMapper;
|
||||
import com.njcn.event.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.event.pojo.po.RStatEventM;
|
||||
import com.njcn.event.pojo.po.RStatEventY;
|
||||
import com.njcn.event.pojo.vo.RArrayVO;
|
||||
import com.njcn.event.pojo.vo.RStatEventMVO;
|
||||
@@ -18,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;
|
||||
@@ -209,6 +206,39 @@ public class RStatEventYServiceImpl extends ServiceImpl<RStatEventYMapper, RStat
|
||||
return arrayVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RStatEventMVO.Vo> getEventBenchmarkLevelList(StatSubstationBizBaseParam param) {
|
||||
//获取暂态信息
|
||||
Map<String, String> map = new HashMap<>(3);
|
||||
//获取主网监测点
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
List<DictData> dictDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> ids = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
//根据字典Code,取出字典id,拼入sql中
|
||||
dictDataList.stream().forEach(dictData -> {
|
||||
if (DicDataEnum.VOLTAGE_DIP.getCode().equals(dictData.getCode())) {
|
||||
map.put("dip", dictData.getId());
|
||||
}
|
||||
if (DicDataEnum.VOLTAGE_RISE.getCode().equals(dictData.getCode())) {
|
||||
map.put("rise", dictData.getId());
|
||||
}
|
||||
if (DicDataEnum.SHORT_INTERRUPTIONS.getCode().equals(dictData.getCode())) {
|
||||
map.put("interrupt", dictData.getId());
|
||||
}
|
||||
});
|
||||
//数据分页查询
|
||||
List<RStatEventMVO.Vo> vos = this.baseMapper.selectEventBenchmarkLevel(ids, param, map, data.getId());
|
||||
Map<String, String> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, DeptDTO::getName));
|
||||
vos.forEach(vo -> {
|
||||
if (deptDTOMap.containsKey(vo.getOrgId())) {
|
||||
vo.setOrgName(deptDTOMap.get(vo.getOrgId()));
|
||||
}
|
||||
});
|
||||
return vos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 便利赋值
|
||||
*
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.njcn.event.service.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.event.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.event.pojo.po.RStatEventY;
|
||||
import com.njcn.event.pojo.vo.RArrayVO;
|
||||
import com.njcn.event.pojo.vo.RStatEventMVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -32,4 +34,13 @@ public interface RStatEventYService extends IService<RStatEventY> {
|
||||
* @return
|
||||
*/
|
||||
List<RArrayVO> getPwRStatEventYAll(StatisticsBizBaseParam param);
|
||||
|
||||
|
||||
/**
|
||||
* 区域暂态电能质量水平评估
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RStatEventMVO.Vo> getEventBenchmarkLevelList(StatSubstationBizBaseParam param);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user