Browse Source

居民信息大屏数据接口修改!

feature/syp_points
songyunpeng 5 years ago
parent
commit
5c4002779a
  1. 55
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java
  2. 53
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java
  3. 15
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java
  4. 24
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java
  5. 15
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  6. 34
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenHouseInfoByPeopleFormDTO.java
  7. 34
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenPopulationInfoByHouseFormDTO.java
  8. 34
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenResidentInfoByCurrentAddressFormDTO.java
  9. 37
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenHouseInfoByPeopleResultDTO.java
  10. 37
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenPopulationInfoByHouseResultDTO.java
  11. 30
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenResidentInfoByCurrentAddressResultDTO.java
  12. 4
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java
  13. 63
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.java
  14. 55
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java
  15. 33
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java
  16. 230
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java
  17. 95
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml

55
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java

@ -5,13 +5,8 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.dto.DeptOption;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenGridRankingFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleDetailFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseUseResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleDetailResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.service.AppUserService;
import com.elink.esua.epdc.service.CustomService;
import org.springframework.beans.factory.annotation.Autowired;
@ -47,6 +42,48 @@ public class ApiScreenPopulationController {
ValidatorUtils.validateEntity(dto);
return appUserService.selectPeople(dto);
}
/**
* @Description 一人找房接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO>>
**/
@ReportData
@PostMapping("selectHouseByPeople")
public Result<PageData<EpdcScreenHouseInfoByPeopleResultDTO>> selectHouseByPeople(@RequestBody EpdcScreenHouseInfoByPeopleFormDTO dto){
ValidatorUtils.validateEntity(dto);
return appUserService.selectHouseByPeople(dto);
}
/**
* @Description 以房找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>>
**/
@ReportData
@PostMapping("selectPeopleByHouse")
public Result<PageData<EpdcScreenPopulationInfoByHouseResultDTO>> selectPeopleByHouse(@RequestBody EpdcScreenPopulationInfoByHouseFormDTO dto){
ValidatorUtils.validateEntity(dto);
return appUserService.selectPeopleByHouse(dto);
}
/**
* @Description 以人找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>>
**/
@ReportData
@PostMapping("selectPeopleByCurrentAddress")
public Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> selectPeopleByCurrentAddress(@RequestBody EpdcScreenResidentInfoByCurrentAddressFormDTO dto){
ValidatorUtils.validateEntity(dto);
return appUserService.selectPeopleByCurrentAddress(dto);
}
/**
* @Description 大屏找人详情接口
* @Author songyunpeng
@ -55,6 +92,7 @@ public class ApiScreenPopulationController {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleDetailResultDTO>
**/
@ReportData
@Deprecated
@PostMapping("selectPeopleDetail")
public Result<EpdcScreenSelectPeopleDetailResultDTO> selectPeopleDetail(@RequestBody EpdcScreenSelectPeopleDetailFormDTO dto){
ValidatorUtils.validateEntity(dto);
@ -70,6 +108,7 @@ public class ApiScreenPopulationController {
* @Date 2020/1/28 11:50
**/
@ReportData
@Deprecated
@GetMapping("getDeptTreeWithTypeKey")
public Result<DeptOption> getDeptTreeWithTypeKey() {
return appUserService.getDeptTreeWithTypeKey();
@ -84,6 +123,7 @@ public class ApiScreenPopulationController {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseUseResultDTO>
**/
@ReportData
@Deprecated
@PostMapping("housingUse")
public Result<EpdcScreenHouseUseResultDTO> housingUse(){
return appUserService.housingUse();
@ -96,6 +136,7 @@ public class ApiScreenPopulationController {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO>
**/
@ReportData
@Deprecated
@PostMapping("gridRanking")
public Result<PageData<EpdcScreenGridRankingResultDTO>> gridRanking(@RequestBody EpdcScreenGridRankingFormDTO dto){
ValidatorUtils.validateEntity(dto);

53
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java

@ -483,7 +483,7 @@ public interface UserFeignClient {
**/
@GetMapping(value = "app-user/usersign/addConsequentSignPoints", consumes = MediaType.APPLICATION_JSON_VALUE)
Result addConsequentSignPoints(UserSignDTO userSignDTO);
/**
* @Description 大屏找人接口
* @Author songyunpeng
@ -493,17 +493,7 @@ public interface UserFeignClient {
**/
@PostMapping(value = "app-user/screenPopulationInfo/selectPeople", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<PageData<EpdcScreenSelectPeopleResultDTO>> selectPeople(EpdcScreenSelectPeopleFormDTO dto);
/**
* @Description 大屏找人详情接口
* @Author songyunpeng
* @Date 2020/9/14
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>>
**/
@PostMapping(value = "app-user/screenPopulationInfo/selectPeopleDetail", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<EpdcScreenSelectPeopleDetailResultDTO> selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto);
/**
* @Description 房屋用途数据接口
* @Author songyunpeng
@ -523,4 +513,43 @@ public interface UserFeignClient {
**/
@PostMapping(value = "app-user/screenPopulationInfo/gridRanking", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<PageData<EpdcScreenGridRankingResultDTO>> gridRanking(@RequestBody EpdcScreenGridRankingFormDTO dto);
/**
* @Description 大屏找人详情接口
* @Author songyunpeng
* @Date 2020/9/14
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>>
**/
@PostMapping(value = "app-user/screenPopulationInfo/selectPeopleDetail", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<EpdcScreenSelectPeopleDetailResultDTO> selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto);
/**
* @Description 一人找房接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO>>
**/
@PostMapping(value = "app-user/screenPopulationInfo/selectHouseByPeople", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<PageData<EpdcScreenHouseInfoByPeopleResultDTO>> selectHouseByPeople(@RequestBody EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @Description 以房找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>>
**/
@PostMapping(value = "app-user/screenPopulationInfo/selectPeopleByHouse", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<PageData<EpdcScreenPopulationInfoByHouseResultDTO>> selectPeopleByHouse(@RequestBody EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @Description 以人找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>>
**/
@PostMapping(value = "app-user/screenPopulationInfo/selectPeopleByCurrentAddress", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> selectPeopleByCurrentAddress(@RequestBody EpdcScreenResidentInfoByCurrentAddressFormDTO dto);
}

15
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java

@ -243,6 +243,21 @@ public class UserFeignClientFallback implements UserFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeopleDetail", dto);
}
@Override
public Result<PageData<EpdcScreenHouseInfoByPeopleResultDTO>> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectHouseByPeople", dto);
}
@Override
public Result<PageData<EpdcScreenPopulationInfoByHouseResultDTO>> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeopleByHouse", dto);
}
@Override
public Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeopleByCurrentAddress", dto);
}
@Override
public Result<EpdcScreenHouseUseResultDTO> housingUse() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "housingUse");

24
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java

@ -360,4 +360,28 @@ public interface AppUserService {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO>
**/
Result<PageData<EpdcScreenGridRankingResultDTO>> gridRanking(EpdcScreenGridRankingFormDTO dto);
/**
* @Description 以人找房
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO>>
**/
Result<PageData<EpdcScreenHouseInfoByPeopleResultDTO>> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @Description 以房找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>>
**/
Result<PageData<EpdcScreenPopulationInfoByHouseResultDTO>> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @Description 以人找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO>>
**/
Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto);
}

15
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java

@ -1612,4 +1612,19 @@ public class AppUserServiceImpl implements AppUserService {
return userFeignClient.gridRanking(dto);
}
@Override
public Result<PageData<EpdcScreenHouseInfoByPeopleResultDTO>> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) {
return userFeignClient.selectHouseByPeople(dto);
}
@Override
public Result<PageData<EpdcScreenPopulationInfoByHouseResultDTO>> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) {
return userFeignClient.selectPeopleByHouse(dto);
}
@Override
public Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) {
return userFeignClient.selectPeopleByCurrentAddress(dto);
}
}

34
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenHouseInfoByPeopleFormDTO.java

@ -0,0 +1,34 @@
package com.elink.esua.epdc.dto.epdc.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
/**
* @author songyunpeng
* @Description 大屏以人找房参数
* @create 2020-09-14
*/
@Data
public class EpdcScreenHouseInfoByPeopleFormDTO {
/**
* 页码
*/
@Min(value = 0, message = "页码必须大于0")
private Integer pageIndex;
/**
* 页容量
*/
@Min(value = 0, message = "页容量必须大于0")
private Integer pageSize;
/**
* 户主姓名
*/
@NotBlank(message = "户主姓名不能为空")
private String houseHeadName;
}

34
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenPopulationInfoByHouseFormDTO.java

@ -0,0 +1,34 @@
package com.elink.esua.epdc.dto.epdc.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
/**
* @author songyunpeng
* @Description 大屏以房找人参数
* @create 2020-09-14
*/
@Data
public class EpdcScreenPopulationInfoByHouseFormDTO {
/**
* 页码
*/
@Min(value = 0, message = "页码必须大于0")
private Integer pageIndex;
/**
* 页容量
*/
@Min(value = 0, message = "页容量必须大于0")
private Integer pageSize;
/**
* 房屋地址
*/
@NotBlank(message = "房屋地址不能为空")
private String houseAddress;
}

34
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenResidentInfoByCurrentAddressFormDTO.java

@ -0,0 +1,34 @@
package com.elink.esua.epdc.dto.epdc.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
/**
* @author songyunpeng
* @Description 大屏以人找人参数
* @create 2020-09-14
*/
@Data
public class EpdcScreenResidentInfoByCurrentAddressFormDTO {
/**
* 页码
*/
@Min(value = 0, message = "页码必须大于0")
private Integer pageIndex;
/**
* 页容量
*/
@Min(value = 0, message = "页容量必须大于0")
private Integer pageSize;
/**
* 当前居住地址
*/
@NotBlank(message = "居住地址不能为空")
private String currentAddress;
}

37
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenHouseInfoByPeopleResultDTO.java

@ -0,0 +1,37 @@
package com.elink.esua.epdc.dto.epdc.result;
import lombok.Data;
/**
* @author songyunpeng
* @Description 大屏以人找房结果
* @create 2020-09-14
*/
@Data
public class EpdcScreenHouseInfoByPeopleResultDTO {
/**
* ID
*/
private String populationId;
/**
* 身份标识
*/
private String identityFlag;
/**
* 户主姓名
*/
private String houseHeadName;
/**
* 网格名称
*/
private String gridName;
/**
* 房屋地址
*/
private String houseAddress;
/**
* 户主联系电话
*/
private String houseHeadPhone;
}

37
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenPopulationInfoByHouseResultDTO.java

@ -0,0 +1,37 @@
package com.elink.esua.epdc.dto.epdc.result;
import lombok.Data;
/**
* @author songyunpeng
* @Description 大屏以房找人结果
* @create 2020-09-14
*/
@Data
public class EpdcScreenPopulationInfoByHouseResultDTO {
/**
* ID
*/
private String populationId;
/**
* 身份标识
*/
private String identityFlag;
/**
* 户主姓名
*/
private String houseHeadName;
/**
* 网格名称
*/
private String gridName;
/**
* 房屋地址
*/
private String houseAddress;
/**
* 户主联系电话
*/
private String houseHeadPhone;
}

30
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenResidentInfoByCurrentAddressResultDTO.java

@ -0,0 +1,30 @@
package com.elink.esua.epdc.dto.epdc.result;
import lombok.Data;
/**
* @author songyunpeng
* @Description 大屏以人找人结果
* @create 2020-09-14
*/
@Data
public class EpdcScreenResidentInfoByCurrentAddressResultDTO {
/**
* ID
*/
private String populationId;
/**
* 身份标识
*/
private String identityFlag;
/**
* 居住人姓名
*/
private String residentName;
/**
* 当前居住地址
*/
private String currentAddress;
}

4
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java

@ -17,5 +17,9 @@ public class FamilyMember {
* 关系
*/
private String relation;
/**
* 居住地
*/
private String currentAddress;
}

63
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.java

@ -19,13 +19,8 @@ package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenGridRankingFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleDetailFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseUseResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleDetailResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.service.PopulationInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -46,19 +41,42 @@ public class EpdcScreenPopulationInformationController {
@Autowired
private PopulationInformationService populationInformationService;
/**
* @Description 一人找房接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO>>
**/
@PostMapping("selectHouseByPeople")
public Result<PageData<EpdcScreenHouseInfoByPeopleResultDTO>> selectHouseByPeople(@RequestBody EpdcScreenHouseInfoByPeopleFormDTO dto){
return new Result<PageData<EpdcScreenHouseInfoByPeopleResultDTO>>().ok(populationInformationService.selectHouseByPeople(dto));
}
/**
* @Description 以房找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>>
**/
@PostMapping("selectPeopleByHouse")
public Result<PageData<EpdcScreenPopulationInfoByHouseResultDTO>> selectPeopleByHouse(@RequestBody EpdcScreenPopulationInfoByHouseFormDTO dto){
return new Result<PageData<EpdcScreenPopulationInfoByHouseResultDTO>>().ok(populationInformationService.selectPeopleByHouse(dto));
}
/**
* @Description 大屏找人接口
* @Description 以人找人接口
* @Author songyunpeng
* @Date 2020/9/14
* @Param [epdcScreenSelectPeopleFormDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>>
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>>
**/
@PostMapping("selectPeople")
public Result<PageData<EpdcScreenSelectPeopleResultDTO>> selectPeople(@RequestBody EpdcScreenSelectPeopleFormDTO dto){
return new Result<PageData<EpdcScreenSelectPeopleResultDTO>>().ok(populationInformationService.selectPeople(dto));
@PostMapping("selectPeopleByCurrentAddress")
public Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> selectPeopleByCurrentAddress(@RequestBody EpdcScreenResidentInfoByCurrentAddressFormDTO dto){
return new Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>>().ok(populationInformationService.selectPeopleByCurrentAddress(dto));
}
/**
* @Description 大屏找人详情接口
* @Author songyunpeng
@ -70,6 +88,19 @@ public class EpdcScreenPopulationInformationController {
public Result<EpdcScreenSelectPeopleDetailResultDTO> selectPeopleDetail(@RequestBody EpdcScreenSelectPeopleDetailFormDTO dto){
return populationInformationService.selectPeopleDetail(dto);
}
/**
* @Description 大屏找人接口
* @Author songyunpeng
* @Date 2020/9/14
* @Param [epdcScreenSelectPeopleFormDTO]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>>
**/
@PostMapping("selectPeople")
@Deprecated
public Result<PageData<EpdcScreenSelectPeopleResultDTO>> selectPeople(@RequestBody EpdcScreenSelectPeopleFormDTO dto){
return new Result<PageData<EpdcScreenSelectPeopleResultDTO>>().ok(populationInformationService.selectPeople(dto));
}
/**
* @Description 房屋用途数据接口
* @Author songyunpeng
@ -78,6 +109,7 @@ public class EpdcScreenPopulationInformationController {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseUseResultDTO>
**/
@PostMapping("housingUse")
@Deprecated
public Result<EpdcScreenHouseUseResultDTO> housingUse(){
return populationInformationService.housingUse();
}
@ -89,6 +121,7 @@ public class EpdcScreenPopulationInformationController {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO>
**/
@PostMapping("gridRanking")
@Deprecated
public Result<PageData<EpdcScreenGridRankingResultDTO>> gridRanking(@RequestBody EpdcScreenGridRankingFormDTO dto){
return new Result<PageData<EpdcScreenGridRankingResultDTO>>().ok(populationInformationService.gridRanking(dto));
}

55
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java

@ -20,11 +20,8 @@ package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO;
import com.elink.esua.epdc.dto.PopulationInformationDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenGridRankingFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseUseResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.entity.PopulationInformationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -144,4 +141,52 @@ public interface PopulationInformationDao extends BaseDao<PopulationInformationE
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO>
**/
Integer selectCountListGridRanking(EpdcScreenGridRankingFormDTO dto);
/**
* @Description 一人找房接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO>
**/
List<EpdcScreenHouseInfoByPeopleResultDTO> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @Description 一人找房接口 - count
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO>
**/
Integer selectCountHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @Description 以房找人
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>
**/
List<EpdcScreenPopulationInfoByHouseResultDTO> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @Description 以房找人 - count
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>
**/
Integer selectCountPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @Description 以人找人
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO>
**/
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto);
/**
* @Description 以人找人 - count
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return java.lang.Integer
**/
Integer selectCountPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto);
}

33
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java

@ -22,13 +22,8 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO;
import com.elink.esua.epdc.dto.PopulationInformationDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenGridRankingFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleDetailFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseUseResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleDetailResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.entity.PopulationInformationEntity;
import java.util.List;
@ -198,4 +193,28 @@ public interface PopulationInformationService extends BaseService<PopulationInfo
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO>
**/
PageData<EpdcScreenGridRankingResultDTO> gridRanking(EpdcScreenGridRankingFormDTO dto);
/**
* @Description 一人找房接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>
**/
PageData<EpdcScreenHouseInfoByPeopleResultDTO> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @Description 以房找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>
**/
PageData<EpdcScreenPopulationInfoByHouseResultDTO> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @Description 一人找人
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.form.EpdcScreenResidentInfoByCurrentAddressFormDTO>
**/
PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto);
}

230
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java

@ -35,9 +35,7 @@ import com.elink.esua.epdc.dto.BaseResidentInformationExportDto;
import com.elink.esua.epdc.dto.HousingInformationDTO;
import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO;
import com.elink.esua.epdc.dto.PopulationInformationDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenGridRankingFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleDetailFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleFormDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.entity.HouseResidentEntity;
import com.elink.esua.epdc.entity.HousingInformationEntity;
@ -55,7 +53,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
* 人口信息表
* 人口信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-08-19
@ -90,8 +88,8 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
return baseDao.selectListOfPopulationInformationDTO(params);
}
private QueryWrapper<PopulationInformationEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<PopulationInformationEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<PopulationInformationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -110,19 +108,19 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
//校验身份证信息
//1.获取表单身份证的人口信息
PopulationInformationEntity infoByIdentityNo = getInfoByIdentityNo(dto.getResidentsIdentityNo());
if(infoByIdentityNo!=null){
Map<String,Object> params = new HashMap<>();
params.put("RESIDENT_ID",infoByIdentityNo.getId());
if (infoByIdentityNo != null) {
Map<String, Object> params = new HashMap<>();
params.put("RESIDENT_ID", infoByIdentityNo.getId());
List<HouseResidentEntity> houseResidentEntities = houseResidentDao.selectByMap(params);
if(houseResidentEntities.size()>0){
if (houseResidentEntities.size() > 0) {
//2.此人有房屋信息,且为第一次提交则此时提示前端
if("0".equals(dto.getIsSubmit())){
if ("0".equals(dto.getIsSubmit())) {
StringBuffer sb = new StringBuffer();
for (HouseResidentEntity houseResidentEntity : houseResidentEntities) {
HousingInformationEntity housingInformationEntity = housingInformationService.selectById(houseResidentEntity.getHouseId());
sb.append(",\"").append(housingInformationEntity.getHouseAddress()).append("\"");
}
String result ="您在地址为"+sb.substring(1)+"下已有房产信息,点击确认则新增此房产且更新居民信息!";
String result = "您在地址为" + sb.substring(1) + "下已有房产信息,点击确认则新增此房产且更新居民信息!";
return new Result().ok(result.substring(1));
}
//2.第二次提交,则更新户主信息且新增关联信息
@ -153,27 +151,27 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
@Transactional(rollbackFor = Exception.class)
public Result update(PopulationInformationDTO dto) {
PopulationInformationEntity infoByIdentityNo = selectById(dto.getId());
if(dto.getResidentsIdentityNo().equals(infoByIdentityNo.getResidentsIdentityNo())){
if (dto.getResidentsIdentityNo().equals(infoByIdentityNo.getResidentsIdentityNo())) {
PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class);
//置空其他选择信息-防止导出时数据出错
if("0".equals(dto.getPoliticsStatus())){
if ("0".equals(dto.getPoliticsStatus())) {
//如果表单选择的是群众,则清空入党时间和组织关系所在地
this.setJionTimeToNull(entity.getId());
entity.setJoinTime(null);
entity.setOrganizationalRelationshipLocation("");
}
if("0".equals(dto.getEmploymentStatus())){
if ("0".equals(dto.getEmploymentStatus())) {
//如果表单选择的是在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间
entity.setUnemploymentReason("");
entity.setReemploymentPermit("");
entity.setUnemploymentRegister("");
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
} else if("1".equals(dto.getEmploymentStatus())){
} else if ("1".equals(dto.getEmploymentStatus())) {
//如果选择为失业,则置空工作单位和工作地址
entity.setCurrentEmployer("");
entity.setCurrentEmployerAddress("");
if("0".equals(dto.getUnemploymentRegister())){
if ("0".equals(dto.getUnemploymentRegister())) {
//如果表单选择的是失业 且就业登记为否 则也置空失业登记时间
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
@ -188,46 +186,46 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
//如果选择为失业,则置空工作单位和工作地址
entity.setCurrentEmployer("");
entity.setCurrentEmployerAddress("");
if("0".equals(dto.getUnemploymentRegister())){
if ("0".equals(dto.getUnemploymentRegister())) {
//如果表单选择的是失业 且就业登记为否 则也置空失业登记时间
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
}
}
if(dto.getMotorVehicleNum()==0){
if (dto.getMotorVehicleNum() == 0) {
//如果机动车数量为0 清空机动车类型
entity.setMotorVehicleCategory("");
}
updateById(entity);
return new Result();
}else {
} else {
//修改了身份证信息 - 提示信息
Map<String,Object> params = new HashMap<>();
params.put("RESIDENT_ID",infoByIdentityNo.getId());
Map<String, Object> params = new HashMap<>();
params.put("RESIDENT_ID", infoByIdentityNo.getId());
List<HouseResidentEntity> houseResidentEntities = houseResidentDao.selectByMap(params);
if(houseResidentEntities.size()>0){
if (houseResidentEntities.size() > 0) {
//2.此人有房屋信息,且为第一次提交则此时提示前端
if("0".equals(dto.getIsSubmit())){
if ("0".equals(dto.getIsSubmit())) {
StringBuffer sb = new StringBuffer();
for (HouseResidentEntity houseResidentEntity : houseResidentEntities) {
HousingInformationEntity housingInformationEntity = housingInformationService.selectById(houseResidentEntity.getHouseId());
sb.append(",\"").append(housingInformationEntity.getHouseAddress()).append("\"");
}
String result ="您在地址为"+sb.substring(1)+"下已有房产信息,点击确认则新增此房产且更新居民信息!";
String result = "您在地址为" + sb.substring(1) + "下已有房产信息,点击确认则新增此房产且更新居民信息!";
return new Result().ok(result.substring(1));
}
//2.第二次提交,则更新户主信息
PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class);
entity.setId(infoByIdentityNo.getId());
//置空其他选择信息-防止导出时数据出错
if("0".equals(dto.getPoliticsStatus())){
if ("0".equals(dto.getPoliticsStatus())) {
//如果表单选择的是群众,则清空入党时间和组织关系所在地
this.setJionTimeToNull(entity.getId());
entity.setJoinTime(null);
entity.setOrganizationalRelationshipLocation("");
}
if("0".equals(dto.getEmploymentStatus())){
if ("0".equals(dto.getEmploymentStatus())) {
//如果表单选择的是在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间
entity.setUnemploymentReason("");
entity.setReemploymentPermit("");
@ -235,11 +233,11 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
entity.setUnemploymentRegisterTime(null);
this.setUnemploymentRegisterTimeToNull(entity.getId());
}
if("1".equals(dto.getEmploymentStatus())){
if ("1".equals(dto.getEmploymentStatus())) {
//如果选择为失业,则置空工作单位和工作地址
entity.setCurrentEmployer("");
entity.setCurrentEmployerAddress("");
if("0".equals(dto.getUnemploymentRegister())){
if ("0".equals(dto.getUnemploymentRegister())) {
//如果表单选择的是失业 且就业登记为否 则也置空失业登记时间
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
@ -264,7 +262,7 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
public PopulationInformationDTO getHouseHeadInfo(String houseId) {
PopulationInformationDTO houseHeadInfo = baseDao.getHouseHeadInfo(houseId);
//处理机动车类型
if(houseHeadInfo!=null && StringUtils.isNotBlank(houseHeadInfo.getMotorVehicleCategory())){
if (houseHeadInfo != null && StringUtils.isNotBlank(houseHeadInfo.getMotorVehicleCategory())) {
String[] motorVehicleCategoryStrings = houseHeadInfo.getMotorVehicleCategory().split(",");
houseHeadInfo.setMotorVehicleCategoryList(Arrays.asList(motorVehicleCategoryStrings));
}
@ -315,95 +313,88 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenSelectPeopleResultDTO> list = baseDao.selectListPeople(dto);
return new PageData<>(list,baseDao.selectCountListPeople(dto));
return new PageData<>(list, baseDao.selectCountListPeople(dto));
}
@Override
public Result<EpdcScreenSelectPeopleDetailResultDTO> selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) {
EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO = new EpdcScreenSelectPeopleDetailResultDTO();
//根据身份标识寻找对应人员信息
if(PopulationIdentify.HOUSE_HEAD.equals(dto.getIdentifyFlag())) {
if(StringUtils.isBlank(dto.getPopulationId())){
if (PopulationIdentify.HOUSE_HEAD.equals(dto.getIdentifyFlag())) {
if (StringUtils.isBlank(dto.getPopulationId())) {
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询产权人信息失败:人口ID为空");
}
//如果是户主,人口信息从人口表拿
PopulationInformationEntity populationInformationEntity = this.selectById(dto.getPopulationId());
epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName());
epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex())?"女":"男");
if(IdentityNoUtils.IdentityNoVerification(populationInformationEntity.getResidentsIdentityNo())==null){
epdcScreenSelectPeopleDetailResultDTO.setAge(IdentityNoUtils.getAge(populationInformationEntity.getResidentsIdentityNo())+"");
}else {
epdcScreenSelectPeopleDetailResultDTO.setAge("");
}
epdcScreenSelectPeopleDetailResultDTO.setPhone(populationInformationEntity.getResidentsPhone());
//房屋信息
List<HousingInformationDTO> housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(dto.getPopulationId());
List<HousingInfo> housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class);
housingInfoList.forEach(housingInfo -> {
setHouseUse(housingInfo.getHouseUse(),housingInfo);
});
epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList);
//居住人信息
List<FamilyMember> familyMemberList = new ArrayList<>();
Set<String> houseHeadIds = new HashSet<>(1);
houseHeadIds.add(dto.getPopulationId());
List<BaseResidentInformationExportDto> baseResidentInformationExportDtos = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds);
FamilyMember familyMember = new FamilyMember();
baseResidentInformationExportDtos.forEach(a -> {
familyMember.setName(a.getResidentsName());
switch (a.getHouseHeadRelation()){
case HouseHeadRelationConstant.CHILDREN :
familyMember.setRelation("子女");
break;
case HouseHeadRelationConstant.HUSBAND_AND_WIFE :
familyMember.setRelation("夫妻");
break;
case HouseHeadRelationConstant.PARENT :
familyMember.setRelation("父母");
break;
case HouseHeadRelationConstant.OTHER :
familyMember.setRelation("其他");
break;
default:
familyMember.setRelation("");
break;
}
familyMemberList.add(familyMember);
});
epdcScreenSelectPeopleDetailResultDTO.setFamilyMember(familyMemberList);
//根据户主ID组装信息
setHouseHeadInfo(dto.getPopulationId(),epdcScreenSelectPeopleDetailResultDTO);
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().ok(epdcScreenSelectPeopleDetailResultDTO);
} else if(PopulationIdentify.HOUSE_RESIDENT.equals(dto.getIdentifyFlag())) {
if(StringUtils.isBlank(dto.getPopulationId())){
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询产权人信息失败:人口ID为空");
}
//居住人,人口信息从人口表拿
PopulationInformationEntity populationInformationEntity = this.selectById(dto.getPopulationId());
if(populationInformationEntity==null){
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("未查找到此人信息!");
} else if (PopulationIdentify.HOUSE_RESIDENT.equals(dto.getIdentifyFlag())) {
if (StringUtils.isBlank(dto.getPopulationId())) {
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询居住人信息失败:人口ID为空");
}
epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName());
epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex())?"女":"男");
epdcScreenSelectPeopleDetailResultDTO.setAge("");
epdcScreenSelectPeopleDetailResultDTO.setPhone("");
//房屋信息 - 继承户主的房屋信息
//查询该居住人的户主ID
Map<String,Object> params = new HashMap<>();
params.put("RESIDENT_ID",dto.getPopulationId());
params.put("IS_HOUSE_HEAD","0");
//查找居住人对应的户主细腻
Map<String, Object> params = new HashMap<>();
params.put("RESIDENT_ID", dto.getPopulationId());
List<HouseResidentEntity> houseResidentEntityList = houseResidentDao.selectByMap(params);
String houseHeadId = houseResidentEntityList.get(0).getHouseHeadId();
//房屋信息
List<HousingInformationDTO> housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(houseHeadId);
List<HousingInfo> housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class);
housingInfoList.forEach(housingInfo -> {
setHouseUse(housingInfo.getHouseUse(),housingInfo);
});
epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList);
if(houseResidentEntityList==null || houseResidentEntityList.size()==0){
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("根据居住人查询户主失败");
}
HouseResidentEntity houseResidentEntity = houseResidentEntityList.get(0);
//根据户主ID组装信息
setHouseHeadInfo(houseResidentEntity.getHouseHeadId(),epdcScreenSelectPeopleDetailResultDTO);
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().ok(epdcScreenSelectPeopleDetailResultDTO);
}
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询错误:身份标识参数无法匹配");
}
private void setHouseHeadInfo(String houseHeadId,EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO ){
//如果是户主,人口信息从人口表拿
PopulationInformationEntity populationInformationEntity = this.selectById(houseHeadId);
epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName());
epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex()) ? "女" : "男");
if (IdentityNoUtils.IdentityNoVerification(populationInformationEntity.getResidentsIdentityNo()) == null) {
epdcScreenSelectPeopleDetailResultDTO.setAge(IdentityNoUtils.getAge(populationInformationEntity.getResidentsIdentityNo()) + "");
} else {
epdcScreenSelectPeopleDetailResultDTO.setAge("");
}
epdcScreenSelectPeopleDetailResultDTO.setPhone(populationInformationEntity.getResidentsPhone());
//房屋信息
List<HousingInformationDTO> housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(houseHeadId);
List<HousingInfo> housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class);
housingInfoList.forEach(housingInfo -> {
setHouseUse(housingInfo.getHouseUse(), housingInfo);
});
epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList);
//居住人信息
List<FamilyMember> familyMemberList = new ArrayList<>();
Set<String> houseHeadIds = new HashSet<>(1);
houseHeadIds.add(houseHeadId);
List<BaseResidentInformationExportDto> baseResidentInformationExportDtos = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds);
FamilyMember familyMember = new FamilyMember();
baseResidentInformationExportDtos.forEach(a -> {
familyMember.setName(a.getResidentsName());
familyMember.setCurrentAddress(a.getCurrentAddress());
switch (a.getHouseHeadRelation()) {
case HouseHeadRelationConstant.CHILDREN:
familyMember.setRelation("子女");
break;
case HouseHeadRelationConstant.HUSBAND_AND_WIFE:
familyMember.setRelation("夫妻");
break;
case HouseHeadRelationConstant.PARENT:
familyMember.setRelation("父母");
break;
case HouseHeadRelationConstant.OTHER:
familyMember.setRelation("其他");
break;
default:
familyMember.setRelation("");
break;
}
familyMemberList.add(familyMember);
});
epdcScreenSelectPeopleDetailResultDTO.setFamilyMember(familyMemberList);
}
@Override
public Result<EpdcScreenHouseUseResultDTO> housingUse() {
EpdcScreenHouseUseResultDTO epdcScreenHouseUseResultDTO = baseDao.selectHouseUseDataForScreen();
@ -424,15 +415,38 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
return new PageData<>(list, baseDao.selectCountListGridRanking(dto));
}
private void setHouseUse(String houseUse,HousingInfo housingInfo){
switch (houseUse){
case HouseUseConstant.RENT :
@Override
public PageData<EpdcScreenHouseInfoByPeopleResultDTO> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenHouseInfoByPeopleResultDTO> list = baseDao.selectHouseByPeople(dto);
return new PageData<>(list, baseDao.selectCountHouseByPeople(dto)); }
@Override
public PageData<EpdcScreenPopulationInfoByHouseResultDTO> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenPopulationInfoByHouseResultDTO> list = baseDao.selectPeopleByHouse(dto);
return new PageData<>(list, baseDao.selectCountPeopleByHouse(dto));
}
@Override
public PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> list = baseDao.selectPeopleByCurrentAddress(dto);
return new PageData<>(list, baseDao.selectCountPeopleByCurrentAddress(dto));
}
private void setHouseUse(String houseUse, HousingInfo housingInfo) {
switch (houseUse) {
case HouseUseConstant.RENT:
housingInfo.setHouseUse("租赁");
break;
case HouseUseConstant.SINCE_THE_LIVING :
case HouseUseConstant.SINCE_THE_LIVING:
housingInfo.setHouseUse("自住");
break;
case HouseUseConstant.BUSINESS :
case HouseUseConstant.BUSINESS:
housingInfo.setHouseUse("经营");
break;
default:

95
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml

@ -385,6 +385,101 @@
order by total desc)a
</if>
</select>
<select id="selectHouseByPeople"
resultType="com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO">
select
epi.ID as populationId,
1 as identityFlag,
epi.RESIDENTS_NAME as houseHeadName,
substring_index(t.ALL_DEPT_NAMES, '-', -1) gridName,
t.HOUSE_ADDRESS as houseAddress,
epi.RESIDENTS_PHONE as houseHeadPhone
from epdc_housing_information t
left join epdc_house_resident ehr on t.ID = ehr.HOUSE_ID
left join epdc_population_information epi on ehr.RESIDENT_ID = epi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and epi.DEL_FLAG = '0'
<if test="houseHeadName!=null and houseHeadName!=''">
and epi.RESIDENTS_NAME like concat('%', #{houseHeadName}, '%')
</if>
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectCountHouseByPeople"
resultType="java.lang.Integer">
select
count(1)
from epdc_housing_information t
left join epdc_house_resident ehr on t.ID = ehr.HOUSE_ID
left join epdc_population_information epi on ehr.RESIDENT_ID = epi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and epi.DEL_FLAG = '0'
<if test="houseHeadName!=null and houseHeadName!=''">
and epi.RESIDENTS_NAME like concat('%', #{houseHeadName}, '%')
</if>
</select>
<select id="selectPeopleByHouse"
resultType="com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO">
select
t.ID as populationId,
1 as identityFlag,
t.RESIDENTS_NAME as houseHeadName,
substring_index(ehi.ALL_DEPT_NAMES, '-', -1) gridName,
ehi.HOUSE_ADDRESS as houseAddress,
t.RESIDENTS_PHONE as houseHeadPhone
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
left join epdc_housing_information ehi on ehr.HOUSE_ID = ehi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and ehi.DEL_FLAG = '0'
<if test="houseAddress!=null and houseAddress!=''">
and HOUSE_ADDRESS like concat('%', #{houseAddress}, '%')
</if>
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectCountPeopleByHouse" resultType="java.lang.Integer">
select
count(1)
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
left join epdc_housing_information ehi on ehr.HOUSE_ID = ehi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and ehi.DEL_FLAG = '0'
<if test="houseAddress!=null and houseAddress!=''">
and HOUSE_ADDRESS like concat('%', #{houseAddress}, '%')
</if>
</select>
<select id="selectPeopleByCurrentAddress"
resultType="com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO">
select
t.ID as populationId,
2 as identityFlag,
t.RESIDENTS_NAME as residentName,
t.CURRENT_ADDRESS as currentAddress
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '0'
<if test="currentAddress!=null and currentAddress!=''">
and CURRENT_ADDRESS like concat('%', #{currentAddress}, '%')
</if>
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectCountPeopleByCurrentAddress" resultType="java.lang.Integer">
select
count(1)
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '0'
<if test="currentAddress!=null and currentAddress!=''">
and CURRENT_ADDRESS like concat('%', #{currentAddress}, '%')
</if>
</select>
</mapper>
Loading…
Cancel
Save