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); }