Browse Source

/gov/org/house/group-rent-house-list

master
yinzuomei 3 years ago
parent
commit
a2c00f431f
  1. 77
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupRentHouseResultDTO.java
  2. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  3. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  5. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  6. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

77
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GroupRentHouseResultDTO.java

@ -0,0 +1,77 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 群租房列表
* @Author yzm
* @Date 2023/3/3 9:27
*/
@Data
public class GroupRentHouseResultDTO implements Serializable {
private static final long serialVersionUID = 3671964765109154117L;
private String houseId;
/**
* 所属组织
*/
private String agencyName;
private String agencyId;
/**
* 所属网格
*/
private String gridName;
private String gridId;
/**
* 所属小区
*/
private String neighborHoodName;
/**
* 所属楼栋
*/
private String buildingName;
private String houseName;
/**
* 房屋类型
*/
private String houseType;
private String houseTypeKey;
/**
* 房屋用途
*/
private String purpose;
private String purposeKey;
/**
* 房屋状态房屋状态:1出租 0自住 2闲置 3未售出
*/
private String rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房主身份证
*/
private String ownerIdCard;
/**
* 备注
*/
private String remark;
/**
* 排序
*/
private Double sort;
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -700,10 +700,10 @@ public class HouseController implements ResultDataResolver {
@PostMapping("group-rent-house-list")
@MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"},
fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE})
public Result<PageData<IcHouseListResultDTO>> groupRentHouseList(@LoginUser TokenDto tokenDto, @RequestBody GroupRentHouseFormDTO formDTO) {
public Result<PageData<GroupRentHouseResultDTO>> groupRentHouseList(@LoginUser TokenDto tokenDto, @RequestBody GroupRentHouseFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<IcHouseListResultDTO>>().ok(houseService.groupRentHouseList(formDTO));
return new Result<PageData<GroupRentHouseResultDTO>>().ok(houseService.groupRentHouseList(formDTO));
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -217,5 +217,5 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
* @param formDTO
* @return
*/
List<IcHouseListResultDTO> selectGroupRentHouseList(GroupRentHouseFormDTO formDTO);
List<GroupRentHouseResultDTO> selectGroupRentHouseList(GroupRentHouseFormDTO formDTO);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -210,5 +210,5 @@ public interface HouseService {
* @param formDTO
* @return
*/
PageData<IcHouseListResultDTO> groupRentHouseList(GroupRentHouseFormDTO formDTO);
PageData<GroupRentHouseResultDTO> groupRentHouseList(GroupRentHouseFormDTO formDTO);
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -1493,7 +1493,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
* @return
*/
@Override
public PageData<IcHouseListResultDTO> groupRentHouseList(GroupRentHouseFormDTO formDTO) {
public PageData<GroupRentHouseResultDTO> groupRentHouseList(GroupRentHouseFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getOrgId())){
//默认查询当前组织及下级
formDTO.setOrgType("agency");
@ -1502,8 +1502,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
//群租房:出租状态并超过5人(≥5)
PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize());
List<IcHouseListResultDTO> list=icHouseDao.selectGroupRentHouseList(formDTO);
PageInfo<IcHouseListResultDTO> pageInfo = new PageInfo<>(list);
List<GroupRentHouseResultDTO> list=icHouseDao.selectGroupRentHouseList(formDTO);
list.forEach(item -> {
item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey()));
item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey()));
});
PageInfo<GroupRentHouseResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
}

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -702,10 +702,16 @@
CONVERT(a.DOOR_NAME using gbk)
</select>
<select id="selectGroupRentHouseList" parameterType="com.epmet.dto.form.GroupRentHouseFormDTO" resultType="com.epmet.dto.result.IcHouseListResultDTO">
<select id="selectGroupRentHouseList" parameterType="com.epmet.dto.form.GroupRentHouseFormDTO" resultType="com.epmet.dto.result.GroupRentHouseResultDTO">
SELECT
ih.ID AS houseId,
n.AGENCY_ID as agencyId,
ca.ORGANIZATION_NAME as agencyName,
n.GRID_ID as gridId,
cg.GRID_NAME as gridName,
concat( n.NEIGHBOR_HOOD_NAME, ib.BUILDING_NAME, bu.UNIT_NAME, ih.DOOR_NAME ) AS houseName,
n.NEIGHBOR_HOOD_NAME as neighborHoodName,
ib.BUILDING_NAME as buildingName,
ih.HOUSE_TYPE AS houseTypeKey,
ih.PURPOSE AS purposeKey,
(
@ -732,6 +738,8 @@
LEFT JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id )
LEFT JOIN ic_neighbor_hood n ON ( ib.NEIGHBOR_HOOD_ID = n.ID )
LEFT JOIN ic_building_unit bu ON ( ih.BUILDING_UNIT_ID = bu.id )
left join customer_agency ca on(n.AGENCY_ID=ca.id)
left join customer_grid cg on(n.grid_id=cg.id)
WHERE
ih.DEL_FLAG = '0'
AND ib.DEL_FLAG = '0'

Loading…
Cancel
Save