|
@ -5,30 +5,31 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
import com.epmet.commons.tools.dto.result.OptionResultDTO; |
|
|
import com.epmet.commons.tools.dto.result.OptionResultDTO; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; |
|
|
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; |
|
|
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
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.PidUtils; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.dao.IcBuildingDao; |
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
import com.epmet.dao.IcBuildingUnitDao; |
|
|
import com.epmet.dao.*; |
|
|
import com.epmet.dao.IcHouseDao; |
|
|
import com.epmet.dto.*; |
|
|
import com.epmet.dao.IcNeighborHoodDao; |
|
|
|
|
|
import com.epmet.dto.IcHouseDTO; |
|
|
|
|
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
|
|
|
|
|
import com.epmet.dto.IcResiUserDTO; |
|
|
|
|
|
import com.epmet.dto.ImportGeneralDTO; |
|
|
|
|
|
import com.epmet.dto.form.CheckHouseInfoFormDTO; |
|
|
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.result.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.entity.IcBuildingEntity; |
|
|
import com.epmet.dto.result.lingshan.HouseTreeDTO; |
|
|
import com.epmet.entity.IcBuildingUnitEntity; |
|
|
import com.epmet.dto.result.lingshan.LingshanPartyCenterHouseLianhuDTO; |
|
|
import com.epmet.entity.IcHouseEntity; |
|
|
import com.epmet.dto.result.lingshan.PartyCenterHouseBindLianHuDetailDTO; |
|
|
import com.epmet.entity.IcNeighborHoodEntity; |
|
|
import com.epmet.dto.result.lingshan.PartyCenterHouseResultDTO; |
|
|
|
|
|
import com.epmet.entity.*; |
|
|
import com.epmet.enums.HousePurposeEnums; |
|
|
import com.epmet.enums.HousePurposeEnums; |
|
|
import com.epmet.enums.HouseRentFlagEnums; |
|
|
import com.epmet.enums.HouseRentFlagEnums; |
|
|
import com.epmet.enums.HouseTypeEnums; |
|
|
import com.epmet.enums.HouseTypeEnums; |
|
@ -36,7 +37,10 @@ import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.OperCustomizeOpenFeignClient; |
|
|
import com.epmet.feign.OperCustomizeOpenFeignClient; |
|
|
import com.epmet.redis.IcHouseRedis; |
|
|
import com.epmet.redis.IcHouseRedis; |
|
|
|
|
|
import com.epmet.service.CustomerGridService; |
|
|
import com.epmet.service.IcHouseService; |
|
|
import com.epmet.service.IcHouseService; |
|
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
@ -73,6 +77,9 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit |
|
|
private IcBuildingUnitDao buildingUnitDao; |
|
|
private IcBuildingUnitDao buildingUnitDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private LingshanPartyCenterHouseLianhuDao partyCenterHouseLianhuDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public IcHouseDTO get(String id) { |
|
|
public IcHouseDTO get(String id) { |
|
@ -405,4 +412,124 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit |
|
|
|
|
|
|
|
|
return new Result<CheckHomeInfoResultInfo>().ok(checkHomeInfoResultInfo); |
|
|
return new Result<CheckHomeInfoResultInfo>().ok(checkHomeInfoResultInfo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 灵山项目-联户绑定 |
|
|
|
|
|
* 该接口返回:党员中心户房屋列表;默认登录用户查询本组织及下级 |
|
|
|
|
|
* |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public PageData<PartyCenterHouseResultDTO> queryPartyCenterHouseList(PartyCenterHousePageFormDTO formDTO) { |
|
|
|
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); |
|
|
|
|
|
PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); |
|
|
|
|
|
List<PartyCenterHouseResultDTO> list=baseDao.selectListPartyCenterHouse(formDTO.getCustomerId(),staffInfoCacheResult.getAgencyId(), |
|
|
|
|
|
formDTO.getNeighborHoodName(),formDTO.getBuildingName(),formDTO.getBuildingId(),formDTO.getPartyCenterHouseFlag()); |
|
|
|
|
|
list.forEach(item -> { |
|
|
|
|
|
item.setHouseTypeName(HouseTypeEnums.getTypeValue(item.getHouseType())); |
|
|
|
|
|
item.setPurposeName(HousePurposeEnums.getTypeValue(item.getPurpose())); |
|
|
|
|
|
}); |
|
|
|
|
|
PageInfo<PartyCenterHouseResultDTO> pageInfo = new PageInfo<>(list); |
|
|
|
|
|
return new PageData<>(list, pageInfo.getTotal(),formDTO.getPageSize()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 灵山项目-党员中心户,绑定联户 |
|
|
|
|
|
* |
|
|
|
|
|
* @param partyCenterHouseId |
|
|
|
|
|
* @param lianHuHouseList |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
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()); |
|
|
|
|
|
String gridIdPath=PidUtils.convertPid2OrgIdPath(gridDTO.getId(), gridDTO.getPids()); |
|
|
|
|
|
|
|
|
|
|
|
// 先删除
|
|
|
|
|
|
LambdaQueryWrapper<LingshanPartyCenterHouseLianhuEntity> queryWrapper=new LambdaQueryWrapper<>(); |
|
|
|
|
|
queryWrapper.eq(LingshanPartyCenterHouseLianhuEntity::getPartyCenterHouseId,partyCenterHouseId); |
|
|
|
|
|
partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(partyCenterHouseId); |
|
|
|
|
|
// 后插入
|
|
|
|
|
|
lianHuHouseList.forEach(lianHuHouse->{ |
|
|
|
|
|
//根据选中类型,查询下面的房屋
|
|
|
|
|
|
List<IcHouseEntity> list=new ArrayList<>(); |
|
|
|
|
|
if(!"house".equals(lianHuHouse.getType())){ |
|
|
|
|
|
LambdaQueryWrapper<IcHouseEntity> query = new LambdaQueryWrapper<>(); |
|
|
|
|
|
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(lianHuHouse.getId()); |
|
|
|
|
|
list.add(icHouseEntity); |
|
|
|
|
|
} |
|
|
|
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 灵山项目-查询联户房屋列表 |
|
|
|
|
|
* |
|
|
|
|
|
* @param partyCenterHouseId |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<LingshanPartyCenterHouseLianhuDTO> queryLianHuHouse(String partyCenterHouseId) { |
|
|
|
|
|
if(StringUtils.isBlank(partyCenterHouseId)){ |
|
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
|
} |
|
|
|
|
|
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; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|