Browse Source

工作端-我的家庭相关接口

feature/teamB_zz_wgh
Jackwang 3 years ago
parent
commit
c65eb4ee87
  1. 19
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInfoFormDTO.java
  2. 105
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoResultDTO.java
  3. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  5. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  6. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  7. 21
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

19
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInfoFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-06-09 15:12
**/
@Data
public class HouseInfoFormDTO implements Serializable {
@NotNull(message = "房屋编码不可为空")
private String houseCode;
}

105
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoResultDTO.java

@ -0,0 +1,105 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-06-09 15:22
**/
@Data
public class HouseInfoResultDTO implements Serializable {
private String houseId;
private String houseName;
private String houseCode;
private String houseQrcodeUrl;
private String customerId;
/**
* 所属行政组织
*/
private String agencyId;
private String agencyName;
/**
* eg市北区-阜新路街道-南宁社区
*/
private String agencyPathName;
/**
* 组织的area_code
*/
private String areaCode;
/**
* 所属网格
*/
private String gridName;
private String gridId;
/**
* 所属小区
*/
private String neighborHoodId;
private String neighborHoodName;
/**
* 所属楼栋
*/
private String buildingId;
private String buildingName;
/**
* 所属单元id
*/
private String buildingUnitId;
private String unitName;
/**
* 门牌号
*/
private String doorName;
/**
* 房屋类型这里存储字典value就可以
*/
private String houseType;
private String houseTypeName;
/**
* 存储字典value
*/
private String purpose;
private String purposeName;
/**
* 1出租0未出租
*/
private Integer rentFlag;
private String rentName;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房主身份证号
*/
private String ownerIdCard;
/**
* 备注
*/
private String remark;
}

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

@ -551,6 +551,21 @@ public class HouseController implements ResultDataResolver {
@PostMapping("createHouseQrcodeUrl")
public String createHouseQrcodeUrl(@RequestBody TestFormDTO formDTO) throws Exception {
return houseService.createHouseQrcodeUrl(formDTO.getHouseId(),null);
}
/**
* @describe: 工作端-通过房屋编码获取房屋信息
* @author wangtong
* @date 2022/6/9 14:48
* @params [tokenDto]
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("getHomeInfoByHouseCode")
public Result getHomeInfoByHouseCode(@RequestBody HouseInfoFormDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto);
return houseService.getHomeInfoByHouseCode(dto);
}
}

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

@ -138,4 +138,13 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
* @return com.epmet.dto.result.IcHouseQrcodeConfigDTO
*/
CustomerOrgParameterEntity selectByCustomerId(@Param("customerId") String customerId, @Param("preKey") String preKey);
/**
* @describe: 工作端-通过房屋编码获取房屋信息
* @author wangtong
* @date 2022/6/9 15:23
* @params [houseCode]
* @return com.epmet.dto.result.HouseInfoResultDTO
*/
HouseInfoResultDTO selectHomeInfoByHouseCode(@Param("houseCode") String houseCode);
}

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

@ -163,4 +163,14 @@ public interface HouseService {
* @return com.epmet.commons.tools.utils.Result
*/
Result createBatchHouseCodeAndUrl(String customerId);
/**
* @describe: 通过房屋编码获取房屋信息
* @author wangtong
* @date 2022/6/9 14:51
* @params [tokenDto]
* @return com.epmet.commons.tools.utils.Result
*/
Result getHomeInfoByHouseCode(HouseInfoFormDTO dto);
}

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

@ -55,6 +55,7 @@ import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -1035,4 +1036,28 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
return buffer.toString();
}
@Override
public Result getHomeInfoByHouseCode(HouseInfoFormDTO dto) {
HouseInfoResultDTO house = icHouseDao.selectHomeInfoByHouseCode(dto.getHouseCode());
HouseInfoCache cache = CustomerIcHouseRedis.getHouseInfo(house.getCustomerId(), house.getHouseId());
BeanUtils.copyProperties(cache,house);
if (null != house && StringUtils.isNotBlank(house.getAgencyId())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(house.getAgencyId());
house.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName()) ? agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()) : agencyInfoCache.getOrganizationName());
house.setAreaCode(StringUtils.isNotBlank(agencyInfoCache.getAreaCode()) ? agencyInfoCache.getAreaCode() : StrConstant.EPMETY_STR);
house.setAgencyName(StringUtils.isNotBlank(agencyInfoCache.getOrganizationName()) ? agencyInfoCache.getOrganizationName() : StrConstant.EPMETY_STR);
} else {
house.setAgencyPathName(StrConstant.EPMETY_STR);
house.setAgencyName(StrConstant.EPMETY_STR);
}
house.setHouseTypeName(HouseTypeEnums.getTypeValue(house.getHouseType()));
house.setRentName(HouseRentFlagEnums.getTypeValue(house.getRentFlag()));
house.setPurposeName(HousePurposeEnums.getTypeValue(house.getPurpose()));
return new Result().ok(house);
}
}

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

@ -421,5 +421,26 @@
and PARAMETER_KEY=#{preKey}
and DEL_FLAG='0'
</select>
<select id="selectHomeInfoByHouseCode" resultType="com.epmet.dto.result.HouseInfoResultDTO">
select
concat(c.NEIGHBOR_HOOD_NAME,b.BUILDING_NAME,d.UNIT_NUM,'单元',a.DOOR_NAME) as houseName,
a.HOUSE_CODE,
a.HOUSE_QRCODE_URL,
a.CUSTOMER_ID,
a.id as houseId,
a.HOUSE_TYPE,
a.PURPOSE,
a.RENT_FLAG,
a.OWNER_NAME,
a.OWNER_PHONE,
a.OWNER_ID_CARD,
a.REMARK
from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0'
where a.HOUSE_CODE=#{houseCode}
and a.del_flag = '0'
</select>
</mapper>

Loading…
Cancel
Save