| 
						
						
							
								
							
						
						
					 | 
					@ -25,6 +25,7 @@ import com.epmet.dto.form.CheckHouseInfoFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.form.HouseFormDTO; | 
					 | 
					 | 
					import com.epmet.dto.form.HouseFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.form.lingshan.PartyCenterHousePageFormDTO; | 
					 | 
					 | 
					import com.epmet.dto.form.lingshan.PartyCenterHousePageFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.result.*; | 
					 | 
					 | 
					import com.epmet.dto.result.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuDetailDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO; | 
					 | 
					 | 
					import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.*; | 
					 | 
					 | 
					import com.epmet.entity.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.enums.HousePurposeEnums; | 
					 | 
					 | 
					import com.epmet.enums.HousePurposeEnums; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -438,29 +439,46 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param lianHuHouseIdList | 
					 | 
					 | 
					     * @param lianHuHouseIdList | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    public void bingLianHu(String partyCenterHouseId, List<String> lianHuHouseIdList) { | 
					 | 
					 | 
					    public void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseIdList) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        IcHouseEntity partyCenterHouse=baseDao.selectById(partyCenterHouseId); | 
					 | 
					 | 
					        IcHouseEntity partyCenterHouse=baseDao.selectById(partyCenterHouseId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        IcNeighborHoodEntity neighborHoodEntity=icNeighborHoodDao.selectById(partyCenterHouse.getNeighborHoodId()); | 
					 | 
					 | 
					        IcNeighborHoodEntity neighborHoodEntity=icNeighborHoodDao.selectById(partyCenterHouse.getNeighborHoodId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        CustomerGridDTO gridDTO=SpringContextUtils.getBean(CustomerGridService.class).get(neighborHoodEntity.getGridId()); | 
					 | 
					 | 
					        CustomerGridDTO gridDTO=SpringContextUtils.getBean(CustomerGridService.class).get(neighborHoodEntity.getGridId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        String gridIdPath=PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // 先删除
 | 
					 | 
					 | 
					        // 先删除
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        LambdaQueryWrapper<LingshanPartyCenterHouseLianhuEntity> queryWrapper=new LambdaQueryWrapper<>(); | 
					 | 
					 | 
					        LambdaQueryWrapper<LingshanPartyCenterHouseLianhuEntity> queryWrapper=new LambdaQueryWrapper<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        queryWrapper.eq(LingshanPartyCenterHouseLianhuEntity::getPartyCenterHouseId,partyCenterHouseId); | 
					 | 
					 | 
					        queryWrapper.eq(LingshanPartyCenterHouseLianhuEntity::getPartyCenterHouseId,partyCenterHouseId); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        partyCenterHouseLianhuDao.delete(queryWrapper); | 
					 | 
					 | 
					        partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(partyCenterHouseId); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        // 后插入
 | 
					 | 
					 | 
					        // 后插入
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        lianHuHouseIdList.forEach(lianHuHouseId->{ | 
					 | 
					 | 
					        lianHuHouseIdList.forEach(lianHuHouseId->{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            IcHouseEntity icHouseEntity=baseDao.selectById(lianHuHouseId); | 
					 | 
					 | 
					            //根据选中类型,查询下面的房屋
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            if(null!=icHouseEntity){ | 
					 | 
					 | 
					            List<IcHouseEntity> list=new ArrayList<>(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                LingshanPartyCenterHouseLianhuEntity entity=new LingshanPartyCenterHouseLianhuEntity(); | 
					 | 
					 | 
					            if(!"house".equals(lianHuHouseId.getType())){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setCustomerId(neighborHoodEntity.getCustomerId()); | 
					 | 
					 | 
					                LambdaQueryWrapper<IcHouseEntity> query = new LambdaQueryWrapper<>(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setPartyCenterHouseId(partyCenterHouseId); | 
					 | 
					 | 
					                query.eq("neighborHood".equals(lianHuHouseId.getType()), IcHouseEntity::getNeighborHoodId, lianHuHouseId.getId()) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setAgencyId(neighborHoodEntity.getAgencyId()); | 
					 | 
					 | 
					                        .eq("building".equals(lianHuHouseId.getType()), IcHouseEntity::getBuildingId, lianHuHouseId.getId()) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setGridId(neighborHoodEntity.getGridId()); | 
					 | 
					 | 
					                        .eq("unit".equals(lianHuHouseId.getType()), IcHouseEntity::getBuildingUnitId, lianHuHouseId.getId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setGridIdPath(PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids())); | 
					 | 
					 | 
					                list.addAll(baseDao.selectList(query)); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setNeighborHoodId(icHouseEntity.getNeighborHoodId()); | 
					 | 
					 | 
					            }else{ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setBuildingId(icHouseEntity.getBuildingId()); | 
					 | 
					 | 
					                IcHouseEntity icHouseEntity=baseDao.selectById(lianHuHouseId.getId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setBuildingUnitId(icHouseEntity.getBuildingUnitId()); | 
					 | 
					 | 
					                list.add(icHouseEntity); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                entity.setHouseId(lianHuHouseId); | 
					 | 
					 | 
					            } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                partyCenterHouseLianhuDao.insert(entity); | 
					 | 
					 | 
					            if(CollectionUtils.isNotEmpty(list)){ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                for(IcHouseEntity houseEntity:list){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    LingshanPartyCenterHouseLianhuEntity entity=new LingshanPartyCenterHouseLianhuEntity(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setPartyCenterHouseId(partyCenterHouseId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    //目前只能绑定同一个网格下的房屋
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setCustomerId(neighborHoodEntity.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setAgencyId(neighborHoodEntity.getAgencyId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setGridId(neighborHoodEntity.getGridId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setGridIdPath(gridIdPath); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setNeighborHoodId(houseEntity.getNeighborHoodId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setBuildingId(houseEntity.getBuildingId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setBuildingUnitId(houseEntity.getBuildingUnitId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    entity.setHouseId(houseEntity.getId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    partyCenterHouseLianhuDao.insert(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }); | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |