Browse Source

房屋详情

master
zhaoqifeng 3 years ago
parent
commit
37fb4042fa
  1. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java
  2. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java
  3. 40
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -57,12 +58,12 @@ public class IcHouseDTO implements Serializable {
* 所属楼栋id
*/
private String buildingId;
private String buildingName;
/**
* 所属单元id
*/
private String buildingUnitId;
private String unitName;
/**
* 房屋名字后台插入时生成
*/
@ -77,17 +78,17 @@ public class IcHouseDTO implements Serializable {
* 房屋类型这里存储字典value就可以
*/
private String houseType;
private String houseTypeName;
/**
* 存储字典value
*/
private String purpose;
private String purposeName;
/**
* 1出租0未出租
*/
private Integer rentFlag;
private String rentName;
/**
* 房主姓名
*/

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseListResultDTO.java

@ -18,6 +18,7 @@ public class HouseListResultDTO implements Serializable {
private static final long serialVersionUID = 2063032844842070847L;
private String houseId;
private String houseName;
private String rentFlag;
private List<CategoryListBean> categoryList;
@NoArgsConstructor

40
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -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) {

Loading…
Cancel
Save