From fd950b875f6824e593c000a79b9518fad386cab6 Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Thu, 16 Nov 2023 11:11:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E6=88=BF?= =?UTF-8?q?=E5=B1=8B=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=EF=BC=8C=E6=89=B9=E9=87=8F=E5=88=9B=E5=BB=BA=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?bug=E4=BF=AE=E6=94=B9=20=20--renpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/building/BuildingController.java | 10 -- .../controller/api/house/HouseController.java | 20 ++++ .../api/building/BuildingAppController.java | 13 --- .../app/api/house/HouseAppController.java | 26 ++++++ .../pojo/dtos/house/AutoHouseDTO.java | 38 ++++++++ .../pojo/vos/building/BuildingBatchVO.java | 89 +++--------------- .../service/building/IBuildingService.java | 34 ------- .../building/impl/BuildingServiceImpl.java | 58 ------------ .../service/house/IHouseService.java | 43 +++++++++ .../service/house/impl/HouseServiceImpl.java | 91 +++++++++++++++++++ .../resources/templates/building/save.html | 2 + .../resources/templates/building/update.html | 2 + 12 files changed, 234 insertions(+), 192 deletions(-) create mode 100644 src/main/java/com/cm/population/pojo/dtos/house/AutoHouseDTO.java diff --git a/src/main/java/com/cm/population/controller/api/building/BuildingController.java b/src/main/java/com/cm/population/controller/api/building/BuildingController.java index 5c6d0d3..ec21392 100644 --- a/src/main/java/com/cm/population/controller/api/building/BuildingController.java +++ b/src/main/java/com/cm/population/controller/api/building/BuildingController.java @@ -9,7 +9,6 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.population.pojo.dtos.building.BuildingDTO; -import com.cm.population.pojo.vos.building.BuildingBatchVO; import com.cm.population.pojo.vos.building.BuildingVO; import com.cm.population.service.building.IBuildingService; import io.swagger.annotations.*; @@ -109,13 +108,4 @@ public class BuildingController extends AbstractController { return new SuccessResultData<>(buildingService.count(params)); } - @ApiOperation(value = "新增楼排管理", notes = "新增楼排管理接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @PostMapping("saveBatch") - @CheckRequestBodyAnnotation - public SuccessResult saveBatch(@RequestBody BuildingBatchVO buildingBatchVO) { - buildingService.saveBatch(buildingBatchVO); - return new SuccessResult(); - } - } \ No newline at end of file diff --git a/src/main/java/com/cm/population/controller/api/house/HouseController.java b/src/main/java/com/cm/population/controller/api/house/HouseController.java index f64a6e1..0188357 100644 --- a/src/main/java/com/cm/population/controller/api/house/HouseController.java +++ b/src/main/java/com/cm/population/controller/api/house/HouseController.java @@ -8,8 +8,10 @@ import com.cm.common.result.ErrorResult; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; +import com.cm.population.pojo.dtos.house.AutoHouseDTO; import com.cm.population.pojo.dtos.house.BatchHouseDTO; import com.cm.population.pojo.dtos.house.HouseDTO; +import com.cm.population.pojo.vos.building.BuildingBatchVO; import com.cm.population.pojo.vos.house.HouseVO; import com.cm.population.service.house.IHouseService; import io.swagger.annotations.*; @@ -131,4 +133,22 @@ public class HouseController extends AbstractController { return houseService.getAllHouse(params); } + @ApiOperation(value = "批量生成房屋", notes = "批量生成房屋接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("saveBatch") + @CheckRequestBodyAnnotation + public SuccessResult saveBatch(@RequestBody BuildingBatchVO buildingBatchVO) { + houseService.saveBatch(buildingBatchVO); + return new SuccessResult(); + } + + @ApiOperation(value = "根据楼栋信息自动生成房屋", notes = "根据楼栋信息自动生成房屋接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("saveAuto") + @CheckRequestBodyAnnotation + public SuccessResult saveAuto(@RequestBody AutoHouseDTO autoHouseDTO) { + houseService.saveAuto(null, autoHouseDTO); + return new SuccessResult(); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/population/controller/app/api/building/BuildingAppController.java b/src/main/java/com/cm/population/controller/app/api/building/BuildingAppController.java index abf5e28..506e717 100644 --- a/src/main/java/com/cm/population/controller/app/api/building/BuildingAppController.java +++ b/src/main/java/com/cm/population/controller/app/api/building/BuildingAppController.java @@ -9,7 +9,6 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.population.pojo.dtos.building.BuildingDTO; -import com.cm.population.pojo.vos.building.BuildingBatchVO; import com.cm.population.pojo.vos.building.BuildingVO; import com.cm.population.service.building.IBuildingService; import io.swagger.annotations.*; @@ -121,16 +120,4 @@ public class BuildingAppController extends AbstractController { return new SuccessResultData<>(buildingService.count(params)); } - @ApiOperation(value = "新增楼排管理", notes = "新增楼排管理接口") - @ApiImplicitParams({ - @ApiImplicitParam(name = "token", value = "token", paramType = "header") - }) - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @PostMapping("saveBatch") - @CheckRequestBodyAnnotation - public SuccessResult saveBatch(@RequestHeader("token") String token, @RequestBody BuildingBatchVO buildingBatchVO) { - buildingService.saveBatch(token, buildingBatchVO); - return new SuccessResult(); - } - } \ No newline at end of file diff --git a/src/main/java/com/cm/population/controller/app/api/house/HouseAppController.java b/src/main/java/com/cm/population/controller/app/api/house/HouseAppController.java index 08f5462..858d0aa 100644 --- a/src/main/java/com/cm/population/controller/app/api/house/HouseAppController.java +++ b/src/main/java/com/cm/population/controller/app/api/house/HouseAppController.java @@ -8,7 +8,9 @@ import com.cm.common.result.ErrorResult; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; +import com.cm.population.pojo.dtos.house.AutoHouseDTO; import com.cm.population.pojo.dtos.house.HouseDTO; +import com.cm.population.pojo.vos.building.BuildingBatchVO; import com.cm.population.pojo.vos.house.HouseVO; import com.cm.population.service.house.IHouseService; import io.swagger.annotations.*; @@ -120,4 +122,28 @@ public class HouseAppController extends AbstractController { return new SuccessResultData<>(houseService.count(params)); } + @ApiOperation(value = "批量生成房屋", notes = "批量生成房屋接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("saveBatch") + @CheckRequestBodyAnnotation + public SuccessResult saveBatch(@RequestHeader("token") String token, @RequestBody BuildingBatchVO buildingBatchVO) { + houseService.saveBatch(token, buildingBatchVO); + return new SuccessResult(); + } + + @ApiOperation(value = "根据楼栋信息自动生成房屋", notes = "根据楼栋信息自动生成房屋接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("saveAuto") + @CheckRequestBodyAnnotation + public SuccessResult saveAuto(@RequestHeader("token") String token, @RequestBody AutoHouseDTO autoHouseDTO) { + houseService.saveAuto(token, autoHouseDTO); + return new SuccessResult(); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/population/pojo/dtos/house/AutoHouseDTO.java b/src/main/java/com/cm/population/pojo/dtos/house/AutoHouseDTO.java new file mode 100644 index 0000000..118b194 --- /dev/null +++ b/src/main/java/com/cm/population/pojo/dtos/house/AutoHouseDTO.java @@ -0,0 +1,38 @@ +package com.cm.population.pojo.dtos.house; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + +/** + * @ClassName: HouseDTO + * @Description: 房院管理 + * @Author: CodeFactory + * @Date: 2023-10-25 14:47:44 + * @Version: 3.0 + **/ +@ApiModel +public class AutoHouseDTO { + + @ApiModelProperty(name = "buildingId", value = "楼/排ID") + private String buildingId; + @ApiModelProperty(name = "floorUnitHouseCount", value = "每单元每层户数") + private Integer floorUnitHouseCount; + + public String getBuildingId() { + return buildingId; + } + + public void setBuildingId(String buildingId) { + this.buildingId = buildingId; + } + + public Integer getFloorUnitHouseCount() { + return floorUnitHouseCount; + } + + public void setFloorUnitHouseCount(Integer floorUnitHouseCount) { + this.floorUnitHouseCount = floorUnitHouseCount; + } +} diff --git a/src/main/java/com/cm/population/pojo/vos/building/BuildingBatchVO.java b/src/main/java/com/cm/population/pojo/vos/building/BuildingBatchVO.java index 4384806..fb0b0ca 100644 --- a/src/main/java/com/cm/population/pojo/vos/building/BuildingBatchVO.java +++ b/src/main/java/com/cm/population/pojo/vos/building/BuildingBatchVO.java @@ -1,7 +1,5 @@ package com.cm.population.pojo.vos.building; -import com.cm.common.annotation.CheckNumberAnnotation; -import com.cm.population.pojo.vos.house.HouseVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -32,25 +30,10 @@ public class BuildingBatchVO { private String residentialId; @ApiModelProperty(name = "residentialName", value = "所在小区名称") private String residentialName; - @ApiModelProperty(name = "name", value = "楼排名称") - private String name; - @ApiModelProperty(name = "buildNum", value = "楼/排号") - @CheckNumberAnnotation(name = "楼/排号") - private Integer buildNum; - @ApiModelProperty(name = "floorsNum", value = "楼层数") - @CheckNumberAnnotation(name = "楼层数") - private Integer floorsNum; - @ApiModelProperty(name = "unitNum", value = "单元/排数") - @CheckNumberAnnotation(name = "单元/排数") - private Integer unitNum; - @ApiModelProperty(name = "address", value = "详细地址") - private String address; - @ApiModelProperty(name = "longitude", value = "经度") - private String longitude; - @ApiModelProperty(name = "latitude", value = "纬度") - private String latitude; - @ApiModelProperty(name = "image", value = "图片") - private String image; + @ApiModelProperty(name = "buildingId", value = "楼栋ID") + private String buildingId; + @ApiModelProperty(name = "buildingName", value = "楼栋名称") + private String buildingName; @ApiModelProperty(name = "resultList", value = "批量录入房屋信息") private List resultList; @@ -86,68 +69,20 @@ public class BuildingBatchVO { this.residentialName = residentialName; } - public String getName() { - return name == null ? "" : name.trim(); + public String getBuildingId() { + return buildingId; } - public void setName(String name) { - this.name = name; + public void setBuildingId(String buildingId) { + this.buildingId = buildingId; } - public Integer getBuildNum() { - return buildNum == null ? 0 : buildNum; + public String getBuildingName() { + return buildingName; } - public void setBuildNum(Integer buildNum) { - this.buildNum = buildNum; - } - - public Integer getFloorsNum() { - return floorsNum == null ? 0 : floorsNum; - } - - public void setFloorsNum(Integer floorsNum) { - this.floorsNum = floorsNum; - } - - public Integer getUnitNum() { - return unitNum; - } - - public void setUnitNum(Integer unitNum) { - this.unitNum = unitNum; - } - - public String getAddress() { - return address == null ? "" : address.trim(); - } - - public void setAddress(String address) { - this.address = address; - } - - public String getLongitude() { - return longitude == null ? "" : longitude.trim(); - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - public String getLatitude() { - return latitude == null ? "" : latitude.trim(); - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getImage() { - return image == null ? "" : image.trim(); - } - - public void setImage(String image) { - this.image = image; + public void setBuildingName(String buildingName) { + this.buildingName = buildingName; } public String getStreet() { diff --git a/src/main/java/com/cm/population/service/building/IBuildingService.java b/src/main/java/com/cm/population/service/building/IBuildingService.java index dd2754d..803aba1 100644 --- a/src/main/java/com/cm/population/service/building/IBuildingService.java +++ b/src/main/java/com/cm/population/service/building/IBuildingService.java @@ -186,38 +186,4 @@ public interface IBuildingService { */ Integer count(Map params); - /** - * 批量新增房屋信息 - * - * @param buildingBatchVO - * @return - */ - void saveBatch(BuildingBatchVO buildingBatchVO); - - /** - * 新增楼排管理 - * - * @param token - * @param buildingBatchVO - * @return - */ - void saveBatch(String token, BuildingBatchVO buildingBatchVO); - - /** - * 新增楼排管理 - * - * @param buildingBatchVO - * @return buildingId - */ - String saveBatchReturnId(BuildingBatchVO buildingBatchVO); - - /** - * 新增楼排管理 - * - * @param token - * @param buildingBatchVO - * @return buildingId - */ - String saveBatchReturnId(String token, BuildingBatchVO buildingBatchVO); - } \ No newline at end of file diff --git a/src/main/java/com/cm/population/service/building/impl/BuildingServiceImpl.java b/src/main/java/com/cm/population/service/building/impl/BuildingServiceImpl.java index 959dc64..9bccc77 100644 --- a/src/main/java/com/cm/population/service/building/impl/BuildingServiceImpl.java +++ b/src/main/java/com/cm/population/service/building/impl/BuildingServiceImpl.java @@ -200,62 +200,4 @@ public class BuildingServiceImpl extends AbstractService implements IBuildingSer return count == null ? 0 : count; } - @Override - public void saveBatch(BuildingBatchVO buildingBatchVO) { - saveBatchReturnId(buildingBatchVO); - } - - @Override - public void saveBatch(String token, BuildingBatchVO buildingBatchVO) { - saveBatchReturnId(token, buildingBatchVO); - } - - @Override - public String saveBatchReturnId(BuildingBatchVO buildingBatchVO) { - return saveBatchReturnId(null, buildingBatchVO); - } - - @Override - public String saveBatchReturnId(String token, BuildingBatchVO buildingBatchVO) { - String buildingId = UUIDUtil.getUUID(); - Map params = null; - try { - params = HashMapUtil.beanToMap(buildingBatchVO); - } catch (Exception e) { - e.printStackTrace(); - } - params.put("buildingId", buildingId); - if (StringUtils.isBlank(token)) { - setSaveInfo(params); - } else { - setSaveInfo(token, params); - } - buildingDao.save(params); - - List resultList = buildingBatchVO.getResultList(); - if (null != resultList && resultList.size() > 0) { - for (BuildingBatchVO.BatchVO batchVO : resultList) { - for (BuildingBatchVO.FloorVO floorVO : batchVO.getFloorList()) { - for (BuildingBatchVO.HouseVO houseVO : floorVO.getHouseList()) { - HouseVO insertHouseVO = new HouseVO(); - // 基本信息 - insertHouseVO.setResidentialId(buildingBatchVO.getResidentialId()); - insertHouseVO.setResidentialName(buildingBatchVO.getResidentialName()); - insertHouseVO.setStreet(buildingBatchVO.getStreet()); - insertHouseVO.setStreetName(buildingBatchVO.getStreetName()); - insertHouseVO.setCommunity(buildingBatchVO.getCommunity()); - insertHouseVO.setCommunityName(buildingBatchVO.getCommunityName()); - - insertHouseVO.setBuildingId(buildingId); - insertHouseVO.setAffiliatedUnit(batchVO.getUnitValue()); - insertHouseVO.setAffiliationFloors(floorVO.getFloorValue()); - insertHouseVO.setHouseNum(houseVO.getHouseValue()); - houseService.save(insertHouseVO); - } - } - } - } - return buildingId; - } - } \ No newline at end of file diff --git a/src/main/java/com/cm/population/service/house/IHouseService.java b/src/main/java/com/cm/population/service/house/IHouseService.java index 972b370..7af35cb 100644 --- a/src/main/java/com/cm/population/service/house/IHouseService.java +++ b/src/main/java/com/cm/population/service/house/IHouseService.java @@ -3,9 +3,11 @@ package com.cm.population.service.house; import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResultList; import com.cm.population.pojo.bos.house.HouseBO; +import com.cm.population.pojo.dtos.house.AutoHouseDTO; import com.cm.population.pojo.dtos.house.BatchHouseDTO; import com.cm.population.pojo.dtos.house.HouseDTO; import com.cm.population.pojo.pos.house.HousePO; +import com.cm.population.pojo.vos.building.BuildingBatchVO; import com.cm.population.pojo.vos.house.HouseVO; import java.util.List; @@ -189,4 +191,45 @@ public interface IHouseService { List listByPopulationInfoId(String populationInfoId); BatchHouseDTO getAllHouse(Map params); + + /** + * 批量新增房屋信息 + * + * @param buildingBatchVO + * @return + */ + void saveBatch(BuildingBatchVO buildingBatchVO); + + /** + * 新增楼排管理 + * + * @param token + * @param buildingBatchVO + * @return + */ + void saveBatch(String token, BuildingBatchVO buildingBatchVO); + + /** + * 新增楼排管理 + * + * @param buildingBatchVO + * @return buildingId + */ + String saveBatchReturnId(BuildingBatchVO buildingBatchVO); + + /** + * 新增楼排管理 + * + * @param token + * @param buildingBatchVO + * @return buildingId + */ + String saveBatchReturnId(String token, BuildingBatchVO buildingBatchVO); + + /** + * 自动生成房屋信息 + * @param token + * @param autoHouseDTO + */ + void saveAuto(String token, AutoHouseDTO autoHouseDTO); } \ No newline at end of file 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 6b50e30..4107a28 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 @@ -9,10 +9,12 @@ import com.cm.common.utils.UUIDUtil; import com.cm.population.dao.house.IHouseDao; import com.cm.population.pojo.bos.house.HouseBO; import com.cm.population.pojo.dtos.building.BuildingDTO; +import com.cm.population.pojo.dtos.house.AutoHouseDTO; import com.cm.population.pojo.dtos.house.BatchHouseDTO; import com.cm.population.pojo.dtos.house.HouseDTO; import com.cm.population.pojo.dtos.residential.ResidentialDTO; import com.cm.population.pojo.pos.house.HousePO; +import com.cm.population.pojo.vos.building.BuildingBatchVO; import com.cm.population.pojo.vos.house.HouseVO; import com.cm.population.service.building.IBuildingService; import com.cm.population.service.house.IHouseService; @@ -289,4 +291,93 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { return batchHouseDTO; } + @Override + public void saveBatch(BuildingBatchVO buildingBatchVO) { + saveBatchReturnId(buildingBatchVO); + } + + @Override + public void saveBatch(String token, BuildingBatchVO buildingBatchVO) { + saveBatchReturnId(token, buildingBatchVO); + } + + @Override + public String saveBatchReturnId(BuildingBatchVO buildingBatchVO) { + return saveBatchReturnId(null, buildingBatchVO); + } + + @Override + public String saveBatchReturnId(String token, BuildingBatchVO buildingBatchVO) { + String buildingId = buildingBatchVO.getBuildingId(); + String buildingName = buildingBatchVO.getBuildingName(); + + BuildingDTO buildingDTO = buildingService.get(buildingId); + + if (null != buildingDTO) { + List resultList = buildingBatchVO.getResultList(); + if (null != resultList && resultList.size() > 0) { + for (BuildingBatchVO.BatchVO batchVO : resultList) { + for (BuildingBatchVO.FloorVO floorVO : batchVO.getFloorList()) { + for (BuildingBatchVO.HouseVO houseVO : floorVO.getHouseList()) { + HouseVO insertHouseVO = new HouseVO(); + // 基本信息 + insertHouseVO.setResidentialId(buildingDTO.getResidentialId()); + insertHouseVO.setResidentialName(buildingDTO.getResidentialName()); + insertHouseVO.setStreet(buildingDTO.getStreet()); + insertHouseVO.setStreetName(buildingDTO.getStreetName()); + insertHouseVO.setCommunity(buildingDTO.getCommunity()); + insertHouseVO.setCommunityName(buildingDTO.getCommunityName()); + insertHouseVO.setBuildingId(buildingId); + insertHouseVO.setBuildingName(buildingDTO.getName()); + + insertHouseVO.setAffiliationUnit(Integer.valueOf(batchVO.getUnitValue())); + insertHouseVO.setAffiliationFloors(floorVO.getFloorValue()); + insertHouseVO.setHouseNum(houseVO.getHouseValue()); + saveReturnId(token, insertHouseVO); + } + } + } + } + } + return buildingId; + } + + @Override + public void saveAuto(String token, AutoHouseDTO autoHouseDTO) { + String buildingId = autoHouseDTO.getBuildingId(); + + BuildingDTO buildingDTO = buildingService.get(buildingId); + if (null != buildingDTO) { + // 楼层数 + int floorsNum = buildingDTO.getFloorsNum(); + // 单元数 + int unitNum = buildingDTO.getUnitNum(); + + int houseCount = autoHouseDTO.getFloorUnitHouseCount(); + + for (int unit = 1; unit <= unitNum; unit++) { + for (int floor = 1; floor <= floorsNum; floor++) { + HouseVO houseVO = new HouseVO(); + // 基本信息:街道、社区、小区、楼栋 + houseVO.setStreet(buildingDTO.getStreet()); + houseVO.setStreetName(buildingDTO.getStreetName()); + houseVO.setCommunity(buildingDTO.getCommunity()); + houseVO.setCommunityName(buildingDTO.getCommunityName()); + houseVO.setResidentialId(buildingDTO.getResidentialId()); + houseVO.setResidentialName(buildingDTO.getResidentialName()); + houseVO.setBuildingId(buildingDTO.getBuildingId()); + houseVO.setBuildingName(buildingDTO.getName()); + + // 房屋信息:单元、楼层、房号 + houseVO.setAffiliationUnit(unit); + houseVO.setAffiliationFloors(String.valueOf(floor)); + for (int house = 1; house <= houseCount; house++) { + houseVO.setHouseNum(floor + "0" + house); + save(token, houseVO); + } + } + } + } + } + } \ No newline at end of file diff --git a/src/main/resources/templates/building/save.html b/src/main/resources/templates/building/save.html index c871e5e..8726137 100644 --- a/src/main/resources/templates/building/save.html +++ b/src/main/resources/templates/building/save.html @@ -372,8 +372,10 @@ // 设置所在街道和社区的选中值 var streetName = $('#street').find("option:selected").text(); var communityName = $('#community').find("option:selected").text(); + var residentialName = $('#residentialId').find("option:selected").text(); formData.field.streetName = streetName; formData.field.communityName = communityName; + formData.field.residentialName = residentialName; top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); diff --git a/src/main/resources/templates/building/update.html b/src/main/resources/templates/building/update.html index 09610b1..cdc6b78 100644 --- a/src/main/resources/templates/building/update.html +++ b/src/main/resources/templates/building/update.html @@ -403,8 +403,10 @@ // 设置所在街道和社区的选中值 var streetName = $('#street').find("option:selected").text(); var communityName = $('#community').find("option:selected").text(); + var residentialName = $('#residentialId').find("option:selected").text(); formData.field.streetName = streetName; formData.field.communityName = communityName; + formData.field.residentialName = residentialName; top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index);