diff --git a/README.md b/README.md index 0dd908b..c0d9ab2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ # 工程简介 - - # 延伸阅读 diff --git a/pom.xml b/pom.xml index ed787f8..612c5aa 100644 --- a/pom.xml +++ b/pom.xml @@ -87,16 +87,16 @@ javacv 1.5.7 --> - - - - - - - - - - + + + + + + + + + + diff --git a/src/main/java/com/hisense/monitormanage/config/GlobalCorsConfig.java b/src/main/java/com/hisense/monitormanage/config/GlobalCorsConfig.java index a673691..79674c3 100644 --- a/src/main/java/com/hisense/monitormanage/config/GlobalCorsConfig.java +++ b/src/main/java/com/hisense/monitormanage/config/GlobalCorsConfig.java @@ -26,7 +26,7 @@ public class GlobalCorsConfig { //2. 添加映射路径 UrlBasedCorsConfigurationSource corsConfigurationSource = new UrlBasedCorsConfigurationSource(); - corsConfigurationSource.registerCorsConfiguration("/**",config); + corsConfigurationSource.registerCorsConfiguration("/**", config); //3. 返回新的CorsFilter return new CorsFilter(corsConfigurationSource); } diff --git a/src/main/java/com/hisense/monitormanage/config/SwaggerConfig.java b/src/main/java/com/hisense/monitormanage/config/SwaggerConfig.java index 4746ff3..9c1b375 100644 --- a/src/main/java/com/hisense/monitormanage/config/SwaggerConfig.java +++ b/src/main/java/com/hisense/monitormanage/config/SwaggerConfig.java @@ -28,7 +28,7 @@ public class SwaggerConfig { private boolean enable; @Bean - public Docket createRestApi(){ + public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) .enable(enable) .select() diff --git a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java index 95d9a19..019ba27 100644 --- a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java +++ b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java @@ -49,40 +49,41 @@ public class BuildingController { @GetMapping("/getRecords") @ApiOperation("测试,获取工地实时数据--调用接口") - public List getRecords(){ + public List getRecords() { return buildingRecordsService.getRecords(); } @GetMapping("/getAndSaveRecords") @ApiOperation("获取工地实时数据并保存到表中--调用接口获取") - public Result getAndSaveRecords(){ + public Result getAndSaveRecords() { boolean result = buildingRecordsService.getAndSaveRecords(); - if(result){ + if (result) { return Result.success(); - }else{ + } else { return Result.error(String.valueOf(result)); } } @GetMapping("/listRecords") @ApiOperation("获取工地实时数据列表-从t_building_records表中查询") - @ApiImplicitParam(name="pushTime",value="上传时间",paramType = "query",required = true,dataType = "string",example = "2022-01-01") + @ApiImplicitParam(name = "pushTime", value = "上传时间", paramType = "query", required = true, dataType = "string", example = "2022-01-01") public List listRecords( - @RequestParam(value="pushTime") String pushTime - ){ + @RequestParam(value = "pushTime") String pushTime + ) { return buildingRecordsService.listRecords(pushTime); } /** * 查询所有工地最新列表 + * * @return */ @GetMapping("selectAllBuilding") @ApiOperation("查询所有工地") - public Result selectAllBuilding(){ + public Result selectAllBuilding() { List records = buildingRecordsMapper.selectAllBuilding(); - records.forEach(record ->{ + records.forEach(record -> { record.setProjectName(record.getGdmc()); }); Result success = Result.success(records); @@ -91,15 +92,16 @@ public class BuildingController { /** * 根据建筑编号查询近7天工地噪声和扬尘的信息 + * * @return */ @GetMapping("selectWeekPmAndNoice") @ApiOperation("根据建筑编号查询近7天工地噪声和扬尘的信息") @ApiImplicitParam(name = "buildLicense", value = "建筑许可编号", required = true, dataType = "String") - public Result selectWeekPmAndNoice(String buildLicense){ + public Result selectWeekPmAndNoice(String buildLicense) { List records = buildingRecordsMapper.selectWeekPmAndNoice(buildLicense); - records.forEach(record ->{ - if (record.getPm10() == null && record.getNoice() == null){ + records.forEach(record -> { + if (record.getPm10() == null && record.getNoice() == null) { record.setPm10(0); record.setNoice(0); } @@ -110,15 +112,16 @@ public class BuildingController { /** * 根据建筑编号查询近30天工地噪声和扬尘的信息 + * * @return */ @GetMapping("selectMonthPmAndNoice") @ApiOperation("根据建筑编号查询近30天工地噪声和扬尘的信息") @ApiImplicitParam(name = "buildLicense", value = "建筑许可编号", required = true, dataType = "String") - public Result selectMonthPmAndNoice(String buildLicense){ + public Result selectMonthPmAndNoice(String buildLicense) { List records = buildingRecordsMapper.selectMonthPmAndNoice(buildLicense); - records.forEach(record ->{ - if (record.getPm10() == null && record.getNoice() == null){ + records.forEach(record -> { + if (record.getPm10() == null && record.getNoice() == null) { record.setPm10(0); record.setNoice(0); } @@ -129,6 +132,7 @@ public class BuildingController { /** * 查询工地扬尘事件 + * * @return */ @GetMapping("selectRaise") @@ -136,21 +140,22 @@ public class BuildingController { @ApiImplicitParams({ @ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer"), - @ApiImplicitParam(name = "startTime",value = "开始时间",required = false,dataType = "String"), - @ApiImplicitParam(name = "endTime",value = "结束时间",required = false,dataType = "String") + @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, dataType = "String") }) - public Result selectRaise(Integer page,Integer pageSize,String startTime,String endTime){ - List records = buildingRecordsMapper.selectRaise(page,pageSize,startTime,endTime); + public Result selectRaise(Integer page, Integer pageSize, String startTime, String endTime) { + List records = buildingRecordsMapper.selectRaise(page, pageSize, startTime, endTime); Integer integer = buildingRecordsMapper.selectCountRaise(); - Map map = new HashMap<>(); - map.put("sum",integer); - map.put("data",records); + Map map = new HashMap<>(); + map.put("sum", integer); + map.put("data", records); Result success = Result.success(map); return success; } /** * 查询工地噪声事件 + * * @return */ @GetMapping("selectNoiceEvent") @@ -159,18 +164,19 @@ public class BuildingController { @ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer") }) - public Result selectNoiceEvent(Integer page,Integer pageSize){ - List records = buildingRecordsMapper.selectNoiceEvent(page,pageSize); + public Result selectNoiceEvent(Integer page, Integer pageSize) { + List records = buildingRecordsMapper.selectNoiceEvent(page, pageSize); Integer integer = buildingRecordsMapper.selectCountNoice(); - Map map = new HashMap<>(); - map.put("sum",integer); - map.put("data",records); + Map map = new HashMap<>(); + map.put("sum", integer); + map.put("data", records); Result success = Result.success(map); return success; } /** * 查询工地视频感知事件 + * * @return */ @GetMapping("selectByAllEvent") @@ -179,28 +185,29 @@ public class BuildingController { @ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer") }) - public Result selectByAllEvent(Integer page,Integer pageSize){ + public Result selectByAllEvent(Integer page, Integer pageSize) { List eventDtos = buildingRecordsMapper.selectByAllEvent(page, pageSize); eventDtos.forEach(eventDto -> { eventDto.setEventNewName(eventDto.getEventCnName()); }); Integer integer = buildingRecordsMapper.selectCountEvent(); - Map map = new HashMap<>(); - map.put("sum",integer); - map.put("data",eventDtos); + Map map = new HashMap<>(); + map.put("sum", integer); + map.put("data", eventDtos); Result success = Result.success(map); return success; } /** * 根据工地名称搜索工地 + * * @param projectName * @return */ @GetMapping("selectByProjectName") @ApiOperation("根据工地名称搜索工地") - @ApiImplicitParam(name = "projectName", value = "工地名称",required = true,dataType ="String") - public Result selectByProjectName(String projectName){ + @ApiImplicitParam(name = "projectName", value = "工地名称", required = true, dataType = "String") + public Result selectByProjectName(String projectName) { List records = buildingRecordsMapper.selectByProjectName(projectName); Result success = Result.success(records); return success; @@ -208,22 +215,23 @@ public class BuildingController { /** * 根据经纬度查询半径内所有的工地 + * * @param jd * @param wd * @param radius * @return */ - @GetMapping ("selectByJdWd") + @GetMapping("selectByJdWd") @ApiOperation("根据经纬度查询半径内所有的工地") @ApiImplicitParams({ - @ApiImplicitParam(name = "jd", value = "经度",required = true,dataType ="Double"), - @ApiImplicitParam(name = "wd", value = "纬度",required = true,dataType ="Double"), - @ApiImplicitParam(name = "radius", value = "半径,米",required = true,dataType ="Integer"),} + @ApiImplicitParam(name = "jd", value = "经度", required = true, dataType = "Double"), + @ApiImplicitParam(name = "wd", value = "纬度", required = true, dataType = "Double"), + @ApiImplicitParam(name = "radius", value = "半径,米", required = true, dataType = "Integer"),} ) - public Result selectByJdWd(Double jd,Double wd,Integer radius){ + public Result selectByJdWd(Double jd, Double wd, Integer radius) { double[] around = LongLatUtil.getAround(jd, wd, radius); List buildingRecordsDtos = buildingRecordsMapper.selectByJdWd(around[0], around[2], around[1], around[3]); - buildingRecordsDtos.forEach(buildingRecordsDto->{ + buildingRecordsDtos.forEach(buildingRecordsDto -> { buildingRecordsDto.setProjectName(buildingRecordsDto.getGdmc()); }); Result success = Result.success(buildingRecordsDtos); @@ -232,181 +240,192 @@ public class BuildingController { /** * 查询当天工地视频感知事件 + * * @return */ @GetMapping("selectByEvent") @ApiOperation("查询当天工地视频感知事件") - public Result selectByEvent(){ + public Result selectByEvent() { List events = buildingRecordsMapper.selectByEvent(); events.forEach(eventDto -> { eventDto.setEventNewName(eventDto.getEventCnName()); }); - Map map = new HashMap<>(); - map.put("sum",events.size()); - map.put("data",events); + Map map = new HashMap<>(); + map.put("sum", events.size()); + map.put("data", events); Result success = Result.success(map); return success; } /** * 查询当天扬尘事件 + * * @return */ @GetMapping("selectByDayRaise") @ApiOperation("查询当天扬尘事件") - public Result selectByDayRaise(){ + public Result selectByDayRaise() { List records = buildingRecordsMapper.selectByDayRaise(); - Map map = new HashMap<>(); - map.put("sum",records.size()); - map.put("data",records); + Map map = new HashMap<>(); + map.put("sum", records.size()); + map.put("data", records); Result success = Result.success(map); return success; } /** * 查询当天噪声事件 + * * @return */ @GetMapping("selectByDayNoice") @ApiOperation("查询当天噪声事件") - public Result selectByDayNoice(){ + public Result selectByDayNoice() { List records = buildingRecordsMapper.selectByDayNoice(); - Map map = new HashMap<>(); - map.put("sum",records.size()); - map.put("data",records); + Map map = new HashMap<>(); + map.put("sum", records.size()); + map.put("data", records); Result success = Result.success(map); return success; } /** * 查询当天道路污染事件 + * * @return */ @GetMapping("selectByDayRoadData") @ApiOperation("查询当天道路污染事件") - public Result selectByDayRoadData(){ + public Result selectByDayRoadData() { RoadData byMaxId = roadDataMapper.getByMaxId(); - String dt = byMaxId.getDt(); + String dt = byMaxId.getDt(); List roadData = buildingRecordsMapper.selectByDayRoadData(dt); - Map map = new HashMap<>(); - map.put("sum",roadData.size()); - map.put("data",roadData); + Map map = new HashMap<>(); + map.put("sum", roadData.size()); + map.put("data", roadData); Result success = Result.success(map); return success; } @GetMapping("exportEvent") - public String exportRaiseEvent(String startTime,String endTime) throws Exception { - buildingRecordsService.testHSSF(startTime,endTime); + public String exportRaiseEvent(String startTime, String endTime) throws Exception { + buildingRecordsService.testHSSF(startTime, endTime); return "导出成功"; } /** * 查询近7天噪声事件 + * * @return */ @GetMapping("selectByWeekNoice") @ApiOperation("查询近7天噪声事件") - public Result selectByWeekNoice(){ + public Result selectByWeekNoice() { List buildingRecordsDtos = buildingRecordsMapper.selectByWeekNoice(); - Map map = new HashMap<>(); - map.put("sum",buildingRecordsDtos.size()); - map.put("data",buildingRecordsDtos); + Map map = new HashMap<>(); + map.put("sum", buildingRecordsDtos.size()); + map.put("data", buildingRecordsDtos); Result success = Result.success(map); return success; } /** * 查询近30天噪声事件 + * * @return */ @GetMapping("selectByMonthNoice") @ApiOperation("查询近30天噪声事件") - public Result selectByMonthNoice(){ + public Result selectByMonthNoice() { List buildingRecordsDtos = buildingRecordsMapper.selectByMonthNoice(); - Map map = new HashMap<>(); - map.put("sum",buildingRecordsDtos.size()); - map.put("data",buildingRecordsDtos); + Map map = new HashMap<>(); + map.put("sum", buildingRecordsDtos.size()); + map.put("data", buildingRecordsDtos); Result success = Result.success(map); return success; } /** * 查询近7天扬尘事件 + * * @return */ @GetMapping("selectByWeekNaise") @ApiOperation("查询近7天扬尘事件") - public Result selectByWeekNaise(){ + public Result selectByWeekNaise() { List buildingRecordsDtos = buildingRecordsMapper.selectByWeekNaise(); - Map map = new HashMap<>(); - map.put("sum",buildingRecordsDtos.size()); - map.put("data",buildingRecordsDtos); + Map map = new HashMap<>(); + map.put("sum", buildingRecordsDtos.size()); + map.put("data", buildingRecordsDtos); Result success = Result.success(map); return success; } /** * 查询近30天扬尘事件 + * * @return */ @GetMapping("selectByMonthNaise") @ApiOperation("查询近30天扬尘事件") - public Result selectByMonthNaise(){ + public Result selectByMonthNaise() { List buildingRecordsDtos = buildingRecordsMapper.selectByMonthNaise(); - Map map = new HashMap<>(); - map.put("sum",buildingRecordsDtos.size()); - map.put("data",buildingRecordsDtos); + Map map = new HashMap<>(); + map.put("sum", buildingRecordsDtos.size()); + map.put("data", buildingRecordsDtos); Result success = Result.success(map); return success; } /** * 查询近7天工地视频感知事件 + * * @return */ @GetMapping("selectByWeekEvent") @ApiOperation("查询近7天工地视频感知事件") - public Result selectByWeekEvent(){ + public Result selectByWeekEvent() { List events = buildingRecordsMapper.selectByWeekEvent(); events.forEach(eventDto -> { eventDto.setEventNewName(eventDto.getEventCnName()); }); - Map map = new HashMap<>(); - map.put("sum",events.size()); - map.put("data",events); + Map map = new HashMap<>(); + map.put("sum", events.size()); + map.put("data", events); Result success = Result.success(map); return success; } /** * 查询近30天工地视频感知事件 + * * @return */ @GetMapping("selectByMonthEvent") @ApiOperation("查询近30天工地视频感知事件") - public Result selectByMonthEvent(){ + public Result selectByMonthEvent() { List events = buildingRecordsMapper.selectByMonthEvent(); events.forEach(eventDto -> { eventDto.setEventNewName(eventDto.getEventCnName()); }); - Map map = new HashMap<>(); - map.put("sum",events.size()); - map.put("data",events); + Map map = new HashMap<>(); + map.put("sum", events.size()); + map.put("data", events); Result success = Result.success(map); return success; } /** * 查询近30天物联感知事件时间趋势 + * * @return */ @GetMapping("selectMonthCurrentByBuilding") @ApiOperation("查询近30天物联感知事件时间趋势") - public Result selectMonthCurrentByBuilding(){ + public Result selectMonthCurrentByBuilding() { List buildingRecordsDtos = buildingRecordsMapper.selectMonthCurrentByBuilding(); buildingRecordsDtos.forEach(buildingRecordsDto -> { - if (buildingRecordsDto.getNumber() == null){ + if (buildingRecordsDto.getNumber() == null) { buildingRecordsDto.setNumber(0); } }); @@ -416,14 +435,15 @@ public class BuildingController { /** * 查询近30天工地视频感知事件时间趋势 + * * @return */ @GetMapping("selectMonthCurrentByEvent") @ApiOperation("查询近30天工地视频感知事件时间趋势") - public Result selectMonthCurrentByEvent(){ + public Result selectMonthCurrentByEvent() { List buildingRecordsDtos = buildingRecordsMapper.selectMonthCurrentByEvent(); buildingRecordsDtos.forEach(buildingRecordsDto -> { - if (buildingRecordsDto.getNumber() == null){ + if (buildingRecordsDto.getNumber() == null) { buildingRecordsDto.setNumber(0); } }); @@ -433,62 +453,66 @@ public class BuildingController { /** * 查询走航监测top5全部道路污染事件 + * * @return */ @GetMapping("selectRoadDataCountEvent") @ApiOperation("查询走航监测top5全部道路污染事件") - public Result selectRoadDataCountEvent(){ + public Result selectRoadDataCountEvent() { List roadDataDtos = buildingRecordsMapper.selectRoadDataCountEvent(); Integer integer = roadDataMapper.selectCountRoadData(); - Map map = new HashMap<>(); - map.put("sum",integer); - map.put("roadDataDtos",roadDataDtos); + Map map = new HashMap<>(); + map.put("sum", integer); + map.put("roadDataDtos", roadDataDtos); Result success = Result.success(map); return success; } /** * 查询走航监测top5近7天道路污染事件 + * * @return */ @GetMapping("selectRoadDataWeekEvent") @ApiOperation("查询走航监测top5近7天道路污染事件") - public Result selectRoadDataWeekEvent(){ + public Result selectRoadDataWeekEvent() { List roadDataDtos = buildingRecordsMapper.selectRoadDataWeekEvent(); Integer integer = roadDataMapper.selectCountWeekRoadData(); - Map map = new HashMap<>(); - map.put("sum",integer); - map.put("roadDataDtos",roadDataDtos); + Map map = new HashMap<>(); + map.put("sum", integer); + map.put("roadDataDtos", roadDataDtos); Result success = Result.success(map); return success; } /** * 查询走航监测top5近30天道路污染事件 + * * @return */ @GetMapping("selectRoadDataMonthEvent") @ApiOperation("查询走航监测top5近30天道路污染事件") - public Result selectRoadDataMonthEvent(){ + public Result selectRoadDataMonthEvent() { List roadDataDtos = buildingRecordsMapper.selectRoadDataMonthEvent(); Integer integer = roadDataMapper.selectCountMonthRoadData(); - Map map = new HashMap<>(); - map.put("sum",integer); - map.put("roadDataDtos",roadDataDtos); + Map map = new HashMap<>(); + map.put("sum", integer); + map.put("roadDataDtos", roadDataDtos); Result success = Result.success(map); return success; } /** * 查询近30天走航监测事件时间趋势 + * * @return */ @GetMapping("selectMonthCurrentByRoadData") @ApiOperation("查询近30天走航监测事件时间趋势") - public Result selectMonthCurrentByRoadData(){ + public Result selectMonthCurrentByRoadData() { List buildingRecordsDtos = buildingRecordsMapper.selectMonthCurrentByRoadData(); buildingRecordsDtos.forEach(buildingRecordsDto -> { - if (buildingRecordsDto.getNumber() == null){ + if (buildingRecordsDto.getNumber() == null) { buildingRecordsDto.setNumber(0); } }); @@ -497,5 +521,4 @@ public class BuildingController { } - } diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index ac3a2ed..94ee302 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -13,11 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + import java.util.List; @RestController @RequestMapping("api/project") -@Api(tags="视频监控") +@Api(tags = "视频监控") public class Controller { @Autowired @@ -45,7 +46,7 @@ public class Controller { private ChannelPictureMapper channelPictureMapper; @GetMapping("all") - public Object all(){ + public Object all() { List projects = projectMapper.selectList(null); projects.forEach(project -> { List pics = cameraMapper.selectPicByProjectId(project.getId()); @@ -57,10 +58,11 @@ public class Controller { /** * 推送给城管接口用的 + * * @return */ @GetMapping("cameras") - public Result cameras(){ + public Result cameras() { List channelPictureDtos = channelPictureMapper.selectByProject(); Result success = Result.success(channelPictureDtos); success.setCount(channelPictureDtos.size()); @@ -68,11 +70,10 @@ public class Controller { } /** - * * @return */ @GetMapping("camera") - public Result camera(){ + public Result camera() { List pictureDtos = channelPictureMapper.selectByPicture(); Result success = Result.success(pictureDtos); return success; @@ -80,10 +81,11 @@ public class Controller { /** * 景区人流识别 + * * @return */ @GetMapping("scenicCamera") - public Result scenicCamera(){ + public Result scenicCamera() { List scenicCameraDtos = scenicMapper.selectScenicCameras(); Result success = Result.success(scenicCameraDtos); success.setCount(scenicCameraDtos.size()); @@ -91,21 +93,21 @@ public class Controller { } @GetMapping("capture") - public Object capture(){ + public Object capture() { monitorService.CameraScreenshot(); return "finish capture"; } @GetMapping("startScenic") - public Object startScenic(){ + public Object startScenic() { monitorService.startScenic(); return "startScenic finish"; } @GetMapping("capture1") - public Object capture1(){ + public Object capture1() { monitorService.scenicSpotAndBathing1(); return "finish capture"; @@ -114,24 +116,26 @@ public class Controller { /** * 查询所有摄像头 + * * @param * @return */ @GetMapping("selectAll") @ApiOperation("查询所有摄像头") - public String selectAll(){ + public String selectAll() { return cameraChannelService.selectAll(); } /** * 根据channelCode查询摄像头详细信息 + * * @param channelCode * @return */ @GetMapping("selectByChannelCode") @ApiOperation("根据摄像头编号查询摄像头详细信息") - @ApiImplicitParam(name = "channelCode",value = "摄像头标识",required = true,dataType = "String") - public Result selectByChannelCode(String channelCode){ + @ApiImplicitParam(name = "channelCode", value = "摄像头标识", required = true, dataType = "String") + public Result selectByChannelCode(String channelCode) { List list = cameraChannelMapper.selectByChannelCode(channelCode); @@ -144,13 +148,14 @@ public class Controller { /** * 根据摄像头名字模糊查询摄像头 + * * @param channelName * @return */ @GetMapping("selectByChannelName") @ApiOperation("根据摄像头名字模糊查询摄像头") - @ApiImplicitParam(name = "channelName",value = "摄像头名称",required = true,dataType = "String") - public Result selectByChannelName(String channelName){ + @ApiImplicitParam(name = "channelName", value = "摄像头名称", required = true, dataType = "String") + public Result selectByChannelName(String channelName) { List labels = cameraChannelMapper.selectByChannelName(channelName); @@ -161,18 +166,19 @@ public class Controller { /** * 根据parentId和checkStatus查询摄像头 + * * @param parentId * @return */ @GetMapping("selectByParentId") @ApiOperation("根据摄像头的组织Id和异常状态查询摄像头") @ApiImplicitParams({ - @ApiImplicitParam(name = "parentId",value = "摄像头的组织Id",required = true,dataType = "String"), - @ApiImplicitParam(name = "checkStatus",value = "异常状态 1正常,0异常",required = true,dataType = "String") + @ApiImplicitParam(name = "parentId", value = "摄像头的组织Id", required = true, dataType = "String"), + @ApiImplicitParam(name = "checkStatus", value = "异常状态 1正常,0异常", required = true, dataType = "String") }) - public Result selectByParentId(String parentId,String checkStatus){ + public Result selectByParentId(String parentId, String checkStatus) { - List list = cameraChannelMapper.selectByParentId(parentId,checkStatus); + List list = cameraChannelMapper.selectByParentId(parentId, checkStatus); Result success = Result.success(list); @@ -182,16 +188,17 @@ public class Controller { /** * 根据标签查询对应摄像头 + * * @return */ @GetMapping("selectLabel") @ApiOperation("根据标签查询对应摄像头") - @ApiImplicitParam(name = "labelCode",value = "标签号",required = true,dataType = "String") - public Result selectLabel(String labelCode){ + @ApiImplicitParam(name = "labelCode", value = "标签号", required = true, dataType = "String") + public Result selectLabel(String labelCode) { List channelLabelDtos = cameraChannelMapper.selectLabel(labelCode); - for (ChannelLabelDto channelLabelDto :channelLabelDtos) { + for (ChannelLabelDto channelLabelDto : channelLabelDtos) { String nodeName = channelLabelDto.getNodeName(); String[] splits = nodeName.split("->"); String split = splits[1]; @@ -204,19 +211,20 @@ public class Controller { /** * 根据经纬度查询半径内所有的摄像头 + * * @param gpsX * @param gpsY * @param radius * @return */ - @GetMapping ("selectAllByGps") + @GetMapping("selectAllByGps") @ApiOperation("根据经纬度查询半径内所有的摄像头") @ApiImplicitParams({ - @ApiImplicitParam(name = "gpsX", value = "经度",required = true,dataType ="Double"), - @ApiImplicitParam(name = "gpsY", value = "纬度",required = true,dataType ="Double"), - @ApiImplicitParam(name = "radius", value = "半径,米",required = true,dataType ="Integer"),} + @ApiImplicitParam(name = "gpsX", value = "经度", required = true, dataType = "Double"), + @ApiImplicitParam(name = "gpsY", value = "纬度", required = true, dataType = "Double"), + @ApiImplicitParam(name = "radius", value = "半径,米", required = true, dataType = "Integer"),} ) - public Result selectAllByGps(Double gpsX,Double gpsY,Integer radius){ + public Result selectAllByGps(Double gpsX, Double gpsY, Integer radius) { double[] around = LongLatUtil.getAround(gpsX, gpsY, radius); List c = cameraChannelMapper.selectAllByGps(around[0], around[2], around[1], around[3]); Result success = Result.success(c); @@ -225,11 +233,12 @@ public class Controller { /** * 查询所有标签 + * * @return */ @GetMapping("selectAllLabel") @ApiOperation("查询所有标签") - public Result selectAllLabel(){ + public Result selectAllLabel() { List