From ca9993fef57153582a5ff961345d3fae43b9996a Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Fri, 17 Nov 2023 15:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=20=20--renpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/house/impl/HouseServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java b/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java index 65d9133..f27bf59 100644 --- a/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java +++ b/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java @@ -295,15 +295,17 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { if (i == houseDTO.getAffiliationFloors()) { if (null != houseDTO.getAffiliatedUnit()) { if (j == houseDTO.getAffiliationUnit()) { - // 获取当前房屋内的人数 - Integer count = populationService.count(params); - house.setPopulationCount(count); house.setIsCreator(0); + house.setPopulationCount(0); house.setHouseId(houseDTO.getHouseId()); house.setName(houseDTO.getHouseNum().toString()); house.setGmtCreate(houseDTO.getGmtCreate()); - if(userId.equals(houseDTO.getCreator())) { + if(userId.equals(houseDTO.getCreator()) || isAdmin()) { house.setIsCreator(1); + // 获取当前房屋内的人数 + params.put("houseId", houseDTO.getHouseId()); + Integer count = populationService.count(params); + house.setPopulationCount(count); } houseList.add(house); }