Browse Source

/gov/org/icneighborhood/neighborhoodlist分页,且只根据小区名称检索

master
yinzuomei 2 years ago
parent
commit
e476725b24
  1. 34
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/ChooseGridFormDTO.java
  2. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  3. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  4. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  5. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  6. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

34
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/yt/ChooseGridFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form.yt;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/4/19 14:13
*/
@Data
public class ChooseGridFormDTO {
private Integer pageNo = 1;
private Integer pageSize = 200;
/**
* 客户id
*/
private String customerId;
/**
* 组织id
*/
private String agencyId;
/**
* 网格id
*/
private String gridId;
/**
* 楼栋名
*/
private String buildingName;
}

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

@ -40,6 +40,7 @@ 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.form.NeighborHoodOptionFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -183,8 +184,9 @@ public class IcNeighborHoodController {
* @date 2022/8/19 15:56 * @date 2022/8/19 15:56
*/ */
@PostMapping("neighborhoodlist") @PostMapping("neighborhoodlist")
public Result<List<BuildingResultDTO>> getNeighborhoodList(@LoginUser TokenDto tokenDto, @RequestBody IcNeighborHoodDTO dto) { public Result<List<BuildingResultDTO>> getNeighborhoodList(@LoginUser TokenDto tokenDto, @RequestBody ChooseGridFormDTO dto) {
return new Result<List<BuildingResultDTO>>().ok(icNeighborHoodService.getNeighborhoodList(tokenDto, dto)); dto.setCustomerId(tokenDto.getCustomerId());
return new Result<List<BuildingResultDTO>>().ok(icNeighborHoodService.getNeighborhoodList(dto));
} }
/** /**

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

@ -19,7 +19,6 @@ 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.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.IcBuildingListFormDTO; import com.epmet.dto.form.IcBuildingListFormDTO;
@ -240,12 +239,14 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
/** /**
* 展示所有楼栋和小区信息 * 展示所有楼栋和小区信息
* *
* @param dto
* @return java.util.List<com.epmet.dto.result.BuildingResultDTO> * @return java.util.List<com.epmet.dto.result.BuildingResultDTO>
* @author zhy * @author zhy
* @date 2022/8/19 17:32 * @date 2022/8/19 17:32
*/ */
List<BuildingResultDTO> listBuildingInfo(IcNeighborHoodDTO dto); List<BuildingResultDTO> listBuildingInfo(@Param("customerId")String customerId,
@Param("agencyId")String agencyId,
@Param("gridId") String gridId,
@Param("buildingName")String buildingName);
/** /**

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

@ -20,7 +20,6 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData; 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.utils.Result;
import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.ImportGeneralDTO;
@ -28,6 +27,7 @@ import com.epmet.dto.NeighborHoodAndManagementDTO;
import com.epmet.dto.form.IcNeighborHoodAddFormDTO; import com.epmet.dto.form.IcNeighborHoodAddFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.NeighborHoodOptionFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultDTO;
import com.epmet.dto.result.IcNeighborHoodDetailDTO; import com.epmet.dto.result.IcNeighborHoodDetailDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -123,13 +123,12 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
/** /**
* 获取用户组织下小区列表 * 获取用户组织下小区列表
* *
* @param tokenDto
* @param dto * @param dto
* @return java.util.List<com.epmet.dto.BuildingResultDTO> * @return java.util.List<com.epmet.dto.BuildingResultDTO>
* @author zhy * @author zhy
* @date 2022/8/19 15:57 * @date 2022/8/19 15:57
*/ */
List<BuildingResultDTO> getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto); List<BuildingResultDTO> getNeighborhoodList(ChooseGridFormDTO dto);
/** /**
* @Description 通过ID查询小区信息 * @Description 通过ID查询小区信息

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

@ -41,7 +41,6 @@ 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;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
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;
import com.epmet.constant.CustomerGridConstant; import com.epmet.constant.CustomerGridConstant;
@ -52,6 +51,7 @@ 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.form.NeighborHoodOptionFormDTO; import com.epmet.dto.form.NeighborHoodOptionFormDTO;
import com.epmet.dto.form.yt.ChooseGridFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.*; import com.epmet.entity.*;
import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.excel.IcNeighborHoodExcel;
@ -223,8 +223,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
public List<BuildingResultDTO> getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto) { public List<BuildingResultDTO> getNeighborhoodList(ChooseGridFormDTO dto) {
dto.setCustomerId(tokenDto.getCustomerId());
// if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) { // if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) {
// log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区"); // log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区");
// CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); // CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
@ -234,7 +233,9 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
// } // }
// dto.setAgencyId(result.getAgencyId()); // dto.setAgencyId(result.getAgencyId());
// } // }
return icBuildingDao.listBuildingInfo(dto); PageHelper.startPage(dto.getPageNo(), dto.getPageSize());
List<BuildingResultDTO> list = icBuildingDao.listBuildingInfo(dto.getCustomerId(), dto.getAgencyId(), dto.getGridId(), dto.getBuildingName());
return list;
} }
/** /**

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

@ -517,11 +517,13 @@
a.ALL_PARENT_NAME, a.ALL_PARENT_NAME,
a.ORGANIZATION_NAME AS AGENCY_NAME, a.ORGANIZATION_NAME AS AGENCY_NAME,
n.CUSTOMER_ID n.CUSTOMER_ID
FROM FROM ic_building b
ic_building b LEFT JOIN ic_neighbor_hood n
LEFT JOIN ic_neighbor_hood n ON b.NEIGHBOR_HOOD_ID = n.id ON b.NEIGHBOR_HOOD_ID = n.id
LEFT JOIN customer_grid g ON n.GRID_ID = g.id LEFT JOIN customer_grid g
LEFT JOIN customer_agency a ON a.id = g.pid ON n.GRID_ID = g.id
LEFT JOIN customer_agency a
ON a.id = g.pid
WHERE WHERE
n.DEL_FLAG = '0' n.DEL_FLAG = '0'
AND b.DEL_FLAG = '0' AND b.DEL_FLAG = '0'
@ -532,13 +534,14 @@
AND n.GRID_ID = #{gridId} AND n.GRID_ID = #{gridId}
</if> </if>
<if test="buildingName != null and buildingName != ''"> <if test="buildingName != null and buildingName != ''">
AND (n.NEIGHBOR_HOOD_NAME LIKE CONCAT('%', #{buildingName}, '%') OR b.BUILDING_NAME LIKE CONCAT('%', #{buildingName}, '%')) AND n.NEIGHBOR_HOOD_NAME LIKE CONCAT('%', #{buildingName}, '%')
</if> </if>
<if test="agencyId != null and agencyId != ''"> <if test="agencyId != null and agencyId != ''">
AND ( AND (
n.AGENCY_ID = #{agencyId} n.AGENCY_ID = #{agencyId}
OR n.AGENCY_PIDS LIKE CONCAT('%', #{agencyId}, '%')) OR n.AGENCY_PIDS LIKE CONCAT('%', #{agencyId}, '%'))
</if> </if>
order by n.CREATED_TIME asc,n.id asc
</select> </select>
<select id="getBuildingInfoByName" resultType="com.epmet.entity.IcBuildingEntity" <select id="getBuildingInfoByName" resultType="com.epmet.entity.IcBuildingEntity"

Loading…
Cancel
Save