|
|
|
@ -1,7 +1,7 @@ |
|
|
|
package com.hnac.hzims.operational.station.service.impl; |
|
|
|
package com.hnac.hzims.operational.station.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.hnac.hzims.operational.OperationalConstants; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.main.constant.HomePageConstant; |
|
|
|
import com.hnac.hzims.operational.main.constant.HomePageConstant; |
|
|
|
import com.hnac.hzims.operational.main.service.IWaterService; |
|
|
|
import com.hnac.hzims.operational.main.service.IWaterService; |
|
|
|
import com.hnac.hzims.operational.station.entity.ImsDeptEntity; |
|
|
|
import com.hnac.hzims.operational.station.entity.ImsDeptEntity; |
|
|
|
@ -366,19 +366,30 @@ public class ImsDeptServiceImpl extends ServiceImpl<ImsDeptMapper, ImsDeptEntity |
|
|
|
} |
|
|
|
} |
|
|
|
WaterDeptTreeVo waterDeptTreeVo = new WaterDeptTreeVo(); |
|
|
|
WaterDeptTreeVo waterDeptTreeVo = new WaterDeptTreeVo(); |
|
|
|
waterDeptTreeVo.setName("霍山县"); |
|
|
|
waterDeptTreeVo.setName("霍山县"); |
|
|
|
|
|
|
|
// 从视频配置表获取存在运行安全视频的去重站点号
|
|
|
|
// List<StationEntity> likeRefDept = stationService.getLikeRefDept(2000000134L, null, new ArrayList<>());
|
|
|
|
List<String> stationIds = stationVideoTypeService.getWaterStationIds(); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(stationIds)) { |
|
|
|
|
|
|
|
waterDeptTreeVo.setChildren(new ArrayList<>()); |
|
|
|
|
|
|
|
return waterDeptTreeVo; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 根据站点号获取站点信息,按站点排序
|
|
|
|
|
|
|
|
List<StationEntity> stationList = stationService.list(new LambdaQueryWrapper<StationEntity>() |
|
|
|
|
|
|
|
.in(StationEntity::getCode, stationIds) |
|
|
|
|
|
|
|
.orderByAsc(StationEntity::getSort)); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(stationList)) { |
|
|
|
|
|
|
|
waterDeptTreeVo.setChildren(new ArrayList<>()); |
|
|
|
|
|
|
|
return waterDeptTreeVo; |
|
|
|
|
|
|
|
} |
|
|
|
List<WaterDeptTreeVo> child = new ArrayList<>(); |
|
|
|
List<WaterDeptTreeVo> child = new ArrayList<>(); |
|
|
|
// for (StationEntity station : likeRefDept) {
|
|
|
|
for (StationEntity station : stationList) { |
|
|
|
for (OperationalConstants.StaionTypeEnum value : OperationalConstants.StaionTypeEnum.values()) { |
|
|
|
List<StationVideoTypeEntity> videoCount = stationVideoTypeService.getVideoCount(station.getCode(), Arrays.asList("1", "2", "3", "4", "5"), "2"); |
|
|
|
List<StationVideoTypeEntity> videoCount = stationVideoTypeService.getVideoCount(value.getStationId(), Arrays.asList("1", "2", "3", "4", "5"), "2"); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(videoCount)) { |
|
|
|
if (CollectionUtil.isEmpty(videoCount)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
WaterDeptTreeVo waterDeptTreeVoChild = new WaterDeptTreeVo(); |
|
|
|
WaterDeptTreeVo waterDeptTreeVoChild = new WaterDeptTreeVo(); |
|
|
|
waterDeptTreeVoChild.setName(value.getName()); |
|
|
|
waterDeptTreeVoChild.setName(station.getName()); |
|
|
|
waterDeptTreeVoChild.setStationId(value.getStationId().toString()); |
|
|
|
waterDeptTreeVoChild.setStationId(station.getCode()); |
|
|
|
waterDeptTreeVoChild.setSort(value.getType()); |
|
|
|
waterDeptTreeVoChild.setSort(ObjectUtil.isNotEmpty(station.getSort()) ? station.getSort() : 0); |
|
|
|
waterDeptTreeVoChild.setVideoNum(videoCount.size()); |
|
|
|
waterDeptTreeVoChild.setVideoNum(videoCount.size()); |
|
|
|
Map<String, List<StationVideoTypeEntity>> collect = videoCount.stream().collect(Collectors.groupingBy(StationVideoTypeEntity::getVideoType)); |
|
|
|
Map<String, List<StationVideoTypeEntity>> collect = videoCount.stream().collect(Collectors.groupingBy(StationVideoTypeEntity::getVideoType)); |
|
|
|
List<WaterDeptTreeVo> res = new ArrayList<>(); |
|
|
|
List<WaterDeptTreeVo> res = new ArrayList<>(); |
|
|
|
@ -399,7 +410,7 @@ public class ImsDeptServiceImpl extends ServiceImpl<ImsDeptMapper, ImsDeptEntity |
|
|
|
if (stringListEntry.getKey().equals("5")) { |
|
|
|
if (stringListEntry.getKey().equals("5")) { |
|
|
|
waterDeptTreeVoThree.setWaterName("运行"); |
|
|
|
waterDeptTreeVoThree.setWaterName("运行"); |
|
|
|
} |
|
|
|
} |
|
|
|
waterDeptTreeVoThree.setStationId(value.getStationId().toString()); |
|
|
|
waterDeptTreeVoThree.setStationId(station.getCode()); |
|
|
|
waterDeptTreeVoThree.setWaterId(stringListEntry.getKey()); |
|
|
|
waterDeptTreeVoThree.setWaterId(stringListEntry.getKey()); |
|
|
|
waterDeptTreeVoThree.setVideoNum(stringListEntry.getValue().size()); |
|
|
|
waterDeptTreeVoThree.setVideoNum(stringListEntry.getValue().size()); |
|
|
|
res.add(waterDeptTreeVoThree); |
|
|
|
res.add(waterDeptTreeVoThree); |
|
|
|
@ -418,17 +429,31 @@ public class ImsDeptServiceImpl extends ServiceImpl<ImsDeptMapper, ImsDeptEntity |
|
|
|
} |
|
|
|
} |
|
|
|
WaterDeptTreeVo waterDeptTreeVo = new WaterDeptTreeVo(); |
|
|
|
WaterDeptTreeVo waterDeptTreeVo = new WaterDeptTreeVo(); |
|
|
|
waterDeptTreeVo.setName("霍山县"); |
|
|
|
waterDeptTreeVo.setName("霍山县"); |
|
|
|
|
|
|
|
// 从视频配置表获取存在防汛安全视频的去重站点号
|
|
|
|
|
|
|
|
List<String> stationIds = stationVideoTypeService.getWaterSafeStationIds(); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(stationIds)) { |
|
|
|
|
|
|
|
waterDeptTreeVo.setChildren(new ArrayList<>()); |
|
|
|
|
|
|
|
return waterDeptTreeVo; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 根据站点号获取站点信息,按站点排序
|
|
|
|
|
|
|
|
List<StationEntity> stationList = stationService.list(new LambdaQueryWrapper<StationEntity>() |
|
|
|
|
|
|
|
.in(StationEntity::getCode, stationIds) |
|
|
|
|
|
|
|
.orderByAsc(StationEntity::getSort)); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(stationList)) { |
|
|
|
|
|
|
|
waterDeptTreeVo.setChildren(new ArrayList<>()); |
|
|
|
|
|
|
|
return waterDeptTreeVo; |
|
|
|
|
|
|
|
} |
|
|
|
List<WaterDeptTreeVo> child = new ArrayList<>(); |
|
|
|
List<WaterDeptTreeVo> child = new ArrayList<>(); |
|
|
|
for (OperationalConstants.StaionTypeEnum value : OperationalConstants.StaionTypeEnum.values()) { |
|
|
|
for (StationEntity station : stationList) { |
|
|
|
List<StationVideoTypeEntity> videoCount = stationVideoTypeService.getVideoCount(value.getStationId(), Arrays.asList("6"), "1"); |
|
|
|
List<StationVideoTypeEntity> videoCount = stationVideoTypeService.getVideoCount(station.getCode(), Arrays.asList("6"), "1"); |
|
|
|
if (CollectionUtil.isEmpty(videoCount)) { |
|
|
|
if (CollectionUtil.isEmpty(videoCount)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
WaterDeptTreeVo waterDeptTreeVoChild = new WaterDeptTreeVo(); |
|
|
|
WaterDeptTreeVo waterDeptTreeVoChild = new WaterDeptTreeVo(); |
|
|
|
waterDeptTreeVoChild.setName(value.getName()); |
|
|
|
waterDeptTreeVoChild.setName(station.getName()); |
|
|
|
waterDeptTreeVoChild.setSort(value.getType()); |
|
|
|
waterDeptTreeVoChild.setSort(ObjectUtil.isNotEmpty(station.getSort()) ? station.getSort() : 0); |
|
|
|
waterDeptTreeVoChild.setStationId(value.getStationId().toString()); |
|
|
|
waterDeptTreeVoChild.setStationId(station.getCode()); |
|
|
|
waterDeptTreeVoChild.setWaterId(value.getStationId().toString()); |
|
|
|
waterDeptTreeVoChild.setWaterId(station.getCode()); |
|
|
|
waterDeptTreeVoChild.setVideoNum(videoCount.size()); |
|
|
|
waterDeptTreeVoChild.setVideoNum(videoCount.size()); |
|
|
|
child.add(waterDeptTreeVoChild); |
|
|
|
child.add(waterDeptTreeVoChild); |
|
|
|
} |
|
|
|
} |
|
|
|
|