From 7101d85b1c0ef36d534a1e35a2245257dd4cf7a7 Mon Sep 17 00:00:00 2001 From: yingsl Date: Fri, 7 Jan 2022 17:19:30 +0800 Subject: [PATCH] =?UTF-8?q?perf=20=E4=BF=AE=E6=94=B9=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E5=8C=96=E6=A1=A3=E6=A1=88=E5=90=8E=E5=8F=B0=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/modular/toilet/controller/ToiletController.java | 3 ++- .../java/com/example/modular/toilet/service/IToiletService.java | 2 +- .../com/example/modular/toilet/service/impl/ToiletServiceImpl.java | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/example/modular/toilet/controller/ToiletController.java b/src/main/java/com/example/modular/toilet/controller/ToiletController.java index d39ee11..dbe07b2 100644 --- a/src/main/java/com/example/modular/toilet/controller/ToiletController.java +++ b/src/main/java/com/example/modular/toilet/controller/ToiletController.java @@ -147,11 +147,12 @@ public class ToiletController { @GetMapping("/export") @CrossOrigin public void exportToilet (HttpServletRequest request,HttpServletResponse response, @RequestParam(value = "toiletName",required = false)String toiletName, + @RequestParam(value = "areaIds",required = false)String areaIds, @RequestParam(value = "toiletCode",required = false)String toiletCode, @RequestParam(value = "toiletType",required = false)Integer toiletType,@RequestParam(value = "toiletLevel",required = false)Integer toiletLevel, @RequestParam(value = "thirdBathroom",required = false)Integer thirdBathroom,@RequestParam(value = "monChildRoom",required = false)Integer monChildRoom) { String userToken = request.getHeader("token"); - toiletService.exportToilet(userToken,response,toiletName,toiletCode,toiletType,toiletLevel,thirdBathroom,monChildRoom); + toiletService.exportToilet(userToken,response,toiletName,toiletCode,toiletType,toiletLevel,thirdBathroom,monChildRoom,areaIds); } diff --git a/src/main/java/com/example/modular/toilet/service/IToiletService.java b/src/main/java/com/example/modular/toilet/service/IToiletService.java index 7edb9f4..98f2783 100644 --- a/src/main/java/com/example/modular/toilet/service/IToiletService.java +++ b/src/main/java/com/example/modular/toilet/service/IToiletService.java @@ -88,7 +88,7 @@ public interface IToiletService extends IService { * @param monChildRoom * @author ysl */ - void exportToilet(String userToken,HttpServletResponse response,String toiletName,String toiletCode,Integer toiletType,Integer toiletLevel,Integer thirdBathroom,Integer monChildRoom); + void exportToilet(String userToken,HttpServletResponse response,String toiletName,String toiletCode,Integer toiletType,Integer toiletLevel,Integer thirdBathroom,Integer monChildRoom,String areaIds); /** * 根据厕所id查询厕所详细信息 diff --git a/src/main/java/com/example/modular/toilet/service/impl/ToiletServiceImpl.java b/src/main/java/com/example/modular/toilet/service/impl/ToiletServiceImpl.java index 4a09b44..dee3d1d 100644 --- a/src/main/java/com/example/modular/toilet/service/impl/ToiletServiceImpl.java +++ b/src/main/java/com/example/modular/toilet/service/impl/ToiletServiceImpl.java @@ -707,7 +707,8 @@ public class ToiletServiceImpl extends ServiceImpl impleme @Override - public void exportToilet(String userToken,HttpServletResponse response, String toiletName,String toiletCode, Integer toiletType, Integer toiletLevel, Integer thirdBathroom, Integer monChildRoom) { + public void exportToilet(String userToken,HttpServletResponse response, String toiletName,String toiletCode, + Integer toiletType, Integer toiletLevel, Integer thirdBathroom, Integer monChildRoom,String areaIds) { //根据token获取登录账户信息 UserInfoVO userInfoVO = userInfoService.getUserInfo(userToken); if (userInfoVO == null) { @@ -717,6 +718,9 @@ public class ToiletServiceImpl extends ServiceImpl impleme return; } List areaIdList = Arrays.asList(userInfoVO.getRegionIds().split(",")); + if (StringUtils.isNotBlank(areaIds)) { + areaIdList = Arrays.asList(areaIds.split(",")); + } List voList = getVoList (toiletName,toiletCode,toiletType,toiletLevel,thirdBathroom,monChildRoom,areaIdList); // 每次写100行数据,就刷新数据出缓存 SXSSFWorkbook wb = new SXSSFWorkbook(100); // keep 100 rows in memory,