暂态指标数据修改,区域稳态指标超标分类统计表增加展示列表监测点对象标签

This commit is contained in:
wr
2024-02-21 15:03:24 +08:00
parent 4a964c82c7
commit 9db6ebf441
8 changed files with 33 additions and 12 deletions

View File

@@ -41,6 +41,12 @@ public class RStatEventOrgVO implements Serializable {
@ApiModelProperty(name = "dataDate", value = "生成数据的时间,每年统计一次")
private Date dataDate;
/**
* 监测点类别
*/
@ApiModelProperty(name = "monitorType", value = "监测点类型")
private String monitorType;
/**
* 日均有效接入监测点数
*/

View File

@@ -25,6 +25,7 @@ public interface RStatEventOrgMapper {
* @return 年区域暂态指标分类统计表
*/
List<RStatEventOrgPO> getYearRStatEventOrgInfo(@Param("deptCode") List<String> deptCode,
@Param("ids") List<String> ids,
@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("mainnetPointId") String mainnetPointId);
@@ -39,6 +40,7 @@ public interface RStatEventOrgMapper {
* @return 季区域暂态指标分类统计表
*/
List<RStatEventOrgPO> getQuarterRStatEventOrgInfo(@Param("deptCode") List<String> deptCode,
@Param("ids") List<String> ids,
@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("mainnetPointId") String mainnetPointId);
@@ -53,6 +55,7 @@ public interface RStatEventOrgMapper {
* @return 月区域暂态指标分类统计表
*/
List<RStatEventOrgPO> getMonthRStatEventOrgInfoInfo(@Param("deptCode") List<String> deptCode,
@Param("ids") List<String> ids,
@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("mainnetPointId") String mainnetPointId);

View File

@@ -206,8 +206,8 @@
SELECT
measurement_point_id as measurementPointId,
start_time AS startTime,
duration AS duration,
feature_amplitude AS featureAmplitude
duration*1000 AS duration,
feature_amplitude*100 AS featureAmplitude
FROM
`r_mp_event_detail`
WHERE

View File

@@ -6,6 +6,7 @@
<sql id="query_rStatEventOrg_field">
rso.org_no AS orgNo,
rso.data_date AS dataDate,
rso.measurement_type_class AS measurementTypeClass,
rso.effective_measurement_average AS effectiveMeasurementAverage,
rso.effective_measurement_accrued AS effectiveMeasurementAccrued,
rso.event_measurement_average AS eventMeasurementAverage,
@@ -22,6 +23,12 @@
<sql id="query_rStatEventOrg_where">
rso.data_type = #{mainnetPointId}
AND rseo.data_type = #{mainnetPointId}
<if test="ids != null and ids.size > 0">
AND rso.measurement_type_class IN
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
#{item}
</foreach>
</if>
AND rso.org_no IN
<foreach collection="deptCode" item="item" open="(" close=")" separator=",">
#{item}

View File

@@ -155,15 +155,15 @@ public class StatisticsOfTransientIndicatorssServiceImpl implements StatisticsOf
switch (param.getType().toString()) {
case BizParamConstant.STAT_BIZ_YEAR:
// 获取年区域暂态指标分类统计表
temp = rStatEventOrgMapper.getYearRStatEventOrgInfo(deptCode, param.getStartTime(), param.getEndTime(), mainnetPointId);
temp = rStatEventOrgMapper.getYearRStatEventOrgInfo(deptCode,param.getMonitorSort(), param.getStartTime(), param.getEndTime(), mainnetPointId);
break;
case BizParamConstant.STAT_BIZ_QUARTER:
// 获取季区域暂态指标分类统计表
temp = rStatEventOrgMapper.getQuarterRStatEventOrgInfo(deptCode, param.getStartTime(), param.getEndTime(), mainnetPointId);
temp = rStatEventOrgMapper.getQuarterRStatEventOrgInfo(deptCode, param.getMonitorSort(),param.getStartTime(), param.getEndTime(), mainnetPointId);
break;
case BizParamConstant.STAT_BIZ_MONTH:
// 获取月区域暂态指标分类统计表
temp = rStatEventOrgMapper.getMonthRStatEventOrgInfoInfo(deptCode, param.getStartTime(), param.getEndTime(), mainnetPointId);
temp = rStatEventOrgMapper.getMonthRStatEventOrgInfoInfo(deptCode,param.getMonitorSort(), param.getStartTime(), param.getEndTime(), mainnetPointId);
break;
default:
break;
@@ -177,7 +177,7 @@ public class StatisticsOfTransientIndicatorssServiceImpl implements StatisticsOf
// 根据暂态指标code转换成map
Map<String, DictData> eventStatisMap = eventStatis.stream().collect(Collectors.toMap(DictData::getId, DictData -> DictData));
// 通过单位code将集合转换为map集合
Map<String, List<RStatEventOrgPO>> tempMap = temp.stream().collect(Collectors.groupingBy(RStatEventOrgPO::getOrgNo));
Map<String, List<RStatEventOrgPO>> tempMap = temp.stream().collect(Collectors.groupingBy(x->x.getOrgNo()+"_"+x.getMeasurementTypeClass()));
// 匹配单位名称
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, DeptDTO -> DeptDTO));
// 属性赋值
@@ -185,9 +185,11 @@ public class StatisticsOfTransientIndicatorssServiceImpl implements StatisticsOf
RStatEventOrgVO rStatEventOrgVO = new RStatEventOrgVO();
// 基础属性赋值
if (rStatEventOrgVO.getOrgNo() == null) {
String[] split = orgOn.split("_");
rStatEventOrgVO.setOrgNo(pos.get(0).getOrgNo());
rStatEventOrgVO.setOrgName(deptDTOMap.get(pos.get(0).getOrgNo()).getName());
rStatEventOrgVO.setOrgName(deptDTOMap.get(split[0]).getName());
rStatEventOrgVO.setDataDate(pos.get(0).getDataDate());
rStatEventOrgVO.setMonitorType(split[1]);
rStatEventOrgVO.setEffectiveMeasurementAverage(pos.get(0).getEffectiveMeasurementAverage());
rStatEventOrgVO.setEffectiveMeasurementAccrued(pos.get(0).getEffectiveMeasurementAccrued());
rStatEventOrgVO.setEventMeasurementAverage(pos.get(0).getEventMeasurementAverage());
@@ -243,6 +245,9 @@ public class StatisticsOfTransientIndicatorssServiceImpl implements StatisticsOf
}
result.add(rStatEventOrgVO);
});
if(CollUtil.isNotEmpty(result)){
result.sort(Comparator.comparing(x->x.getOrgName()));
}
return result;
}

View File

@@ -82,9 +82,9 @@ public class RStatOrgController extends BaseController {
@PostMapping("/getRStatSubstation")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("区域稳态指标超标分类统计表")
public HttpResult<List<RStatSubstationOrg2VO>> getRStatSubstation(@RequestBody StatSubstationBizBaseParam param) {
public HttpResult<List<RStatSubstationOrg2VO.MonitorType>> getRStatSubstation(@RequestBody StatSubstationBizBaseParam param) {
String methodDescribe = getMethodDescribe("getRStatSubstation");
List<RStatSubstationOrg2VO> statSubstationIcon = rStatOrgYService.getRStatSubstationOrg(param);
List<RStatSubstationOrg2VO.MonitorType> statSubstationIcon = rStatOrgYService.getRStatSubstationOrg(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, statSubstationIcon, methodDescribe);
}

View File

@@ -33,7 +33,7 @@ public interface RStatOrgYService extends IService<RStatOrgY> {
* @param param
* @return
*/
List<RStatSubstationOrg2VO> getRStatSubstationOrg(StatSubstationBizBaseParam param);
List<RStatSubstationOrg2VO.MonitorType> getRStatSubstationOrg(StatSubstationBizBaseParam param);
/**
* 变电站(换流站)稳态指标超标分类统计表

View File

@@ -127,12 +127,12 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
}
@Override
public List<RStatSubstationOrg2VO> getRStatSubstationOrg(StatSubstationBizBaseParam param) {
public List<RStatSubstationOrg2VO.MonitorType> getRStatSubstationOrg(StatSubstationBizBaseParam param) {
// 获取当前用户的部门的子部门信息
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
List<DeptDTO> data = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
List<RStatSubstationOrg2VO> info = new ArrayList<>();
List<RStatSubstationOrg2VO.MonitorType> info = new ArrayList<>();
if (CollectionUtil.isNotEmpty(data)) {
// 根据暂态指标枚举查询暂态指标
List<DictData> eventStatis = dicDataFeignClient.getDicDataByTypeCode(