|
|
@ -25,6 +25,7 @@ import com.hnac.hzims.operational.station.vo.HikVideoAreaTreeVO; |
|
|
|
import com.hnac.hzims.operational.station.vo.HikVideoAreaVO; |
|
|
|
import com.hnac.hzims.operational.station.vo.HikVideoAreaVO; |
|
|
|
import com.hnac.hzims.operational.station.vo.StationVideoTypeVO; |
|
|
|
import com.hnac.hzims.operational.station.vo.StationVideoTypeVO; |
|
|
|
import com.hnac.hzims.operational.station.vo.VideoMonitorVO; |
|
|
|
import com.hnac.hzims.operational.station.vo.VideoMonitorVO; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.station.wrapper.StationVideoTypeWrapper; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
@ -32,8 +33,11 @@ import org.springblade.core.log.exception.ServiceException; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
import org.springblade.system.cache.DictCache; |
|
|
|
import org.springblade.system.cache.DictCache; |
|
|
|
|
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
import org.springframework.util.Assert; |
|
|
@ -51,7 +55,10 @@ import java.util.stream.Collectors; |
|
|
|
@Slf4j |
|
|
|
@Slf4j |
|
|
|
public class StationVideoTypeServiceImpl extends ServiceImpl<StationVideoTypeMapper, StationVideoTypeEntity> implements IStationVideoTypeService { |
|
|
|
public class StationVideoTypeServiceImpl extends ServiceImpl<StationVideoTypeMapper, StationVideoTypeEntity> implements IStationVideoTypeService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ISysClient sysClient; |
|
|
|
|
|
|
|
|
|
|
|
private final HikPathConfiguration pathConfiguration; |
|
|
|
private final HikPathConfiguration pathConfiguration; |
|
|
|
|
|
|
|
|
|
|
|
private final IHikVideoService hikVideoService; |
|
|
|
private final IHikVideoService hikVideoService; |
|
|
|
|
|
|
|
|
|
|
|
@Value("${url.video.login}") |
|
|
|
@Value("${url.video.login}") |
|
|
@ -273,6 +280,40 @@ public class StationVideoTypeServiceImpl extends ServiceImpl<StationVideoTypeMap |
|
|
|
return cameras.stream().collect(Collectors.groupingBy(c -> deviceMap.get(c.getString("encodeDevIndexCode")))); |
|
|
|
return cameras.stream().collect(Collectors.groupingBy(c -> deviceMap.get(c.getString("encodeDevIndexCode")))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询列表 |
|
|
|
|
|
|
|
* @param param |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<StationVideoTypeVO> stationVideos(StationVideoTypeDTO param) { |
|
|
|
|
|
|
|
StationVideoTypeEntity stationVideoTypeEntity = BeanUtil.copy(param,StationVideoTypeEntity.class); |
|
|
|
|
|
|
|
QueryWrapper<StationVideoTypeEntity> queryWrapper = com.hnac.hzims.common.utils.Condition.getQueryWrapper(new StationVideoTypeEntity(),stationVideoTypeEntity,false, "vt"); |
|
|
|
|
|
|
|
return this.baseMapper.stationVideos(queryWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询列表 |
|
|
|
|
|
|
|
* @param param |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<StationVideoTypeVO> videoTypes(StationVideoTypeEntity param) { |
|
|
|
|
|
|
|
LambdaQueryWrapper<StationVideoTypeEntity> queryWrapper = com.hnac.hzims.common.utils.Condition.getQueryWrapper(new StationVideoTypeEntity(), param); |
|
|
|
|
|
|
|
queryWrapper.orderByAsc(StationVideoTypeEntity::getStationId).orderByAsc(StationVideoTypeEntity::getSort); |
|
|
|
|
|
|
|
List<StationVideoTypeEntity> records = this.list(queryWrapper); |
|
|
|
|
|
|
|
if(CollectionUtil.isEmpty(records)){ |
|
|
|
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<StationVideoTypeVO> videoTypes = StationVideoTypeWrapper.builder().listVO(records); |
|
|
|
|
|
|
|
return videoTypes.stream().peek(videoType->{ |
|
|
|
|
|
|
|
R<Dept> dept = sysClient.getDept(videoType.getDeptId()); |
|
|
|
|
|
|
|
if (dept.isSuccess() && ObjectUtil.isEmpty(dept.getData())) { |
|
|
|
|
|
|
|
videoType.setDeptName(Optional.ofNullable(dept.getData()).map(Dept::getDeptName).orElse(null)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private HikVideoAreaTreeVO generateAreaTree(Map<String, List<HikVideoAreaVO>> videoAreaMapByParent,HikVideoAreaVO area) { |
|
|
|
private HikVideoAreaTreeVO generateAreaTree(Map<String, List<HikVideoAreaVO>> videoAreaMapByParent,HikVideoAreaVO area) { |
|
|
|
HikVideoAreaTreeVO parentTree = BeanUtil.copy(area,HikVideoAreaTreeVO.class); |
|
|
|
HikVideoAreaTreeVO parentTree = BeanUtil.copy(area,HikVideoAreaTreeVO.class); |
|
|
|
if(CollectionUtil.isNotEmpty(videoAreaMapByParent.get(area.getIndexCode()))) { |
|
|
|
if(CollectionUtil.isNotEmpty(videoAreaMapByParent.get(area.getIndexCode()))) { |
|
|
|