|
|
@ -36,6 +36,7 @@ import com.epmet.enums.BuildingTypeEnums; |
|
|
|
import com.epmet.enums.OrganizationTypeEnums; |
|
|
|
import com.epmet.excel.IcBuildingExcel; |
|
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.model.BuildingInfoModel; |
|
|
|
import com.epmet.model.ImportBuildingInfoListener; |
|
|
|
import com.epmet.redis.IcHouseRedis; |
|
|
@ -43,6 +44,7 @@ import com.epmet.service.*; |
|
|
|
import com.epmet.util.ExcelPoiUtils; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.sun.org.apache.bcel.internal.generic.RETURN; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -94,6 +96,8 @@ public class BuildingServiceImpl implements BuildingService { |
|
|
|
private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl; |
|
|
|
@Autowired |
|
|
|
private CommunityBuildingManagerDao communityBuildingManagerDao; |
|
|
|
@Resource |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@ -655,6 +659,36 @@ public class BuildingServiceImpl implements BuildingService { |
|
|
|
return new Result<>(); |
|
|
|
} |
|
|
|
|
|
|
|
// @Transactional
|
|
|
|
@Override |
|
|
|
public Boolean changeBuilding(Map<String, Object> params) { |
|
|
|
|
|
|
|
|
|
|
|
// 找到本身的building 先改掉小区id
|
|
|
|
IcBuildingEntity building = icBuildingDao.selectById(params.get("buildingId").toString()); |
|
|
|
if (building == null){ |
|
|
|
return true; |
|
|
|
} |
|
|
|
building.setNeighborHoodId(params.get("neighborhoodId").toString()); |
|
|
|
icBuildingDao.updateById(building); |
|
|
|
|
|
|
|
// 找到该building的house 改掉小区id
|
|
|
|
LambdaQueryWrapper<IcHouseEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(IcHouseEntity::getBuildingId,building.getId()); |
|
|
|
List<IcHouseEntity> houseEntityList = icHouseDao.selectList(queryWrapper); |
|
|
|
houseEntityList.forEach(house->{ |
|
|
|
house.setNeighborHoodId(building.getNeighborHoodId()); |
|
|
|
icHouseDao.updateById(house); |
|
|
|
}); |
|
|
|
|
|
|
|
// 修改居民的小区id
|
|
|
|
epmetUserOpenFeignClient.changeResiNeighborHoodByBuilding(params); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
private List<IcBuildingExcel> searchAllBuilding(IcHouseListFormDTO formDTO) { |
|
|
|
IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); |
|
|
|
building.setDelFlag("0"); |
|
|
|