Browse Source

Merge remote-tracking branch 'remotes/origin/dev_optimize' into develop

master
jianjun 3 years ago
parent
commit
d3736065fc
  1. 29
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBuildingListFormDTO.java
  2. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java
  3. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java
  4. 69
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java
  5. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java
  6. 63
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodListFormDTO.java
  7. 89
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java
  8. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java
  9. 35
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBuildingListResultDTO.java
  10. 37
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java
  11. 29
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  12. 52
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  13. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  14. 33
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  15. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  16. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  17. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
  18. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java
  19. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  20. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  21. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java
  22. 52
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  23. 53
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  24. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  25. 59
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  26. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx
  27. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx
  28. 23
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  29. 9
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  30. 28
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

29
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBuildingListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* desc: 楼宇列表查询条件
*
* @return
* @author LiuJanJun
* @date 2022/4/13 2:45 下午
*/
@Data
public class IcBuildingListFormDTO extends PageFormDTO {
private static final long serialVersionUID = -7536532648656861790L;
/**
* 小区ID
*/
private String neighborHoodId;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java → epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java

@ -27,7 +27,7 @@ import java.io.Serializable;
@Data @Data
public class IcBulidingFormDTO implements Serializable { public class IcBulidingAddFormDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java → epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java

@ -26,7 +26,7 @@ import java.io.Serializable;
@Data @Data
public class IcHouseFormDTO implements Serializable { public class IcHouseAddFormDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

69
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java

@ -0,0 +1,69 @@
package com.epmet.dto.form;/**
* Created by 11 on 2020/3/19.
*/
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Description 小区房屋列表查询条件
* @ClassName ListCustomerGridFormDTO
* @Author wangc
* @date 2020.03.19 15:00
*/
@Data
public class IcHouseListFormDTO extends PageFormDTO {
private static final long serialVersionUID = -1L;
/**
* 组织类别
*/
private String level;
private String id;
/**
* 组织ID
*/
private String agencyId;
private String pids;
private String gridId;
/**
* 小区名字
*/
private String neighborHoodName;
/**
* 楼栋名字
*/
private String buildingName;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房屋状态 1出租 0自住 2闲置
*/
private String rentFlag;
/**
* 楼栋ID
*/
private String buildingId;
/**
* 小区ID
*/
private String neighborHoodId;
/**
* 搜索关键词社区查询搜索输入的关键词
*/
private String keyword;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java → epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java

@ -27,7 +27,7 @@ import javax.validation.constraints.NotBlank;
@Data @Data
public class IcNeighborHoodFormDTO extends PageFormDTO { public class IcNeighborHoodAddFormDTO extends PageFormDTO {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

63
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodListFormDTO.java

@ -0,0 +1,63 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class IcNeighborHoodListFormDTO extends PageFormDTO {
private static final long serialVersionUID = 1L;
/**
* 组织类别
*/
@NotBlank(message = "组织类别不能为空")
private String level;
/**
* orgId 跟level配套使用
*/
@NotBlank(message = "组织Id不能为空")
private String id;
/**
* 组织ID
*/
private String agencyId;
private String pids;
private String gridId;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
}

89
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java

@ -1,89 +0,0 @@
package com.epmet.dto.form;/**
* Created by 11 on 2020/3/19.
*/
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
/**
* @Description 陌生人导览查询附近网格传参定义
* @ClassName ListCustomerGridFormDTO
* @Author wangc
* @date 2020.03.19 15:00
*/
@Data
public class ListIcNeighborHoodFormDTO implements Serializable{
private static final long serialVersionUID = -1L;
/**
* 当前页
* */
private Integer pageNo = 1;
/**
* 每页显示数量
* */
private Integer pageSize = 20;
/**
* 组织类别
*/
private String level ;
private String id;
/**
* 组织ID
*/
// private String agencyId;
/**
* 网格ID
*/
// private String gridId;
/**
* 小区名字
*/
// private String neighborHoodName;
/**
* 楼栋名字
*/
// private String buildingName;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房屋状态 1出租 0自住 2闲置
*/
private String rentFlag;
/**
* 数据类型小区neighbourHood楼栋building房屋house
*/
// @Pattern(regexp = "^(neighbourHood|building|house)?$",message = "数据类型选择错误")
// private String dataType;
/**
* 楼栋ID
*/
private String buildingId;
/**
* 小区ID
*/
private String neighborHoodId;
/**
* 搜索关键词社区查询搜索输入的关键词
*/
private String keyword;
}

17
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseResultDTO.java

@ -1,17 +0,0 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/10/25 16:58
*/
@Data
public class HouseResultDTO implements Serializable {
private static final long serialVersionUID = 8054109017922254586L;
private String houseId;
private String houseName;
}

35
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBuildingListResultDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* desc:楼宇列表结果类
*
* @author: LiuJanJun
* @date: 2022/4/13 2:28 下午
* @version: 1.0
*/
@NoArgsConstructor
@Data
public class IcBuildingListResultDTO extends PageFormDTO {
private static final long serialVersionUID = -8277921228438123299L;
private String gridName;
private Integer totalHouseNum;
private String latitude;
private String agencyId;
private Integer sort;
private String agencyName;
private String buildingId;
private String buildingName;
private String buildingTypeKey;
private String neighborHoodId;
private String neighborHoodName;
private Integer totalFloorNum;
private String gridId;
private Integer totalUnitNum;
private String longitude;
private String buildingType;
}

37
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java

@ -1,10 +1,8 @@
package com.epmet.dto.result; package com.epmet.dto.result;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/** /**
* @Description 网格列表信息 * @Description 网格列表信息
@ -12,25 +10,22 @@ import java.util.Map;
* @Author wangc * @Author wangc
* @date 2020.04.23 14:21 * @date 2020.04.23 14:21
*/ */
@NoArgsConstructor
@Data @Data
public class IcNeighborHoodResultDTO implements Serializable { public class IcNeighborHoodResultDTO extends PageFormDTO {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 总条数
* */
private Integer total;
// /**
// * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】
// * */
// private String dataType;
/**
* 结果集
*/
private List<Map<String,Object>> list;
private String gridName;
private String address;
private String neighborHoodId;
private String neighborHoodName;
private String latitude;
private String remark;
private String agencyId;
private String location;
private String gridId;
private String propertyId;
private String agencyName;
private String longitude;
} }

29
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -33,10 +34,7 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.*;
import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.entity.IcBuildingUnitEntity; import com.epmet.entity.IcBuildingUnitEntity;
import com.epmet.excel.IcBuildingExcel; import com.epmet.excel.IcBuildingExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -75,19 +73,17 @@ public class BuildingController {
@PostMapping("buildinglist") @PostMapping("buildinglist")
public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ public Result<PageData<IcBuildingListResultDTO>> houseList(@RequestBody IcBuildingListFormDTO formDTO){
//效验数据 PageData<IcBuildingListResultDTO> icNeighborHoodResultDTO = buildingService.listBuilding(formDTO);
ValidatorUtils.validateEntity(formDTO);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = buildingService.listBuilding(formDTO);
return new Result().ok(icNeighborHoodResultDTO); return new Result().ok(icNeighborHoodResultDTO);
} }
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("buildingadd") @PostMapping("buildingadd")
public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.AddShowGroup.class); ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.AddShowGroup.class);
String customerId = tokenDTO.getCustomerId(); String customerId = tokenDTO.getCustomerId();
buildingService.addBuilding(customerId,formDTO); buildingService.addBuilding(customerId,formDTO);
return new Result().ok("保存成功"); return new Result().ok("保存成功");
@ -95,9 +91,9 @@ public class BuildingController {
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("buildingupdate") @PostMapping("buildingupdate")
public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.UpdateShowGroup.class); ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.UpdateShowGroup.class);
String customerId = tokenDTO.getCustomerId(); String customerId = tokenDTO.getCustomerId();
// String customerId = "123123"; // String customerId = "123123";
buildingService.updateBuilding(customerId,formDTO); buildingService.updateBuilding(customerId,formDTO);
@ -105,9 +101,9 @@ public class BuildingController {
} }
@PostMapping("buildingdel") @PostMapping("buildingdel")
public Result buildingDel(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ public Result buildingDel(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingAddFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcBulidingFormDTO.DeleteGroup.class); ValidatorUtils.validateEntity(formDTO, IcBulidingAddFormDTO.DeleteGroup.class);
String buildingId = formDTO.getBuildingId(); String buildingId = formDTO.getBuildingId();
buildingService.delBuilding(buildingId); buildingService.delBuilding(buildingId);
return new Result(); return new Result();
@ -137,7 +133,6 @@ public class BuildingController {
*/ */
@PostMapping("exporttemplate") @PostMapping("exporttemplate")
public void exportTemplate( HttpServletResponse response) throws Exception { public void exportTemplate( HttpServletResponse response) throws Exception {
TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx"); TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("maplist",new ArrayList<IcBuildingExcel>()); map.put("maplist",new ArrayList<IcBuildingExcel>());
@ -151,7 +146,7 @@ public class BuildingController {
* @throws Exception * @throws Exception
*/ */
@RequestMapping("exportbuildinginfo") @RequestMapping("exportbuildinginfo")
public void exportbuildinginfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { public void exportbuildinginfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
buildingService.exportBuildinginfo(formDTO,response); buildingService.exportBuildinginfo(formDTO,response);
@ -165,7 +160,7 @@ public class BuildingController {
*/ */
@GetMapping("export") @GetMapping("export")
public void export(HttpServletResponse response) throws Exception { public void export(HttpServletResponse response) throws Exception {
ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO(); IcHouseListFormDTO formDTO = new IcHouseListFormDTO();
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
buildingService.exportBuildinginfo(formDTO,response); buildingService.exportBuildinginfo(formDTO,response);

52
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -33,7 +34,7 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.excel.IcHouseExcel; import com.epmet.excel.IcHouseExcel;
@ -85,33 +86,25 @@ public class HouseController implements ResultDataResolver {
@PostMapping("houselist") @PostMapping("houselist")
public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ public Result<PageData<IcHouseListResultDTO>> houseList(@RequestBody IcHouseListFormDTO formDTO) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
return new Result().ok(houseService.getHouseList(formDTO));
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, formDTO.getBuildingId(), formDTO.getOwnerName(),
formDTO.getOwnerPhone(), null,
null,
formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getId(),formDTO.getLevel(),formDTO.getRentFlag());
return new Result().ok(icNeighborHoodResultDTO);
} }
/** /**
* @return
* @Description 社区查询-搜索房屋 * @Description 社区查询-搜索房屋
* @Author wangxianzhang * @Author wangxianzhang
* @Date 2022/1/14 11:00 上午 * @Date 2022/1/14 11:00 上午
* @Param * @Param
*@return
*/ */
@PostMapping("search") @PostMapping("search")
public Result<IcNeighborHoodResultDTO> searchHouse(@RequestBody ListIcNeighborHoodFormDTO formDTO, @LoginUser TokenDto loginUser) { public Result<PageData<IcHouseListResultDTO>> searchHouse(@RequestBody IcHouseListFormDTO formDTO, @LoginUser TokenDto loginUser) {
String keyword = formDTO.getKeyword(); String keyword = formDTO.getKeyword();
if (StringUtils.isBlank(keyword)) { if (StringUtils.isBlank(keyword)) {
IcNeighborHoodResultDTO r = new IcNeighborHoodResultDTO(); return new Result<PageData<IcHouseListResultDTO>>().ok(new PageData<>(new ArrayList<>(), NumConstant.ZERO));
r.setTotal(0);
r.setList(new ArrayList<>());
return new Result<IcNeighborHoodResultDTO>().ok(r);
} }
keyword = keyword.trim(); keyword = keyword.trim();
@ -135,18 +128,17 @@ public class HouseController implements ResultDataResolver {
EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getCode(),
"【社区查询-查询房屋】查询当前staff所在组织信息失败", "【社区查询-查询房屋】查询当前staff所在组织信息失败",
null); null);
formDTO.setAgencyId(loginUserDetail.getAgencyId());
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null, formDTO.setBuildingName(buildingName);
neighborhoodName, buildingName, formDTO.getPageNo(), formDTO.getPageSize(),null,null,null); formDTO.setNeighborHoodName(neighborhoodName);
return new Result<PageData<IcHouseListResultDTO>>().ok(houseService.getHouseList(formDTO));
return new Result<IcNeighborHoodResultDTO>().ok(icNeighborHoodResultDTO);
} }
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("houseadd") @PostMapping("houseadd")
public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.AddShowGroup.class); ValidatorUtils.validateEntity(formDTO, IcHouseAddFormDTO.AddShowGroup.class);
String customerId = tokenDTO.getCustomerId(); String customerId = tokenDTO.getCustomerId();
// String customerId = "123123"; // String customerId = "123123";
@ -156,9 +148,9 @@ public class HouseController implements ResultDataResolver {
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("houseupdate") @PostMapping("houseupdate")
public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcHouseFormDTO.UpdateShowGroup.class); ValidatorUtils.validateEntity(formDTO, IcHouseAddFormDTO.UpdateShowGroup.class);
String customerId = tokenDTO.getCustomerId(); String customerId = tokenDTO.getCustomerId();
// String customerId = "123123"; // String customerId = "123123";
houseService.updateHouse(customerId, formDTO); houseService.updateHouse(customerId, formDTO);
@ -167,18 +159,21 @@ public class HouseController implements ResultDataResolver {
/** /**
* lzh * lzh
*
* @param formDTO * @param formDTO
* @return 单独删除房屋内部调用/gov/org/house/delete * @return 单独删除房屋内部调用/gov/org/house/delete
*/ */
@PostMapping("housedel") @PostMapping("housedel")
public Result houseDel(@RequestBody IcHouseFormDTO formDTO){ public Result houseDel(@RequestBody IcHouseAddFormDTO formDTO) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.DeleteGroup.class);
houseService.delHouse(formDTO.getHouseId()); houseService.delHouse(formDTO.getHouseId());
return new Result(); return new Result();
} }
/** /**
* 导出模板 * 导出模板
*
* @param response * @param response
* @throws Exception * @throws Exception
*/ */
@ -191,14 +186,16 @@ public class HouseController implements ResultDataResolver {
ExcelPoiUtils.exportExcel(templatePath, map, "房屋信息录入表", response); ExcelPoiUtils.exportExcel(templatePath, map, "房屋信息录入表", response);
} }
/** /**
* 导出 * 导出
*
* @param formDTO * @param formDTO
* @param response * @param response
* @throws Exception * @throws Exception
*/ */
@RequestMapping("exporthouseinfo") @RequestMapping("exporthouseinfo")
public void exporthouseinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { public void exporthouseinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
houseService.exportBuildinginfo(formDTO, response); houseService.exportBuildinginfo(formDTO, response);
@ -206,6 +203,7 @@ public class HouseController implements ResultDataResolver {
/** /**
* 导入数据 * 导入数据
*
* @param file * @param file
* @return * @return
* @throws IOException * @throws IOException
@ -280,6 +278,7 @@ public class HouseController implements ResultDataResolver {
/** /**
* Desc 小区管理中批量删除 * Desc 小区管理中批量删除
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/3/1 4:57 下午 * @date 2022/3/1 4:57 下午
@ -293,6 +292,7 @@ public class HouseController implements ResultDataResolver {
/** /**
* 获取房屋信息 * 获取房屋信息
*
* @param houseId * @param houseId
* @return * @return
*/ */

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java

@ -35,7 +35,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.constants.ImportTaskConstants; import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -80,7 +80,7 @@ public class IcNeighborHoodController {
} }
@PostMapping("open/list") @PostMapping("open/list")
public Result<PageData<IcNeighborHoodDTO>> openList(@RequestBody IcNeighborHoodFormDTO params){ public Result<PageData<IcNeighborHoodDTO>> openList(@RequestBody IcNeighborHoodAddFormDTO params){
PageData<IcNeighborHoodDTO> page = icNeighborHoodService.openPage(params); PageData<IcNeighborHoodDTO> page = icNeighborHoodService.openPage(params);
return new Result<PageData<IcNeighborHoodDTO>>().ok(page); return new Result<PageData<IcNeighborHoodDTO>>().ok(page);
} }

33
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java

@ -28,9 +28,9 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.entity.IcBuildingEntity; import com.epmet.entity.IcBuildingEntity;
import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.service.BuildingService; import com.epmet.service.BuildingService;
@ -77,48 +77,45 @@ public class NeighborHoodController {
@PostMapping("neighborhoodlist") @PostMapping("neighborhoodlist")
public Result neighborhoodlist(@RequestBody ListIcNeighborHoodFormDTO formDTO){ public Result<IcHouseListFormDTO> neighborhoodlist(@RequestBody IcNeighborHoodListFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = neighborHoodService.listNeighborhood(formDTO); return new Result().ok(neighborHoodService.listNeighborhood(formDTO));
return new Result().ok(icNeighborHoodResultDTO);
} }
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("neighborhoodadd") @PostMapping("neighborhoodadd")
public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.AddShowGroup.class); ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.AddShowGroup.class);
String customerId = tokenDTO.getCustomerId(); String customerId = tokenDTO.getCustomerId();
// String customerId = "123123"; neighborHoodService.addNeighborhood(customerId,formDTO);
neighborHoodService.AddNeighborhood(customerId,formDTO);
return new Result(); return new Result();
} }
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("neighborhoodupdate") @PostMapping("neighborhoodupdate")
public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.UpdateShowGroup.class); ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.UpdateShowGroup.class);
String customerId = tokenDTO.getCustomerId(); String customerId = tokenDTO.getCustomerId();
// String customerId = "123123"; // String customerId = "123123";
neighborHoodService.UpdateNeighborhood(customerId,formDTO); neighborHoodService.updateNeighborhood(customerId,formDTO);
return new Result(); return new Result();
} }
@PostMapping("neighborhooddel") @PostMapping("neighborhooddel")
public Result neighborhooddel(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ public Result neighborhooddel(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); ValidatorUtils.validateEntity(formDTO, IcNeighborHoodAddFormDTO.DeleteGroup.class);
String neighborHoodId = formDTO.getNeighborHoodId(); String neighborHoodId = formDTO.getNeighborHoodId();
//判断是否存在楼宇,如果存在不能删除 //判断是否存在楼宇,如果存在不能删除
List<IcBuildingEntity> icBuildingEntities = icBuildingDao.selectList(new QueryWrapper<IcBuildingEntity>().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId)); List<IcBuildingEntity> icBuildingEntities = icBuildingDao.selectList(new QueryWrapper<IcBuildingEntity>().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId));
if(!CollectionUtils.isEmpty(icBuildingEntities)){ if(!CollectionUtils.isEmpty(icBuildingEntities)){
return new Result().error(8001,"小区下已存在楼宇,无法删除"); return new Result().error(8001,"小区下已存在楼宇,无法删除");
} }
neighborHoodService.DelNeighborhood(neighborHoodId); neighborHoodService.delNeighborhood(neighborHoodId);
return new Result().ok("删除成功"); return new Result().ok("删除成功");
} }
@ -130,7 +127,7 @@ public class NeighborHoodController {
* @throws Exception * @throws Exception
*/ */
@PostMapping("exportneighborhoodinfo") @PostMapping("exportneighborhoodinfo")
public void exportneighborhoodinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { public void exportneighborhoodinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
neighborHoodService.exportNeighborhoodinfo(formDTO,response); neighborHoodService.exportNeighborhoodinfo(formDTO,response);

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java

@ -20,10 +20,8 @@ package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO; import com.epmet.dto.form.IcBuildingListFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.*;
import com.epmet.dto.result.ExistHouseInfoResultDTO;
import com.epmet.dto.result.UpdateBuildingHouseNumResultDTO;
import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.IcBuildingEntity; import com.epmet.entity.IcBuildingEntity;
import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcHouseEntity;
@ -45,16 +43,9 @@ import java.util.Set;
@Mapper @Mapper
public interface IcBuildingDao extends BaseDao<IcBuildingEntity> { public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
// IPage<Map<String, Object>> searchBuildingByPage(IPage<IcBuildingEntity> page,
// @Param("neighbor") IcNeighborHoodEntity neighbor,
// @Param("building")IcBuildingEntity building);
IPage<Map<String, Object>> searchBuildingByPage(IPage<IcBuildingEntity> page,
@Param("building")IcBuildingEntity building, @Param("house") IcHouseEntity house);
// List<IcBuildingExcel> searchAllBuilding(@Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper, List<IcBuildingListResultDTO> searchBuildingByPage(IcBuildingListFormDTO formDTO);
// @Param("ew1") QueryWrapper<IcBuildingEntity> buildingEntityQueryWrapper);
// List<IcBuildingExcel> searchAllBuilding(@Param("neighbor") IcNeighborHoodEntity neighbor,
// @Param("building")IcBuildingEntity building);
List<IcBuildingExcel> searchAllBuilding( List<IcBuildingExcel> searchAllBuilding(
@Param("building")IcBuildingEntity building, @Param("house")IcHouseEntity house); @Param("building")IcBuildingEntity building, @Param("house")IcHouseEntity house);

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -1,10 +1,11 @@
package com.epmet.dao; package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HousesNameResultDTO; import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO; import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcHouseEntity;
import com.epmet.excel.IcHouseExcel; import com.epmet.excel.IcHouseExcel;
@ -12,7 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
/** /**
@ -24,16 +24,7 @@ import java.util.Set;
@Mapper @Mapper
public interface IcHouseDao extends BaseDao<IcHouseEntity> { public interface IcHouseDao extends BaseDao<IcHouseEntity> {
IPage<Map<String, Object>> searchHouseByPage(IPage<IcHouseEntity> page, List<IcHouseListResultDTO> searchHouseByPage(IcHouseListFormDTO formDTO);
@Param("pids") String pids,
@Param("buildingId") String buildingId,
@Param("ownerName") String ownerName,
@Param("ownerPhone") String ownerPhone,
@Param("neighborHoodName") String neighborHoodName,
@Param("buildingName") String buildingName,
@Param("id")String id,
@Param("level")String level,
@Param("rentFlag")String rentFlag);
List<IcHouseExcel> searchAllHouse(@Param("house") IcHouseEntity house); List<IcHouseExcel> searchAllHouse(@Param("house") IcHouseEntity house);

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java

@ -17,8 +17,9 @@
package com.epmet.dao; package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.excel.IcNeighborHoodExcel;
@ -26,7 +27,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 小区表 * 小区表
@ -38,7 +38,7 @@ import java.util.Map;
public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> { public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> {
// IPage<Map<String, Object>> searchNeighborhoodByPage(IPage<IcNeighborHoodEntity> page,@Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper); // IPage<Map<String, Object>> searchNeighborhoodByPage(IPage<IcNeighborHoodEntity> page,@Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper);
IPage<Map<String, Object>> searchNeighborhoodByPage(IPage<IcNeighborHoodEntity> page, @Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house); List<IcHouseListFormDTO> searchNeighborhoodByPage(IcNeighborHoodListFormDTO formDTO);
// List<IcNeighborHoodExcel> searchAllNeighborhood(@Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper); // List<IcNeighborHoodExcel> searchAllNeighborhood(@Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper);
List<IcNeighborHoodExcel> searchAllNeighborhood(@Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house); List<IcNeighborHoodExcel> searchAllNeighborhood(@Param("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house);

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java

@ -17,14 +17,16 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.IcBuildingListFormDTO;
import com.epmet.dto.form.IcBulidingAddFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.BuildingResultPagedDTO; import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcBuildingListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcBuildingExcel; import com.epmet.excel.IcBuildingExcel;
@ -45,7 +47,7 @@ public interface BuildingService {
void updateBuilding(String customerId, IcBulidingFormDTO formDTO); void updateBuilding(String customerId, IcBulidingAddFormDTO formDTO);
/** /**
* 删除小区 * 删除小区
@ -54,16 +56,16 @@ public interface BuildingService {
void delBuilding(String buildingId); void delBuilding(String buildingId);
void addBuilding(String customerId, IcBulidingFormDTO formDTO); void addBuilding(String customerId, IcBulidingAddFormDTO formDTO);
List<BuildingTreeLevelDTO> treeList(String customerId, String staffId); List<BuildingTreeLevelDTO> treeList(String customerId, String staffId);
List<String> treeIds(String customerId, String staffId); List<String> treeIds(String customerId, String staffId);
List<Integer> importExcel(String customerId, List<IcBuildingExcel> list, String staffId, List<Integer> numList); List<Integer> importExcel(String customerId, List<IcBuildingExcel> list, String staffId, List<Integer> numList);
IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO); PageData<IcBuildingListResultDTO> listBuilding(IcBuildingListFormDTO formDTO);
void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception ;
List<BuildingResultDTO> buildingListByIds(List<String> buildingIdList); List<BuildingResultDTO> buildingListByIds(List<String> buildingIdList);

27
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -17,13 +17,14 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcHouseFormDTO; import com.epmet.dto.form.IcHouseAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO; import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcHouseExcel; import com.epmet.excel.IcHouseExcel;
@ -40,10 +41,10 @@ import java.util.Set;
*/ */
public interface HouseService { public interface HouseService {
void addHouse(String customerId, IcHouseFormDTO formDTO); void addHouse(String customerId, IcHouseAddFormDTO formDTO);
void updateHouse(String customerId, IcHouseFormDTO formDTO); void updateHouse(String customerId, IcHouseAddFormDTO formDTO);
/** /**
* 删除小区 * 删除小区
@ -54,19 +55,9 @@ public interface HouseService {
List<Integer> importExcel(String customerId, List<IcHouseExcel> list, String staffId, List<Integer> numList); List<Integer> importExcel(String customerId, List<IcHouseExcel> list, String staffId, List<Integer> numList);
IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId, PageData<IcHouseListResultDTO> getHouseList(IcHouseListFormDTO formDTO);
String buildingId,
String ownerName, void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception;
String ownerPhone,
String neighborHoodName,
String buildingName,
Integer pageNo,
Integer pageSize,
String id,
String level,
String rentFlag);
void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception;
List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIds, String customerId); List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIds, String customerId);

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java

@ -23,7 +23,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.entity.IcNeighborHoodEntity;
@ -154,5 +154,5 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @param params * @param params
* @return * @return
*/ */
PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodFormDTO params); PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodAddFormDTO params);
} }

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java

@ -17,9 +17,10 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.excel.IcNeighborHoodExcel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -33,24 +34,24 @@ import java.util.List;
*/ */
public interface NeighborHoodService{ public interface NeighborHoodService{
void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO); void addNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO);
IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO); PageData<IcHouseListFormDTO> listNeighborhood(IcNeighborHoodListFormDTO formDTO);
void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO); void updateNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO);
/** /**
* 删除小区 * 删除小区
* @param neighborHoodId * @param neighborHoodId
*/ */
void DelNeighborhood(String neighborHoodId); void delNeighborhood(String neighborHoodId);
/** /**
* 导出数据 * 导出数据
* @param formDTO * @param formDTO
* @param response * @param response
*/ */
void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception ; void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception ;
List<Integer> importExcel(String customerId, List<IcNeighborHoodExcel> list, String staffId, List<Integer> numList); List<Integer> importExcel(String customerId, List<IcNeighborHoodExcel> list, String staffId, List<Integer> numList);
} }

52
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -14,6 +14,7 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -21,14 +22,8 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.*; import com.epmet.dao.*;
import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.*;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.result.*;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.BuildingResultPagedDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.entity.*; import com.epmet.entity.*;
import com.epmet.enums.BuildingTypeEnums; import com.epmet.enums.BuildingTypeEnums;
import com.epmet.excel.IcBuildingExcel; import com.epmet.excel.IcBuildingExcel;
@ -38,6 +33,8 @@ import com.epmet.model.ImportBuildingInfoListener;
import com.epmet.redis.IcHouseRedis; import com.epmet.redis.IcHouseRedis;
import com.epmet.service.*; import com.epmet.service.*;
import com.epmet.util.ExcelPoiUtils; import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -93,7 +90,7 @@ public class BuildingServiceImpl implements BuildingService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addBuilding(String customerId, IcBulidingFormDTO formDTO) { public void addBuilding(String customerId, IcBulidingAddFormDTO formDTO) {
//同一小区下不能存在楼栋名字一样的 //同一小区下不能存在楼栋名字一样的
Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),null); Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),null);
if (null != count && count > 0) { if (null != count && count > 0) {
@ -386,25 +383,19 @@ public class BuildingServiceImpl implements BuildingService {
//4.新增单元 //4.新增单元
icBuildingService.insertBatch(buildingEntityList); icBuildingService.insertBatch(buildingEntityList);
icBuildingUnitService.insertBatch(icBuildingUnitEntityList); icBuildingUnitService.insertBatch(icBuildingUnitEntityList);
/* if(!"".equals(str)){
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str.append("不存在").toString());
}*/
return numList; return numList;
} }
@Override @Override
public IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO) { public PageData<IcBuildingListResultDTO> listBuilding(IcBuildingListFormDTO formDTO) {
PageInfo<IcBuildingListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> icBuildingDao.searchBuildingByPage(formDTO));
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO(); List<IcBuildingListResultDTO> records = pageInfo.getList();
IPage<Map<String, Object>> resultMap = searchBuilding(formDTO); records.forEach(item-> item.setBuildingType( BuildingTypeEnums.getTypeValue(item.getBuildingTypeKey())));
result.setTotal(Long.valueOf(resultMap.getTotal()).intValue()); return new PageData<>(pageInfo.getList(),pageInfo.getTotal());
result.setList(resultMap.getRecords());
return result;
} }
@Override @Override
public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//如果类型是building 查楼栋 //如果类型是building 查楼栋
//导出楼栋 //导出楼栋
List<IcBuildingExcel> icBuildingExcels = searchAllBuilding(formDTO); List<IcBuildingExcel> icBuildingExcels = searchAllBuilding(formDTO);
@ -467,7 +458,7 @@ public class BuildingServiceImpl implements BuildingService {
return new Result<>(); return new Result<>();
} }
private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) { private List<IcBuildingExcel> searchAllBuilding(IcHouseListFormDTO formDTO) {
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>(); // QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();
// neighborHoodEntityQueryWrapper.lambda() // neighborHoodEntityQueryWrapper.lambda()
@ -492,21 +483,6 @@ public class BuildingServiceImpl implements BuildingService {
return icBuildingExcels; return icBuildingExcels;
} }
private IPage<Map<String, Object>> searchBuilding(ListIcNeighborHoodFormDTO formDTO) {
IPage<IcBuildingEntity> page = new Page<IcBuildingEntity>(formDTO.getPageNo(),formDTO.getPageSize());
IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class);
building.setDelFlag("0");
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
IPage<Map<String, Object>> mapIPage = icBuildingDao.searchBuildingByPage(page, building, house);
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{
item.put("buildingType", BuildingTypeEnums.getTypeValue(item.get("buildingTypeKey")));
});
return mapIPage;
}
private List<BuildingTreeLevelDTO> covertToTree(CustomerAgencyEntity customerAgency,List<BuildingTreeLevelDTO> agencyList) { private List<BuildingTreeLevelDTO> covertToTree(CustomerAgencyEntity customerAgency,List<BuildingTreeLevelDTO> agencyList) {
BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO();
@ -545,7 +521,7 @@ public class BuildingServiceImpl implements BuildingService {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateBuilding(String customerId, IcBulidingFormDTO formDTO) { public void updateBuilding(String customerId, IcBulidingAddFormDTO formDTO) {
//同一小区下不能存在楼栋名字一样的 //同一小区下不能存在楼栋名字一样的
Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),formDTO.getBuildingId()); Integer count = icBuildingDao.checkBuildName(formDTO.getNeighborHoodId(),formDTO.getBuildingName(),formDTO.getBuildingId());
if (null != count && count > 0) { if (null != count && count > 0) {

53
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -4,8 +4,6 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader; import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -14,6 +12,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
@ -33,7 +32,7 @@ import com.epmet.dto.IcBuildingUnitDTO;
import com.epmet.dto.IcHouseDTO; import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO; import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcHouseEntity;
@ -49,6 +48,8 @@ import com.epmet.model.ImportHouseInfoListener;
import com.epmet.redis.IcHouseRedis; import com.epmet.redis.IcHouseRedis;
import com.epmet.service.*; import com.epmet.service.*;
import com.epmet.util.ExcelPoiUtils; import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -102,7 +103,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addHouse(String customerId, IcHouseFormDTO formDTO) { public void addHouse(String customerId, IcHouseAddFormDTO formDTO) {
//同一楼栋,单元内,房屋名称唯一 //同一楼栋,单元内,房屋名称唯一
Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(),null); Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(), formDTO.getDoorName(),null);
if (null != count && count > 0) { if (null != count && count > 0) {
@ -116,7 +117,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icHouseService.save(icHouseDTO); icHouseService.save(icHouseDTO);
} }
private String getHouseName(IcHouseFormDTO formDTO){ private String getHouseName(IcHouseAddFormDTO formDTO){
//设置房间名 楼栋-单元号-门牌号 //设置房间名 楼栋-单元号-门牌号
IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId()); IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId());
IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId()); IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId());
@ -133,7 +134,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateHouse(String customerId, IcHouseFormDTO formDTO) { public void updateHouse(String customerId, IcHouseAddFormDTO formDTO) {
//同一楼栋,单元内,房屋名称唯一 //同一楼栋,单元内,房屋名称唯一
Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(),formDTO.getDoorName(), formDTO.getHouseId()); Integer count = icHouseDao.checkDoorNameUq(formDTO.getNeighborHoodId(), formDTO.getBuildingId(), formDTO.getBuildingUnitId(),formDTO.getDoorName(), formDTO.getHouseId());
if (null != count && count > 0) { if (null != count && count > 0) {
@ -251,37 +252,27 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
} }
@Override @Override
public IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId, public PageData<IcHouseListResultDTO> getHouseList(IcHouseListFormDTO formDTO) {
String buildingId,
String ownerName,
String ownerPhone,
String neighborHoodName,
String buildingName,
Integer pageNo,
Integer pageSize,
String id,String level, String rentFlag) {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
// 查询pids // 查询pids
String pids = null; String pids = null;
if (StringUtils.isNotBlank(ancestorAgencyId)) { if (StringUtils.isNotBlank(formDTO.getAgencyId())) {
pids = getPids(ancestorAgencyId); pids = getPids(formDTO.getAgencyId());
} }
if (StringUtils.isNotBlank(level) && OrgTypeEnum.AGENCY.getCode().equals(level)){ if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())){
pids = getPids(ancestorAgencyId); pids = getPids(formDTO.getAgencyId());
} }
formDTO.setPids(pids);
IPage<IcHouseEntity> page = new Page<IcHouseEntity>(pageNo,pageSize); PageInfo<IcHouseListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() ->
icHouseDao.searchHouseByPage(formDTO));
IPage<Map<String, Object>> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName,id,level,rentFlag); List<IcHouseListResultDTO> records = pageInfo.getList();
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{ records.forEach(item->{
item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey"))); item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey()));
item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey"))); item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey()));
}); });
result.setTotal(Long.valueOf(mapIPage.getTotal()).intValue()); return new PageData<>(records,pageInfo.getTotal());
result.setList(records);
return result;
} }
public String getPids(String agencyId){ public String getPids(String agencyId){
String pids = null; String pids = null;
@ -301,7 +292,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
} }
@Override @Override
public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//如果类型是house 查房屋 //如果类型是house 查房屋
//导出房屋 //导出房屋
@ -313,7 +304,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
return ; return ;
} }
private List<IcHouseExcel> searchAllHouse(ListIcNeighborHoodFormDTO formDTO) { private List<IcHouseExcel> searchAllHouse(IcHouseListFormDTO formDTO) {
//IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); //IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
// //

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -48,7 +48,7 @@ import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcNeighborHoodDao; import com.epmet.dao.IcNeighborHoodDao;
import com.epmet.dao.IcPropertyManagementDao; import com.epmet.dao.IcPropertyManagementDao;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -689,7 +689,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
} }
@Override @Override
public PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodFormDTO params) { public PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodAddFormDTO params) {
LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId()); wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId());
PageData<IcNeighborHoodDTO> result = null; PageData<IcNeighborHoodDTO> result = null;

59
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java

@ -2,12 +2,11 @@ package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -16,9 +15,9 @@ import com.epmet.dao.*;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcNeighborHoodPropertyDTO; import com.epmet.dto.IcNeighborHoodPropertyDTO;
import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.entity.*; import com.epmet.entity.*;
import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
@ -26,6 +25,8 @@ import com.epmet.service.IcNeighborHoodPropertyService;
import com.epmet.service.IcNeighborHoodService; import com.epmet.service.IcNeighborHoodService;
import com.epmet.service.NeighborHoodService; import com.epmet.service.NeighborHoodService;
import com.epmet.util.ExcelPoiUtils; import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -72,7 +73,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { public void addNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO) {
//同一网格下,小区名称唯一 //同一网格下,小区名称唯一
Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),null); Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),null);
if (null != count && count > 0) { if (null != count && count > 0) {
@ -105,45 +106,19 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
/** /**
* 查询 * 查询
* @param formDTO * @param formDTO
* @return
*/ */
@Override @Override
public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO formDTO) { public PageData<IcHouseListFormDTO> listNeighborhood(IcNeighborHoodListFormDTO formDTO) {
String level = formDTO.getLevel();
Integer pageNo = formDTO.getPageNo();
Integer pageSize = formDTO.getPageSize();
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
IPage<Map<String, Object>> resultMap = searchNeighborhood(formDTO);
result.setTotal(Long.valueOf(resultMap.getTotal()).intValue());
result.setList(resultMap.getRecords());
return result;
}
private IPage<Map<String,Object>> searchNeighborhood(ListIcNeighborHoodFormDTO formDTO) {
IPage<IcNeighborHoodEntity> page = new Page<IcNeighborHoodEntity>(formDTO.getPageNo(),formDTO.getPageSize());
IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
neighbor.setDelFlag("0");
if(NeighborhoodConstant.GRID.equals(formDTO.getLevel())){ if(NeighborhoodConstant.GRID.equals(formDTO.getLevel())){
//根据网格过滤 //根据网格过滤
neighbor.setGridId(formDTO.getId()); formDTO.setGridId(formDTO.getId());
}else{ }else{
//根据组织过滤 //根据组织过滤
neighbor.setAgencyId(formDTO.getId()); formDTO.setAgencyId(formDTO.getId());
} }
return icNeighborHoodDao.searchNeighborhoodByPage(page, neighbor,house); PageInfo<IcHouseListFormDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> icNeighborHoodDao.searchNeighborhoodByPage(formDTO));
return new PageData<>(pageInfo.getList(),pageInfo.getTotal());
} }
/** /**
@ -153,7 +128,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { public void updateNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO) {
//同一客户下,小区名称唯一 //同一客户下,小区名称唯一
Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId()); Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId());
if (null != count && count > 0) { if (null != count && count > 0) {
@ -203,7 +178,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void DelNeighborhood(String neighborHoodId) { public void delNeighborhood(String neighborHoodId) {
//删除小区 //删除小区
icNeighborHoodService.deleteById(neighborHoodId); icNeighborHoodService.deleteById(neighborHoodId);
//删除小区物业关联 //删除小区物业关联
@ -220,7 +195,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
* @param response * @param response
*/ */
@Override @Override
public void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { public void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//导出小区 //导出小区
List<IcNeighborHoodExcel> icNeighborHoodExcels = searchAllNeighborhood(formDTO); List<IcNeighborHoodExcel> icNeighborHoodExcels = searchAllNeighborhood(formDTO);
// ExcelUtils.exportExcelToTarget(response, "小区信息录入表", icNeighborHoodExcels, IcNeighborHoodExcel.class); // ExcelUtils.exportExcelToTarget(response, "小区信息录入表", icNeighborHoodExcels, IcNeighborHoodExcel.class);
@ -336,7 +311,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
private List<IcNeighborHoodExcel> searchAllNeighborhood(ListIcNeighborHoodFormDTO formDTO) { private List<IcNeighborHoodExcel> searchAllNeighborhood(IcHouseListFormDTO formDTO) {
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>(); // QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();
// neighborHoodEntityQueryWrapper.lambda() // neighborHoodEntityQueryWrapper.lambda()
// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId()) // .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId())

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx

Binary file not shown.

23
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -64,7 +64,7 @@
</select>--> </select>-->
<select id="searchBuildingByPage" resultType="map"> <select id="searchBuildingByPage" resultType="com.epmet.dto.result.IcBuildingListResultDTO">
select select
a.BUILDING_NAME as buildingName, a.BUILDING_NAME as buildingName,
b.NEIGHBOR_HOOD_NAME as neighborHoodName, b.NEIGHBOR_HOOD_NAME as neighborHoodName,
@ -86,30 +86,25 @@
LEFT JOIN ic_neighbor_hood b on a.NEIGHBOR_HOOD_ID = b.ID and b.DEL_FLAG='0' LEFT JOIN ic_neighbor_hood b on a.NEIGHBOR_HOOD_ID = b.ID and b.DEL_FLAG='0'
left join customer_agency c on b.AGENCY_ID = c.ID and c.DEL_FLAG='0' left join customer_agency c on b.AGENCY_ID = c.ID and c.DEL_FLAG='0'
left join customer_grid d on b.GRID_ID = d.ID and d.DEL_FLAG='0' left join customer_grid d on b.GRID_ID = d.ID and d.DEL_FLAG='0'
<where> <where>
<if test="building.neighborHoodId != null and building.neighborHoodId.trim() != ''"> <if test="neighborHoodId != null and neighborHoodId.trim() != ''">
AND a.NEIGHBOR_HOOD_ID = #{building.neighborHoodId} AND a.NEIGHBOR_HOOD_ID = #{neighborHoodId}
</if> </if>
<if test="(ownerName != null and ownerName.trim() != '') or (ownerPhone != null and ownerPhone.trim() != '')">
<if test="(house.ownerName != null and house.ownerName.trim() != '') or (house.ownerPhone != null and house.ownerPhone.trim() != '')">
AND a.ID in (select distinct BUILDING_ID from ic_house e AND a.ID in (select distinct BUILDING_ID from ic_house e
<where> <where>
<if test="house.ownerName != null and house.ownerName.trim() != ''"> <if test="ownerName != null and ownerName.trim() != ''">
AND e.OWNER_NAME = #{house.ownerName} AND e.OWNER_NAME = #{ownerName}
</if> </if>
<if test="house.ownerPhone != null and house.ownerPhone.trim() != ''"> <if test="ownerPhone != null and ownerPhone.trim() != ''">
AND e.OWNER_PHONE = #{house.ownerPhone} AND e.OWNER_PHONE = #{ownerPhone}
</if> </if>
and e.DEL_FLAG='0' and e.DEL_FLAG='0'
</where> </where>
) )
</if> </if>
AND a.DEL_FLAG = '0'
<if test="building.delFlag != null and building.delFlag.trim() != ''">
AND a.DEL_FLAG = #{building.delFlag}
</if>
</where> </where>
order by a.CREATED_TIME, a.BUILDING_NAME order by a.CREATED_TIME, a.BUILDING_NAME
</select> </select>

9
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -70,7 +70,7 @@
) )
</update> </update>
<select id="searchHouseByPage" resultType="map"> <select id="searchHouseByPage" resultType="com.epmet.dto.result.IcHouseListResultDTO">
select select
a.HOUSE_NAME as houseName, a.HOUSE_NAME as houseName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName, c.NEIGHBOR_HOOD_NAME as neighborHoodName,
@ -138,7 +138,7 @@
</if> </if>
and a.del_flag = '0' and a.del_flag = '0'
</where> </where>
/*排序规则:根据小区、楼栋、单元、门牌号(分别按照数字和中文)分别升序排序*/ #排序规则:根据小区、楼栋、单元、门牌号(分别按照数字和中文)分别升序排序
ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk), ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk),
CONVERT(b.BUILDING_NAME USING gbk), CONVERT(b.BUILDING_NAME USING gbk),
CONVERT(d.UNIT_NAME USING gbk), CONVERT(d.UNIT_NAME USING gbk),
@ -176,6 +176,11 @@
AND a.DEL_FLAG = #{house.delFlag} AND a.DEL_FLAG = #{house.delFlag}
</if> </if>
</where> </where>
ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk),
CONVERT(b.BUILDING_NAME USING gbk),
CONVERT(d.UNIT_NAME USING gbk),
CAST(a.DOOR_NAME AS SIGNED),
CONVERT(a.DOOR_NAME using gbk)
</select> </select>

28
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

@ -57,7 +57,7 @@
</if> </if>
</where> </where>
</select>--> </select>-->
<select id="searchNeighborhoodByPage" resultType="map"> <select id="searchNeighborhoodByPage" resultType="com.epmet.dto.form.IcHouseListFormDTO">
select select
a.id as neighborHoodId, a.id as neighborHoodId,
a.NEIGHBOR_HOOD_NAME as neighborHoodName, a.NEIGHBOR_HOOD_NAME as neighborHoodName,
@ -73,38 +73,32 @@
a.LATITUDE as latitude a.LATITUDE as latitude
from ic_neighbor_hood a from ic_neighbor_hood a
left join customer_agency b on a.AGENCY_ID = b.ID and b.DEL_FLAG='0' left join customer_agency b on a.AGENCY_ID = b.ID and b.DEL_FLAG='0'
left join customer_grid c on a.GRID_ID = c.ID and c.DEL_FLAG='0' left join customer_grid c on a.GRID_ID = c.ID and c.DEL_FLAG='0'
left join ic_neighbor_hood_property d on a.ID = d.NEIGHBOR_HOOD_ID and d.DEL_FLAG='0' left join ic_neighbor_hood_property d on a.ID = d.NEIGHBOR_HOOD_ID and d.DEL_FLAG='0'
<where> <where>
<if test="neighbor.gridId != null and neighbor.gridId.trim() != ''"> <if test="gridId != null and gridId.trim() != ''">
AND a.GRID_ID = #{neighbor.gridId} AND a.GRID_ID = #{gridId}
</if> </if>
<if test="neighbor.agencyId != null and neighbor.agencyId.trim() != ''"> <if test="agencyId != null and agencyId.trim() != ''">
AND (a.AGENCY_ID = #{neighbor.agencyId} or CONCAT(':',a.AGENCY_PIDS, ':') like CONCAT('%:',#{neighbor.agencyId},':%')) AND (a.AGENCY_ID = #{agencyId} or CONCAT(':',a.AGENCY_PIDS, ':') like CONCAT('%:',#{agencyId},':%'))
</if> </if>
<if test="(house.ownerName != null and house.ownerName.trim() != '') or (house.ownerPhone != null and house.ownerPhone.trim() != '')"> <if test="(ownerName != null and ownerName.trim() != '') or (ownerPhone != null and ownerPhone.trim() != '')">
AND a.ID in (select NEIGHBOR_HOOD_ID from ic_house e AND a.ID in (select NEIGHBOR_HOOD_ID from ic_house e
<where> <where>
<if test="house.ownerName != null and house.ownerName.trim() != ''"> <if test="ownerName != null and ownerName.trim() != ''">
AND e.OWNER_NAME like concat('%',#{house.ownerName},'%') AND e.OWNER_NAME like concat('%',#{ownerName},'%')
</if> </if>
<if test="house.ownerPhone != null and house.ownerPhone.trim() != ''"> <if test="ownerPhone != null and ownerPhone.trim() != ''">
AND e.OWNER_PHONE like concat('%',#{house.ownerPhone},'%') AND e.OWNER_PHONE like concat('%',#{ownerPhone},'%')
</if> </if>
and e.DEL_FLAG='0' and e.DEL_FLAG='0'
</where> </where>
) )
</if> </if>
AND a.DEL_FLAG = '0'
<if test="neighbor.delFlag != null and neighbor.delFlag.trim() != ''">
AND a.DEL_FLAG = #{neighbor.delFlag}
</if>
</where> </where>
ORDER BY a.CREATED_TIME ORDER BY a.CREATED_TIME
</select> </select>

Loading…
Cancel
Save