From cc4b3f8713b4c561c193fa1abdae0ab69b98750d Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期三, 23 八月 2023 14:49:34 +0800 Subject: [PATCH] 优化 --- ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java | 20 ++++---------------- 1 files changed, 4 insertions(+), 16 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java index 6792122..af4c67b 100644 --- a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java +++ b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java @@ -26,6 +26,7 @@ import com.ruoyi.common.annotation.DataScope; import com.ruoyi.system.mapper.SysDeptMapper; import com.ruoyi.utils.tools.GisTool; +import com.ruoyi.utils.tools.Point; import com.sun.org.apache.bcel.internal.generic.NEW; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -119,20 +120,7 @@ ardCameras.setCreateTime(DateUtils.getNowDate()); ardCameras.setUserId(SecurityUtils.getUserId()); redisCache.setCacheObject(getCacheKey(ardCameras.getId()), ardCameras); - int i = ardCamerasMapper.insertArdCameras(ardCameras); - if (i > 0) { -// //鍒犻櫎褰撳墠鐩告満鐨勬墍鏈夐�氶亾 -// ardChannelMapper.deleteArdChannelByDeviceId(ardCameras.getId()); -// //鑾峰彇鐩告満閫氶亾 -// List<ArdChannel> ipChannelList = hikClientService.getCameraChannelList(ardCameras); -// if (ipChannelList.size() > 0) { -// for (ArdChannel channel : ipChannelList) { -// channel.setId(IdUtils.simpleUUID()); -// ardChannelMapper.insertArdChannel(channel); -// } -// } - } - return i; + return ardCamerasMapper.insertArdCameras(ardCameras); } /** @@ -357,7 +345,7 @@ public List<ArdCameras> getNearCamerasWithPolygon(SchedulingParam param) { try { Long deptId=SecurityUtils.getLoginUser().getUser().getDeptId(); - List<Point2D> partitionLocation = param.getPartitionLocation(); + List<Point> partitionLocation = param.getPartitionLocation(); if(partitionLocation==null) { log.debug("澶氳竟褰㈠潗鏍囬泦鍚堜负绌�"); @@ -374,7 +362,7 @@ continue; } /*鍒ゆ柇鍧愭爣鏄惁鍦ㄥ杈瑰舰鑼冨洿鍐�*/ - Point2D camPosition=new Point2D.Double(camera.getLongitude(), camera.getLatitude()); + Point camPosition=new Point(camera.getLongitude(),camera.getLatitude()); boolean inPolygon = GisTool.isInPolygon(camPosition, partitionLocation); if (inPolygon) { /*鑾峰彇閫氶亾鍒楄〃*/ -- Gitblit v1.9.3