|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.OptionResultDTO; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
@ -18,11 +19,17 @@ import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
|
|
|
import com.epmet.dto.IcResiUserDTO; |
|
|
|
import com.epmet.dto.ImportGeneralDTO; |
|
|
|
import com.epmet.dto.form.HouseFormDTO; |
|
|
|
import com.epmet.dto.result.HouseInfoDTO; |
|
|
|
import com.epmet.dto.result.HouseListResultDTO; |
|
|
|
import com.epmet.dto.result.HousesNameResultDTO; |
|
|
|
import com.epmet.entity.IcHouseEntity; |
|
|
|
import com.epmet.enums.HousePurposeEnums; |
|
|
|
import com.epmet.enums.HouseRentFlagEnums; |
|
|
|
import com.epmet.enums.HouseTypeEnums; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.feign.OperCustomizeOpenFeignClient; |
|
|
|
import com.epmet.redis.IcHouseRedis; |
|
|
|
import com.epmet.service.IcHouseService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
@ -47,6 +54,10 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit |
|
|
|
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; |
|
|
|
@Resource |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
@Resource |
|
|
|
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; |
|
|
|
@Resource |
|
|
|
private IcHouseRedis icHouseRedis; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@ -77,7 +88,21 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit |
|
|
|
@Override |
|
|
|
public IcHouseDTO get(String id) { |
|
|
|
IcHouseEntity entity = baseDao.selectById(id); |
|
|
|
return ConvertUtils.sourceToTarget(entity, IcHouseDTO.class); |
|
|
|
IcHouseDTO dto = ConvertUtils.sourceToTarget(entity, IcHouseDTO.class); |
|
|
|
dto.setHouseTypeName(HouseTypeEnums.getTypeValue(dto.getHouseType())); |
|
|
|
dto.setRentName(HouseRentFlagEnums.getTypeValue(dto.getRentFlag())); |
|
|
|
dto.setPurposeName(HousePurposeEnums.getTypeValue(dto.getPurpose())); |
|
|
|
|
|
|
|
HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(id, dto.getCustomerId()); |
|
|
|
if (null != houseInfo) { |
|
|
|
dto.setBuildingName(houseInfo.getNeighborHoodName().concat(houseInfo.getBuildingName())); |
|
|
|
dto.setUnitName(houseInfo.getUnitName()); |
|
|
|
} else { |
|
|
|
dto.setBuildingName(StrConstant.EPMETY_STR); |
|
|
|
dto.setUnitName(StrConstant.EPMETY_STR); |
|
|
|
} |
|
|
|
|
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -188,6 +213,19 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit |
|
|
|
HouseListResultDTO dto = new HouseListResultDTO(); |
|
|
|
dto.setHouseId(item.getId()); |
|
|
|
dto.setHouseName(item.getHouseName()); |
|
|
|
switch (item.getRentFlag()){ |
|
|
|
case NumConstant.ZERO: |
|
|
|
dto.setRentFlag("自住"); |
|
|
|
break; |
|
|
|
case NumConstant.ONE: |
|
|
|
dto.setRentFlag("出租"); |
|
|
|
break; |
|
|
|
case NumConstant.TWO: |
|
|
|
dto.setRentFlag("闲置"); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
List<HouseListResultDTO.CategoryListBean> categories = new ArrayList<>(); |
|
|
|
if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) { |
|
|
|
for (IcResiCategoryStatsConfigDTO category : categoryList) { |
|
|
|