Browse Source

网格下的小区树:gov/org/ichouse/housetree

master
yinzuomei 2 years ago
parent
commit
75b5d35463
  1. 28
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/HouseTreeDTO.java
  2. 14
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/HouseTreeFormDTO.java
  3. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  4. 22
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  5. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  6. 29
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  7. 50
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

28
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/HouseTreeDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2023/5/17 9:21
*/
@Data
public class HouseTreeDTO {
private String id;
/**
* 小区neighborHood
* 楼栋building
* 单元unit
* 房屋:house
*/
private String type;
private String name;
/**
* 下级机关组织
*/
private List<HouseTreeDTO> children;
}

14
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/HouseTreeFormDTO.java

@ -0,0 +1,14 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/5/17 9:29
*/
@Data
public class HouseTreeFormDTO {
private String gridId;
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java

@ -29,10 +29,9 @@ import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.form.lingshan.PartyCenterHousePageFormDTO;
import com.epmet.dto.result.HouseAgencyInfoResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.HouseTreeDTO;
import com.epmet.dto.result.lingshan.HouseTreeFormDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuFormDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.service.IcHouseService;
@ -206,6 +205,17 @@ public class IcHouseController {
return new Result<List<String>>().ok(list);
}
/**
* 灵山项目-绑定联户时候选择同网格内的房屋
* 房屋树小区-楼栋-单元-房屋共4级
* 可以根据网格id的房屋
*
* @param formDTO
* @return
*/
@PostMapping("housetree")
public Result<List<HouseTreeDTO>> getOrgTreeData(@RequestBody HouseTreeFormDTO formDTO) {
return new Result<List<HouseTreeDTO>>().ok(icHouseService.getOrgTreeData(formDTO.getGridId()));
}
}

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

@ -24,6 +24,7 @@ import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.IcBuildingListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.HouseTreeDTO;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.entity.IcHouseEntity;
@ -255,4 +256,25 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
*/
IcBuildingEntity getBuildingInfoByName(CheckHouseInfoFormDTO formDTO);
/**
* 1楼栋节点
* @param neighborHoodId
* @return
*/
List<HouseTreeDTO> selectBuildingTree(@Param("neighborHoodId") String neighborHoodId);
/**
* 2单元节点
* @param buildingId
* @return
*/
List<HouseTreeDTO> selectUnit(@Param("buildingId") String buildingId);
/**
* 3房屋节点
* @param unitId
* @return
*/
List<HouseTreeDTO> selectHouseTree(@Param("unitId") String unitId);
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java

@ -14,6 +14,7 @@ import com.epmet.dto.result.HouseAgencyInfoResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.dto.result.lingshan.HouseTreeDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuDetailDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -164,4 +165,14 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
* @return
*/
List<String> queryLianHuHouseId(String partyCenterHouseId);
/**
* 灵山项目-绑定联户时候选择同网格内的房屋
* 房屋树小区-楼栋-单元-房屋共4级
* 可以根据网格id的房屋
*
* @param gridId
* @return
*/
List<HouseTreeDTO> getOrgTreeData(String gridId);
}

29
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.form.lingshan.PartyCenterHousePageFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.HouseTreeDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuDetailDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.entity.*;
@ -498,5 +499,33 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
return partyCenterHouseLianhuDao.queryLianHuHouseId(partyCenterHouseId);
}
/**
* 灵山项目-绑定联户时候选择同网格内的房屋
* 房屋树小区-楼栋-单元-房屋共4级
* 可以根据网格id的房屋
*
* @param gridId
* @return
*/
@Override
public List<HouseTreeDTO> getOrgTreeData(String gridId) {
LambdaQueryWrapper<IcNeighborHoodEntity> neighborHoodWrapper = new LambdaQueryWrapper<>();
neighborHoodWrapper.eq(IcNeighborHoodEntity::getGridId, gridId)
.select(IcNeighborHoodEntity::getId,IcNeighborHoodEntity::getNeighborHoodName);
List<IcNeighborHoodEntity> list = icNeighborHoodDao.selectList(neighborHoodWrapper);
List<HouseTreeDTO> resultList = new ArrayList<>();
for (IcNeighborHoodEntity neighborHoodEntity : list) {
HouseTreeDTO houseTreeDTO = new HouseTreeDTO();
houseTreeDTO.setId(neighborHoodEntity.getId());
houseTreeDTO.setType("neighborHood");
houseTreeDTO.setName(neighborHoodEntity.getNeighborHoodName());
List<HouseTreeDTO> buildingList=icBuildingDao.selectBuildingTree(neighborHoodEntity.getId());
houseTreeDTO.setChildren(buildingList);
resultList.add(houseTreeDTO);
}
return resultList;
}
}

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

@ -552,4 +552,54 @@
</select>
<resultMap id="HouseTreeDTOMap" type="com.epmet.dto.result.lingshan.HouseTreeDTO">
<result property="id" column="id"/>
<result property="name" column="BUILDING_NAME"/>
<result property="type" column="type"/>
<collection property="children" ofType="com.epmet.dto.result.lingshan.HouseTreeDTO"
column="{buildingId=id}" select="com.epmet.dao.IcBuildingDao.selectUnit"/>
</resultMap>
<!-- 楼栋节点 -->
<select id="selectBuildingTree" parameterType="map" resultMap="HouseTreeDTOMap">
select id ,
BUILDING_NAME,
'building' as type
from ic_building
where DEL_FLAG = '0'
and NEIGHBOR_HOOD_ID = #{neighborHoodId}
order by sort asc,CREATED_TIME asc
</select>
<resultMap id="UnitMap" type="com.epmet.dto.result.lingshan.HouseTreeDTO">
<result property="id" column="id"/>
<result property="name" column="UNIT_NAME"/>
<result property="type" column="type"/>
<collection property="children" ofType="com.epmet.dto.result.lingshan.HouseTreeDTO"
column="{unitId=id}" select="com.epmet.dao.IcBuildingDao.selectHouseTree"/>
</resultMap>
<!-- 单元节点 -->
<select id="selectUnit" parameterType="map" resultMap="UnitMap">
SELECT
u.ID,
u.UNIT_NAME,
'unit' AS type
FROM
ic_building_unit u
WHERE
u.DEL_FLAG = '0'
AND u.BUILDING_ID = #{buildingId}
ORDER BY
u.UNIT_NUM ASC
</select>
<!-- 房屋节点 -->
<select id="selectHouseTree" parameterType="map" resultType="com.epmet.dto.result.lingshan.HouseTreeDTO">
select ih.id,
ih.DOOR_NAME as name,
'house' as type
from ic_house ih
where ih.DEL_FLAG='0'
and ih.BUILDING_UNIT_ID=#{unitId}
order by ih.DOOR_NAME asc
</select>
</mapper>

Loading…
Cancel
Save