diff --git a/src/main/java/com/genersoft/iot/vmp/service/IRegionService.java b/src/main/java/com/genersoft/iot/vmp/service/IRegionService.java index b61c31b7..875dd89b 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/IRegionService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/IRegionService.java @@ -20,7 +20,7 @@ public interface IRegionService { /** * 查询子区划列表 */ - PageInfo queryChildGroupList(String regionParentId, int page, int count); + PageInfo queryChildRegionList(String regionParentId, int page, int count); /** * 更新区域 @@ -28,4 +28,6 @@ public interface IRegionService { void update(Region region); List getAllChild(String parent); + + Region queryRegionByDeviceId(String regionDeviceId); } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index f2653f70..0f735f24 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -445,7 +445,8 @@ public class PlayServiceImpl implements IPlayService { String endTime, ErrorCallback callback) { Device device = storager.queryVideoDevice(deviceId); if (device == null) { - logger.warn("[录像回放] 未找到设备 deviceId: {},channelId:{}", deviceId, channelId); + logger.warn("[录像回放] 未找到设备 deviceId: {}, channelId:{},startTime:{}, endTime:{}", + deviceId, channelId, startTime, endTime); throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备:" + deviceId); } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/RegionServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/RegionServiceImpl.java index 420ab669..45100ae3 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/RegionServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/RegionServiceImpl.java @@ -87,7 +87,7 @@ public class RegionServiceImpl implements IRegionService { } @Override - public PageInfo queryChildGroupList(String regionParentId, int page, int count) { + public PageInfo queryChildRegionList(String regionParentId, int page, int count) { assert regionParentId != null; PageHelper.startPage(page, count); List all = regionMapper.getChildren(regionParentId); @@ -130,4 +130,9 @@ public class RegionServiceImpl implements IRegionService { Collections.sort(allChild); return allChild; } + + @Override + public Region queryRegionByDeviceId(String regionDeviceId) { + return regionMapper.queryRegionByDeviceId(regionDeviceId); + } } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/RegionMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/RegionMapper.java index a02ea3c8..3cf4938b 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/RegionMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/RegionMapper.java @@ -116,4 +116,7 @@ public interface RegionMapper { " #{item.commonRegionId}" + "") void removeRegionByList(@Param("regionList") List regionList); + + @Select("select * from wvp_common_region where common_region_device_id = #{regionDeviceId}") + Region queryRegionByDeviceId(@Param("regionDeviceId") String regionDeviceId); } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/region/RegionController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/region/RegionController.java index e58814f5..c3d3105f 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/region/RegionController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/region/RegionController.java @@ -75,7 +75,7 @@ public class RegionController { @Parameter(name = "count", description = "每页查询数量", required = true) @ResponseBody @GetMapping("/child/list") - public PageInfo queryChildGroupList( + public PageInfo queryChildRegionList( @RequestParam(required = true) String regionParentId, @RequestParam(required = true) int page, @RequestParam(required = true) int count @@ -83,7 +83,20 @@ public class RegionController { if (ObjectUtils.isEmpty(regionParentId.trim())) { regionParentId = null; } - return regionService.queryChildGroupList(regionParentId, page, count); + return regionService.queryChildRegionList(regionParentId, page, count); + } + + @Operation(summary = "根据区域Id查询区域") + @Parameter(name = "regionDeviceId", description = "行政区划节点编号", required = true) + @ResponseBody + @GetMapping("/one") + public Region queryRegionByDeviceId( + @RequestParam(required = true) String regionDeviceId + ){ + if (ObjectUtils.isEmpty(regionDeviceId.trim())) { + throw new ControllerException(ErrorCode.ERROR400); + } + return regionService.queryRegionByDeviceId(regionDeviceId); } @Operation(summary = "获取所属的行政区划下的行政区划")