Browse Source

Merge remote-tracking branch 'origin/lingshan_master' into dev

# Conflicts:
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
master
yinzuomei 2 years ago
parent
commit
b5d347347f
  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. 75
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingshanPartyCenterHouseLianhuDTO.java
  4. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PartyCenterHouseBindLianHuFormDTO.java
  5. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PartyCenterHouseResultDTO.java
  6. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  7. 22
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  8. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/LingshanPartyCenterHouseLianhuDao.java
  9. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  10. 53
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  11. 50
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  12. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  13. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/LingshanPartyCenterHouseLianhuDao.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;
}

75
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingshanPartyCenterHouseLianhuDTO.java

@ -0,0 +1,75 @@
package com.epmet.dto.result.lingshan;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* 灵山_党员中心户联户
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-16
*/
@Data
public class LingshanPartyCenterHouseLianhuDTO implements Serializable {
/**
* 主键联户记录表
*/
@JsonIgnore
private String id;
/**
* 客户id
*/
@JsonIgnore
private String customerId;
/**
* 党员中心户房屋idlingshan_party_center_house.HOUSE_ID
*/
@JsonIgnore
private String partyCenterHouseId;
/**
* 联户房屋所属组织id
*/
@JsonIgnore
private String agencyId;
/**
* 联户房屋所属网格id
*/
@JsonIgnore
private String gridId;
/**
* 联户grid_id的path包含grid_id
*/
@JsonIgnore
private String gridIdPath;
/**
* 联户小区id
*/
private String neighborHoodId;
/**
* 联户楼栋id
*/
private String buildingId;
/**
* 联户单元id
*/
private String buildingUnitId;
/**
* 联户联户房屋id
*/
private String houseId;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PartyCenterHouseBindLianHuFormDTO.java

@ -12,6 +12,6 @@ import java.util.List;
@Data
public class PartyCenterHouseBindLianHuFormDTO {
private String partyCenterHouseId;
private List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseIdList;
private List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseList;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PartyCenterHouseResultDTO.java

@ -93,6 +93,9 @@ public class PartyCenterHouseResultDTO {
* 联户数
*/
private Integer totalLianHu;
/**
* 灵山项目是否党员中心户1是0不是
*/
private String partyCenterHouseFlag;
}

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

@ -54,6 +54,7 @@ import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.dto.result.*;
import com.epmet.excel.EnterpriseExportExcelDTO;
import com.epmet.excel.HousePictureListExcelDTO;
import com.epmet.dto.result.lingshan.*;
import com.epmet.service.IcHouseService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -298,7 +299,7 @@ public class IcHouseController {
@PostMapping("bingLianHu")
public Result bingLianHu( @RequestBody PartyCenterHouseBindLianHuFormDTO formDTO) {
if(StringUtils.isNotBlank(formDTO.getPartyCenterHouseId())){
icHouseService.bingLianHu(formDTO.getPartyCenterHouseId(),formDTO.getLianHuHouseIdList());
icHouseService.bingLianHu(formDTO.getPartyCenterHouseId(),formDTO.getLianHuHouseList());
}
return new Result();
}
@ -309,12 +310,23 @@ public class IcHouseController {
* @param partyCenterHouseId
* @return
*/
@PostMapping("queryLianHuHouseId/{partyCenterHouseId}")
public Result<List<String>> queryLianHuHouseId(@PathVariable("partyCenterHouseId") String partyCenterHouseId) {
List<String> list = icHouseService.queryLianHuHouseId(partyCenterHouseId);
return new Result<List<String>>().ok(list);
@PostMapping("queryLianHuHouse/{partyCenterHouseId}")
public Result<List<LingshanPartyCenterHouseLianhuDTO>> queryLianHuHouse(@PathVariable("partyCenterHouseId") String partyCenterHouseId) {
List<LingshanPartyCenterHouseLianhuDTO> list = icHouseService.queryLianHuHouse(partyCenterHouseId);
return new Result<List<LingshanPartyCenterHouseLianhuDTO>>().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

@ -23,6 +23,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;
@ -256,4 +257,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);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/LingshanPartyCenterHouseLianhuDao.java

@ -4,8 +4,6 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.LingshanPartyCenterHouseLianhuEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 灵山_党员中心户联户
*
@ -15,12 +13,5 @@ import java.util.List;
@Mapper
public interface LingshanPartyCenterHouseLianhuDao extends BaseDao<LingshanPartyCenterHouseLianhuEntity> {
/**
* 查询党员中心对应的联户房屋id
* @param partyCenterHouseId
* @return
*/
List<String> queryLianHuHouseId(String partyCenterHouseId);
int deleteByPartyCenterHouseId(String partyCenterHouseId);
}

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

@ -16,6 +16,8 @@ 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.LingshanPartyCenterHouseLianhuDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuDetailDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.entity.IcHouseEntity;
@ -161,14 +163,24 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
/**
* 灵山项目-党员中心户绑定联户
* @param partyCenterHouseId
* @param lianHuHouseIdList
* @param lianHuHouseList
*/
void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseIdList);
void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseList);
/**
* 灵山项目-查询联户房屋列表
* @param partyCenterHouseId
* @return
*/
List<String> queryLianHuHouseId(String partyCenterHouseId);
List<LingshanPartyCenterHouseLianhuDTO> queryLianHuHouse(String partyCenterHouseId);
/**
* 灵山项目-绑定联户时候选择同网格内的房屋
* 房屋树小区-楼栋-单元-房屋共4级
* 可以根据网格id的房屋
*
* @param gridId
* @return
*/
List<HouseTreeDTO> getOrgTreeData(String gridId);
}

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

@ -32,6 +32,8 @@ import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.form.lingshan.PartyCenterHousePageFormDTO;
import com.epmet.dto.region.LogOperationResultDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.HouseTreeDTO;
import com.epmet.dto.result.lingshan.LingshanPartyCenterHouseLianhuDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuDetailDTO;
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO;
import com.epmet.entity.*;
@ -602,10 +604,10 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
* 灵山项目-党员中心户绑定联户
*
* @param partyCenterHouseId
* @param lianHuHouseIdList
* @param lianHuHouseList
*/
@Override
public void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseIdList) {
public void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseList) {
IcHouseEntity partyCenterHouse=baseDao.selectById(partyCenterHouseId);
IcNeighborHoodEntity neighborHoodEntity=icNeighborHoodDao.selectById(partyCenterHouse.getNeighborHoodId());
CustomerGridDTO gridDTO=SpringContextUtils.getBean(CustomerGridService.class).get(neighborHoodEntity.getGridId());
@ -616,17 +618,17 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
queryWrapper.eq(LingshanPartyCenterHouseLianhuEntity::getPartyCenterHouseId,partyCenterHouseId);
partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(partyCenterHouseId);
// 后插入
lianHuHouseIdList.forEach(lianHuHouseId->{
lianHuHouseList.forEach(lianHuHouse->{
//根据选中类型,查询下面的房屋
List<IcHouseEntity> list=new ArrayList<>();
if(!"house".equals(lianHuHouseId.getType())){
if(!"house".equals(lianHuHouse.getType())){
LambdaQueryWrapper<IcHouseEntity> query = new LambdaQueryWrapper<>();
query.eq("neighborHood".equals(lianHuHouseId.getType()), IcHouseEntity::getNeighborHoodId, lianHuHouseId.getId())
.eq("building".equals(lianHuHouseId.getType()), IcHouseEntity::getBuildingId, lianHuHouseId.getId())
.eq("unit".equals(lianHuHouseId.getType()), IcHouseEntity::getBuildingUnitId, lianHuHouseId.getId());
query.eq("neighborHood".equals(lianHuHouse.getType()), IcHouseEntity::getNeighborHoodId, lianHuHouse.getId())
.eq("building".equals(lianHuHouse.getType()), IcHouseEntity::getBuildingId, lianHuHouse.getId())
.eq("unit".equals(lianHuHouse.getType()), IcHouseEntity::getBuildingUnitId, lianHuHouse.getId());
list.addAll(baseDao.selectList(query));
}else{
IcHouseEntity icHouseEntity=baseDao.selectById(lianHuHouseId.getId());
IcHouseEntity icHouseEntity=baseDao.selectById(lianHuHouse.getId());
list.add(icHouseEntity);
}
if(CollectionUtils.isNotEmpty(list)){
@ -657,12 +659,43 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
* @return
*/
@Override
public List<String> queryLianHuHouseId(String partyCenterHouseId) {
public List<LingshanPartyCenterHouseLianhuDTO> queryLianHuHouse(String partyCenterHouseId) {
if(StringUtils.isBlank(partyCenterHouseId)){
return new ArrayList<>();
}
return partyCenterHouseLianhuDao.queryLianHuHouseId(partyCenterHouseId);
LambdaQueryWrapper<LingshanPartyCenterHouseLianhuEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(LingshanPartyCenterHouseLianhuEntity::getPartyCenterHouseId,partyCenterHouseId);
List<LingshanPartyCenterHouseLianhuEntity> list=partyCenterHouseLianhuDao.selectList(queryWrapper);
return ConvertUtils.sourceToTarget(list,LingshanPartyCenterHouseLianhuDTO.class);
}
/**
* 灵山项目-绑定联户时候选择同网格内的房屋
* 房屋树小区-楼栋-单元-房屋共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

@ -566,4 +566,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>

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

@ -954,7 +954,8 @@
from lingshan_party_center_house_lianhu r
where r.PARTY_CENTER_HOUSE_ID=ih.ID
and r.DEL_FLAG='0'
)as totalLianHu
)as totalLianHu,
ih.PARTY_CENTER_HOUSE_FLAG as partyCenterHouseFlag
FROM
ic_house ih
inner join ic_building_unit u

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/LingshanPartyCenterHouseLianhuDao.xml

@ -22,16 +22,6 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 查询党员中心对应的联户房屋id -->
<select id="queryLianHuHouseId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
distinct h.HOUSE_ID
FROM
lingshan_party_center_house_lianhu h
WHERE
h.DEL_FLAG = '0'
AND h.PARTY_CENTER_HOUSE_ID = #{partyCenterHouseId}
</select>
<delete id="deleteByPartyCenterHouseId" parameterType="java.lang.String">
delete from lingshan_party_center_house_lianhu where PARTY_CENTER_HOUSE_ID=#{partyCenterHouseId}

Loading…
Cancel
Save