添加统计类型监测点性质
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
package com.njcn.device.pq.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/1/4
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum PowerFlagEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统拓扑各层级描述
|
||||||
|
*/
|
||||||
|
GRID_SIDE(0, "电网侧"),
|
||||||
|
NO_GRID_SIDE(1, "非电网侧"),
|
||||||
|
NEW_ENERGY(2, "电网侧(新能源)"),
|
||||||
|
NO_NEW_ENERGY(3, "非电网侧(新能源)"),
|
||||||
|
SEND_NETWORK(4, "上送国网"),
|
||||||
|
PCC(5, "PCC");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
PowerFlagEnum(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PowerFlagEnum getPowerFlagEnumByCode(Integer code) {
|
||||||
|
return Arrays.stream(PowerFlagEnum.values())
|
||||||
|
.filter(x -> x.getCode().equals(code))
|
||||||
|
.findAny()
|
||||||
|
.orElse(GRID_SIDE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.device.pq.pojo.vo;
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -21,6 +20,11 @@ public class GridDiagramVO {
|
|||||||
@ApiModelProperty(name = "gwInfo", value = "国网监测点信息信息")
|
@ApiModelProperty(name = "gwInfo", value = "国网监测点信息信息")
|
||||||
private List<?> gwInfo;
|
private List<?> gwInfo;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "data", value = "总信息")
|
||||||
|
private Double data;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "gwData", value = "国网总信息")
|
||||||
|
private Double gwData;
|
||||||
@Data
|
@Data
|
||||||
public static class LineStatistics {
|
public static class LineStatistics {
|
||||||
@ApiModelProperty(name = "orgId", value = "单位id")
|
@ApiModelProperty(name = "orgId", value = "单位id")
|
||||||
@@ -29,6 +33,9 @@ public class GridDiagramVO {
|
|||||||
@ApiModelProperty(name = "orgName", value = "单位名称")
|
@ApiModelProperty(name = "orgName", value = "单位名称")
|
||||||
private String orgName;
|
private String orgName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "count", value = "次数")
|
||||||
|
private Long count;
|
||||||
|
|
||||||
@ApiModelProperty(name = "data", value = "数据")
|
@ApiModelProperty(name = "data", value = "数据")
|
||||||
private List<?> data;
|
private List<?> data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,10 +73,9 @@ public class HalfReportVO implements Serializable {
|
|||||||
@ApiModelProperty("使用流量(M)")
|
@ApiModelProperty("使用流量(M)")
|
||||||
private BigDecimal statisValue;
|
private BigDecimal statisValue;
|
||||||
|
|
||||||
// @ApiModelProperty("剩余流量(M)")
|
@ApiModelProperty("干扰源类型")
|
||||||
// private BigDecimal ;
|
private String loadType;
|
||||||
// @ApiModelProperty("使用率(%)")
|
|
||||||
// private BigDecimal ;
|
|
||||||
@ApiModelProperty("ICICD")
|
@ApiModelProperty("ICICD")
|
||||||
private String sim;
|
private String sim;
|
||||||
|
|
||||||
|
|||||||
@@ -541,4 +541,6 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
*/
|
*/
|
||||||
List<LineDetailVO.Detail> selectByIds(@Param("ids") List<String> ids);
|
List<LineDetailVO.Detail> selectByIds(@Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
List<String> getDeviceIdByPowerFlag(@Param("lineIds")List<String> lineIds, @Param("powerFlag")Integer manufacturer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1272,6 +1272,7 @@
|
|||||||
pd.Com_Flag AS comFlag,
|
pd.Com_Flag AS comFlag,
|
||||||
pld.Line_Grade AS lineGrade,
|
pld.Line_Grade AS lineGrade,
|
||||||
pld.Business_Type AS businessType,
|
pld.Business_Type AS businessType,
|
||||||
|
pld.Load_Type AS loadType,
|
||||||
pd.Login_Time AS loginTime,
|
pd.Login_Time AS loginTime,
|
||||||
pd.Update_Time AS updateTime,
|
pd.Update_Time AS updateTime,
|
||||||
ifnull( round(onlineRate,2), 0 ) AS onlineRate,
|
ifnull( round(onlineRate,2), 0 ) AS onlineRate,
|
||||||
@@ -1484,5 +1485,21 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getDeviceIdByPowerFlag" resultType="String">
|
||||||
|
select
|
||||||
|
t1.id
|
||||||
|
from
|
||||||
|
pq_line t1 ,
|
||||||
|
pq_line_detail t2
|
||||||
|
where
|
||||||
|
t1.id = t2.id
|
||||||
|
and
|
||||||
|
t1.id in
|
||||||
|
<foreach collection="lineIds" separator="," open="(" close=")" item="item">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND
|
||||||
|
t2.Power_Flag = #{powerFlag}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -158,6 +158,14 @@ public interface TerminalBaseService {
|
|||||||
* @param manufacturer 终端厂家
|
* @param manufacturer 终端厂家
|
||||||
*/
|
*/
|
||||||
List<String> getDeviceIdByManufacturer(List<String> deviceIds, String manufacturer);
|
List<String> getDeviceIdByManufacturer(List<String> deviceIds, String manufacturer);
|
||||||
|
/**
|
||||||
|
* 根据监测点性质获取监测信息
|
||||||
|
*
|
||||||
|
* @param lineIds 监测点id
|
||||||
|
* @param manufacturer 监测点性质
|
||||||
|
*/
|
||||||
|
List<String> getDeviceIdByPowerFlag(List<String> lineIds, Integer manufacturer);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据监测点集合查询基础信息
|
* 根据监测点集合查询基础信息
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.njcn.common.pojo.dto.SimpleDTO;
|
|||||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||||
import com.njcn.common.utils.EnumUtils;
|
import com.njcn.common.utils.EnumUtils;
|
||||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||||
|
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||||
import com.njcn.device.pq.mapper.DeviceMapper;
|
import com.njcn.device.pq.mapper.DeviceMapper;
|
||||||
import com.njcn.device.pq.mapper.LineMapper;
|
import com.njcn.device.pq.mapper.LineMapper;
|
||||||
import com.njcn.device.pq.mapper.TopMsgMapper;
|
import com.njcn.device.pq.mapper.TopMsgMapper;
|
||||||
@@ -368,6 +369,8 @@ public class GeneralDeviceService {
|
|||||||
return filterDataByLoadType(deviceInfos, deviceInfoParam.getLoadType());
|
return filterDataByLoadType(deviceInfos, deviceInfoParam.getLoadType());
|
||||||
case MANUFACTURER:
|
case MANUFACTURER:
|
||||||
return filterDataByManufacturer(deviceInfos, deviceInfoParam.getManufacturer());
|
return filterDataByManufacturer(deviceInfos, deviceInfoParam.getManufacturer());
|
||||||
|
case POWER_FLAG:
|
||||||
|
return filterDataByPowerFlag(deviceInfos, deviceInfoParam.getManufacturer());
|
||||||
default:
|
default:
|
||||||
return deviceInfos;
|
return deviceInfos;
|
||||||
}
|
}
|
||||||
@@ -548,7 +551,27 @@ public class GeneralDeviceService {
|
|||||||
return generalDeviceDTOS;
|
return generalDeviceDTOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<GeneralDeviceDTO> filterDataByPowerFlag(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> manufacturer) {
|
||||||
|
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||||
|
List<String> deviceIds = deviceInfos.stream().flatMap(x->x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||||
|
List<String> lineIds = deviceInfos.stream().flatMap(x->x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||||
|
//监测点为空,则返回空的分类数据
|
||||||
|
if (CollectionUtil.isEmpty(lineIds)) {
|
||||||
|
return assembleCommonData(manufacturer);
|
||||||
|
}
|
||||||
|
SimpleDTO dto;
|
||||||
|
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
|
List<String> powerFlagIds = terminalBaseService.getDeviceIdByPowerFlag(deviceIds, i);
|
||||||
|
dto=new SimpleDTO();
|
||||||
|
PowerFlagEnum enumByCode = PowerFlagEnum.getPowerFlagEnumByCode(i);
|
||||||
|
dto.setId(enumByCode.getCode().toString());
|
||||||
|
dto.setName(enumByCode.getMessage());
|
||||||
|
generalDeviceDTOS.add(assembleDataByLine(dto, lines, powerFlagIds, LineBaseEnum.LINE_LEVEL.getCode()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return generalDeviceDTOS;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 当该部门不存在监测点时,返回空的分类数据
|
* 当该部门不存在监测点时,返回空的分类数据
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -282,13 +282,16 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
|||||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||||
Map<String, Long> map = new LinkedHashMap<>();
|
Map<String, Long> map = new LinkedHashMap<>();
|
||||||
DateField dateField;
|
DateField dateField;
|
||||||
|
DateTime parse;
|
||||||
if (1 == param.getType()) {
|
if (1 == param.getType()) {
|
||||||
dateField = DateField.YEAR;
|
dateField = DateField.YEAR;
|
||||||
|
parse =DateUtil.offset(DateUtil.parse(param.getSearchBeginTime()),DateField.YEAR,-5);
|
||||||
} else {
|
} else {
|
||||||
dateField = DateField.MONTH;
|
dateField = DateField.MONTH;
|
||||||
|
parse = DateUtil.parse(param.getSearchBeginTime());
|
||||||
}
|
}
|
||||||
//根据步进单位获取起始日期时间和结束日期时间的时间区间集合
|
//根据步进单位获取起始日期时间和结束日期时间的时间区间集合
|
||||||
List<DateTime> dateTimes = DateUtil.rangeToList(DateUtil.parse(param.getSearchBeginTime()), DateUtil.parse(param.getSearchEndTime()), dateField);
|
List<DateTime> dateTimes = DateUtil.rangeToList(parse, DateUtil.parse(param.getSearchEndTime()), dateField);
|
||||||
List<Date> times;
|
List<Date> times;
|
||||||
if (4 == type) {
|
if (4 == type) {
|
||||||
List<String> devIDs = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).distinct().collect(Collectors.toList());
|
List<String> devIDs = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).distinct().collect(Collectors.toList());
|
||||||
|
|||||||
@@ -1504,6 +1504,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
return this.baseMapper.getDeviceIdByManufacturer(deviceIds, manufacturer);
|
return this.baseMapper.getDeviceIdByManufacturer(deviceIds, manufacturer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getDeviceIdByPowerFlag(List<String> lineIds, Integer manufacturer) {
|
||||||
|
return this.baseMapper.getDeviceIdByPowerFlag(lineIds, manufacturer);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BaseLineInfo> getBaseLineInfo(List<String> lineIndex) {
|
public List<BaseLineInfo> getBaseLineInfo(List<String> lineIndex) {
|
||||||
return this.baseMapper.getBaseLineInfo(lineIndex);
|
return this.baseMapper.getBaseLineInfo(lineIndex);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public enum StatisticsEnum {
|
|||||||
VOLTAGE_LEVEL("电压等级", "Voltage_Level"),
|
VOLTAGE_LEVEL("电压等级", "Voltage_Level"),
|
||||||
LOAD_TYPE("干扰源类型", "Load_Type"),
|
LOAD_TYPE("干扰源类型", "Load_Type"),
|
||||||
MANUFACTURER("终端厂家", "Manufacturer"),
|
MANUFACTURER("终端厂家", "Manufacturer"),
|
||||||
|
POWER_FLAG("监测点性质", "Power_Flag"),
|
||||||
REPORT_TYPE("上报类型", "Report_Type");
|
REPORT_TYPE("上报类型", "Report_Type");
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|||||||
Reference in New Issue
Block a user