pmsbug修改

This commit is contained in:
hzj
2025-07-16 20:00:23 +08:00
parent 5f1f42f8d7
commit 74808dbd05
13 changed files with 327 additions and 171 deletions

View File

@@ -88,17 +88,17 @@
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%') AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
</if> </if>
</select> </select>
<!--sql直接报错修改不爆错-->
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO"> <select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
SELECT DISTINCT SELECT DISTINCT
monitor.Org_Id AS orgId, pm.Org_Id AS orgId,
monitor.Org_Name AS orgName, pm.Org_Name AS orgName,
monitor.Powerr_Id AS powerId, pm.Powerr_Id AS powerId,
monitor.Powerr_Name AS powerName, pm.Powerr_Name AS powerName,
monitor.id AS monitorId, pm.id AS monitorId,
monitor.Name AS monitorName, pm.Name AS monitorName,
monitor.Line_Id, pm.Line_Id,
monitor.Line_Name, pm.Line_Name,
pdm.Monitor_Sort AS monitorSort, pdm.Monitor_Sort AS monitorSort,
pdm.Voltage_Level AS voltageLevel, pdm.Voltage_Level AS voltageLevel,
pdm.If_Power_User AS if_powerUser, pdm.If_Power_User AS if_powerUser,
@@ -110,28 +110,7 @@
pdm.Update_By AS updateBy, pdm.Update_By AS updateBy,
pdm.Update_Time AS updateTime pdm.Update_Time AS updateTime
FROM FROM
((
SELECT
pm.id,
pm.Name,
pm.Status,
pm.Org_Id,
pm.Org_Name,
pm.Powerr_Id,
pm.Powerr_Name,
pm.Line_Id,
pm.Line_Name
FROM
pms_monitor AS pm pms_monitor AS pm
<where>
<if test="pwPmsMonitorParam.monitorTag!=null and pwPmsMonitorParam.monitorTag.size()!=0">
AND pm.Monitor_Tag IN
<foreach collection="pwPmsMonitorParam.monitorTag" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
)
INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id
WHERE WHERE
pm.Status = 1 pm.Status = 1
@@ -140,6 +119,12 @@
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=","> <foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
#{orgId} #{orgId}
</foreach> </foreach>
<if test="pwPmsMonitorParam.monitorTag!=null and pwPmsMonitorParam.monitorTag.size()!=0">
AND pm.Monitor_Tag IN
<foreach collection="pwPmsMonitorParam.monitorTag" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="pwPmsMonitorParam.voltageLevels!=null and pwPmsMonitorParam.voltageLevels.size()!=0"> <if test="pwPmsMonitorParam.voltageLevels!=null and pwPmsMonitorParam.voltageLevels.size()!=0">
AND pdm.Voltage_Level IN AND pdm.Voltage_Level IN
<foreach collection="pwPmsMonitorParam.voltageLevels" item="item" open="(" close=")" separator=","> <foreach collection="pwPmsMonitorParam.voltageLevels" item="item" open="(" close=")" separator=",">

View File

@@ -387,6 +387,7 @@
<select id="pwMonitorAreaDetailInfo" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO"> <select id="pwMonitorAreaDetailInfo" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
SELECT SELECT
t.org_id orgId, t.org_id orgId,
t.orgName orgName,
t.id monitorId, t.id monitorId,
t.NAME monitorName, t.NAME monitorName,
b.Terminal_Id terminalId, b.Terminal_Id terminalId,
@@ -401,6 +402,7 @@
a.id, a.id,
a.NAME, a.NAME,
a.org_id, a.org_id,
dept.name orgName,
3 AS lineType, 3 AS lineType,
a.Power_Station_Id AS powerrId, a.Power_Station_Id AS powerrId,
a.Line_Id, a.Line_Id,
@@ -408,7 +410,7 @@
b.Power_Name powerName b.Power_Name powerName
FROM FROM
pms_power_client a pms_power_client a
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code
WHERE WHERE
a.STATUS = 1 a.STATUS = 1
) UNION ALL ) UNION ALL
@@ -417,6 +419,7 @@
a.id, a.id,
a.NAME, a.NAME,
a.org_id, a.org_id,
dept.name orgName,
3 AS lineType, 3 AS lineType,
a.Power_Station_Id AS powerrId, a.Power_Station_Id AS powerrId,
a.Line_Id, a.Line_Id,
@@ -424,37 +427,39 @@
b.Power_Name powerName b.Power_Name powerName
FROM FROM
pms_power_generation_user a pms_power_generation_user a
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code
WHERE WHERE
a.STATUS = 1 a.STATUS = 1
) UNION ALL ) UNION ALL
( (
SELECT SELECT
id, a.id,
NAME, a.NAME,
org_id, a.org_id,
dept.name orgName,
2 AS lineType, 2 AS lineType,
Power_Station_Id AS powerrId, a.Power_Station_Id AS powerrId,
Line_Id, a.Line_Id,
Voltage_Level, a.Voltage_Level,
Powerr_Name powerName a.Powerr_Name powerName
FROM FROM
pms_power_distributionarea pms_power_distributionarea a LEFT JOIN sys_dept dept on a.org_id =dept.code
WHERE WHERE
STATUS = 1 STATUS = 1
) UNION ALL ) UNION ALL
( (
SELECT SELECT
id, a.id,
NAME, a.NAME,
org_id, a.org_id,
dept.name orgName,
1 AS lineType, 1 AS lineType,
Powerr_Id AS powerrId, a.Powerr_Id AS powerrId,
Line_Id, a.Line_Id,
Voltage_Level, a.Voltage_Level,
Powerr_Name powerName a.Powerr_Name powerName
FROM FROM
pms_monitor pms_monitor a LEFT JOIN sys_dept dept on a.org_id =dept.code
WHERE WHERE
STATUS = 1 STATUS = 1
) )

View File

@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
@@ -183,7 +184,7 @@ public class DeviceController extends BaseController {
@ApiOperation("修改装置通讯状态") @ApiOperation("修改装置通讯状态")
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) { public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
String methodDescribe = getMethodDescribe("updateDevComFlag"); String methodDescribe = getMethodDescribe("updateDevComFlag");
boolean update = iDeviceService.lambdaUpdate().set(Device::getComFlag, devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update(); boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()), Device::getComFlag,devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
} }

View File

@@ -121,13 +121,13 @@ public class TerminalBaseController extends BaseController {
} }
terminalBaseService.addTerminal(addTerminalParam); terminalBaseService.addTerminal(addTerminalParam);
//新增终端后发送消息给前置重启设备 //新增终端后发送消息给前置重启设备
if (Objects.nonNull(addTerminalParam.getDeviceParam())) { // if (Objects.nonNull(addTerminalParam.getDeviceParam())) {
addTerminalParam.getDeviceParam().forEach(temp->{ // addTerminalParam.getDeviceParam().forEach(temp->{
Line line = terminalBaseService.queryTerminalByName(temp.getName()); // Line line = terminalBaseService.queryTerminalByName(temp.getName());
terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL); // terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL);
}); // });
//
} // }
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }
@@ -163,7 +163,7 @@ public class TerminalBaseController extends BaseController {
Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId); Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId);
//删除监测点即修改终端通知前置重启 //删除监测点即修改终端通知前置重启
terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY); // terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
} }

View File

@@ -1513,7 +1513,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList); lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
deptLineMapper.delete(lineLambdaQueryWrapper); deptLineMapper.delete(lineLambdaQueryWrapper);
// 删除终端通知前置重启 // 删除终端通知前置重启
this.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL); // this.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL);
} }
@@ -1535,8 +1535,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList); lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
deptLineMapper.delete(lineLambdaQueryWrapper); deptLineMapper.delete(lineLambdaQueryWrapper);
//通知前置删除监测点 //通知前置删除监测点
String[] split = obj.getPids().split(","); // String[] split = obj.getPids().split(",");
this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY); // this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
} }
@@ -1547,8 +1547,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
overlimitMapper.deleteById(obj.getId()); overlimitMapper.deleteById(obj.getId());
deptLineMapper.deleteById(obj.getId()); deptLineMapper.deleteById(obj.getId());
//通知前置删除监测点 //通知前置删除监测点
String[] split = obj.getPids().split(","); // String[] split = obj.getPids().split(",");
this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY); // this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
} else { } else {
throw new BusinessException(CommonResponseEnum.FAIL); throw new BusinessException(CommonResponseEnum.FAIL);

View File

@@ -17,84 +17,84 @@ public class EventDipShortDistributionVO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private int featureAmp90with100ms; private int featureAmp90with100ms=0;
private int featureAmp90with250ms; private int featureAmp90with250ms=0;
private int featureAmp90with500ms; private int featureAmp90with500ms=0;
private int featureAmp90with1000ms; private int featureAmp90with1000ms=0;
private int featureAmp90with3000ms; private int featureAmp90with3000ms=0;
private int featureAmp90with10000ms; private int featureAmp90with10000ms=0;
private int featureAmp90with20000ms; private int featureAmp90with20000ms=0;
private int featureAmp90with60000ms; private int featureAmp90with60000ms=0;
private int featureAmp80with100ms; private int featureAmp80with100ms=0;
private int featureAmp80with250ms; private int featureAmp80with250ms=0;
private int featureAmp80with500ms; private int featureAmp80with500ms=0;
private int featureAmp80with1000ms; private int featureAmp80with1000ms=0;
private int featureAmp80with3000ms; private int featureAmp80with3000ms=0;
private int featureAmp80with10000ms; private int featureAmp80with10000ms=0;
private int featureAmp80with20000ms; private int featureAmp80with20000ms=0;
private int featureAmp80with60000ms; private int featureAmp80with60000ms=0;
private int featureAmp70with100ms; private int featureAmp70with100ms=0;
private int featureAmp70with250ms; private int featureAmp70with250ms=0;
private int featureAmp70with500ms; private int featureAmp70with500ms=0;
private int featureAmp70with1000ms; private int featureAmp70with1000ms=0;
private int featureAmp70with3000ms; private int featureAmp70with3000ms=0;
private int featureAmp70with10000ms; private int featureAmp70with10000ms=0;
private int featureAmp70with20000ms; private int featureAmp70with20000ms=0;
private int featureAmp70with60000ms; private int featureAmp70with60000ms=0;
private int featureAmp60with100ms; private int featureAmp60with100ms=0;
private int featureAmp60with250ms; private int featureAmp60with250ms=0;
private int featureAmp60with500ms; private int featureAmp60with500ms=0;
private int featureAmp60with1000ms; private int featureAmp60with1000ms=0;
private int featureAmp60with3000ms; private int featureAmp60with3000ms=0;
private int featureAmp60with10000ms; private int featureAmp60with10000ms=0;
private int featureAmp60with20000ms; private int featureAmp60with20000ms=0;
private int featureAmp60with60000ms; private int featureAmp60with60000ms=0;
private int featureAmp50with100ms; private int featureAmp50with100ms=0;
private int featureAmp50with250ms; private int featureAmp50with250ms=0;
private int featureAmp50with500ms; private int featureAmp50with500ms=0;
private int featureAmp50with1000ms; private int featureAmp50with1000ms=0;
private int featureAmp50with3000ms; private int featureAmp50with3000ms=0;
private int featureAmp50with10000ms; private int featureAmp50with10000ms=0;
private int featureAmp50with20000ms; private int featureAmp50with20000ms=0;
private int featureAmp50with60000ms; private int featureAmp50with60000ms=0;
private int featureAmp40with100ms; private int featureAmp40with100ms=0;
private int featureAmp40with250ms; private int featureAmp40with250ms=0;
private int featureAmp40with500ms; private int featureAmp40with500ms=0;
private int featureAmp40with1000ms; private int featureAmp40with1000ms=0;
private int featureAmp40with3000ms; private int featureAmp40with3000ms=0;
private int featureAmp40with10000ms; private int featureAmp40with10000ms=0;
private int featureAmp40with20000ms; private int featureAmp40with20000ms=0;
private int featureAmp40with60000ms; private int featureAmp40with60000ms=0;
private int featureAmp30with100ms; private int featureAmp30with100ms=0;
private int featureAmp30with250ms; private int featureAmp30with250ms=0;
private int featureAmp30with500ms; private int featureAmp30with500ms=0;
private int featureAmp30with1000ms; private int featureAmp30with1000ms=0;
private int featureAmp30with3000ms; private int featureAmp30with3000ms=0;
private int featureAmp30with10000ms; private int featureAmp30with10000ms=0;
private int featureAmp30with20000ms; private int featureAmp30with20000ms=0;
private int featureAmp30with60000ms; private int featureAmp30with60000ms=0;
private int featureAmp20with100ms; private int featureAmp20with100ms=0;
private int featureAmp20with250ms; private int featureAmp20with250ms=0;
private int featureAmp20with500ms; private int featureAmp20with500ms=0;
private int featureAmp20with1000ms; private int featureAmp20with1000ms=0;
private int featureAmp20with3000ms; private int featureAmp20with3000ms=0;
private int featureAmp20with10000ms; private int featureAmp20with10000ms=0;
private int featureAmp20with20000ms; private int featureAmp20with20000ms=0;
private int featureAmp20with60000ms; private int featureAmp20with60000ms=0;
private int featureAmp10with100ms; private int featureAmp10with100ms=0;
private int featureAmp10with250ms; private int featureAmp10with250ms=0;
private int featureAmp10with500ms; private int featureAmp10with500ms=0;
private int featureAmp10with1000ms; private int featureAmp10with1000ms=0;
private int featureAmp10with3000ms; private int featureAmp10with3000ms=0;
private int featureAmp10with10000ms; private int featureAmp10with10000ms=0;
private int featureAmp10with20000ms; private int featureAmp10with20000ms=0;
private int featureAmp10with60000ms; private int featureAmp10with60000ms=0;
} }

View File

@@ -26,18 +26,18 @@ public class EventRiseDistributionTableVO implements Serializable {
* 持续时间100ms-500ms * 持续时间100ms-500ms
*/ */
@ApiModelProperty(name = "duration500",value = "持续时间100ms-500ms") @ApiModelProperty(name = "duration500",value = "持续时间100ms-500ms")
private Integer duration500; private Integer duration500=0;
/** /**
* 持续时间500ms-5000ms * 持续时间500ms-5000ms
*/ */
@ApiModelProperty(name = "duration5000",value = "持续时间500ms-5000ms") @ApiModelProperty(name = "duration5000",value = "持续时间500ms-5000ms")
private Integer duration5000; private Integer duration5000=0;
/** /**
* 持续时间5000ms-60000ms * 持续时间5000ms-60000ms
*/ */
@ApiModelProperty(name = "duration60000",value = "持续时间5000ms-60000ms") @ApiModelProperty(name = "duration60000",value = "持续时间5000ms-60000ms")
private Integer duration60000; private Integer duration60000=0;
} }

View File

@@ -53,4 +53,7 @@ public interface PwEventDistributionStatisticsMapper {
* @return com.njcn.event.pojo.vo.EventRiseDistributionVO * @return com.njcn.event.pojo.vo.EventRiseDistributionVO
*/ */
EventRiseDistributionVO getEventRiseDistributionByCond(Map<String, Object> map); EventRiseDistributionVO getEventRiseDistributionByCond(Map<String, Object> map);
List<RmpEventDetailPO> getEventDipShortDistributionByCondition(Map<String, Object> condMap);
} }

View File

@@ -34,13 +34,13 @@ public interface PwRmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
/** /**
* 获取暂态事件明细 * 获取暂态事件明细
* *
* @param monitorIds 监测点id
* @param eventType 暂态指标类型 * @param eventType 暂态指标类型
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @return 暂态事件明细 * @return 暂态事件明细
*/ */
List<RmpEventDetailPO> getDetailsOfTransientEvents(@Param("monitorIds") List<String> monitorIds, List<RmpEventDetailPO> getDetailsOfTransientEvents(
// @Param("monitorIds") List<String> monitorIds,
@Param("eventType") List<String> eventType, @Param("eventType") List<String> eventType,
@Param("startTime") String startTime, @Param("startTime") String startTime,
@Param("endTime") String endTime); @Param("endTime") String endTime);
@@ -55,7 +55,8 @@ public interface PwRmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
* @param endTime * @param endTime
* @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO> * @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO>
*/ */
List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(@Param("monitorIds") List<String> monitorIds, List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(
// @Param("monitorIds") List<String> monitorIds,
@Param("eventType") List<String> eventType, @Param("eventType") List<String> eventType,
@Param("startTime") String startTime, @Param("startTime") String startTime,
@Param("endTime") String endTime); @Param("endTime") String endTime);

View File

@@ -262,4 +262,39 @@
) )
r r
</select> </select>
<select id="getEventDipShortDistributionByCondition" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
SELECT
measurement_point_id as measurementPointId,
start_time AS startTime,
duration AS duration,
feature_amplitude AS featureAmplitude
FROM
r_mp_event_detail
WHERE 1 = 1
AND event_type IN
<foreach collection="eventTypeList" item="type" open="(" close=")" separator=",">
#{type}
</foreach>
<choose>
<when test="dateType != null and dateType == 3">
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &lt;= #{endTime}
</if>
</when>
<when test="dateType != null and dateType == 5">
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &lt;= #{endTime}
</if>
</when>
</choose>
</select>
</mapper> </mapper>

View File

@@ -36,11 +36,11 @@
Event_Type as eventType Event_Type as eventType
FROM FROM
r_mp_event_detail r_mp_event_detail
WHERE WHERE 1=1
measurement_point_id IN <!-- measurement_point_id IN-->
<foreach collection="monitorIds" item="item" open="(" close=")" separator=","> <!-- <foreach collection="monitorIds" item="item" open="(" close=")" separator=",">-->
#{item} <!-- #{item}-->
</foreach> <!-- </foreach>-->
<if test="eventType != null and eventType.size() >0"> <if test="eventType != null and eventType.size() >0">
AND Event_Type IN AND Event_Type IN
<foreach collection="eventType" item="item" open="(" close=")" separator=","> <foreach collection="eventType" item="item" open="(" close=")" separator=",">
@@ -71,12 +71,12 @@
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &lt;= #{endTime} AND DATE_FORMAT(start_time, '%Y-%m') &lt;= #{endTime}
</if> </if>
<if test="monitorIds != null and monitorIds.size() != 0 "> <!-- <if test="monitorIds != null and monitorIds.size() != 0 ">-->
and measurement_point_id IN <!-- and measurement_point_id IN-->
<foreach collection="monitorIds" item="item" open="(" close=")" separator=","> <!-- <foreach collection="monitorIds" item="item" open="(" close=")" separator=",">-->
#{item} <!-- #{item}-->
</foreach> <!-- </foreach>-->
</if> <!-- </if>-->
<if test="eventType != null and eventType.size() >0"> <if test="eventType != null and eventType.size() >0">
AND Event_Type IN AND Event_Type IN
<foreach collection="eventType" item="item" open="(" close=")" separator=","> <foreach collection="eventType" item="item" open="(" close=")" separator=",">

View File

@@ -17,6 +17,7 @@ import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -80,14 +81,20 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
//查询暂态事件明细 //查询暂态事件明细
List<RmpEventDetailPO> detailList = new ArrayList<>(); List<RmpEventDetailPO> detailList = new ArrayList<>();
List<List<String>> partition = ListUtils.partition(monitorIdList, 20000); // List<List<String>> partition = ListUtils.partition(monitorIdList, 20000);
for (List<String> list : partition) { // for (List<String> list : partition) {
// if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查
// detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth(list, null, startTime, endTime));
// } else { //按日查
// detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(list, null, startTime, endTime));
// }
// }
if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查 if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查
detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth(list, null, startTime, endTime)); detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth( null, startTime, endTime));
} else { //按日查 } else { //按日查
detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(list, null, startTime, endTime)); detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(null, startTime, endTime));
}
} }
detailList = detailList.stream().filter(temp->monitorIdList.contains(temp.getLineId())).collect(Collectors.toList());
if (CollUtil.isNotEmpty(detailList)) { if (CollUtil.isNotEmpty(detailList)) {
//todo 获取监测点信息接口 //todo 获取监测点信息接口
pwPmsMonitorParam.setMonitorName(eventMonitorReportParam.getMonitorName()); pwPmsMonitorParam.setMonitorName(eventMonitorReportParam.getMonitorName());
@@ -173,8 +180,10 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
condMap.put("endTime", endTime); condMap.put("endTime", endTime);
condMap.put("eventTypeList", Arrays.asList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_DIP.getCode()).getId(), eventStatisMapByCode.get(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getId())); condMap.put("eventTypeList", Arrays.asList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_DIP.getCode()).getId(), eventStatisMapByCode.get(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getId()));
condMap.put("dateType", type); condMap.put("dateType", type);
EventDipShortDistributionVO eventDipShortDistribution = eventDistributionStatisticsMapper.getEventDipShortDistributionByCond(condMap); // EventDipShortDistributionVO eventDipShortDistribution = eventDistributionStatisticsMapper.getEventDipShortDistributionByCond(condMap);
List<RmpEventDetailPO> eventDipShortDistributionByCondition = eventDistributionStatisticsMapper.getEventDipShortDistributionByCondition(condMap);
eventDipShortDistributionByCondition = eventDipShortDistributionByCondition.stream().filter(temp->monitorIds.contains(temp.getMeasurementPointId())).collect(Collectors.toList());
EventDipShortDistributionVO eventDipShortDistribution = change(eventDipShortDistributionByCondition);
//设置返回数据 //设置返回数据
List<EventDipShortDistributionTableVO> list = new ArrayList<>(); List<EventDipShortDistributionTableVO> list = new ArrayList<>();
//特征幅值[80,90] //特征幅值[80,90]
@@ -296,12 +305,100 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
return list; return list;
} }
/*** private EventDipShortDistributionVO change(List<RmpEventDetailPO> list) {
EventDipShortDistributionVO eventDipShortDistributionVO = new EventDipShortDistributionVO();
if(!CollectionUtils.isEmpty(list)) {
eventDipShortDistributionVO.setFeatureAmp90with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp90with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp90with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp90with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp90with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp90with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp90with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp90with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
eventDipShortDistributionVO.setFeatureAmp80with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp80with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp80with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp80with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp80with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp80with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp80with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp80with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
eventDipShortDistributionVO.setFeatureAmp70with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp70with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp70with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp70with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp70with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp70with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp70with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp70with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
eventDipShortDistributionVO.setFeatureAmp60with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp60with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp60with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp60with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp60with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp60with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp60with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp60with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
eventDipShortDistributionVO.setFeatureAmp50with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp50with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp50with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp50with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp50with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp50with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp50with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp50with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
eventDipShortDistributionVO.setFeatureAmp40with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp40with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp40with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp40with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp40with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp40with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp40with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp40with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
eventDipShortDistributionVO.setFeatureAmp30with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp30with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp30with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp30with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp30with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp30with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp30with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp30with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
eventDipShortDistributionVO.setFeatureAmp20with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp20with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp20with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp20with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp20with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp20with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp20with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp20with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
eventDipShortDistributionVO.setFeatureAmp10with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
eventDipShortDistributionVO.setFeatureAmp10with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
eventDipShortDistributionVO.setFeatureAmp10with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
eventDipShortDistributionVO.setFeatureAmp10with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
eventDipShortDistributionVO.setFeatureAmp10with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
eventDipShortDistributionVO.setFeatureAmp10with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
eventDipShortDistributionVO.setFeatureAmp10with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
eventDipShortDistributionVO.setFeatureAmp10with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
}
return eventDipShortDistributionVO;
}
/**
* 暂态指标监测点电压暂升分布情况 * 暂态指标监测点电压暂升分布情况
* @author jianghaifei * @author jianghaifei
* @date 2022-10-29 14:08 * @date 2022-10-29 14:03
* @param eventMonitorReportParam * @param eventMonitorReportParam
* @return com.njcn.event.pojo.vo.EventRiseDistributionVO * @retu4n com.njcn.event4pojo.vo.EventRiseDistributionVO
*/ */
@Override @Override
public List<EventRiseDistributionTableVO> getEventRiseDistributionByCond(EventMonitorReportParam eventMonitorReportParam) { public List<EventRiseDistributionTableVO> getEventRiseDistributionByCond(EventMonitorReportParam eventMonitorReportParam) {
@@ -325,7 +422,10 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
riseCondMap.put("endTime", endTime); riseCondMap.put("endTime", endTime);
riseCondMap.put("eventTypeList", Collections.singletonList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_RISE.getCode()).getId())); riseCondMap.put("eventTypeList", Collections.singletonList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_RISE.getCode()).getId()));
riseCondMap.put("dateType", type); riseCondMap.put("dateType", type);
EventRiseDistributionVO eventRiseDistribution = eventDistributionStatisticsMapper.getEventRiseDistributionByCond(riseCondMap); // EventRiseDistributionVO eventRiseDistribution = eventDistributionStatisticsMapper.getEventRiseDistributionByCond(riseCondMap);
List<RmpEventDetailPO> rmpEventDetailPOS = eventDistributionStatisticsMapper.getEventDipShortDistributionByCondition(riseCondMap);
rmpEventDetailPOS = rmpEventDetailPOS.stream().filter(temp->monitorIds.contains(temp.getMeasurementPointId())).collect(Collectors.toList());
EventRiseDistributionVO eventRiseDistribution = changeEventRise(rmpEventDetailPOS);
//设置返回数据 //设置返回数据
List<EventRiseDistributionTableVO> list = new ArrayList<>(); List<EventRiseDistributionTableVO> list = new ArrayList<>();
//特征幅值U1≥120 //特征幅值U1≥120
@@ -345,4 +445,19 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
list.add(entity110); list.add(entity110);
return list; return list;
} }
private EventRiseDistributionVO changeEventRise(List<RmpEventDetailPO> list) {
EventRiseDistributionVO eventRiseDistributionVO = new EventRiseDistributionVO();
if(!CollectionUtils.isEmpty(list)){
eventRiseDistributionVO.setFeatureAmp120with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 10 && temp.getDuration() <= 500).count());
eventRiseDistributionVO.setFeatureAmp120with5000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 500 && temp.getDuration() <= 5000).count());
eventRiseDistributionVO.setFeatureAmp120with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 5000 && temp.getDuration() <= 60000).count());
eventRiseDistributionVO.setFeatureAmp110with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 500 && temp.getDuration() <= 60000).count());
eventRiseDistributionVO.setFeatureAmp110with5000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 5000 && temp.getDuration() <= 60000).count());
eventRiseDistributionVO.setFeatureAmp110with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 60000 && temp.getDuration() <= 60000).count());
}
return eventRiseDistributionVO;
}
} }

View File

@@ -107,10 +107,11 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
//监测点map key:监测点id value:监测点实体 //监测点map key:监测点id value:监测点实体
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key1)); Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key1));
List<PwRMpBenchmarkLevelVO> resultList = temList.stream().map(item -> { List<PwRMpBenchmarkLevelVO> resultList = temList.stream().filter(temp->monitorMap.containsKey(temp.getMeasurementPointId())).map(item -> {
//封装前端需要的对象 //封装前端需要的对象
PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO(); PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO();
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO); BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
if(monitorMap.containsKey(item.getMeasurementPointId())){
//单位信息 //单位信息
rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id
rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称 rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称
@@ -118,6 +119,16 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称 rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
//电压等级 //电压等级
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel()); rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel());
}else {
//单位信息
rMpBenchmarkLevelVO.setOrgNo("/"); //单位id
rMpBenchmarkLevelVO.setOrgName("/"); //单位名称
//监测点信息
rMpBenchmarkLevelVO.setMeasurementPointName("/"); //监测点名称
//电压等级
rMpBenchmarkLevelVO.setVoltageLevel("/");
}
return rMpBenchmarkLevelVO; return rMpBenchmarkLevelVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());