1.审批流程中审批不通过会造成俩条数据bug解决
2.解决公共方法,变电站信息台账数据量不准确问题,增加变电数据判断 3.技术监督-干扰源治理验收报告逻辑校验 4.技术监督-台账联调,增加治理验收和入网评估报告验证
This commit is contained in:
@@ -555,4 +555,6 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
List<LineDetailVO.noDataLineInfo> getNoDataLine(@Param("time")String time);
|
||||
|
||||
List<ReportLineInfoVo> getReportLineInfo(@Param("ids")List<String> ids);
|
||||
|
||||
List<Line> getSubByCondition(@Param("subIds") List<String> subIds, @Param("scale") List<SimpleDTO> scale);
|
||||
}
|
||||
|
||||
@@ -268,7 +268,8 @@
|
||||
pq_line t1 ,
|
||||
pq_line_detail t2
|
||||
where
|
||||
t1.id = t2.id
|
||||
t1.state = 1
|
||||
and t1.id = t2.id
|
||||
and
|
||||
t1.id in
|
||||
<foreach collection="ids" separator="," open="(" close=")" item="item">
|
||||
@@ -1723,4 +1724,24 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getSubByCondition" resultType="com.njcn.device.pq.pojo.po.Line">
|
||||
select
|
||||
t1.*
|
||||
from
|
||||
pq_line t1 ,
|
||||
pq_substation t2
|
||||
where
|
||||
t1.id = t2.id
|
||||
and
|
||||
t1.id in
|
||||
<foreach collection="subIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="scale!=null and scale.size()!=0">
|
||||
AND t2.scale in
|
||||
<foreach collection="scale" open="(" close=")" item="item" separator=",">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -132,6 +132,14 @@ public interface TerminalBaseService {
|
||||
*/
|
||||
List<Line> getVoltageByCondition(List<String> voltageIds, List<SimpleDTO> scale);
|
||||
|
||||
/**
|
||||
* 查询变电站信息
|
||||
*
|
||||
* @param subIds 变电站索引
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<Line> getSubByCondition(List<String> subIds, List<SimpleDTO> scale);
|
||||
|
||||
/**
|
||||
* 根据指定电压等级查询母线id
|
||||
*
|
||||
|
||||
@@ -434,8 +434,15 @@ public class GeneralDeviceService {
|
||||
//再根据电压等级筛选合法母线信息
|
||||
List<Line> voltages = terminalBaseService.getVoltageByCondition(voltageIds,
|
||||
deviceInfoParam.getScale());
|
||||
//筛选出变电站id,理论上监测点的pids中第四个id为变电站id 联查: pq_line t1 ,pq_substation t2
|
||||
List<String> subIds = lines.stream().map(line -> {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
return idsArray[3];
|
||||
}).collect(Collectors.toList());
|
||||
List<Line> sub = terminalBaseService.getSubByCondition(subIds,
|
||||
deviceInfoParam.getScale());
|
||||
//筛选最终的数据
|
||||
dealDeviceData(generalDeviceDTO, lines, devices, voltages);
|
||||
dealDeviceData(generalDeviceDTO, lines, devices, voltages, sub);
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
|
||||
@@ -447,15 +454,18 @@ public class GeneralDeviceService {
|
||||
* @param devices 筛选后的终端信息
|
||||
* @param voltages 筛选后的母线信息
|
||||
*/
|
||||
private void dealDeviceData(GeneralDeviceDTO generalDeviceDTO, List<Line> lines, List<Line> devices, List<Line> voltages) {
|
||||
private void dealDeviceData(GeneralDeviceDTO generalDeviceDTO, List<Line> lines, List<Line> devices, List<Line> voltages, List<Line> sub) {
|
||||
List<String> gdIndexes = new ArrayList<>(), subIndexes = new ArrayList<>(), deviceIndexes = new ArrayList<>(), voltageIndexes = new ArrayList<>(), lineIndexes = new ArrayList<>();
|
||||
List<String> devIds = devices.stream().map(Line::getId).distinct().collect(Collectors.toList());
|
||||
List<String> volIds = voltages.stream().map(Line::getId).distinct().collect(Collectors.toList());
|
||||
List<String> subIds = sub.stream().map(Line::getId).distinct().collect(Collectors.toList());
|
||||
for (Line line : lines) {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
//监测点同时满足条件筛选后的终端、母线信息,才是最终的结果
|
||||
if (devIds.contains(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]) &&
|
||||
volIds.contains(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()])) {
|
||||
volIds.contains(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()])&&
|
||||
subIds.contains(idsArray[LineBaseEnum.SUB_LEVEL.getCode()])
|
||||
) {
|
||||
gdIndexes.add(idsArray[LineBaseEnum.GD_LEVEL.getCode()]);
|
||||
subIndexes.add(idsArray[LineBaseEnum.SUB_LEVEL.getCode()]);
|
||||
deviceIndexes.add(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]);
|
||||
|
||||
@@ -296,12 +296,14 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
//根据步进单位获取起始日期时间和结束日期时间的时间区间集合
|
||||
List<DateTime> dateTimes = DateUtil.rangeToList(parse, DateUtil.parse(param.getSearchEndTime()), dateField);
|
||||
List<Date> times;
|
||||
//终端分布趋势
|
||||
if (4 == type) {
|
||||
List<String> devIDs = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).distinct().collect(Collectors.toList());
|
||||
List<Device> list = deviceService.list(new LambdaQueryWrapper<Device>().select(Device::getLoginTime).in(CollUtil.isNotEmpty(devIDs), Device::getId, devIDs).eq(Device::getRunFlag, 0));
|
||||
times = list.stream().map(x -> Date.from(x.getLoginTime().atStartOfDay(ZoneId.systemDefault()).toInstant())).collect(Collectors.toList());
|
||||
} else {
|
||||
List<String> ids;
|
||||
//监测点分布趋势
|
||||
if (type == 3) {
|
||||
ids = generalDeviceDTOList.stream().flatMap(x -> x.getSubIndexes().stream()).distinct().collect(Collectors.toList());
|
||||
} else {
|
||||
|
||||
@@ -1491,6 +1491,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
return this.baseMapper.getVoltageByCondition(voltageIds, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Line> getSubByCondition(List<String> subIds, List<SimpleDTO> scale) {
|
||||
return this.baseMapper.getSubByCondition(subIds, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getVoltageIdByScale(List<String> voltageIds, String scale) {
|
||||
return this.baseMapper.getVoltageIdByScale(voltageIds, scale);
|
||||
|
||||
Reference in New Issue
Block a user