From 2d678c19984a54b5f53f8d44cb84ea9439465ecd Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Thu, 25 Nov 2021 18:52:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8Cbug=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/dtos/residential/ResidentialDTO.java | 20 +++++++++++++ .../impl/ResidentialServiceImpl.java | 30 ++++++++++++++++++- .../resources/templates/residential/save.html | 2 +- .../templates/residential/update.html | 2 +- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/main/java/cn/com/tenlion/systemhouse/pojo/dtos/residential/ResidentialDTO.java b/src/main/java/cn/com/tenlion/systemhouse/pojo/dtos/residential/ResidentialDTO.java index ffb4635..5f3f260 100644 --- a/src/main/java/cn/com/tenlion/systemhouse/pojo/dtos/residential/ResidentialDTO.java +++ b/src/main/java/cn/com/tenlion/systemhouse/pojo/dtos/residential/ResidentialDTO.java @@ -54,6 +54,8 @@ public class ResidentialDTO { private String phone; @ApiModelProperty(name = "community", value = "社区") private String community; + @ApiModelProperty(name = "communityName", value = "社区") + private String communityName; @ApiModelProperty(name = "remake", value = "备注") private String remake; @@ -87,6 +89,8 @@ public class ResidentialDTO { private String locationCode; @ApiModelProperty(name = "grid", value = "所属网格") private String grid; + @ApiModelProperty(name = "gridName", value = "所属网格") + private String gridName; public String getResidentialId() { return residentialId == null ? "" : residentialId.trim(); @@ -248,6 +252,14 @@ public class ResidentialDTO { this.community = community; } + public String getCommunityName() { + return communityName; + } + + public void setCommunityName(String communityName) { + this.communityName = communityName; + } + public String getRemake() { return remake == null ? "" : remake.trim(); } @@ -359,4 +371,12 @@ public class ResidentialDTO { public void setGrid(String grid) { this.grid = grid; } + + public String getGridName() { + return gridName; + } + + public void setGridName(String gridName) { + this.gridName = gridName; + } } diff --git a/src/main/java/cn/com/tenlion/systemhouse/service/residential/impl/ResidentialServiceImpl.java b/src/main/java/cn/com/tenlion/systemhouse/service/residential/impl/ResidentialServiceImpl.java index 06cdc1e..a781b9f 100644 --- a/src/main/java/cn/com/tenlion/systemhouse/service/residential/impl/ResidentialServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemhouse/service/residential/impl/ResidentialServiceImpl.java @@ -2,9 +2,14 @@ package cn.com.tenlion.systemhouse.service.residential.impl; import cn.com.tenlion.systemhouse.dao.residential.IResidentialDao; import cn.com.tenlion.systemhouse.pojo.bos.residential.ResidentialBO; +import cn.com.tenlion.systemhouse.pojo.dtos.community.CommunityDTO; +import cn.com.tenlion.systemhouse.pojo.dtos.grid.GridDTO; import cn.com.tenlion.systemhouse.pojo.dtos.residential.ResidentialDTO; import cn.com.tenlion.systemhouse.pojo.pos.residential.ResidentialPO; import cn.com.tenlion.systemhouse.pojo.vos.residential.ResidentialVO; +import cn.com.tenlion.systemhouse.service.community.ICommunityService; +import cn.com.tenlion.systemhouse.service.grid.IGridService; +import cn.com.tenlion.systemhouse.service.grid.impl.GridServiceImpl; import cn.com.tenlion.systemhouse.service.residential.IResidentialService; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.exceptions.SearchException; @@ -36,6 +41,10 @@ public class ResidentialServiceImpl extends DefaultBaseService implements IResid private IResidentialDao residentialDao; @Autowired private IAreaService areaService; + @Autowired + private ICommunityService communityService; + @Autowired + private IGridService gridService; @Override public void save(ResidentialVO residentialVO) { @@ -110,6 +119,16 @@ public class ResidentialServiceImpl extends DefaultBaseService implements IResid @Override public ResidentialDTO get(Map params) { ResidentialDTO residentialDTO = residentialDao.get(params); + if(null != residentialDTO) { + CommunityDTO communityDTO = communityService.get(residentialDTO.getCommunity()); + if(null != communityDTO) { + residentialDTO.setCommunityName(communityDTO.getCommunityName()); + } + GridDTO gridDTO = gridService.get(residentialDTO.getGrid()); + if(null != gridDTO) { + residentialDTO.setGridName(gridDTO.getGridName()); + } + } /*if(null != residentialDTO) { AreaDTO area1DTO = getAreaMsg(residentialDTO.getArea1Id()); residentialDTO.setArea1Lng(area1DTO.getAreaLng()); @@ -167,7 +186,16 @@ public class ResidentialServiceImpl extends DefaultBaseService implements IResid @Override public List list(Map params) { - return residentialDao.list(params); + List residentialDTOList =residentialDao.list(params); + if(null != residentialDTOList && residentialDTOList.size() > 0) { + for(ResidentialDTO residentialDTO: residentialDTOList) { + CommunityDTO communityDTO = communityService.get(residentialDTO.getCommunity()); + if(null != communityDTO) { + residentialDTO.setCommunityName(communityDTO.getCommunityName()); + } + } + } + return residentialDTOList; } @Override diff --git a/src/main/resources/templates/residential/save.html b/src/main/resources/templates/residential/save.html index b5293ae..d10d930 100644 --- a/src/main/resources/templates/residential/save.html +++ b/src/main/resources/templates/residential/save.html @@ -122,7 +122,7 @@
- -