From c4aa721a61edb5ff4502d621897c266b98ef3d1c Mon Sep 17 00:00:00 2001 From: baizonghao <1719256278@qq.com> Date: 星期五, 24 二月 2023 11:18:58 +0800 Subject: [PATCH] 按报警点位统计,按区域统计 --- ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java | 62 +++++++++++++++++++++++++++---- 1 files changed, 54 insertions(+), 8 deletions(-) diff --git a/ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java b/ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java index 467a9b9..f37dedc 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java @@ -82,18 +82,29 @@ return CommonResult.success(page); } - /*@GetMapping("/unlawful/point") + @GetMapping("/unlawful/point") @ApiOperation("鎸夌偣浣嶇粺璁�") @LogSave(operationType = "鎸夌偣浣嶇粺璁�", contain = "鏌ヨ") public CommonResult<IPage<UnlawfulDto>> searchByPoint(@RequestParam(required = true) Integer currentPage, @RequestParam(required = true) Integer pageSize, @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime beginTime, @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) { + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + String startTime = null; + String endTime1 = null; + if (beginTime != null){ + startTime = beginTime.format(fmt); + } + if (endTime != null){ + endTime1 = beginTime.format(fmt); + } IPage<UnlawfulDto> page = new Page<>(); - page.setTotal(ls.size()); - page.setRecords(ls); + List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulBySite((currentPage - 1) * pageSize, pageSize, startTime, endTime1); + + page.setTotal(unlawfulByType.size()); + page.setRecords(unlawfulByType); return CommonResult.success(page); - }*/ + } /*@GetMapping("/unlawful/time") @ApiOperation("鎸夋椂闂寸粺璁�") @@ -108,18 +119,29 @@ return CommonResult.success(page); }*/ - /*@GetMapping("/unlawful/area") + @GetMapping("/unlawful/area") @ApiOperation("鎸夊尯鍩熺粺璁�") @LogSave(operationType = "鎸夊尯鍩熺粺璁�", contain = "鏌ヨ") public CommonResult<IPage<UnlawfulDto>> searchByArea(@RequestParam(required = true) Integer currentPage, @RequestParam(required = true) Integer pageSize, @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime beginTime, @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) { + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + String startTime = null; + String endTime1 = null; + if (beginTime != null){ + startTime = beginTime.format(fmt); + } + if (endTime != null){ + endTime1 = beginTime.format(fmt); + } IPage<UnlawfulDto> page = new Page<>(); - page.setTotal(ls.size()); - page.setRecords(ls); + List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulBySite((currentPage - 1) * pageSize, pageSize, startTime, endTime1); + + page.setTotal(unlawfulByType.size()); + page.setRecords(unlawfulByType); return CommonResult.success(page); - }*/ + } /*@GetMapping("/unlawful/shop") @ApiOperation("闂ㄥ墠涓夊寘缁熻") @@ -156,6 +178,30 @@ EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulByTypeExport); } + @PostMapping("/export/unlawful/type") + @ApiOperation("鎸夊悇绉嶇粺璁℃柟寮�-瀵煎嚭") + public void exportType(HttpServletResponse response) { + List<UnlawfulDto> unlawfulByTypeExport = unlawfulService.getUnlawfulByTypeExport(); + String sheetName = "鎸夌粺璁℃柟寮�"; + EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulByTypeExport); + } + + @PostMapping("/export/unlawful/street") + @ApiOperation("鎸夊悇绉嶇粺璁℃柟寮�-瀵煎嚭") + public void exportStreet(HttpServletResponse response) { + List<UnlawfulDto> unlawfulByStreetExport = unlawfulService.getUnlawfulByStreetExport(); + String sheetName = "鎸夌粺璁℃柟寮�"; + EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulByStreetExport); + } + + @PostMapping("/export/unlawful/site") + @ApiOperation("鎸夊悇绉嶇粺璁℃柟寮�-瀵煎嚭") + public void exportSite(HttpServletResponse response) { + List<UnlawfulDto> unlawfulBySiteExport = unlawfulService.getUnlawfulBySiteExport(); + String sheetName = "鎸夌粺璁℃柟寮�"; + EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulBySiteExport); + } + /*@PostMapping("/export/shop") @ApiOperation("闂ㄥ墠涓夊寘-瀵煎嚭") public void exportShop(HttpServletResponse response) { -- Gitblit v1.8.0