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