数据中心台账修改
This commit is contained in:
@@ -342,8 +342,9 @@ public class COverlimit {
|
|||||||
|
|
||||||
//处理基准容量
|
//处理基准容量
|
||||||
public static float getStandShortCap(String voltageLevel){
|
public static float getStandShortCap(String voltageLevel){
|
||||||
|
if(DicDataEnum.KV01.getCode().equalsIgnoreCase(voltageLevel)){
|
||||||
if(DicDataEnum.KV038.getCode().equalsIgnoreCase(voltageLevel)){
|
return 10;
|
||||||
|
} else if(DicDataEnum.KV038.getCode().equalsIgnoreCase(voltageLevel)){
|
||||||
return 10;
|
return 10;
|
||||||
}else if(DicDataEnum.V380.getCode().equalsIgnoreCase(voltageLevel)){
|
}else if(DicDataEnum.V380.getCode().equalsIgnoreCase(voltageLevel)){
|
||||||
return 10;
|
return 10;
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import java.util.Date;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 配网运行指标统计-年表,配网监测指标数据质量统计-年表
|
* 配网运行指标统计-年表,配网监测指标数据质量统计-年表
|
||||||
* @TableName r_dn_operating_y
|
* @TableName r_dn_operating_index_y
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class RDnOperatingY implements Serializable {
|
public class RDnOperatingIndexY implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 单位ID
|
* 单位ID
|
||||||
*/
|
*/
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.njcn.device.pms.mapper.distribution;
|
package com.njcn.device.pms.mapper.distribution;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.device.pms.pojo.po.RDnOperatingY;
|
import com.njcn.device.pms.pojo.po.RDnOperatingIndexY;
|
||||||
import com.njcn.device.pms.pojo.vo.PwRDnOperatingIndexCommonVO;
|
import com.njcn.device.pms.pojo.vo.PwRDnOperatingIndexCommonVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -9,11 +9,11 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jianghf
|
* @author jianghf
|
||||||
* @description 针对表【r_dn_operating_y(配网运行指标统计-年表,配网监测指标数据质量统计-年表)】的数据库操作Mapper
|
* @description 针对表【r_dn_operating_index_y(配网运行指标统计-年表,配网监测指标数据质量统计-年表)】的数据库操作Mapper
|
||||||
* @createDate 2022-11-10 10:21:46
|
* @createDate 2022-11-10 10:21:46
|
||||||
* @Entity com.njcn.device.pms.pojo.po.RDnOperatingY
|
* @Entity com.njcn.device.pms.pojo.po.RDnOperatingY
|
||||||
*/
|
*/
|
||||||
public interface RDnOperatingYMapper extends BaseMapper<RDnOperatingY> {
|
public interface RDnOperatingYMapper extends BaseMapper<RDnOperatingIndexY> {
|
||||||
|
|
||||||
List<PwRDnOperatingIndexCommonVO> getOperatingList(Map<String, Object> condMap);
|
List<PwRDnOperatingIndexCommonVO> getOperatingList(Map<String, Object> condMap);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
||||||
is_unusual
|
is_unusual
|
||||||
FROM
|
FROM
|
||||||
r_dn_operating_y t
|
r_dn_operating_index_y t
|
||||||
<where>
|
<where>
|
||||||
t.org_no IN
|
t.org_no IN
|
||||||
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
||||||
is_unusual
|
is_unusual
|
||||||
FROM
|
FROM
|
||||||
r_dn_operating_y t
|
r_dn_operating_index_y t
|
||||||
<where>
|
<where>
|
||||||
t.org_no IN
|
t.org_no IN
|
||||||
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
||||||
is_unusual
|
is_unusual
|
||||||
FROM
|
FROM
|
||||||
r_dn_operating_y t
|
r_dn_operating_index_y t
|
||||||
<where>
|
<where>
|
||||||
t.org_no IN
|
t.org_no IN
|
||||||
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
||||||
is_unusual
|
is_unusual
|
||||||
FROM
|
FROM
|
||||||
r_dn_operating_q t
|
r_dn_operating_index_q t
|
||||||
<where>
|
<where>
|
||||||
t.org_no IN
|
t.org_no IN
|
||||||
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
||||||
is_unusual
|
is_unusual
|
||||||
FROM
|
FROM
|
||||||
r_dn_operating_q t
|
r_dn_operating_index_q t
|
||||||
<where>
|
<where>
|
||||||
t.org_no IN
|
t.org_no IN
|
||||||
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
TRUNCATE ( sum( index_integrity_rate ) / count( index_integrity_rate ), 2 ) iir,
|
||||||
is_unusual
|
is_unusual
|
||||||
FROM
|
FROM
|
||||||
r_dn_operating_q t
|
r_dn_operating_index_q t
|
||||||
<where>
|
<where>
|
||||||
t.org_no IN
|
t.org_no IN
|
||||||
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="item" open="(" close=")" separator=",">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njcn.device.pms.mapper.distribution.RDnOperatingYMapper">
|
<mapper namespace="com.njcn.device.pms.mapper.distribution.RDnOperatingYMapper">
|
||||||
|
|
||||||
<resultMap id="BaseResultMap" type="com.njcn.device.pms.pojo.po.RDnOperatingY">
|
<resultMap id="BaseResultMap" type="com.njcn.device.pms.pojo.po.RDnOperatingIndexY">
|
||||||
<id property="orgNo" column="org_no" jdbcType="VARCHAR"/>
|
<id property="orgNo" column="org_no" jdbcType="VARCHAR"/>
|
||||||
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
<id property="dataDate" column="data_date" jdbcType="DATE"/>
|
||||||
<id property="measurementPointType" column="measurement_point_type" jdbcType="VARCHAR"/>
|
<id property="measurementPointType" column="measurement_point_type" jdbcType="VARCHAR"/>
|
||||||
@@ -55,11 +55,11 @@
|
|||||||
-- 数据准确率
|
-- 数据准确率
|
||||||
truncate((rdim1.data_right_rate + rdim2.data_right_rate + rdim3.data_right_rate) / 3, 2) as dataRightRate
|
truncate((rdim1.data_right_rate + rdim2.data_right_rate + rdim3.data_right_rate) / 3, 2) as dataRightRate
|
||||||
|
|
||||||
from r_dn_operating_y rdim1
|
from r_dn_operating_index_y rdim1
|
||||||
|
|
||||||
left join r_dn_operating_y rdim2
|
left join r_dn_operating_index_y rdim2
|
||||||
on rdim1.org_no = rdim2.org_no
|
on rdim1.org_no = rdim2.org_no
|
||||||
left join r_dn_operating_y rdim3
|
left join r_dn_operating_index_y rdim3
|
||||||
on rdim1.org_no = rdim3.org_no
|
on rdim1.org_no = rdim3.org_no
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
<if test="startTime != null and startTime != ''">
|
<if test="startTime != null and startTime != ''">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.njcn.device.pms.service.distribution;
|
package com.njcn.device.pms.service.distribution;
|
||||||
|
|
||||||
import com.njcn.device.pms.pojo.param.PwRDnOperatingParam;
|
import com.njcn.device.pms.pojo.param.PwRDnOperatingParam;
|
||||||
import com.njcn.device.pms.pojo.po.RDnOperatingY;
|
import com.njcn.device.pms.pojo.po.RDnOperatingIndexY;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.device.pms.pojo.vo.PwRDnOperatingIndexCommonVO;
|
import com.njcn.device.pms.pojo.vo.PwRDnOperatingIndexCommonVO;
|
||||||
|
|
||||||
@@ -9,10 +9,10 @@ import java.util.List;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jianghf
|
* @author jianghf
|
||||||
* @description 针对表【r_dn_operating_y(配网运行指标统计-年表,配网监测指标数据质量统计-年表)】的数据库操作Service
|
* @description 针对表【r_dn_operating_index_y(配网运行指标统计-年表,配网监测指标数据质量统计-年表)】的数据库操作Service
|
||||||
* @createDate 2022-11-10 10:21:46
|
* @createDate 2022-11-10 10:21:46
|
||||||
*/
|
*/
|
||||||
public interface RDnOperatingYService extends IService<RDnOperatingY> {
|
public interface RDnOperatingYService extends IService<RDnOperatingIndexY> {
|
||||||
|
|
||||||
List<PwRDnOperatingIndexCommonVO> getOperatingList(PwRDnOperatingParam pwRDnOperatingParam);
|
List<PwRDnOperatingIndexCommonVO> getOperatingList(PwRDnOperatingParam pwRDnOperatingParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.device.pms.pojo.param.PwRDnOperatingParam;
|
import com.njcn.device.pms.pojo.param.PwRDnOperatingParam;
|
||||||
import com.njcn.device.pms.pojo.po.RDnOperatingY;
|
import com.njcn.device.pms.pojo.po.RDnOperatingIndexY;
|
||||||
import com.njcn.device.pms.pojo.vo.PwRDnOperatingIndexCommonVO;
|
import com.njcn.device.pms.pojo.vo.PwRDnOperatingIndexCommonVO;
|
||||||
import com.njcn.device.pms.service.distribution.RDnOperatingYService;
|
import com.njcn.device.pms.service.distribution.RDnOperatingYService;
|
||||||
import com.njcn.device.pms.mapper.distribution.RDnOperatingYMapper;
|
import com.njcn.device.pms.mapper.distribution.RDnOperatingYMapper;
|
||||||
@@ -13,7 +13,6 @@ import com.njcn.system.api.DicDataFeignClient;
|
|||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.pojo.dto.DeptDTO;
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
import com.njcn.web.utils.WebUtil;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -24,12 +23,12 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jianghf
|
* @author jianghf
|
||||||
* @description 针对表【r_dn_operating_y(配网运行指标统计-年表,配网监测指标数据质量统计-年表)】的数据库操作Service实现
|
* @description 针对表【r_dn_operating_index_y(配网运行指标统计-年表,配网监测指标数据质量统计-年表)】的数据库操作Service实现
|
||||||
* @createDate 2022-11-10 10:21:46
|
* @createDate 2022-11-10 10:21:46
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class RDnOperatingYServiceImpl extends ServiceImpl<RDnOperatingYMapper, RDnOperatingY>
|
public class RDnOperatingYServiceImpl extends ServiceImpl<RDnOperatingYMapper, RDnOperatingIndexY>
|
||||||
implements RDnOperatingYService{
|
implements RDnOperatingYService{
|
||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.device.pq.controller;
|
||||||
|
|
||||||
|
import com.njcn.device.pq.service.IDeviceService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
* 设备相关
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/4/4
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "台账-设备相关")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/dev")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DeviceController extends BaseController {
|
||||||
|
|
||||||
|
private final IDeviceService iDeviceService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -486,7 +486,6 @@
|
|||||||
substation.`Name` subName,
|
substation.`Name` subName,
|
||||||
subscale.name subScale,
|
subscale.name subScale,
|
||||||
pqdevice.IP ip,
|
pqdevice.IP ip,
|
||||||
pqdevice.Com_Flag comFlag,
|
|
||||||
factory.`Name` manufacturer,
|
factory.`Name` manufacturer,
|
||||||
voltage.`Name` voltageName,
|
voltage.`Name` voltageName,
|
||||||
scale.`Name` voltageScale,
|
scale.`Name` voltageScale,
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public class RunManageServiceImpl implements RunManageService {
|
|||||||
*/
|
*/
|
||||||
private TerminalLedgerVO.TemData filterScale(GeneralDeviceDTO generalDeviceDTO, List<SimpleDTO> scales) {
|
private TerminalLedgerVO.TemData filterScale(GeneralDeviceDTO generalDeviceDTO, List<SimpleDTO> scales) {
|
||||||
TerminalLedgerVO.TemData temData = new TerminalLedgerVO.TemData();
|
TerminalLedgerVO.TemData temData = new TerminalLedgerVO.TemData();
|
||||||
temData.setName(DicDataTypeEnum.DEV_VOLTAGE.getName());
|
temData.setName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName());
|
||||||
//如果电压等级集合为空,则查询所有的电压等级
|
//如果电压等级集合为空,则查询所有的电压等级
|
||||||
if (CollectionUtil.isEmpty(scales)) {
|
if (CollectionUtil.isEmpty(scales)) {
|
||||||
List<DictData> scaleDictData = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_VOLTAGE.getName()).getData();
|
List<DictData> scaleDictData = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_VOLTAGE.getName()).getData();
|
||||||
|
|||||||
@@ -1416,7 +1416,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
List<DictData> manufacturerList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName()).getData();
|
List<DictData> manufacturerList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName()).getData();
|
||||||
List<DictData> devTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_TYPE.getName()).getData();
|
List<DictData> devTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_TYPE.getName()).getData();
|
||||||
List<DictData> frontList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.FRONT_TYPE.getName()).getData();
|
List<DictData> frontList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.FRONT_TYPE.getName()).getData();
|
||||||
List<DictData> scaleList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_VOLTAGE.getName()).getData();
|
List<DictData> scaleList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName()).getData();
|
||||||
List<Node> nodeList = nodeService.nodeAllList();
|
List<Node> nodeList = nodeService.nodeAllList();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import java.math.BigDecimal;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Measurement(name = "pqs_eventdetail")
|
|
||||||
public class WaveTypeVO{
|
public class WaveTypeVO{
|
||||||
|
|
||||||
|
|
||||||
@@ -124,7 +123,7 @@ public class WaveTypeVO{
|
|||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
@Column(name = "time")
|
@Column(name = "time")
|
||||||
private String timeId;
|
private String startTime;
|
||||||
|
|
||||||
@Column(name = "event_describe")
|
@Column(name = "event_describe")
|
||||||
private String eventDescribe;
|
private String eventDescribe;
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
|||||||
|
|
||||||
//查询监测点未处理暂态事件
|
//查询监测点未处理暂态事件
|
||||||
List<RmpEventDetailPO> eventDetails = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
List<RmpEventDetailPO> eventDetails = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||||
.in(RmpEventDetailPO::getMeasurementPointId, lineIds));
|
.in(RmpEventDetailPO::getMeasurementPointId, lineIds).orderByDesc(RmpEventDetailPO::getStartTime));
|
||||||
EventDetailNew eventDetailNew;
|
EventDetailNew eventDetailNew;
|
||||||
for (RmpEventDetailPO eventDetail : eventDetails) {
|
for (RmpEventDetailPO eventDetail : eventDetails) {
|
||||||
eventDetailNew= BeanUtil.copyProperties(eventDetail,EventDetailNew.class);
|
eventDetailNew= BeanUtil.copyProperties(eventDetail,EventDetailNew.class);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class AreaStatisticalServiceImpl implements AreaStatisticalService {
|
|||||||
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||||
.in(RmpEventDetailPO::getMeasurementPointId, lineIds)
|
.in(RmpEventDetailPO::getMeasurementPointId, lineIds)
|
||||||
//todo 是否缺少录波
|
//todo 是否缺少录波
|
||||||
.eq(RmpEventDetailPO::getEventType, data.getId())
|
.ne(RmpEventDetailPO::getEventType, data.getId())
|
||||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||||
.le(StrUtil.isNotBlank(deviceInfoParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())))
|
.le(StrUtil.isNotBlank(deviceInfoParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())))
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -999,7 +999,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Map<String, List<RmpEventDetailPO>> map = eventDetailList.stream().filter(x -> data.getId().equals(x.getEventType()))
|
Map<String, List<RmpEventDetailPO>> map = eventDetailList.stream().filter(x -> data.getId().equals(x.getEventType()))
|
||||||
.collect(Collectors.groupingBy(s -> s.getStartTime().substring(0, 10)));
|
.collect(Collectors.groupingBy(s -> s.getStartTime().toString()));
|
||||||
Set<String> keySet = map.keySet();
|
Set<String> keySet = map.keySet();
|
||||||
|
|
||||||
LocalDate parse1 = LocalDate.parse(startTime);
|
LocalDate parse1 = LocalDate.parse(startTime);
|
||||||
|
|||||||
@@ -377,28 +377,30 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
@Override
|
@Override
|
||||||
public List<WaveTypeVO> getSeverity(DeviceInfoParam.BusinessParam businessParam) {
|
public List<WaveTypeVO> getSeverity(DeviceInfoParam.BusinessParam businessParam) {
|
||||||
List<WaveTypeVO> result = new ArrayList<>();
|
List<WaveTypeVO> result = new ArrayList<>();
|
||||||
List<EventDetailNew> info = getED2(businessParam);
|
List<GeneralDeviceDTO> deviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(businessParam).getData();
|
||||||
|
List<String> lineIds = deviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList());
|
||||||
|
List<EventDetailNew> info = new ArrayList<>();
|
||||||
|
if(CollectionUtil.isNotEmpty(lineIds)){
|
||||||
|
//数据暂降查询
|
||||||
|
List<RmpEventDetailPO> eventDetails = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||||
|
.in(RmpEventDetailPO::getMeasurementPointId, lineIds)
|
||||||
|
.ge(StrUtil.isNotBlank(businessParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(businessParam.getSearchBeginTime())))
|
||||||
|
.le(StrUtil.isNotBlank(businessParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(businessParam.getSearchEndTime())))
|
||||||
|
.orderByDesc(RmpEventDetailPO::getSeverity).last(" limit 20")
|
||||||
|
);
|
||||||
|
info = BeanUtil.copyToList(eventDetails, EventDetailNew.class);
|
||||||
|
}else{
|
||||||
|
throw new BusinessException(DeviceResponseEnum.DEPT_LINE_EMPTY);
|
||||||
|
}
|
||||||
if (CollectionUtil.isNotEmpty(info)) {
|
if (CollectionUtil.isNotEmpty(info)) {
|
||||||
List<String> idlist = new ArrayList<>();
|
|
||||||
//根据严重度进行排序并取前二十个数据
|
|
||||||
info.sort(((o1, o2) -> o1.getSeverity().compareTo(o2.getSeverity())));
|
|
||||||
Collections.reverse(info);
|
|
||||||
List<EventDetailNew> details=new ArrayList<>();
|
|
||||||
if(info.size()>20){
|
|
||||||
details = info.subList(0, 20);
|
|
||||||
}else{
|
|
||||||
details=info;
|
|
||||||
}
|
|
||||||
|
|
||||||
//遍历集合得到id集合
|
List<String> idlist = info.stream().map(EventDetailNew::getLineId).distinct().collect(Collectors.toList());
|
||||||
for (EventDetailNew detail : details) {
|
|
||||||
idlist.add(detail.getLineId());
|
|
||||||
}
|
|
||||||
//得到对应的监测点信息
|
//得到对应的监测点信息
|
||||||
HttpResult<List<AreaLineInfoVO>> AreaInfo = lineFeignClient.getBaseLineAreaInfo(idlist);
|
HttpResult<List<AreaLineInfoVO>> AreaInfo = lineFeignClient.getBaseLineAreaInfo(idlist);
|
||||||
List<AreaLineInfoVO> data = AreaInfo.getData();
|
List<AreaLineInfoVO> data = AreaInfo.getData();
|
||||||
//遍历集合比较id得到最终数据
|
//遍历集合比较id得到最终数据
|
||||||
for (EventDetailNew detail : details) {
|
for (EventDetailNew detail : info) {
|
||||||
WaveTypeVO waveTypeVO = new WaveTypeVO();
|
WaveTypeVO waveTypeVO = new WaveTypeVO();
|
||||||
for (AreaLineInfoVO vo : data) {
|
for (AreaLineInfoVO vo : data) {
|
||||||
if (detail.getLineId().equals(vo.getLineId())) {
|
if (detail.getLineId().equals(vo.getLineId())) {
|
||||||
|
|||||||
@@ -349,17 +349,21 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DictData dictData : reasonList) {
|
if(StrUtil.isNotBlank(eventDetail.getAdvanceReason())) {
|
||||||
if (eventDetail.getAdvanceReason().equals(dictData.getId())) {
|
for (DictData dictData : reasonList) {
|
||||||
eventDetail.setAdvanceReason(dictData.getName());
|
if (eventDetail.getAdvanceReason().equals(dictData.getId())) {
|
||||||
break;
|
eventDetail.setAdvanceReason(dictData.getName());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DictData dictData : typeList) {
|
if(StrUtil.isNotBlank(eventDetail.getAdvanceType())) {
|
||||||
if (eventDetail.getAdvanceType().equals(dictData.getId())) {
|
for (DictData dictData : typeList) {
|
||||||
eventDetail.setAdvanceType(dictData.getName());
|
if (eventDetail.getAdvanceType().equals(dictData.getId())) {
|
||||||
break;
|
eventDetail.setAdvanceType(dictData.getName());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -371,68 +375,6 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if (!CollectionUtils.isEmpty(lineList)) {
|
|
||||||
// StringBuilder stringBuilder = InfluxDBCommUtils.assToInfluxParam(lineList);
|
|
||||||
// //influxDB查询待分页数据总量
|
|
||||||
// Long total = getTransientDetail(stringBuilder, transientParam);
|
|
||||||
// page.setTotal(total);
|
|
||||||
// //分页总页数
|
|
||||||
// int pages = (int) Math.ceil(transientParam.getPageNum() * 1.0 / transientParam.getPageSize());
|
|
||||||
// page.setPages(pages);
|
|
||||||
// //influxDB分页查询
|
|
||||||
// List<EventDetailNew> eventDetailData = getTransientDetailLimit(lineList, transientParam);
|
|
||||||
//
|
|
||||||
// if (CollUtil.isNotEmpty(eventDetailData)) {
|
|
||||||
// List<String> lineIds = eventDetailData.stream().map(EventDetailNew::getLineId).collect(Collectors.toList());
|
|
||||||
// lineIds = lineIds.stream().distinct().collect(Collectors.toList());
|
|
||||||
//
|
|
||||||
// List<AreaLineInfoVO> r = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
|
|
||||||
// List<DictData> reasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData();
|
|
||||||
// List<DictData> typeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// for (EventDetailNew eventDetail : eventDetailData) {
|
|
||||||
// for (AreaLineInfoVO areaLineInfoVO : r) {
|
|
||||||
// if (eventDetail.getLineId().equals(areaLineInfoVO.getLineId())) {
|
|
||||||
// eventDetail.setLineId(areaLineInfoVO.getLineId());
|
|
||||||
// eventDetail.setLineName(areaLineInfoVO.getLineName());
|
|
||||||
// eventDetail.setGdName(areaLineInfoVO.getGdName());
|
|
||||||
// eventDetail.setSubName(areaLineInfoVO.getSubName());
|
|
||||||
// eventDetail.setIp(areaLineInfoVO.getIp());
|
|
||||||
// eventDetail.setScale(areaLineInfoVO.getVoltageScale());
|
|
||||||
// eventDetail.setIp(areaLineInfoVO.getIp());
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// for (DictData dictData : reasonList) {
|
|
||||||
// if (eventDetail.getEventReason().equals(dictData.getId())) {
|
|
||||||
// eventDetail.setEventReason(dictData.getName());
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// for (DictData dictData : typeList) {
|
|
||||||
// if (eventDetail.getEventType().equals(dictData.getId())) {
|
|
||||||
// eventDetail.setEventType(dictData.getName());
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// //当前页数据
|
|
||||||
// page.setRecords(eventDetailData);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ public enum DicDataEnum {
|
|||||||
* @date 2023/3/24
|
* @date 2023/3/24
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
KV01("0.1kV","0.1"),
|
||||||
V022("0.22kV","0.22"),
|
V022("0.22kV","0.22"),
|
||||||
KV038("0.38kV","0.38"),
|
KV038("0.38kV","0.38"),
|
||||||
V380("380V","0.38"),
|
V380("380V","0.38"),
|
||||||
|
|||||||
Reference in New Issue
Block a user