From de176f8efdca33e7de39b2be124c5d717c72f6d0 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Mon, 14 Sep 2020 16:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E4=BF=A1=E6=81=AF=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F-=E6=89=BE=E4=BA=BA+=E6=89=BE=E4=BA=BA=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esua-epdc/epdc-gateway/pom.xml | 4 +- .../src/main/resources/application.yml | 3 + .../ApiScreenPopulationController.java | 56 +++++++ .../esua/epdc/feign/UserFeignClient.java | 22 +++ .../fallback/UserFeignClientFallback.java | 10 ++ .../esua/epdc/service/AppUserService.java | 16 ++ .../epdc/service/impl/AppUserServiceImpl.java | 10 ++ .../constant/HouseHeadRelationConstant.java | 17 ++ .../epdc/constant/PopulationIdentify.java | 19 +++ .../EpdcScreenSelectPeopleDetailFormDTO.java | 28 ++++ .../form/EpdcScreenSelectPeopleFormDTO.java | 43 +++++ ...EpdcScreenSelectPeopleDetailResultDTO.java | 38 +++++ .../EpdcScreenSelectPeopleResultDTO.java | 36 +++++ .../epdc/dto/epdc/result/FamilyMember.java | 24 +++ .../epdc/dto/epdc/result/HousingInfo.java | 28 ++++ ...ScreenPopulationInformationController.java | 72 +++++++++ .../esua/epdc/dao/HousingInformationDao.java | 8 + .../epdc/dao/PopulationInformationDao.java | 10 ++ .../service/HousingInformationService.java | 8 + .../service/PopulationInformationService.java | 20 +++ .../impl/HousingInformationServiceImpl.java | 5 + .../PopulationInformationServiceImpl.java | 148 +++++++++++++++++- .../mapper/HousingInformationDao.xml | 8 +- .../mapper/PopulationInformationDao.xml | 90 +++++++++++ 24 files changed, 716 insertions(+), 7 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/HouseHeadRelationConstant.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/PopulationIdentify.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleDetailFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleDetailResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/HousingInfo.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.java diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index 698173f7..d20ec81b 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -104,8 +104,8 @@ http://127.0.0.1:9092 lb://epdc-activiti-server - lb://epdc-api-server - + + http://127.0.0.1:9040 lb://epdc-app-server lb://epdc-heart-server diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index 91b876df..7cd48e8d 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -269,6 +269,8 @@ renren: - /api/work/user/scripLogin #工作端-用户凭证登录 - /api/work/*/swagger/** - /api/residentConfig/getResidentConfig #获取居民端配置 + - /api/screenPopulationInfo/** #获取居民端配置 + workUrls: - /api/work/** #工作端接口 - /api/analysis/** #数据端接口 @@ -297,3 +299,4 @@ epdc: - /api/analysis/** #数据端接口不拦截 - /cloudAnalysis/** #数据端接口 - /api/residentConfig/getResidentConfig #获取居民端配置 + - /api/screenPopulationInfo/** #获取居民端配置 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java new file mode 100644 index 00000000..206629b7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +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.EpdcScreenSelectPeopleDetailResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO; +import com.elink.esua.epdc.service.AppUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 用户模块 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/6 19:30 + */ +@RestController +@RequestMapping("screenPopulationInfo") +public class ApiScreenPopulationController { + + @Autowired + private AppUserService appUserService; + + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [epdcScreenSelectPeopleFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping("selectPeople") + public Result> selectPeople(@RequestBody EpdcScreenSelectPeopleFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return appUserService.selectPeople(dto); + } + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("selectPeopleDetail") + public Result selectPeopleDetail(@RequestBody EpdcScreenSelectPeopleDetailFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return appUserService.selectPeopleDetail(dto); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index 74556cc6..c1c177b8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -482,4 +482,26 @@ public interface UserFeignClient { @GetMapping(value = "app-user/usersign/addConsequentSignPoints", consumes = MediaType.APPLICATION_JSON_VALUE) Result addConsequentSignPoints(UserSignDTO userSignDTO); + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping(value = "app-user/screenPopulationInfo/selectPeople", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectPeople(EpdcScreenSelectPeopleFormDTO dto); + + + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping(value = "app-user/screenPopulationInfo/selectPeopleDetail", consumes = MediaType.APPLICATION_JSON_VALUE) + Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto); + + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index 925d171c..a6f9864a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -232,4 +232,14 @@ public class UserFeignClientFallback implements UserFeignClient { public Result addConsequentSignPoints(UserSignDTO userSignDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "addConsequentSignPoints", userSignDTO); } + + @Override + public Result> selectPeople(EpdcScreenSelectPeopleFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeople", dto); + } + + @Override + public Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectPeopleDetail", dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java index 9d46d8f5..07f9d85b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java @@ -318,4 +318,20 @@ public interface AppUserService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result userSign(TokenDto userDetail); + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> selectPeople(EpdcScreenSelectPeopleFormDTO dto); + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index b9a3d10a..a94e7da8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -1586,4 +1586,14 @@ public class AppUserServiceImpl implements AppUserService { return new Result().ok("您已连续签到"+userSignDTO.getConsequentSignDays()+"天,继续努力吧"); } + @Override + public Result> selectPeople(EpdcScreenSelectPeopleFormDTO dto) { + return userFeignClient.selectPeople(dto); + } + + @Override + public Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) { + return userFeignClient.selectPeopleDetail(dto); + } + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/HouseHeadRelationConstant.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/HouseHeadRelationConstant.java new file mode 100644 index 00000000..62fc8d56 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/HouseHeadRelationConstant.java @@ -0,0 +1,17 @@ +package com.elink.esua.epdc.constant; + +/** + * @author: songyunpeng + * @Date: 2020/08/19 14:12 + * @Description: 房屋用处 + */ +public interface HouseHeadRelationConstant { + + String CHILDREN = "0"; + + String HUSBAND_AND_WIFE = "1"; + + String PARENT = "2"; + + String OTHER = "3"; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/PopulationIdentify.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/PopulationIdentify.java new file mode 100644 index 00000000..958a02a5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/constant/PopulationIdentify.java @@ -0,0 +1,19 @@ +package com.elink.esua.epdc.constant; + +/** + * @author songyunpeng + * @Description 人口信息 人口身份标识 + * @create 2020-09-14 + */ + +public interface PopulationIdentify { + + + String PROPERTY_OWNER = "0"; + + String HOUSE_HEAD = "1"; + + String HOUSE_RESIDENT = "2"; + + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleDetailFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleDetailFormDTO.java new file mode 100644 index 00000000..90d70722 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleDetailFormDTO.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @author songyunpeng + * @Description 大屏找人接口详情参数 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenSelectPeopleDetailFormDTO { + + /** + * 人口ID + */ + private String populationId; + /** + * 房屋ID + */ + private String houseId; + /** + * 身份标识 + */ + @NotBlank(message = "身份标识不能为空") + private String identifyFlag; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleFormDTO.java new file mode 100644 index 00000000..19ec994f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcScreenSelectPeopleFormDTO.java @@ -0,0 +1,43 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.Min; + +/** + * @author songyunpeng + * @Description 大屏找人接口参数 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenSelectPeopleFormDTO { + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 姓名 + */ + private String name; + /** + * 社区ID + */ + private String communityId; + /** + * 电话 + */ + private String phone; + /** + * 网格ID + */ + private String gridId; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleDetailResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleDetailResultDTO.java new file mode 100644 index 00000000..83db7f0f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleDetailResultDTO.java @@ -0,0 +1,38 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.util.List; + +/** + * @author songyunpeng + * @Description 大屏找人详情接口结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenSelectPeopleDetailResultDTO { + /** + * 姓名 + */ + private String name; + /** + * 性别 + */ + private String sex; + /** + * 年龄 + */ + private String age; + /** + * 电话 + */ + private String phone; + /** + * 房屋信息 + */ + List housingInfo; + /** + * 家庭成员信息 + */ + List familyMember; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleResultDTO.java new file mode 100644 index 00000000..6e97880b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcScreenSelectPeopleResultDTO.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏找人接口结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenSelectPeopleResultDTO { + /** + * 姓名 + */ + private String name; + /** + * 网格名 + */ + private String gridName; + /** + * 身份 + */ + private String identityName; + /** + * 身份标识 + */ + private String identityFlag; + /** + * 房屋ID + */ + private String houseId; + /** + * 居民ID + */ + private String populationId; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java new file mode 100644 index 00000000..0bdb0e24 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/FamilyMember.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏找人详情接口 家庭成员信息 + * @create 2020-09-14 + */ +@Data +public class FamilyMember { + /** + * 姓名 + */ + private String name; + /** + * 关系 + */ + private String relation; + /** + * 电话 + */ + private String phone; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/HousingInfo.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/HousingInfo.java new file mode 100644 index 00000000..338392ae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/HousingInfo.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author songyunpeng + * @Description 大屏详情接口 房屋信息 + * @create 2020-09-14 + */ +@Data +public class HousingInfo { + + /** + * 房屋地址 + */ + private String houseAddress; + /** + * 房屋面积 + */ + private BigDecimal houseArea; + /** + * 房屋用途 + */ + private String houseUse; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.java new file mode 100644 index 00000000..4122f03f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcScreenPopulationInformationController.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +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.EpdcScreenSelectPeopleDetailResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO; +import com.elink.esua.epdc.service.PopulationInformationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 大屏接口 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@RestController +@RequestMapping("screenPopulationInfo") +public class EpdcScreenPopulationInformationController { + + @Autowired + private PopulationInformationService populationInformationService; + + + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [epdcScreenSelectPeopleFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping("selectPeople") + public Result> selectPeople(@RequestBody EpdcScreenSelectPeopleFormDTO dto){ + return populationInformationService.selectPeople(dto); + } + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("selectPeopleDetail") + public Result selectPeopleDetail(@RequestBody EpdcScreenSelectPeopleDetailFormDTO dto){ + return populationInformationService.selectPeopleDetail(dto); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java index b0a6557b..24b32ade 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java @@ -69,4 +69,12 @@ public interface HousingInformationDao extends BaseDao * @return java.util.List **/ List selectBaseResidentInformationExcelList(@Param("houseHeadIds") Set houseHeadIds); + /** + * @Description 根据户主ID获取所有房子信息 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [houseHeadId] + * @return java.util.List + **/ + List getHouseInfoByHouseHeadID(String houseHeadId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java index 9f837e87..28dc424e 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java @@ -20,6 +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.EpdcScreenSelectPeopleFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO; import com.elink.esua.epdc.entity.PopulationInformationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -100,4 +102,12 @@ public interface PopulationInformationDao extends BaseDao + **/ + List selectListPeople(EpdcScreenSelectPeopleFormDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java index e8fcdd9c..403d1fb0 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java @@ -129,4 +129,12 @@ public interface HousingInformationService extends BaseService **/ List selectBaseResidentInformationExcelList(Set houseHeadIds); + /** + * @Description 根据户主ID获取所有房子信息 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [populationId] + * @return java.util.List + **/ + List getHouseInfoByHouseHeadID(String houseHeadId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java index 30247302..ed3bd891 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java @@ -22,6 +22,10 @@ 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.EpdcScreenSelectPeopleDetailFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleDetailResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO; import com.elink.esua.epdc.entity.PopulationInformationEntity; import java.util.List; @@ -159,4 +163,20 @@ public interface PopulationInformationService extends BaseService> + **/ + Result> selectPeople(EpdcScreenSelectPeopleFormDTO epdcScreenSelectPeopleFormDTO); + /** + * @Description 大屏找人详情接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java index b66d8e12..fb29c9da 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java @@ -386,6 +386,11 @@ public class HousingInformationServiceImpl extends BaseServiceImpl getHouseInfoByHouseHeadID(String houseHeadId) { + return baseDao.getHouseInfoByHouseHeadID(houseHeadId); + } + /** * @return void * @Description 校验完成后插入居民信息 diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java index 1fc95351..fc15b936 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java @@ -21,16 +21,30 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.constant.HouseHeadRelationConstant; +import com.elink.esua.epdc.constant.HouseUseConstant; +import com.elink.esua.epdc.constant.PopulationIdentify; import com.elink.esua.epdc.dao.HouseResidentDao; import com.elink.esua.epdc.dao.PopulationInformationDao; +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.EpdcScreenSelectPeopleDetailFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcScreenSelectPeopleFormDTO; +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.result.FamilyMember; +import com.elink.esua.epdc.dto.epdc.result.HousingInfo; import com.elink.esua.epdc.entity.HouseResidentEntity; import com.elink.esua.epdc.entity.HousingInformationEntity; import com.elink.esua.epdc.entity.PopulationInformationEntity; +import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.redis.PopulationInformationRedis; import com.elink.esua.epdc.service.HouseResidentService; import com.elink.esua.epdc.service.HousingInformationService; @@ -40,10 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 人口信息表 @@ -63,6 +74,9 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl page(Map params) { @@ -285,4 +299,130 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl> selectPeople(EpdcScreenSelectPeopleFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List data = baseDao.selectListPeople(dto); + return new Result().ok(data); + } + + @Override + public Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) { + EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO = new EpdcScreenSelectPeopleDetailResultDTO(); + //根据身份标识寻找对应人员信息 + if(PopulationIdentify.PROPERTY_OWNER.equals(dto.getIdentifyFlag())){ + if(StringUtils.isBlank(dto.getHouseId())){ + return new Result().error("查询产权人信息失败:房屋ID为空"); + } + //如果是产权人,人口信息从房屋信息表拿 + HousingInformationEntity housingInformationEntity = housingInformationService.selectById(dto.getHouseId()); + epdcScreenSelectPeopleDetailResultDTO.setName(housingInformationEntity.getPropertyOwner()); + epdcScreenSelectPeopleDetailResultDTO.setSex(""); + epdcScreenSelectPeopleDetailResultDTO.setAge(""); + epdcScreenSelectPeopleDetailResultDTO.setPhone(housingInformationEntity.getPropertyOwnerMobile()); + //房屋信息 + List housingInfoList = new ArrayList<>(); + HousingInfo housingInfo = new HousingInfo(); + housingInfo.setHouseAddress(housingInformationEntity.getHouseAddress()); + housingInfo.setHouseArea(housingInformationEntity.getHouseArea()); + setHouseUse(housingInformationEntity.getHouseUse(),housingInfo); + housingInfoList.add(housingInfo); + epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList); + return new Result().ok(epdcScreenSelectPeopleDetailResultDTO); + } else if(PopulationIdentify.HOUSE_HEAD.equals(dto.getIdentifyFlag())) { + if(StringUtils.isBlank(dto.getPopulationId())){ + return new Result().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 housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(dto.getPopulationId()); + List housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class); + housingInfoList.forEach(housingInfo -> { + setHouseUse(housingInfo.getHouseUse(),housingInfo); + }); + epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList); + //居住人信息 + List familyMemberList = new ArrayList<>(); + Set houseHeadIds = new HashSet<>(1); + houseHeadIds.add(dto.getPopulationId()); + List baseResidentInformationExportDtos = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds); + FamilyMember familyMember = new FamilyMember(); + baseResidentInformationExportDtos.forEach(a -> { + familyMember.setName(a.getResidentsName()); + familyMember.setPhone(""); + 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); + return new Result().ok(epdcScreenSelectPeopleDetailResultDTO); + } else if(PopulationIdentify.HOUSE_RESIDENT.equals(dto.getIdentifyFlag())) { + if(StringUtils.isBlank(dto.getPopulationId())){ + return new Result().error("查询产权人信息失败:人口ID为空"); + } + //居住人,人口信息从人口表拿 + PopulationInformationEntity populationInformationEntity = this.selectById(dto.getPopulationId()); + epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName()); + epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex())?"女":"男"); + epdcScreenSelectPeopleDetailResultDTO.setAge(""); + epdcScreenSelectPeopleDetailResultDTO.setPhone(""); + //房屋信息 - 继承户主的房屋信息 + //查询该居住人的户主ID + Map params = new HashMap<>(); + params.put("RESIDENT_ID",dto.getPopulationId()); + params.put("IS_HOUSE_HEAD","0"); + List houseResidentEntityList = houseResidentDao.selectByMap(params); + String houseHeadId = houseResidentEntityList.get(0).getHouseHeadId(); + //房屋信息 + List housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(houseHeadId); + List housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class); + housingInfoList.forEach(housingInfo -> { + setHouseUse(housingInfo.getHouseUse(),housingInfo); + }); + epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList); + return new Result().ok(epdcScreenSelectPeopleDetailResultDTO); + } + return new Result().error("查询错误:身份标识参数无法匹配"); + } + private void setHouseUse(String houseUse,HousingInfo housingInfo){ + switch (houseUse){ + case HouseUseConstant.RENT : + housingInfo.setHouseUse("租赁"); + break; + case HouseUseConstant.SINCE_THE_LIVING : + housingInfo.setHouseUse("自住"); + break; + case HouseUseConstant.BUSINESS : + housingInfo.setHouseUse("经营"); + break; + default: + housingInfo.setHouseUse(""); + break; + } + } } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HousingInformationDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HousingInformationDao.xml index daa8d2a4..7f43ec0c 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HousingInformationDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HousingInformationDao.xml @@ -170,7 +170,6 @@ from epdc_house_resident t left join epdc_population_information t1 on t.RESIDENT_ID = t1.ID left join epdc_population_information t2 on t.HOUSE_HEAD_ID = t2.ID - where t.DEL_FLAG ='0' and t1.DEL_FLAG = '0' and t2.DEL_FLAG ='0' and t.HOUSE_HEAD_ID in @@ -178,6 +177,13 @@ order by t.CREATED_TIME desc + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml index b3fc8da5..84fab082 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml @@ -175,6 +175,96 @@ from epdc_population_information where DEL_FLAG = 0 and RESIDENTS_IDENTITY_NO is not null and RESIDENTS_IDENTITY_NO != '')a on 1=1 where t.DEL_FLAG ='0'; + \ No newline at end of file