Browse Source

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

dev
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. 4
      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. 118
      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. 8
      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. 19
      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. 52
      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;
}

4
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
public class IcBulidingFormDTO implements Serializable {
public class IcBulidingAddFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ -126,4 +126,4 @@ public class IcBulidingFormDTO implements Serializable {
}
}

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
public class IcHouseFormDTO implements Serializable {
public class IcHouseAddFormDTO implements Serializable {
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
public class IcNeighborHoodFormDTO extends PageFormDTO {
public class IcNeighborHoodAddFormDTO extends PageFormDTO {
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;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import lombok.NoArgsConstructor;
/**
* @Description 网格列表信息
@ -12,25 +10,22 @@ import java.util.Map;
* @Author wangc
* @date 2020.04.23 14:21
*/
@NoArgsConstructor
@Data
public class IcNeighborHoodResultDTO implements Serializable {
public class IcNeighborHoodResultDTO extends PageFormDTO {
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.exception.EpmetErrorCode;
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.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -33,10 +34,7 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.form.*;
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.dto.result.*;
import com.epmet.entity.IcBuildingUnitEntity;
import com.epmet.excel.IcBuildingExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -75,19 +73,17 @@ public class BuildingController {
@PostMapping("buildinglist")
public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = buildingService.listBuilding(formDTO);
public Result<PageData<IcBuildingListResultDTO>> houseList(@RequestBody IcBuildingListFormDTO formDTO){
PageData<IcBuildingListResultDTO> icNeighborHoodResultDTO = buildingService.listBuilding(formDTO);
return new Result().ok(icNeighborHoodResultDTO);
}
@NoRepeatSubmit
@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();
buildingService.addBuilding(customerId,formDTO);
return new Result().ok("保存成功");
@ -95,9 +91,9 @@ public class BuildingController {
@NoRepeatSubmit
@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 = "123123";
buildingService.updateBuilding(customerId,formDTO);
@ -105,9 +101,9 @@ public class BuildingController {
}
@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();
buildingService.delBuilding(buildingId);
return new Result();
@ -137,7 +133,6 @@ public class BuildingController {
*/
@PostMapping("exporttemplate")
public void exportTemplate( HttpServletResponse response) throws Exception {
TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",new ArrayList<IcBuildingExcel>());
@ -151,7 +146,7 @@ public class BuildingController {
* @throws Exception
*/
@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);
buildingService.exportBuildinginfo(formDTO,response);
@ -165,7 +160,7 @@ public class BuildingController {
*/
@GetMapping("export")
public void export(HttpServletResponse response) throws Exception {
ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO();
IcHouseListFormDTO formDTO = new IcHouseListFormDTO();
ValidatorUtils.validateEntity(formDTO);
buildingService.exportBuildinginfo(formDTO,response);

118
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.EpmetException;
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.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -33,7 +34,7 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.form.*;
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.LoginUserDetailsResultDTO;
import com.epmet.excel.IcHouseExcel;
@ -85,33 +86,25 @@ public class HouseController implements ResultDataResolver {
@PostMapping("houselist")
public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){
public Result<PageData<IcHouseListResultDTO>> houseList(@RequestBody IcHouseListFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(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 new Result().ok(houseService.getHouseList(formDTO));
}
/**
*@Description 社区查询-搜索房屋
*@Author wangxianzhang
*@Date 2022/1/14 11:00 上午
*@Param
*@return
*/
* @return
* @Description 社区查询-搜索房屋
* @Author wangxianzhang
* @Date 2022/1/14 11:00 上午
* @Param
*/
@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();
if (StringUtils.isBlank(keyword)) {
IcNeighborHoodResultDTO r = new IcNeighborHoodResultDTO();
r.setTotal(0);
r.setList(new ArrayList<>());
return new Result<IcNeighborHoodResultDTO>().ok(r);
return new Result<PageData<IcHouseListResultDTO>>().ok(new PageData<>(new ArrayList<>(), NumConstant.ZERO));
}
keyword = keyword.trim();
@ -135,50 +128,52 @@ public class HouseController implements ResultDataResolver {
EpmetErrorCode.SERVER_ERROR.getCode(),
"【社区查询-查询房屋】查询当前staff所在组织信息失败",
null);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null,
neighborhoodName, buildingName, formDTO.getPageNo(), formDTO.getPageSize(),null,null,null);
return new Result<IcNeighborHoodResultDTO>().ok(icNeighborHoodResultDTO);
formDTO.setAgencyId(loginUserDetail.getAgencyId());
formDTO.setBuildingName(buildingName);
formDTO.setNeighborHoodName(neighborhoodName);
return new Result<PageData<IcHouseListResultDTO>>().ok(houseService.getHouseList(formDTO));
}
@NoRepeatSubmit
@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 = "123123";
houseService.addHouse(customerId,formDTO);
houseService.addHouse(customerId, formDTO);
return new Result();
}
@NoRepeatSubmit
@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 = "123123";
houseService.updateHouse(customerId,formDTO);
houseService.updateHouse(customerId, formDTO);
return new Result();
}
/**
* lzh
*
* @param formDTO
* @return 单独删除房屋内部调用/gov/org/house/delete
*/
@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());
return new Result();
}
/**
* 导出模板
*
* @param response
* @throws Exception
*/
@ -186,26 +181,29 @@ public class HouseController implements ResultDataResolver {
public void exportTemplate(HttpServletResponse response) throws Exception {
// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class);
TemplateExportParams templatePath = new TemplateExportParams("excel/house_template.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",new ArrayList<IcHouseExcel>());
ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response);
Map<String, Object> map = new HashMap<>();
map.put("maplist", new ArrayList<IcHouseExcel>());
ExcelPoiUtils.exportExcel(templatePath, map, "房屋信息录入表", response);
}
/**
* 导出
*
* @param formDTO
* @param response
* @throws Exception
*/
@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);
houseService.exportBuildinginfo(formDTO,response);
houseService.exportBuildinginfo(formDTO, response);
}
/**
* 导入数据
*
* @param file
* @return
* @throws IOException
@ -222,34 +220,34 @@ public class HouseController implements ResultDataResolver {
//存放错误数据行号
List<Integer> numList = new ArrayList<>();
if(!CollectionUtils.isEmpty(failList)){
for ( IcHouseExcel entity : failList) {
log.warn("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息
if (!CollectionUtils.isEmpty(failList)) {
for (IcHouseExcel entity : failList) {
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());//打印失败的行 和失败的信息
numList.add(entity.getRowNum());
}
}
List<IcHouseExcel> result =importResult.getList();
List<IcHouseExcel> result = importResult.getList();
List<Integer> resultList = houseService.importExcel(customerId,result,tokenDTO.getUserId(),numList);
String str = String.format("共%s条,成功导入%s条。",numList.size()+result.size(),numList.size()+result.size()-resultList.size());
if(resultList.size()> NumConstant.ZERO){
List<Integer> resultList = houseService.importExcel(customerId, result, tokenDTO.getUserId(), numList);
String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - resultList.size());
if (resultList.size() > NumConstant.ZERO) {
Collections.sort(resultList);
String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str+"第"+subList+"行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!");
}
return new Result().ok(str);
}
@PostMapping( "queryListHouseInfo")
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId){
return new Result<List<HouseInfoDTO>>().ok(houseService.queryListHouseInfo(houseIds,customerId));
@PostMapping("queryListHouseInfo")
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId) {
return new Result<List<HouseInfoDTO>>().ok(houseService.queryListHouseInfo(houseIds, customerId));
}
@PostMapping("houseimport")
public Result houseImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file,
@RequestParam("orgId")String orgId,
@RequestParam("orgType")String orgType,HttpServletRequest multipartRequest){
@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType, HttpServletRequest multipartRequest) {
ImportInfoFormDTO formDTO = new ImportInfoFormDTO();
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setOrgType(orgType);
@ -260,32 +258,33 @@ public class HouseController implements ResultDataResolver {
importFormDTO.setOperatorId(formDTO.getUserId());
importFormDTO.setOriginFileName(file.getOriginalFilename());
Result<ImportTaskCommonResultDTO> importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO);
if (!importTask.success()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"","存在进行中的导入");
if (!importTask.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "", "存在进行中的导入");
}
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
}catch (Exception e){
} catch (Exception e) {
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(formDTO.getUserId());
input.setTaskId(importTask.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
epmetCommonServiceOpenFeignClient.finishImportTask(input);
log.error("读取文件失败",e);
log.error("读取文件失败", e);
}
houseService.dispose(inputStream,formDTO,importTask);
houseService.dispose(inputStream, formDTO, importTask);
return new Result<>();
}
/**
* Desc 小区管理中批量删除
*
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
@PostMapping("delete")
public Result allDelete(@RequestBody NeighborHoodManageDelFormDTO formDTO){
public Result allDelete(@RequestBody NeighborHoodManageDelFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, NeighborHoodManageDelFormDTO.NeighborHoodManageDelForm.class);
houseService.allDelete(formDTO);
return new Result();
@ -293,14 +292,15 @@ public class HouseController implements ResultDataResolver {
/**
* 获取房屋信息
*
* @param houseId
* @return
*/
@PostMapping("gethouseinfo/{houseId}")
public Result<HouseInfoDTO> getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){
if(StringUtils.isBlank(houseId)){
public Result<HouseInfoDTO> getHouseInfo(@LoginUser TokenDto tokenDto, @PathVariable("houseId") String houseId) {
if (StringUtils.isBlank(houseId)) {
return new Result<>();
}
return new Result<HouseInfoDTO>().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId));
return new Result<HouseInfoDTO>().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(), houseId));
}
}

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.constants.ImportTaskConstants;
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.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -80,7 +80,7 @@ public class IcNeighborHoodController {
}
@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);
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.validator.ValidatorUtils;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.service.BuildingService;
@ -77,48 +77,45 @@ public class NeighborHoodController {
@PostMapping("neighborhoodlist")
public Result neighborhoodlist(@RequestBody ListIcNeighborHoodFormDTO formDTO){
public Result<IcHouseListFormDTO> neighborhoodlist(@RequestBody IcNeighborHoodListFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = neighborHoodService.listNeighborhood(formDTO);
return new Result().ok(icNeighborHoodResultDTO);
return new Result().ok(neighborHoodService.listNeighborhood(formDTO));
}
@NoRepeatSubmit
@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 = "123123";
neighborHoodService.AddNeighborhood(customerId,formDTO);
neighborHoodService.addNeighborhood(customerId,formDTO);
return new Result();
}
@NoRepeatSubmit
@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 = "123123";
neighborHoodService.UpdateNeighborhood(customerId,formDTO);
neighborHoodService.updateNeighborhood(customerId,formDTO);
return new Result();
}
@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();
//判断是否存在楼宇,如果存在不能删除
List<IcBuildingEntity> icBuildingEntities = icBuildingDao.selectList(new QueryWrapper<IcBuildingEntity>().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId));
if(!CollectionUtils.isEmpty(icBuildingEntities)){
return new Result().error(8001,"小区下已存在楼宇,无法删除");
}
neighborHoodService.DelNeighborhood(neighborHoodId);
neighborHoodService.delNeighborhood(neighborHoodId);
return new Result().ok("删除成功");
}
@ -130,7 +127,7 @@ public class NeighborHoodController {
* @throws Exception
*/
@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);
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.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO;
import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.ExistHouseInfoResultDTO;
import com.epmet.dto.result.UpdateBuildingHouseNumResultDTO;
import com.epmet.dto.form.IcBuildingListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.entity.IcHouseEntity;
@ -45,16 +43,9 @@ import java.util.Set;
@Mapper
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,
// @Param("ew1") QueryWrapper<IcBuildingEntity> buildingEntityQueryWrapper);
// List<IcBuildingExcel> searchAllBuilding(@Param("neighbor") IcNeighborHoodEntity neighbor,
// @Param("building")IcBuildingEntity building);
List<IcBuildingListResultDTO> searchBuildingByPage(IcBuildingListFormDTO formDTO);
List<IcBuildingExcel> searchAllBuilding(
@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;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.dto.result.IcHouseListResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.excel.IcHouseExcel;
@ -12,7 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@ -24,16 +24,7 @@ import java.util.Set;
@Mapper
public interface IcHouseDao extends BaseDao<IcHouseEntity> {
IPage<Map<String, Object>> searchHouseByPage(IPage<IcHouseEntity> page,
@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<IcHouseListResultDTO> searchHouseByPage(IcHouseListFormDTO formDTO);
List<IcHouseExcel> searchAllHouse(@Param("house") IcHouseEntity house);

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

@ -17,8 +17,9 @@
package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.IcNeighborHoodEntity;
import com.epmet.excel.IcNeighborHoodExcel;
@ -26,7 +27,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 小区表
@ -38,7 +38,7 @@ import java.util.Map;
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("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("neighbor") IcNeighborHoodEntity neighbor, @Param("house")IcHouseEntity house);
@ -61,4 +61,4 @@ public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> {
*/
List<String> selectNeighborhoodNameByNames(@Param("names")List<String> names,@Param("customerId") String customerId);
}
}

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

@ -17,14 +17,16 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
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.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.BuildingResultDTO;
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.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 addBuilding(String customerId, IcBulidingFormDTO formDTO);
void addBuilding(String customerId, IcBulidingAddFormDTO formDTO);
List<BuildingTreeLevelDTO> treeList(String customerId, String staffId);
List<String> treeIds(String customerId, String staffId);
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);

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

@ -17,13 +17,14 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
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.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
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.excel.IcHouseExcel;
@ -40,10 +41,10 @@ import java.util.Set;
*/
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);
IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId,
String buildingId,
String ownerName,
String ownerPhone,
String neighborHoodName,
String buildingName,
Integer pageNo,
Integer pageSize,
String id,
String level,
String rentFlag);
void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception;
PageData<IcHouseListResultDTO> getHouseList(IcHouseListFormDTO formDTO);
void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception;
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.dto.IcNeighborHoodDTO;
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.result.ImportTaskCommonResultDTO;
import com.epmet.entity.IcNeighborHoodEntity;
@ -154,5 +154,5 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @param params
* @return
*/
PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodFormDTO params);
PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodAddFormDTO params);
}

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

@ -17,9 +17,10 @@
package com.epmet.service;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.excel.IcNeighborHoodExcel;
import javax.servlet.http.HttpServletResponse;
@ -33,24 +34,24 @@ import java.util.List;
*/
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
*/
void DelNeighborhood(String neighborHoodId);
void delNeighborhood(String neighborHoodId);
/**
* 导出数据
* @param formDTO
* @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);
}
}

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.exception.EpmetErrorCode;
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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -21,14 +22,8 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.*;
import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.form.IcBulidingFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
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.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.enums.BuildingTypeEnums;
import com.epmet.excel.IcBuildingExcel;
@ -38,6 +33,8 @@ import com.epmet.model.ImportBuildingInfoListener;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.*;
import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -93,7 +90,7 @@ public class BuildingServiceImpl implements BuildingService {
@Override
@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);
if (null != count && count > 0) {
@ -386,25 +383,19 @@ public class BuildingServiceImpl implements BuildingService {
//4.新增单元
icBuildingService.insertBatch(buildingEntityList);
icBuildingUnitService.insertBatch(icBuildingUnitEntityList);
/* if(!"".equals(str)){
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str.append("不存在").toString());
}*/
return numList;
}
@Override
public IcNeighborHoodResultDTO listBuilding(ListIcNeighborHoodFormDTO formDTO) {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
IPage<Map<String, Object>> resultMap = searchBuilding(formDTO);
result.setTotal(Long.valueOf(resultMap.getTotal()).intValue());
result.setList(resultMap.getRecords());
return result;
public PageData<IcBuildingListResultDTO> listBuilding(IcBuildingListFormDTO formDTO) {
PageInfo<IcBuildingListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> icBuildingDao.searchBuildingByPage(formDTO));
List<IcBuildingListResultDTO> records = pageInfo.getList();
records.forEach(item-> item.setBuildingType( BuildingTypeEnums.getTypeValue(item.getBuildingTypeKey())));
return new PageData<>(pageInfo.getList(),pageInfo.getTotal());
}
@Override
public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//如果类型是building 查楼栋
//导出楼栋
List<IcBuildingExcel> icBuildingExcels = searchAllBuilding(formDTO);
@ -467,7 +458,7 @@ public class BuildingServiceImpl implements BuildingService {
return new Result<>();
}
private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) {
private List<IcBuildingExcel> searchAllBuilding(IcHouseListFormDTO formDTO) {
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();
// neighborHoodEntityQueryWrapper.lambda()
@ -492,21 +483,6 @@ public class BuildingServiceImpl implements BuildingService {
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) {
BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO();
@ -545,7 +521,7 @@ public class BuildingServiceImpl implements BuildingService {
*/
@Override
@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());
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.ExcelReader;
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.StrConstant;
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.RenException;
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.CustomerStaffRedis;
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.form.*;
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.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -49,6 +48,8 @@ import com.epmet.model.ImportHouseInfoListener;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.*;
import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -102,7 +103,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Override
@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);
if (null != count && count > 0) {
@ -116,7 +117,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icHouseService.save(icHouseDTO);
}
private String getHouseName(IcHouseFormDTO formDTO){
private String getHouseName(IcHouseAddFormDTO formDTO){
//设置房间名 楼栋-单元号-门牌号
IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId());
IcBuildingUnitDTO icBuildingUnit = icBuildingUnitService.get(formDTO.getBuildingUnitId());
@ -133,7 +134,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
*/
@Override
@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());
if (null != count && count > 0) {
@ -251,37 +252,27 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
@Override
public IcNeighborHoodResultDTO listNeighborhood(String ancestorAgencyId,
String buildingId,
String ownerName,
String ownerPhone,
String neighborHoodName,
String buildingName,
Integer pageNo,
Integer pageSize,
String id,String level, String rentFlag) {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
public PageData<IcHouseListResultDTO> getHouseList(IcHouseListFormDTO formDTO) {
// 查询pids
String pids = null;
if (StringUtils.isNotBlank(ancestorAgencyId)) {
pids = getPids(ancestorAgencyId);
if (StringUtils.isNotBlank(formDTO.getAgencyId())) {
pids = getPids(formDTO.getAgencyId());
}
if (StringUtils.isNotBlank(level) && OrgTypeEnum.AGENCY.getCode().equals(level)){
pids = getPids(ancestorAgencyId);
if (StringUtils.isNotBlank(formDTO.getLevel()) && OrgTypeEnum.AGENCY.getCode().equals(formDTO.getLevel())){
pids = getPids(formDTO.getAgencyId());
}
formDTO.setPids(pids);
IPage<IcHouseEntity> page = new Page<IcHouseEntity>(pageNo,pageSize);
IPage<Map<String, Object>> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName,id,level,rentFlag);
List<Map<String, Object>> records = mapIPage.getRecords();
PageInfo<IcHouseListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() ->
icHouseDao.searchHouseByPage(formDTO));
List<IcHouseListResultDTO> records = pageInfo.getList();
records.forEach(item->{
item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey")));
item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey")));
item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey()));
item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey()));
});
result.setTotal(Long.valueOf(mapIPage.getTotal()).intValue());
result.setList(records);
return result;
return new PageData<>(records,pageInfo.getTotal());
}
public String getPids(String agencyId){
String pids = null;
@ -301,7 +292,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
@Override
public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//如果类型是house 查房屋
//导出房屋
@ -313,7 +304,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
return ;
}
private List<IcHouseExcel> searchAllHouse(ListIcNeighborHoodFormDTO formDTO) {
private List<IcHouseExcel> searchAllHouse(IcHouseListFormDTO formDTO) {
//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.IcPropertyManagementDao;
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.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -689,7 +689,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}
@Override
public PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodFormDTO params) {
public PageData<IcNeighborHoodDTO> openPage(IcNeighborHoodAddFormDTO params) {
LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId());
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 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.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -16,9 +15,9 @@ import com.epmet.dao.*;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcNeighborHoodPropertyDTO;
import com.epmet.dto.form.IcNeighborHoodFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
import com.epmet.entity.*;
import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.feign.GovOrgOpenFeignClient;
@ -26,6 +25,8 @@ import com.epmet.service.IcNeighborHoodPropertyService;
import com.epmet.service.IcNeighborHoodService;
import com.epmet.service.NeighborHoodService;
import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -72,7 +73,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
@Override
@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);
if (null != count && count > 0) {
@ -105,45 +106,19 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
/**
* 查询
* @param formDTO
* @return
*/
@Override
public IcNeighborHoodResultDTO listNeighborhood(ListIcNeighborHoodFormDTO 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");
public PageData<IcHouseListFormDTO> listNeighborhood(IcNeighborHoodListFormDTO formDTO) {
if(NeighborhoodConstant.GRID.equals(formDTO.getLevel())){
//根据网格过滤
neighbor.setGridId(formDTO.getId());
formDTO.setGridId(formDTO.getId());
}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
@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());
if (null != count && count > 0) {
@ -203,7 +178,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void DelNeighborhood(String neighborHoodId) {
public void delNeighborhood(String neighborHoodId) {
//删除小区
icNeighborHoodService.deleteById(neighborHoodId);
//删除小区物业关联
@ -220,7 +195,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
* @param response
*/
@Override
public void exportNeighborhoodinfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {
public void exportNeighborhoodinfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//导出小区
List<IcNeighborHoodExcel> icNeighborHoodExcels = searchAllNeighborhood(formDTO);
// 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<>();
// neighborHoodEntityQueryWrapper.lambda()
// .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 id="searchBuildingByPage" resultType="map">
<select id="searchBuildingByPage" resultType="com.epmet.dto.result.IcBuildingListResultDTO">
select
a.BUILDING_NAME as buildingName,
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 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'
<where>
<if test="building.neighborHoodId != null and building.neighborHoodId.trim() != ''">
AND a.NEIGHBOR_HOOD_ID = #{building.neighborHoodId}
<if test="neighborHoodId != null and neighborHoodId.trim() != ''">
AND a.NEIGHBOR_HOOD_ID = #{neighborHoodId}
</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 distinct BUILDING_ID from ic_house e
<where>
<if test="house.ownerName != null and house.ownerName.trim() != ''">
AND e.OWNER_NAME = #{house.ownerName}
<if test="ownerName != null and ownerName.trim() != ''">
AND e.OWNER_NAME = #{ownerName}
</if>
<if test="house.ownerPhone != null and house.ownerPhone.trim() != ''">
AND e.OWNER_PHONE = #{house.ownerPhone}
<if test="ownerPhone != null and ownerPhone.trim() != ''">
AND e.OWNER_PHONE = #{ownerPhone}
</if>
and e.DEL_FLAG='0'
</where>
)
</if>
<if test="building.delFlag != null and building.delFlag.trim() != ''">
AND a.DEL_FLAG = #{building.delFlag}
</if>
AND a.DEL_FLAG = '0'
</where>
order by a.CREATED_TIME, a.BUILDING_NAME
</select>

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

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

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

@ -57,54 +57,48 @@
</if>
</where>
</select>-->
<select id="searchNeighborhoodByPage" resultType="map">
<select id="searchNeighborhoodByPage" resultType="com.epmet.dto.form.IcHouseListFormDTO">
select
a.id as neighborHoodId,
a.NEIGHBOR_HOOD_NAME as neighborHoodName,
b.ORGANIZATION_NAME as agencyName,
c.GRID_NAME as gridName,
a.ADDRESS as address,
a.REMARK as remark,
b.ID as agencyId,
c.ID as gridId,
d.PROPERTY_ID as propertyId ,
a.LOCATION as location,
a.LONGITUDE as longitude,
a.LATITUDE as latitude
a.id as neighborHoodId,
a.NEIGHBOR_HOOD_NAME as neighborHoodName,
b.ORGANIZATION_NAME as agencyName,
c.GRID_NAME as gridName,
a.ADDRESS as address,
a.REMARK as remark,
b.ID as agencyId,
c.ID as gridId,
d.PROPERTY_ID as propertyId ,
a.LOCATION as location,
a.LONGITUDE as longitude,
a.LATITUDE as latitude
from ic_neighbor_hood a
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 ic_neighbor_hood_property d on a.ID = d.NEIGHBOR_HOOD_ID and d.DEL_FLAG='0'
<where>
<if test="neighbor.gridId != null and neighbor.gridId.trim() != ''">
AND a.GRID_ID = #{neighbor.gridId}
<if test="gridId != null and gridId.trim() != ''">
AND a.GRID_ID = #{gridId}
</if>
<if test="neighbor.agencyId != null and neighbor.agencyId.trim() != ''">
AND (a.AGENCY_ID = #{neighbor.agencyId} or CONCAT(':',a.AGENCY_PIDS, ':') like CONCAT('%:',#{neighbor.agencyId},':%'))
<if test="agencyId != null and agencyId.trim() != ''">
AND (a.AGENCY_ID = #{agencyId} or CONCAT(':',a.AGENCY_PIDS, ':') like CONCAT('%:',#{agencyId},':%'))
</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
<where>
<if test="house.ownerName != null and house.ownerName.trim() != ''">
AND e.OWNER_NAME like concat('%',#{house.ownerName},'%')
<if test="ownerName != null and ownerName.trim() != ''">
AND e.OWNER_NAME like concat('%',#{ownerName},'%')
</if>
<if test="house.ownerPhone != null and house.ownerPhone.trim() != ''">
AND e.OWNER_PHONE like concat('%',#{house.ownerPhone},'%')
<if test="ownerPhone != null and ownerPhone.trim() != ''">
AND e.OWNER_PHONE like concat('%',#{ownerPhone},'%')
</if>
and e.DEL_FLAG='0'
</where>
)
</if>
AND a.DEL_FLAG = '0'
<if test="neighbor.delFlag != null and neighbor.delFlag.trim() != ''">
AND a.DEL_FLAG = #{neighbor.delFlag}
</if>
</where>
ORDER BY a.CREATED_TIME
</select>

Loading…
Cancel
Save