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,