Browse Source

Merge branch 'dev_resi_export' into develop

dev
zhaoqifeng 3 years ago
parent
commit
9c7cb8576d
  1. 18
      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. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
  4. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java
  5. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  6. 40
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  7. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.17__edit_building_and_house.sql
  8. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx

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

@ -17,9 +17,10 @@
package com.epmet.dto; package com.epmet.dto;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
@ -57,12 +58,12 @@ public class IcHouseDTO implements Serializable {
* 所属楼栋id * 所属楼栋id
*/ */
private String buildingId; private String buildingId;
private String buildingName;
/** /**
* 所属单元id * 所属单元id
*/ */
private String buildingUnitId; private String buildingUnitId;
private String unitName;
/** /**
* 房屋名字后台插入时生成 * 房屋名字后台插入时生成
*/ */
@ -73,26 +74,21 @@ public class IcHouseDTO implements Serializable {
*/ */
private String doorName; private String doorName;
/**
* 排序
*/
private Integer sort;
/** /**
* 房屋类型这里存储字典value就可以 * 房屋类型这里存储字典value就可以
*/ */
private String houseType; private String houseType;
private String houseTypeName;
/** /**
* 存储字典value * 存储字典value
*/ */
private String purpose; private String purpose;
private String purposeName;
/** /**
* 1出租0未出租 * 1出租0未出租
*/ */
private Integer rentFlag; 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 static final long serialVersionUID = 2063032844842070847L;
private String houseId; private String houseId;
private String houseName; private String houseName;
private String rentFlag;
private List<CategoryListBean> categoryList; private List<CategoryListBean> categoryList;
@NoArgsConstructor @NoArgsConstructor

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java

@ -73,11 +73,6 @@ public class IcHouseEntity extends BaseEpmetEntity {
*/ */
private String doorName; private String doorName;
/**
* 排序
*/
private Integer sort;
/** /**
* 房屋类型这里存储字典value就可以 * 房屋类型这里存储字典value就可以
*/ */

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseInfoModel.java

@ -50,9 +50,6 @@ public class HouseInfoModel {
@ExcelProperty(value = "房主身份证") @ExcelProperty(value = "房主身份证")
private String ownerIdCard; private String ownerIdCard;
@ExcelProperty(value = "排序")
private Integer sort;
@ExcelIgnore @ExcelIgnore
private Integer num; private Integer num;

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -154,11 +154,6 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
disposeErrorMsg(info, "房主身份证的长度超出限制"); disposeErrorMsg(info, "房主身份证的长度超出限制");
return; return;
} }
if (null != data.getSort() && !isNumber(data.getSort().toString())){
nums.add(num);
disposeErrorMsg(info, "排序格式不正确");
return;
}
/** /**
* 2022-03-29 需求改动单元号修改 eg 1 改为 1单元 * 2022-03-29 需求改动单元号修改 eg 1 改为 1单元
* 做限制此字段中必须带有 "单元"2字不存在就不给导入 * 做限制此字段中必须带有 "单元"2字不存在就不给导入
@ -212,18 +207,6 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
} }
} }
public boolean isNumber(String str) {
if(str.length()>0) {
Pattern pattern = Pattern.compile("[0-9]*");
Matcher isNum = pattern.matcher(str);
if (!isNum.matches()) {
return false;
}
return true;
}
return false;
}
public void disposeErrorMsg(HouseInfoModel data,String msg){ public void disposeErrorMsg(HouseInfoModel data,String msg){
HouseErrorInfoModel err = ConvertUtils.sourceToTarget(data, HouseErrorInfoModel.class); HouseErrorInfoModel err = ConvertUtils.sourceToTarget(data, HouseErrorInfoModel.class);
err.setErrorMsg(msg); err.setErrorMsg(msg);

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.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
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.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
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.page.PageData;
@ -18,11 +19,17 @@ import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.HouseFormDTO; import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.HouseListResultDTO; import com.epmet.dto.result.HouseListResultDTO;
import com.epmet.dto.result.HousesNameResultDTO; import com.epmet.dto.result.HousesNameResultDTO;
import com.epmet.entity.IcHouseEntity; 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.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.IcHouseService; import com.epmet.service.IcHouseService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -47,6 +54,10 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Resource @Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Resource
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Resource
private IcHouseRedis icHouseRedis;
@Override @Override
@ -77,7 +88,21 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
@Override @Override
public IcHouseDTO get(String id) { public IcHouseDTO get(String id) {
IcHouseEntity entity = baseDao.selectById(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 @Override
@ -188,6 +213,19 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
HouseListResultDTO dto = new HouseListResultDTO(); HouseListResultDTO dto = new HouseListResultDTO();
dto.setHouseId(item.getId()); dto.setHouseId(item.getId());
dto.setHouseName(item.getHouseName()); 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<>(); List<HouseListResultDTO.CategoryListBean> categories = new ArrayList<>();
if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) { if (null != countMap && CollectionUtils.isNotEmpty(categoryList)) {
for (IcResiCategoryStatsConfigDTO category : categoryList) { for (IcResiCategoryStatsConfigDTO category : categoryList) {

1
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.17__edit_building_and_house.sql

@ -1,3 +1,2 @@
alter table ic_building add COLUMN BUILDING_LEADER_NAME VARCHAR(11) comment '楼长姓名' AFTER TOTAL_HOUSE_NUM; alter table ic_building add COLUMN BUILDING_LEADER_NAME VARCHAR(11) comment '楼长姓名' AFTER TOTAL_HOUSE_NUM;
alter table ic_building add COLUMN BUILDING_LEADER_MOBILE VARCHAR(11) comment '楼长电话' AFTER BUILDING_LEADER_NAME; alter table ic_building add COLUMN BUILDING_LEADER_MOBILE VARCHAR(11) comment '楼长电话' AFTER BUILDING_LEADER_NAME;
alter table ic_house add COLUMN SORT INT(11) comment '排序' DEFAULT 0 AFTER DOOR_NAME;

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx

Binary file not shown.
Loading…
Cancel
Save