diff --git a/src/main/java/com/cm/population/pojo/dtos/house/BatchHouseDTO.java b/src/main/java/com/cm/population/pojo/dtos/house/BatchHouseDTO.java index f4671d2..d9984b0 100644 --- a/src/main/java/com/cm/population/pojo/dtos/house/BatchHouseDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/house/BatchHouseDTO.java @@ -102,6 +102,8 @@ public class BatchHouseDTO { private String name; @ApiModelProperty(name = "gmtCreate", value = "创建时间") private String gmtCreate; + @ApiModelProperty(name = "isCreator", value = "是否时创建人") + private Integer isCreator; public String getHouseId() { return houseId; @@ -126,6 +128,14 @@ public class BatchHouseDTO { public void setGmtCreate(String gmtCreate) { this.gmtCreate = gmtCreate; } + + public Integer getIsCreator() { + return isCreator; + } + + public void setIsCreator(Integer isCreator) { + this.isCreator = isCreator; + } } } 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 60d6793..363d31d 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 @@ -259,6 +259,10 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { @Override public BatchHouseDTO getAllHouse(Map params) { + // 获取当前登陆人ID + UserInfoBO userInfoBO = this.securityComponent.getCurrentUser(); + String userId = userInfoBO.getUserId(); + BatchHouseDTO batchHouseDTO = new BatchHouseDTO(); // 获取楼栋信息 BuildingDTO buildingDTO = buildingService.get(params.get("buildingId").toString()); @@ -291,9 +295,13 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { if (i == houseDTO.getAffiliationFloors()) { if (null != houseDTO.getAffiliatedUnit()) { if (j == houseDTO.getAffiliationUnit()) { + house.setIsCreator(0); house.setHouseId(houseDTO.getHouseId()); house.setName(houseDTO.getHouseNum().toString()); house.setGmtCreate(houseDTO.getGmtCreate()); + if(userId.equals(houseDTO.getCreator())) { + house.setIsCreator(1); + } houseList.add(house); } }