From 62a35b4e6062592f2c516dd939a33d6d2ca0dff6 Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Fri, 17 Nov 2023 11:06:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D=E6=A5=BC?= =?UTF-8?q?=E6=A0=8B=E7=9A=84=E6=89=80=E6=9C=89=E6=88=BF=E5=B1=8B=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=20=20--renpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cm/population/pojo/dtos/house/BatchHouseDTO.java | 10 ++++++++++ .../service/house/impl/HouseServiceImpl.java | 8 ++++++++ 2 files changed, 18 insertions(+) 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); } }