diff --git a/smartFishingPort-kechuang/src/main/java/com/ltgk/smartFishingPort/service/impl/VideoIdentificationServiceImpl.java b/smartFishingPort-kechuang/src/main/java/com/ltgk/smartFishingPort/service/impl/VideoIdentificationServiceImpl.java index 3637caf..f6c4788 100644 --- a/smartFishingPort-kechuang/src/main/java/com/ltgk/smartFishingPort/service/impl/VideoIdentificationServiceImpl.java +++ b/smartFishingPort-kechuang/src/main/java/com/ltgk/smartFishingPort/service/impl/VideoIdentificationServiceImpl.java @@ -7,19 +7,19 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ltgk.smartFishingPort.common.utils.MybatisUtil; import com.ltgk.smartFishingPort.domain.dto.VideoIdentificationDto; -import com.ltgk.smartFishingPort.domain.entity.VideoCamera; +import com.ltgk.smartFishingPort.domain.entity.DsVideo; import com.ltgk.smartFishingPort.domain.entity.VideoIdentification; import com.ltgk.smartFishingPort.mapper.VideoIdentificationMapper; -import com.ltgk.smartFishingPort.service.IVideoCameraService; +import com.ltgk.smartFishingPort.service.IDsVideoService; import com.ltgk.smartFishingPort.service.IVideoIdentificationService; import com.ltgk.smartFishingPort.utils.CameraDegreesUtil; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; +import javax.annotation.Resource; import java.math.BigDecimal; import java.util.Arrays; import java.util.List; @@ -39,8 +39,8 @@ public class VideoIdentificationServiceImpl extends ServiceImpl pageResult = baseMapper.selectPage(pageParam, queryWrapper); @@ -118,30 +118,30 @@ public class VideoIdentificationServiceImpl extends ServiceImpl videoCameraQueryWrapper = new LambdaQueryWrapper<>(); - videoCameraQueryWrapper.eq(VideoCamera::getVideoName, videoName); - videoCameraQueryWrapper.last("limit 1"); - videoCamera = videoCameraService.getOne(videoCameraQueryWrapper); - if (!Objects.isNull(videoCamera)) { - m.setVideoCode(videoCamera.getVideoCode()); + LambdaQueryWrapper dsVideoLambdaQueryWrapper = new LambdaQueryWrapper<>(); + dsVideoLambdaQueryWrapper.eq(DsVideo::getVideoName, videoName); + dsVideoLambdaQueryWrapper.last("limit 1"); + dsVideo = dsVideoService.getOne(dsVideoLambdaQueryWrapper); + if (!Objects.isNull(dsVideo)) { + m.setVideoCode(dsVideo.getVideoCode()); } } if (!StringUtils.isEmpty(m.getVideoName()) && !Objects.isNull(m.getLatitude()) && !Objects.isNull(m.getLongitude())) { - if (Objects.isNull(videoCamera)) { + if (Objects.isNull(dsVideo)) { m.setDistance(BigDecimal.ZERO); - } else if (Objects.isNull(videoCamera.getLatitude()) || Objects.isNull(videoCamera.getLongitude())) { + } else if (Objects.isNull(dsVideo.getLatitude()) || Objects.isNull(dsVideo.getLongitude())) { m.setDistance(BigDecimal.ZERO); } else { - BigDecimal distance = CameraDegreesUtil.getDistance1(videoCamera.getLongitude().doubleValue() - , videoCamera.getLatitude().doubleValue(), m.getLongitude().doubleValue(), m.getLatitude().doubleValue()); + BigDecimal distance = CameraDegreesUtil.getDistance1(dsVideo.getLongitude().doubleValue() + , dsVideo.getLatitude().doubleValue(), m.getLongitude().doubleValue(), m.getLatitude().doubleValue()); m.setDistance(distance); } } - if (!Objects.isNull(videoCamera) && !StringUtils.isEmpty(videoCamera.getVideoName())) { - m.setVideoName(videoCamera.getVideoBelong() + videoCamera.getVideoName()); + if (!Objects.isNull(dsVideo) && !StringUtils.isEmpty(dsVideo.getVideoName())) { + m.setVideoName(dsVideo.getBelongUnit() + dsVideo.getVideoName()); } if (!Objects.isNull(m.getSpeed())) { m.setSpeed(m.getSpeed().divide(new BigDecimal(0.5144444), 2, BigDecimal.ROUND_HALF_UP));