From 39794d3cd1b4569f82528fbad23f048d9d1be398 Mon Sep 17 00:00:00 2001 From: fangyuan <527392886@qq.com> Date: 星期三, 11 一月 2023 13:55:52 +0800 Subject: [PATCH] 导出接口 --- ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java | 36 ++++++++++++++++++++++++++++++++---- 1 files changed, 32 insertions(+), 4 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 2bfb1af..084a6b8 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 @@ -5,16 +5,17 @@ import com.ycl.annotation.LogSave; import com.ycl.api.CommonResult; import com.ycl.controller.BaseController; +import com.ycl.dto.caseHandler.QueryForViolationParam; import com.ycl.dto.statistics.UnlawfulDto; import com.ycl.dto.statistics.UnlawfulShopDto; +import com.ycl.utils.EasyExcelUtils; +import com.ycl.vo.casePool.QueryForViolationVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -129,4 +130,31 @@ return CommonResult.success(page); } + @PostMapping("/export/unlawful") + @ApiOperation("鎸夊悇绉嶇粺璁℃柟寮�-瀵煎嚭") + public void export(HttpServletResponse response) { + String sheetName = "鎸夌粺璁℃柟寮�"; + EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, ls); + } + + @PostMapping("/export/shop") + @ApiOperation("闂ㄥ墠涓夊寘-瀵煎嚭") + public void exportShop(HttpServletResponse response) { + List<UnlawfulShopDto> ls = new ArrayList<>(); + ls.add(new UnlawfulShopDto("搴楅摵1", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵2", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵3", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵4", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵5", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵6", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵7", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵8", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵9", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵10", 100, 10, 1, 20, 5, 20, 0.6)); + ls.add(new UnlawfulShopDto("搴楅摵11", 100, 10, 1, 20, 5, 20, 0.7)); + ls.add(new UnlawfulShopDto("搴楅摵12", 100, 10, 1, 20, 5, 20, 0.8)); + ls.add(new UnlawfulShopDto("搴楅摵13", 100, 10, 1, 20, 5, 20, 0.9)); + String sheetName = "闂ㄥ墠涓夊寘"; + EasyExcelUtils.export(response, sheetName, UnlawfulShopDto.class, ls); + } } -- Gitblit v1.8.0