From 874d3a5abf7a1fd7663469ee51c68b6b4aa3111c Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Fri, 27 Aug 2021 17:23:56 +0800 Subject: [PATCH 1/4] =?UTF-8?q?PC=E7=AB=AF-=E7=96=AB=E6=83=85=E9=98=B2?= =?UTF-8?q?=E6=8E=A7=E5=88=97=E8=A1=A8SQL=E5=8E=BB=E9=99=A4=E5=88=86?= =?UTF-8?q?=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epdc-cloud-client-yushan | 2 +- .../src/main/resources/mapper/vim/VaccinationInfoDao.xml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/epdc-cloud-client-yushan b/epdc-cloud-client-yushan index bbc441e..a87f857 160000 --- a/epdc-cloud-client-yushan +++ b/epdc-cloud-client-yushan @@ -1 +1 @@ -Subproject commit bbc441e5c276aa9b151e6346136fc7c5bc034183 +Subproject commit a87f857cb65f7fc7a32937c714ae520c79f3a67c diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml index 8dc4f5a..9842da5 100644 --- a/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml @@ -86,9 +86,6 @@ #{grid} - GROUP BY - v.IDENTITY_NO, - v.DOSE ORDER BY v.CREATED_TIME DESC @@ -204,4 +201,4 @@ ORDER BY vi.DOSE - \ No newline at end of file + From 67b5e41ef8cde3dd992ba8c8fa1b61b3a2d21f7f Mon Sep 17 00:00:00 2001 From: rongchao Date: Sat, 28 Aug 2021 18:55:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BA=BA=E5=8F=A3=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=92=8C=E6=88=BF=E5=B1=8B=E4=BF=A1=E6=81=AF=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epdc-cloud-client-yushan | 2 +- epdc-cloud-commons-yushan | 2 +- epdc-cloud-custom/pom.xml | 2 +- .../elink/esua/epdc/config/StreamUtils.java | 56 - .../service/GridOperatorInfoService.java | 3 +- .../impl/GridOperatorInfoServiceImpl.java | 2 +- .../service/EnterpriseInfoService.java | 3 +- .../impl/EnterpriseInfoServiceImpl.java | 4 +- .../controller/PersonTestingController.java | 1 + .../v2/PersonTestingV2Controller.java | 127 ++ .../service/PersonTestingService.java | 9 + .../impl/EpidemicSentryPostServiceImpl.java | 3 +- .../impl/PersonTestingServiceImpl.java | 140 +- .../evaluate/service/EvaluateDeptService.java | 2 +- .../service/impl/EvaluateDeptServiceImpl.java | 2 +- .../epdc/modules/feign/AdminFeignClient.java | 14 + .../fallback/AdminFeignClientFallback.java | 7 + .../consumer/OrganizationModifyConsumer.java | 4 +- .../rocketmq/dto/OrganizationModifyDTO.java | 37 - .../src/main/resources/application.yml | 1 + epdc-cloud-parent-yushan | 2 +- epdc-cloud-vim-yushan/pom.xml | 12 + .../epidemic/dto/EpidemicUserInfoDTO.java | 2 +- .../vaccine/feign/VimAdminFeignClient.java | 56 + .../fallback/VimAdminFeignClientFallback.java | 36 + .../HouseBusinessInfoController.java | 94 ++ .../controller/HouseRentInfoController.java | 94 ++ .../controller/HouseResidentController.java | 93 ++ .../HousingInformationController.java | 283 ++++ .../PopulationInformationController.java | 241 +++ .../house/dao/HouseBusinessInfoDao.java | 44 + .../vaccine/house/dao/HouseRentInfoDao.java | 33 + .../vaccine/house/dao/HouseResidentDao.java | 61 + .../house/dao/HousingInformationDao.java | 93 ++ .../house/dao/PopulationInformationDao.java | 247 +++ .../house/entity/HouseBusinessInfoEntity.java | 63 + .../house/entity/HouseRentInfoEntity.java | 58 + .../house/entity/HouseResidentEntity.java | 62 + .../entity/HousingInformationEntity.java | 104 ++ .../entity/PopulationInformationEntity.java | 220 +++ .../excel/BasePopulationInformationExcel.java | 156 ++ .../BasePopulationInformationExportExcel.java | 163 ++ .../excel/BaseResidentInformationExcel.java | 53 + .../BaseResidentInformationExportExcel.java | 56 + ...reenResidentInfoByCurrentAddressExcel.java | 44 + .../house/excel/FamilyInformationExcel.java | 50 + .../house/excel/HouseBusinessInfoExcel.java | 54 + .../house/excel/HouseRentInfoExcel.java | 68 + .../house/excel/HouseResidentExcel.java | 68 + .../house/excel/HousingInformationExcel.java | 93 ++ .../excel/PopulationInformationExcel.java | 164 ++ .../excel/PopulationMotorVehicleExcel.java | 43 + .../house/redis/HouseBusinessInfoRedis.java | 47 + .../house/redis/HouseRentInfoRedis.java | 47 + .../house/redis/HouseResidentRedis.java | 47 + .../house/redis/HousingInformationRedis.java | 47 + .../redis/PopulationInformationRedis.java | 47 + .../service/HouseBusinessInfoService.java | 112 ++ .../house/service/HouseRentInfoService.java | 104 ++ .../house/service/HouseResidentService.java | 121 ++ .../service/HousingInformationService.java | 149 ++ .../service/PopulationInformationService.java | 254 ++++ .../impl/HouseBusinessInfoServiceImpl.java | 120 ++ .../impl/HouseRentInfoServiceImpl.java | 116 ++ .../impl/HouseResidentServiceImpl.java | 380 +++++ .../impl/HousingInformationServiceImpl.java | 1318 +++++++++++++++++ .../PopulationInformationServiceImpl.java | 585 ++++++++ .../vim/enums/VaccinationStateEnum.java | 43 + .../impl/VaccinationInfoServiceImpl.java | 466 +++--- .../excel/居民信息录入模板.xls | Bin 0 -> 36352 bytes .../mapper/house/HouseBusinessInfoDao.xml | 46 + .../mapper/house/HouseRentInfoDao.xml | 21 + .../mapper/house/HouseResidentDao.xml | 65 + .../mapper/house/HousingInformationDao.xml | 201 +++ .../mapper/house/PopulationInformationDao.xml | 696 +++++++++ 75 files changed, 8017 insertions(+), 346 deletions(-) delete mode 100644 epdc-cloud-custom/src/main/java/com/elink/esua/epdc/config/StreamUtils.java create mode 100644 epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java delete mode 100644 epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/fallback/VimAdminFeignClientFallback.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseBusinessInfoController.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseRentInfoController.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseResidentController.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseBusinessInfoDao.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseRentInfoDao.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseResidentDao.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HousingInformationDao.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseBusinessInfoEntity.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseRentInfoEntity.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseResidentEntity.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HousingInformationEntity.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/PopulationInformationEntity.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExportExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExportExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/EpdcScreenResidentInfoByCurrentAddressExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/FamilyInformationExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseBusinessInfoExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseRentInfoExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseResidentExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HousingInformationExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationInformationExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationMotorVehicleExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseBusinessInfoRedis.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseRentInfoRedis.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseResidentRedis.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HousingInformationRedis.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/PopulationInformationRedis.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseBusinessInfoService.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseRentInfoService.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseResidentService.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HousingInformationService.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/PopulationInformationService.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseBusinessInfoServiceImpl.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseRentInfoServiceImpl.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseResidentServiceImpl.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/enums/VaccinationStateEnum.java create mode 100644 epdc-cloud-vim-yushan/src/main/resources/excel/居民信息录入模板.xls create mode 100644 epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseBusinessInfoDao.xml create mode 100644 epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseRentInfoDao.xml create mode 100644 epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml create mode 100644 epdc-cloud-vim-yushan/src/main/resources/mapper/house/HousingInformationDao.xml create mode 100644 epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml diff --git a/epdc-cloud-client-yushan b/epdc-cloud-client-yushan index a87f857..8c5f912 160000 --- a/epdc-cloud-client-yushan +++ b/epdc-cloud-client-yushan @@ -1 +1 @@ -Subproject commit a87f857cb65f7fc7a32937c714ae520c79f3a67c +Subproject commit 8c5f912270a32bf7cf695349c0681fb6198e2e5e diff --git a/epdc-cloud-commons-yushan b/epdc-cloud-commons-yushan index 235f56d..72b0a45 160000 --- a/epdc-cloud-commons-yushan +++ b/epdc-cloud-commons-yushan @@ -1 +1 @@ -Subproject commit 235f56d5ea756317efe54c5e0d4be0ac45e09155 +Subproject commit 72b0a4547c75aa6788dcd05749994bc094a38010 diff --git a/epdc-cloud-custom/pom.xml b/epdc-cloud-custom/pom.xml index eca5840..f8819fa 100644 --- a/epdc-cloud-custom/pom.xml +++ b/epdc-cloud-custom/pom.xml @@ -179,7 +179,7 @@ yushan_epdc_test elink-epdc@yushan - false + true 115.29.142.202:8848 8831513c-2f72-42e8-899f-eb6c2c5ae110 diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/config/StreamUtils.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/config/StreamUtils.java deleted file mode 100644 index 1caef31..0000000 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/config/StreamUtils.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.elink.esua.epdc.config; - -import com.elink.esua.epdc.commons.tools.exception.RenException; -import org.springframework.web.multipart.MultipartFile; - -import java.io.*; - -/** - * 接收文件转化File - * Created by liuhongwei on 2019/6/21. - */ -public class StreamUtils { - - - - public static File conversionFile(MultipartFile file){ - - File toFile =null; - InputStream ins = null; - try { - // 转化字节流 - ins = file.getInputStream(); - // 获取文件名字 - toFile = new File(file.getOriginalFilename()); - // 字节转化文件 - inputStreamToFile(ins, toFile); - ins.close(); - } catch (IOException e) { - new RenException(500,"文件转化失败"); - } - return toFile; - } - - - /** - * 流转化 - * @param ins file - * @return - * @author liuhongwei - * @date 2019/6/14 14:07 - */ - public static void inputStreamToFile(InputStream ins, File file) { - try { - OutputStream os = new FileOutputStream(file); - int bytesRead = 0; - byte[] buffer = new byte[8192]; - while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) { - os.write(buffer, 0, bytesRead); - } - os.close(); - ins.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorInfoService.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorInfoService.java index 6835f3f..56b2402 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorInfoService.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorInfoService.java @@ -21,11 +21,10 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.consult.GridOperatorInfoDTO; -import com.elink.esua.epdc.dto.enterprise.EnterpriseInfoDTO; import com.elink.esua.epdc.dto.consult.form.GridOperatorListFormDTO; import com.elink.esua.epdc.dto.consult.result.GridOperatorListResultDTO; import com.elink.esua.epdc.modules.consult.entity.GridOperatorInfoEntity; -import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.dto.OrganizationModifyDTO; import java.util.List; import java.util.Map; diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java index 720795b..5f0846a 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java @@ -35,7 +35,7 @@ import com.elink.esua.epdc.modules.consult.dao.GridOperatorInfoDao; import com.elink.esua.epdc.modules.consult.entity.GridOperatorInfoEntity; import com.elink.esua.epdc.modules.consult.service.GridOperatorInfoService; import com.elink.esua.epdc.modules.feign.AdminFeignClient; -import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.dto.OrganizationModifyDTO; import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/EnterpriseInfoService.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/EnterpriseInfoService.java index 3ca7693..fd30740 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/EnterpriseInfoService.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/EnterpriseInfoService.java @@ -25,8 +25,7 @@ import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; import com.elink.esua.epdc.modules.enterprise.entity.EnterpriseInfoEntity; -import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; -import org.apache.ibatis.annotations.Param; +import com.elink.esua.epdc.dto.OrganizationModifyDTO; import java.util.List; import java.util.Map; diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/impl/EnterpriseInfoServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/impl/EnterpriseInfoServiceImpl.java index 0dc1296..7cbef04 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/impl/EnterpriseInfoServiceImpl.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/impl/EnterpriseInfoServiceImpl.java @@ -27,7 +27,6 @@ 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.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.EpidemicDTO; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.enterprise.EnterpriseInfoDTO; import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; @@ -39,8 +38,7 @@ import com.elink.esua.epdc.modules.enterprise.entity.EnterpriseInfoEntity; import com.elink.esua.epdc.modules.enterprise.service.EnterpriseInfoService; import com.elink.esua.epdc.modules.feign.AdminFeignClient; import com.elink.esua.epdc.modules.feign.UserFeignClient; -import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; -import io.seata.spring.annotation.GlobalTransactional; +import com.elink.esua.epdc.dto.OrganizationModifyDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/PersonTestingController.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/PersonTestingController.java index 1c82129..4810085 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/PersonTestingController.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/PersonTestingController.java @@ -45,6 +45,7 @@ import java.util.Map; * @author qu qu@elink-cn.com * @since v1.0.0 2021-08-20 */ +@Deprecated @RestController @RequestMapping("persontesting") public class PersonTestingController { diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java new file mode 100644 index 0000000..26ad77e --- /dev/null +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java @@ -0,0 +1,127 @@ +/** + * 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.modules.epidemic.controller.v2; + +import com.elink.esua.epdc.commons.api.version.ApiVersion; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.PersonTestingDTO; +import com.elink.esua.epdc.dto.PersonTestingPageDTO; +import com.elink.esua.epdc.modules.epidemic.dao.PersonTestingDao; +import com.elink.esua.epdc.modules.epidemic.excel.PersonTestingExcel; +import com.elink.esua.epdc.modules.epidemic.service.PersonTestingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; +import java.util.List; +import java.util.Map; + + +/** + * 核酸检测记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-08-20 + */ +@ApiVersion(2) +@RestController +@RequestMapping("persontesting" + Constant.VERSION_CONTROL) +public class PersonTestingV2Controller { + + @Autowired + private PersonTestingService personTestingService; + + @Autowired + private PersonTestingDao personTestingDao; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = personTestingService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + PersonTestingDTO data = personTestingService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PersonTestingDTO dto) throws ParseException { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return personTestingService.saveScanningInfo(dto); + } + + @PutMapping + public Result update(@RequestBody PersonTestingDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + personTestingService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + personTestingService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = personTestingDao.getTestingPage(params); + ExcelUtils.exportExcelToTarget(response, null, list, PersonTestingExcel.class); + } + + /** + * @return Result + * @describe: 读卡器录入数据 + * @author rongchao + * @date 2021/8/26 + * @params dto + */ + @PostMapping("saveScanningInfo") + public Result saveScanningInfo(@RequestBody PersonTestingDTO dto) { + return personTestingService.saveScanningInfoV2(dto); + } + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @describe: 通过身份证号码查询手机号 + * @author wangtong + * @date 2021/8/23 17:54 + * @params [dto] + */ + @GetMapping("getMobileByIdCard") + public Result getMobileByIdCard(PersonTestingDTO dto) { + return personTestingService.getMobileByIdCard(dto); + } + + +} \ No newline at end of file diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/PersonTestingService.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/PersonTestingService.java index beef95a..a7d366a 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/PersonTestingService.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/PersonTestingService.java @@ -105,6 +105,15 @@ public interface PersonTestingService extends BaseService { */ Result saveScanningInfo(PersonTestingDTO dto); + /** + * @describe: 读卡器录入数据V2 + * @author rongchao + * @date 2021/8/26 + * @params dto + * @return Result + */ + Result saveScanningInfoV2(PersonTestingDTO dto); + /** * @describe: 通过身份证号码查询手机号 * @author wangtong diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/EpidemicSentryPostServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/EpidemicSentryPostServiceImpl.java index 9d992fc..0da4168 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/EpidemicSentryPostServiceImpl.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/EpidemicSentryPostServiceImpl.java @@ -29,7 +29,7 @@ import com.elink.esua.epdc.commons.tools.exception.RenException; 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.Result; -import com.elink.esua.epdc.config.StreamUtils; +import com.elink.esua.epdc.commons.tools.utils.StreamUtils; import com.elink.esua.epdc.dto.EpidemicSentryPostDTO; import com.elink.esua.epdc.dto.UploadToOssDTO; import com.elink.esua.epdc.dto.form.CreateCodeFormDTO; @@ -51,7 +51,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.*; import java.net.MalformedURLException; import java.net.URL; -import java.net.URLEncoder; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java index 8eaa0d6..d753ab3 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java @@ -21,6 +21,7 @@ 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.enums.UserSexEnum; 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.Result; @@ -32,6 +33,8 @@ import com.elink.esua.epdc.modules.epidemic.entity.PersonTestingEntity; import com.elink.esua.epdc.modules.epidemic.feign.OssFeignClient; import com.elink.esua.epdc.modules.epidemic.redis.PersonTestingRedis; import com.elink.esua.epdc.modules.epidemic.service.PersonTestingService; +import com.elink.esua.epdc.vaccine.house.dao.PopulationInformationDao; +import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoDao; import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInoutRecordDao; import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; @@ -65,6 +68,9 @@ public class PersonTestingServiceImpl extends BaseServiceImpl page(Map params) { @@ -85,8 +91,8 @@ public class PersonTestingServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -106,39 +112,40 @@ public class PersonTestingServiceImpl extends BaseServiceImpl uploadResult = ossFeignClient.uploadBase64(form); + if (!uploadResult.success()) { + return new Result().error("上传图片错误"); + } + if (StringUtils.isNotBlank(uploadResult.getData())) { + entity.setImgUrl(uploadResult.getData()); + } + entity.setTestingTime(date); + insert(entity); + return new Result().ok("录入成功"); + } + + @Transactional + @Override + public Result saveScanningInfoV2(PersonTestingDTO dto) { + //检测时间 + Date date = new Date(); + dto.setTestingTime(date); + saveScanningInfoForUserV2(dto); + UploadFormDTO form = new UploadFormDTO(); + form.setBase64String("data:image/png;base64," + dto.getImgCode()); PersonTestingEntity entity = ConvertUtils.sourceToTarget(dto, PersonTestingEntity.class); Result uploadResult = ossFeignClient.uploadBase64(form); - if(!uploadResult.success()){ + if (!uploadResult.success()) { return new Result().error("上传图片错误"); } - if(StringUtils.isNotBlank(uploadResult.getData())){ + if (StringUtils.isNotBlank(uploadResult.getData())) { entity.setImgUrl(uploadResult.getData()); } entity.setTestingTime(date); @@ -183,27 +212,26 @@ public class PersonTestingServiceImpl extends BaseServiceImpl getParentAndAllDept(@PathVariable("deptId") String deptId); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Description 获取多个字典值列表 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [sysPopulationSimpleDictFormDTO] + **/ + @PostMapping("sys/dict/listPopulationSimple") + Result> listPopulationSimple(@RequestBody SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO); } diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java index b4f7c3f..13f80a9 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java @@ -4,6 +4,8 @@ import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO; +import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; import com.elink.esua.epdc.modules.feign.AdminFeignClient; import org.springframework.stereotype.Component; @@ -26,4 +28,9 @@ public class AdminFeignClientFallback implements AdminFeignClient { public Result getParentAndAllDept(String depId) { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId); } + + @Override + public Result> listPopulationSimple(SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listPopulationSimple", sysPopulationSimpleDictFormDTO); + } } diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java index 989bb20..a461fda 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java @@ -5,7 +5,7 @@ import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; import com.elink.esua.epdc.modules.consult.service.GridOperatorInfoService; import com.elink.esua.epdc.modules.enterprise.service.EnterpriseInfoService; import com.elink.esua.epdc.modules.evaluate.service.EvaluateDeptService; -import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.dto.OrganizationModifyDTO; import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.common.message.MessageExt; import org.apache.rocketmq.spring.annotation.MessageModel; @@ -14,8 +14,6 @@ import org.apache.rocketmq.spring.core.RocketMQListener; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.xml.ws.Action; - /** * * 组织机构信息修改-监听MQ消息 diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java deleted file mode 100644 index 2e1b5b7..0000000 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.elink.esua.epdc.rocketmq.dto; - -import lombok.Data; - -import java.io.Serializable; - -/** - * - * 组织机构信息修改-接收MQ消息DTO - * - * @Author:liuchuang - * @Date:2020/3/6 22:34 - */ -@Data -public class OrganizationModifyDTO implements Serializable { - - private static final long serialVersionUID = -6534846437298229554L; - /** - * 部门ID - */ - private Long deptId; - - /** - * 旧部门名称 - */ - private String oldDeptName; - - /** - * 新部门名称 - */ - private String newDeptName; - - /** - * 部门类型 - */ - private String typeKey; -} diff --git a/epdc-cloud-custom/src/main/resources/application.yml b/epdc-cloud-custom/src/main/resources/application.yml index 0417e6a..b984ddf 100644 --- a/epdc-cloud-custom/src/main/resources/application.yml +++ b/epdc-cloud-custom/src/main/resources/application.yml @@ -68,6 +68,7 @@ mybatis-plus: map-underscore-to-camel-case: true cache-enabled: false call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl wx: ma: diff --git a/epdc-cloud-parent-yushan b/epdc-cloud-parent-yushan index db92131..6c53fd9 160000 --- a/epdc-cloud-parent-yushan +++ b/epdc-cloud-parent-yushan @@ -1 +1 @@ -Subproject commit db9213163f8005cba05ad21334bebb72484174b7 +Subproject commit 6c53fd985cbaae46046a44a2d84f1eb9bff86a9d diff --git a/epdc-cloud-vim-yushan/pom.xml b/epdc-cloud-vim-yushan/pom.xml index 719e743..cd1ea2d 100644 --- a/epdc-cloud-vim-yushan/pom.xml +++ b/epdc-cloud-vim-yushan/pom.xml @@ -43,6 +43,18 @@ 4.4.14 compile + + com.esua.epdc.yushan + epdc-cloud-custom-client + ${epdc-cloud-client.version} + + + + com.esua.epdc.yushan + epdc-cloud-admin-client + ${epdc-cloud-client.version} + + diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTO.java index 2437881..36e78cc 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTO.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTO.java @@ -2,7 +2,7 @@ package com.elink.esua.epdc.vaccine.epidemic.dto; // import io.swagger.annotations.ApiModel; // import io.swagger.annotations.ApiModelProperty; -import com.google.common.net.InternetDomainName; + import lombok.Data; import java.io.Serializable; diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java new file mode 100644 index 0000000..6243768 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.vaccine.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO; +import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; +import com.elink.esua.epdc.vaccine.feign.fallback.VimAdminFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/5 14:44 + */ +@FeignClient(name = ServiceConstant.EPDC_ADMIN_SERVER, fallback = VimAdminFeignClientFallback.class) +public interface VimAdminFeignClient { + + /** + * 根据部门ID,获取下属所有网格ID + * + * @param pid + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author yujintao + * @date 2019/9/5 14:49 + */ + @GetMapping("/sys/dept/listGridId/{pid}") + Result> listGridIdByDeptPid(@PathVariable("pid") Long pid); + + /** + * 根据部门ID获取上级所有部门信息 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author gp + * @date 2019-11-29 + */ + @GetMapping("/sys/dept/getParentAndAllDept/{deptId}") + Result getParentAndAllDept(@PathVariable("deptId") String deptId); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Description 获取多个字典值列表 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [sysPopulationSimpleDictFormDTO] + **/ + @PostMapping("sys/dict/listPopulationSimple") + Result> listPopulationSimple(@RequestBody SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO); +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/fallback/VimAdminFeignClientFallback.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/fallback/VimAdminFeignClientFallback.java new file mode 100644 index 0000000..0855733 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/fallback/VimAdminFeignClientFallback.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.vaccine.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO; +import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; +import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/5 14:44 + */ +@Component +public class VimAdminFeignClientFallback implements VimAdminFeignClient { + + @Override + public Result> listGridIdByDeptPid(Long pid) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listGridIdByDeptPid", pid); + } + + @Override + public Result getParentAndAllDept(String depId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId); + } + + @Override + public Result> listPopulationSimple(SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listPopulationSimple", sysPopulationSimpleDictFormDTO); + } +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseBusinessInfoController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseBusinessInfoController.java new file mode 100644 index 0000000..a16e8a1 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseBusinessInfoController.java @@ -0,0 +1,94 @@ +/** + * 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.vaccine.house.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.house.HouseBusinessInfoDTO; +import com.elink.esua.epdc.vaccine.house.excel.HouseBusinessInfoExcel; +import com.elink.esua.epdc.vaccine.house.service.HouseBusinessInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 房屋经营信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@RestController +@RequestMapping("housebusinessinfo") +public class HouseBusinessInfoController { + + @Autowired + private HouseBusinessInfoService houseBusinessInfoService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = houseBusinessInfoService.listPage(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + HouseBusinessInfoDTO data = houseBusinessInfoService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody HouseBusinessInfoDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + houseBusinessInfoService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody HouseBusinessInfoDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + houseBusinessInfoService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + houseBusinessInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = houseBusinessInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, "经营信息", list, HouseBusinessInfoExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseRentInfoController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseRentInfoController.java new file mode 100644 index 0000000..16d19aa --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseRentInfoController.java @@ -0,0 +1,94 @@ +/** + * 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.vaccine.house.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.house.HouseRentInfoDTO; +import com.elink.esua.epdc.vaccine.house.excel.HouseRentInfoExcel; +import com.elink.esua.epdc.vaccine.house.service.HouseRentInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 房屋租赁信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@RestController +@RequestMapping("houserentinfo") +public class HouseRentInfoController { + + @Autowired + private HouseRentInfoService houseRentInfoService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = houseRentInfoService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + HouseRentInfoDTO data = houseRentInfoService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody HouseRentInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + houseRentInfoService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody HouseRentInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + houseRentInfoService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + houseRentInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = houseRentInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, HouseRentInfoExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseResidentController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseResidentController.java new file mode 100644 index 0000000..606c107 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseResidentController.java @@ -0,0 +1,93 @@ +/** + * 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.vaccine.house.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.house.HouseResidentDTO; +import com.elink.esua.epdc.dto.house.PopulationInformationDTO; +import com.elink.esua.epdc.vaccine.house.excel.HouseResidentExcel; +import com.elink.esua.epdc.vaccine.house.service.HouseResidentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 房屋人员关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@RestController +@RequestMapping("houseresident") +public class HouseResidentController { + + @Autowired + private HouseResidentService houseResidentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = houseResidentService.listPage(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PopulationInformationDTO data = houseResidentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody HouseResidentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return houseResidentService.saveWithoutIdentifyNo(dto); + } + + @PutMapping + public Result update(@RequestBody HouseResidentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return houseResidentService.updateWithoutIdentifyNo(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + houseResidentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = houseResidentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, HouseResidentExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java new file mode 100644 index 0000000..8f475cd --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java @@ -0,0 +1,283 @@ +/** + * 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.vaccine.house.controller; + +import com.elink.esua.epdc.commons.tools.exception.RenException; +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.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.constant.PopulationDictConstant; +import com.elink.esua.epdc.dto.house.*; +import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; +import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient; +import com.elink.esua.epdc.vaccine.house.excel.BasePopulationInformationExportExcel; +import com.elink.esua.epdc.vaccine.house.excel.BaseResidentInformationExportExcel; +import com.elink.esua.epdc.vaccine.house.service.HousingInformationService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.beans.IntrospectionException; +import java.beans.PropertyDescriptor; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URLEncoder; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 房屋信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@RestController +@RequestMapping("housinginformation") +public class HousingInformationController { + + @Autowired + private HousingInformationService housingInformationService; + + @Autowired + private VimAdminFeignClient adminFeignClient; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = housingInformationService.listOfPage(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + HousingInformationDTO data = housingInformationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody HousingInformationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return housingInformationService.save(dto); + } + + @PutMapping + public Result update(@RequestBody HousingInformationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return housingInformationService.update(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + housingInformationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + //查询房屋和人口信息 + List basePopulationInformationExcelList = housingInformationService.selectBasePopulationInformationExcelList(params); + List> classes = new ArrayList<>(2); + classes.add(BasePopulationInformationExportExcel.class); + classes.add(BaseResidentInformationExportExcel.class); + List sheetNames = new ArrayList<>(2); + sheetNames.add("房屋信息和户主信息"); + sheetNames.add("居民信息"); + if(basePopulationInformationExcelList == null || basePopulationInformationExcelList.size()==0){ + ExcelUtils.exportExcelToTargetWithSheets(response, "居民信息导出",sheetNames,classes,new ArrayList<>(), new ArrayList<>(),new ArrayList<>()); + } + //根据字典赋值 + //获取字典信息 + SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO = new SysPopulationSimpleDictFormDTO(); + List dicTypes = new ArrayList<>(); + Collections.addAll(dicTypes, PopulationDictConstant.ACCOUNT_TYPE, PopulationDictConstant.BODY_STATUS, PopulationDictConstant.EDUCATION_LEVEL + , PopulationDictConstant.EMPLOYMENT_STATUS, PopulationDictConstant.FAMILY_CATEGORY, PopulationDictConstant.GENDER, PopulationDictConstant.HELP_STATUS, PopulationDictConstant.MARITAL_STATUS + , PopulationDictConstant.MOTOR_VEHICLE_CATEGORY, PopulationDictConstant.POLITICS_STATUS, PopulationDictConstant.UNEMPLOYMENT_REASON); + sysPopulationSimpleDictFormDTO.setDicTypes(dicTypes); + Result> listResult = adminFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO); + if (listResult == null || !listResult.success()) { + throw new RenException("获取字典失败!"); + } + List sysPopulationSimpleDictDTOS = listResult.getData(); + for (BasePopulationInformationExportDto basePopulationInformationExportDto : basePopulationInformationExcelList) { + if(StringUtils.isBlank(basePopulationInformationExportDto.getId())){ + continue; + } + String educationLevel = basePopulationInformationExportDto.getEducationLevel(); + String politicsStatus = basePopulationInformationExportDto.getPoliticsStatus(); + String bodyStatus = basePopulationInformationExportDto.getBodyStatus(); + String maritalStatus = basePopulationInformationExportDto.getMaritalStatus(); + String accountType = basePopulationInformationExportDto.getAccountType(); + String employmentStatus = basePopulationInformationExportDto.getEmploymentStatus(); + String unemploymentReason = basePopulationInformationExportDto.getUnemploymentReason(); + String familyCategory = basePopulationInformationExportDto.getFamilyCategory(); + String helpStatus = basePopulationInformationExportDto.getHelpStatus(); + String motorVehicleCategory = basePopulationInformationExportDto.getMotorVehicleCategory(); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"educationLevel",educationLevel,PopulationDictConstant.EDUCATION_LEVEL); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"politicsStatus",politicsStatus,PopulationDictConstant.POLITICS_STATUS); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"bodyStatus",bodyStatus,PopulationDictConstant.BODY_STATUS); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"maritalStatus",maritalStatus,PopulationDictConstant.MARITAL_STATUS); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"accountType",accountType,PopulationDictConstant.ACCOUNT_TYPE); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"employmentStatus",employmentStatus,PopulationDictConstant.EMPLOYMENT_STATUS); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"unemploymentReason",unemploymentReason,PopulationDictConstant.UNEMPLOYMENT_REASON); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"familyCategory",familyCategory,PopulationDictConstant.FAMILY_CATEGORY); + setDicNameByValue(sysPopulationSimpleDictDTOS,basePopulationInformationExportDto,"helpStatus",helpStatus,PopulationDictConstant.HELP_STATUS); + //处理多选类型 + if(StringUtils.isNotBlank(motorVehicleCategory)){ + String[] motorVehicleCategoryStrings = motorVehicleCategory.split(","); + String motorVehicleCategoryEnd = ""; + for(String motorVehicleCategoryStr : motorVehicleCategoryStrings){ + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.MOTOR_VEHICLE_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (motorVehicleCategoryStr.equals(sysSimpleDict.getDictValue())) { + motorVehicleCategoryEnd += sysSimpleDict.getDictName()+","; + } + } + } + } + } + basePopulationInformationExportDto.setMotorVehicleCategory(motorVehicleCategoryEnd.substring(0,motorVehicleCategoryEnd.lastIndexOf(","))); + } + } + //所有信息,转换excel时,替换是否时会出现null,此时将对应null值替换成空字符 + basePopulationInformationExcelList.forEach(HousingInformationController::checkNull); + //根据获取的户主ID查询居住人信息 + List basePopulationInformationExcelListWithHouseHead = new ArrayList<>(basePopulationInformationExcelList); + //先去除没有户主的房屋 + basePopulationInformationExcelListWithHouseHead.removeIf(basePopulationInformationExportDto -> StringUtils.isBlank(basePopulationInformationExportDto.getId())); + Map> baseMap = basePopulationInformationExcelListWithHouseHead.stream().collect(Collectors.groupingBy(BasePopulationInformationExportDto::getId)); + //获取所有的户主ID + Set houseHeadIds = baseMap.keySet(); + List baseResidentInformationExportDtoList = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds); + ExcelUtils.exportExcelToTargetWithSheets(response, "居民信息导出",sheetNames,classes,new ArrayList<>(), ConvertUtils.sourceToTarget(basePopulationInformationExcelList, BasePopulationInformationExportExcel.class),ConvertUtils.sourceToTarget(baseResidentInformationExportDtoList,BaseResidentInformationExportExcel.class)); + } + /** + * @Description 根据字典值匹配键 + * @Author songyunpeng + * @Date 2020/9/8 + * @param column 实体类的属性名 + * @param columnValue 实体类的属性值 + * @param dicType 字典的类型 + * @Param [sysPopulationSimpleDictDTOS, basePopulationInformationExportDto, column] + * @return java.lang.String + **/ + private void setDicNameByValue(List sysPopulationSimpleDictDTOS,BasePopulationInformationExportDto basePopulationInformationExportDto,String column,String columnValue,String dicType) throws IntrospectionException, InvocationTargetException, IllegalAccessException { + if(StringUtils.isNotBlank(columnValue)){ + a:for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (dicType.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (columnValue.equals(sysSimpleDict.getDictValue())) { + Class basePopulationInformationExportDtoClass = basePopulationInformationExportDto.getClass(); + PropertyDescriptor pd = new PropertyDescriptor(column, basePopulationInformationExportDtoClass); + Method wM = pd.getWriteMethod();//获得写方法 + wM.invoke(basePopulationInformationExportDto, sysSimpleDict.getDictName()); + break a; + } + } + } + } + } + } + private static Object checkNull(Object obj) { + Class clazz = obj.getClass(); + // 获取实体类的所有属性,返回Field数组 + Field[] fields = clazz.getDeclaredFields(); + for (Field field : fields) { + // 可访问私有变量 + field.setAccessible(true); + // 获取属性类型 + String type = field.getGenericType().toString(); + // 如果type是类类型,则前面包含"class ",后面跟类名 + if ("class java.lang.String".equals(type)) { + // 将属性的首字母大写 + String methodName = field.getName().replaceFirst(field.getName().substring(0, 1), + field.getName().substring(0, 1).toUpperCase()); + System.out.println(methodName); + try { + Method methodGet = clazz.getMethod("get" + methodName); + // 调用getter方法获取属性值 + String str = (String) methodGet.invoke(obj); + if (StringUtils.isBlank(str)) { + // 如果为null的String类型的属性则重新复制为空字符串 + field.set(obj, field.getType().getConstructor(field.getType()).newInstance("")); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + return obj; + } + + /** + * @Description 批量导入 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [file] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("importExcel") + public Result importExcel(@RequestParam("file") MultipartFile file,String gridId) { + return housingInformationService.importPopulationInfo(file,gridId); + } + + /** + * @Description 导出模板 + * @Author songyunpeng + * @Date 2020/8/27 + * @Param [params, response] + * @return void + **/ + @GetMapping("exportModule") + public void exportModule(HttpServletResponse res) throws Exception{ + //获取要下载的模板名称 + String fileName = "居民信息录入模板"; + //设置要下载的文件的名称 + res.setCharacterEncoding("UTF-8"); + res.setHeader("content-Type", "application/vnd.ms-excel"); + res.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls"); + //获取文件的路径 + InputStream input = this.getClass().getResourceAsStream("/excel/居民信息录入模板.xls"); + OutputStream out = res.getOutputStream(); + byte[] b = new byte[2048]; + int len; + while ((len = input.read(b)) != -1) { + out.write(b, 0, len); + } + input.close(); + + } +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java new file mode 100644 index 0000000..ad6acac --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java @@ -0,0 +1,241 @@ +/** + * 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.vaccine.house.controller; + +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.constant.PopulationDictConstant; +import com.elink.esua.epdc.dto.house.PopulationInfoOverviewDTO; +import com.elink.esua.epdc.dto.house.PopulationInformationDTO; +import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO; +import com.elink.esua.epdc.dto.house.SysSimpleDictDTO; +import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; +import com.elink.esua.epdc.dto.house.result.EpdcScreenResidentInfoByCurrentAddressResultDTO; +import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient; +import com.elink.esua.epdc.vaccine.house.excel.EpdcScreenResidentInfoByCurrentAddressExcel; +import com.elink.esua.epdc.vaccine.house.excel.FamilyInformationExcel; +import com.elink.esua.epdc.vaccine.house.excel.PopulationInformationExcel; +import com.elink.esua.epdc.vaccine.house.excel.PopulationMotorVehicleExcel; +import com.elink.esua.epdc.vaccine.house.service.PopulationInformationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; + + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@RestController +@RequestMapping("populationinformation") +public class PopulationInformationController { + + @Autowired + private PopulationInformationService populationInformationService; + + + @Autowired + private VimAdminFeignClient adminFeignClient; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = populationInformationService.listPage(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + PopulationInformationDTO populationInformationDTOS = populationInformationService.get(id); + return new Result().ok(populationInformationDTOS); + } + + @GetMapping("getHouseHeadInfo") + public Result getHouseHeadInfo(String id) { + PopulationInformationDTO data = populationInformationService.getHouseHeadInfo(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PopulationInformationDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return populationInformationService.save(dto); + } + + @PutMapping + public Result update(@RequestBody PopulationInformationDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return populationInformationService.update(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + populationInformationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = populationInformationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PopulationInformationExcel.class); + } + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 判断身份证是否合法 + * @Author songyunpeng + * @Date 2020/8/24 + * @Param [isIdentifyNo] + **/ + @GetMapping("isIdentifyNoLegal/{isIdentifyNo}") + public Result isIdentifyNoLegal(@PathVariable("isIdentifyNo") String isIdentifyNo) { + String result = IdentityNoUtils.IdentityNoVerification(isIdentifyNo); + if (result != null) { + return new Result().error(result); + } + return new Result(); + } + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Description 获取机动车信息列表 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + **/ + @GetMapping("motorVehicle/page") + public Result> motorVehiclePage(@RequestParam Map params) { + PageData page = populationInformationService.motorVehiclePage(params); + return new Result>().ok(page); + } + + /** + * @return void + * @Description 机动车信息列表导出 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params, response] + **/ + @GetMapping("motorVehicle/export") + public void motorVehicleExport(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = populationInformationService.motorVehicleList(params); + //处理机动车类型 + //获取字典信息 + SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO = new SysPopulationSimpleDictFormDTO(); + List dicTypes = new ArrayList<>(); + Collections.addAll(dicTypes, PopulationDictConstant.MOTOR_VEHICLE_CATEGORY); + sysPopulationSimpleDictFormDTO.setDicTypes(dicTypes); + Result> listResult = adminFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO); + if (listResult == null || !listResult.success()) { + throw new RenException("获取字典失败!"); + } + List sysPopulationSimpleDictDTOS = listResult.getData(); + for (PopulationInformationDTO populationInformationDTO : list) { + String[] motorVehicleCategoryStrings = populationInformationDTO.getMotorVehicleCategory().split(","); + String motorVehicleCategoryEnd = ""; + a: + for (String motorVehicleCategoryStr : Arrays.asList(motorVehicleCategoryStrings)) { + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.MOTOR_VEHICLE_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (motorVehicleCategoryStr.equals(sysSimpleDict.getDictValue())) { + motorVehicleCategoryEnd += sysSimpleDict.getDictName() + ","; + continue a; + } + } + } + } + } + populationInformationDTO.setMotorVehicleCategory(motorVehicleCategoryEnd.substring(0, motorVehicleCategoryEnd.lastIndexOf(","))); + } + + + ExcelUtils.exportExcelToTarget(response, "机动车信息", list, PopulationMotorVehicleExcel.class); + } + + /** + * @return void + * @Description 家庭信息导出 + * @Author songyunpeng + * @Date 2020/8/28 + * @Param [params, response] + **/ + @GetMapping("getFamily/export") + public void getFamilyExport(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = populationInformationService.list(params); + ExcelUtils.exportExcelToTarget(response, "家庭信息", list, FamilyInformationExcel.class); + } + + /** + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + * @Description 获取居民信息采集总览数据 + * @Author songyunpeng + * @Date 2020/8/27 + * @Param [] + **/ + @GetMapping("getPopulationInfoOverview") + public PopulationInfoOverviewDTO getPopulationInfoOverview() { + return populationInformationService.getPopulationInfoOverview(); + } + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Description 以城找人 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + **/ + @GetMapping("selectPeopleByCurrentAddress") + public Result> selectPeopleByCurrentAddress(@RequestParam Map params) { + List pointDeptStatisticsResultDTOS = populationInformationService.selectPeopleByCurrentAddressForPc(params); + Integer total = populationInformationService.selectCountPeopleByCurrentAddressForPc(params); + PageData page = new PageData<>(pointDeptStatisticsResultDTOS, total); + return new Result>().ok(page); + } + + /** + * @return void + * @Description 以城找人 - 导出 + * @Author songyunpeng + * @Date 2020/8/28 + * @Param [params, response] + **/ + @GetMapping("selectPeopleByCurrentAddress/export") + public void selectPeopleByCurrentAddressExport(@RequestParam Map params, HttpServletResponse response) throws Exception { + List pointDeptStatisticsResultDTOS = populationInformationService.selectPeopleByCurrentAddressExportList(params); + ExcelUtils.exportExcelToTarget(response, "居民信息", pointDeptStatisticsResultDTOS, EpdcScreenResidentInfoByCurrentAddressExcel.class); + } + + +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseBusinessInfoDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseBusinessInfoDao.java new file mode 100644 index 0000000..83b8ac7 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseBusinessInfoDao.java @@ -0,0 +1,44 @@ +/** + * 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.vaccine.house.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.house.HouseBusinessInfoDTO; +import com.elink.esua.epdc.vaccine.house.entity.HouseBusinessInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 房屋经营信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface HouseBusinessInfoDao extends BaseDao { + /** + * @return java.util.List + * @Description 前端列表 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + **/ + List selectHouseBusinessInfoDTO(Map params); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseRentInfoDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseRentInfoDao.java new file mode 100644 index 0000000..be244a2 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseRentInfoDao.java @@ -0,0 +1,33 @@ +/** + * 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.vaccine.house.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.vaccine.house.entity.HouseRentInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 房屋租赁信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface HouseRentInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseResidentDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseResidentDao.java new file mode 100644 index 0000000..b2a7cc8 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseResidentDao.java @@ -0,0 +1,61 @@ +/** + * 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.vaccine.house.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.house.PopulationInformationDTO; +import com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 房屋人员关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface HouseResidentDao extends BaseDao { + /** + * @Description 根据户主ID查询居住人信息 + * @Author songyunpeng + * @Date 2020/8/21 + * @Param [params] + * @return java.util.List + **/ + List selectListOfPopulationInformationDTO(Map params); + /** + * @Description 根据联系表ID查询居住人详细信息 + * @Author songyunpeng + * @Date 2020/8/21 + * @Param [id] + * @return com.elink.esua.epdc.dto.PopulationInformationDTO + **/ + PopulationInformationDTO selectByHouseResidentId(@Param("id") String id); + /** + * @Description 根据居民ID获取关联关系表ID + * @Author songyunpeng + * @Date 2020/8/21 + * @Param [dto] + * @return com.elink.esua.epdc.entity.HouseResidentEntity + **/ + HouseResidentEntity getHouseResidentInfoByResidentId(@Param("residentId") String residentId); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HousingInformationDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HousingInformationDao.java new file mode 100644 index 0000000..91571cf --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HousingInformationDao.java @@ -0,0 +1,93 @@ +/** + * 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.vaccine.house.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.house.BasePopulationInformationExportDto; +import com.elink.esua.epdc.dto.house.BaseResidentInformationExportDto; +import com.elink.esua.epdc.dto.house.HousingInformationDTO; +import com.elink.esua.epdc.vaccine.house.entity.HousingInformationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 房屋信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface HousingInformationDao extends BaseDao { + /** + * @return java.util.List + * @Description 前端分页查询 + * @Author songyunpeng + * @Date 2020/8/19 + * @Param [params] + **/ + List selectListOfHousingInformationDTO(Map params); + + /** + * @return com.elink.esua.epdc.dto.HousingInformationDTO + * @Description 根据ID和房屋使用方式查询详情 + * @Author songyunpeng + * @Date 2020/8/19 + * @Param [params] + **/ + HousingInformationDTO selectByIdAndUsed(Map params); + + /** + * @return java.util.List + * @Description 查询导出的 房屋信息和户主信息 + * @Author songyunpeng + * @Date 2020/9/1 + * @Param [params] + **/ + List selectBasePopulationInformationExcelList(Map params); + + /** + * @return java.util.List + * @Description 根据户主ID列表获取居住人信息 + * @Author songyunpeng + * @Date 2020/9/1 + * @Param [houseHeadIds] + **/ + List selectBaseResidentInformationExcelList(@Param("houseHeadIds") Set houseHeadIds); + + /** + * @return java.util.List + * @Description 根据户主ID获取所有房子信息 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [houseHeadId] + **/ + List getHouseInfoByHouseHeadID(String houseHeadId); + + /** + * @return java.util.List + * @Description 查询需要修改的组织机构信息 + * @Author songyunpeng + * @Date 2020/11/24 + * @Param [toString] + **/ + List selectListOfOrganizationInfo(String deptId); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java new file mode 100644 index 0000000..3a398ee --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java @@ -0,0 +1,247 @@ +/** + * 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.vaccine.house.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.house.PopulationInfoOverviewDTO; +import com.elink.esua.epdc.dto.house.PopulationInformationDTO; +import com.elink.esua.epdc.dto.house.form.*; +import com.elink.esua.epdc.dto.house.result.*; +import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTO; +import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface PopulationInformationDao extends BaseDao { + /** + * @return com.elink.esua.epdc.dto.PopulationInformationDTO + * @Description 根据身份证信息获取人口信息 + * @Author songyunpeng + * @Date 2020/8/21 + * @Param [residentsIdentityNo] + **/ + PopulationInformationEntity getInfoByIdentityNo(@Param("residentsIdentityNo") String residentsIdentityNo); + + /** + * @return List + * @describe: 根据居民多个身份证信息获取相关人口信息 + * @author rongchao + * @date 2021/8/27 + * @params residentsIdentityNos + */ + List selectListByIdentityNos(@Param("residentsIdentityNos") List residentsIdentityNos); + + /** + * @return com.elink.esua.epdc.dto.PopulationInformationDTO + * @Description 取房屋户主信息 + * @Author songyunpeng + * @Date 2020/8/24 + * @Param [houseId] + **/ + PopulationInformationDTO getHouseHeadInfo(String houseId); + + /** + * @return java.util.List + * @Description 人口信息列表 + * @Author songyunpeng + * @Date 2020/8/25 + * @Param [params] + **/ + List selectListOfPopulationInformationDTO(Map params); + + /** + * @return java.util.List + * @Description 人口信息详细列表 + * @Author songyunpeng + * @Date 2020/8/25 + * @Param [params] + **/ + PopulationInformationDTO selectDetailOfPopulationInformationDTO(@Param("id") String id); + + /** + * @return java.util.List + * @Description 获取机动车列表信息 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + **/ + List motorVehiclePage(Map params); + + /** + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + * @Description 获取居民信息采集总览数据 + * @Author songyunpeng + * @Date 2020/8/27 + * @Param [] + **/ + PopulationInfoOverviewDTO getPopulationInfoOverview(); + + /** + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + * @Description 获取居民信息采集总览数据 - 大屏 + * @Author songyunpeng + * @Date 2020/8/27 + * @Param [] + **/ + PopulationInfoOverviewDTO getPopulationInfoOverviewForScreen(@Param("communityId") String communityId); + + /** + * @return void + * @Description 清空入党时间 + * @Author songyunpeng + * @Date 2020/9/4 + * @Param [id] + **/ + void setJionTimeToNull(@Param("id") String id); + + /** + * @return void + * @Description 清空失业登记时间 + * @Author songyunpeng + * @Date 2020/9/4 + * @Param [id] + **/ + void setUnemploymentRegisterTimeToNull(@Param("id") String id); + + /** + * @return java.util.List + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + **/ + List selectListPeople(EpdcScreenSelectPeopleFormDTO dto); + + /** + * @return java.util.List + * @Description 大屏找人接口 - count + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [dto] + **/ + Integer selectCountListPeople(EpdcScreenSelectPeopleFormDTO dto); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 房屋用途数据接口 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [] + **/ + EpdcScreenHouseUseResultDTO selectHouseUseDataForScreen(); + + /** + * @return java.util.List + * @Description 网格排名 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + **/ + List selectListGridRanking(EpdcScreenGridRankingFormDTO dto); + + /** + * @return java.util.List + * @Description 网格排名 count + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + **/ + Integer selectCountListGridRanking(EpdcScreenGridRankingFormDTO dto); + + /** + * @return java.util.List + * @Description 一人找房接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + **/ + List selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); + + /** + * @return java.util.List + * @Description 一人找房接口 - count + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + **/ + Integer selectCountHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); + + /** + * @return java.util.List + * @Description 以房找人 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + **/ + List selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); + + /** + * @return java.util.List + * @Description 以房找人 - count + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + **/ + Integer selectCountPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); + + /** + * @return java.util.List + * @Description 以城找人 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + **/ + List selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); + + /** + * @return java.lang.Integer + * @Description 以城找人 - count + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + **/ + Integer selectCountPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); + + /** + * @return java.util.List + * @Description 以城找人 - 导出 + * @Author songyunpeng + * @Date 2021/1/5 + * @Param [params] + **/ + List selectPeopleByCurrentAddressExportList(Map params); + + /** + * @return void + * @describe: + * @author rongchao + * @date 2021/8/28 + * @params entity + */ + void updatePersonInfo(PopulationInformationEntity entity); +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseBusinessInfoEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseBusinessInfoEntity.java new file mode 100644 index 0000000..7047101 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseBusinessInfoEntity.java @@ -0,0 +1,63 @@ +/** + * 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.vaccine.house.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 房屋经营信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_house_business_info") +public class HouseBusinessInfoEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 企业名称 + */ + private String enterpriseName; + + /** + * 社会统一代码 + */ + private String socialUniformCode; + + /** + * 法人代表 + */ + private String legalRepresentative; + + /** + * 电话 + */ + private String enterprisePhone; + + /** + * 房屋ID + */ + private String houseId; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseRentInfoEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseRentInfoEntity.java new file mode 100644 index 0000000..0d07d0d --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseRentInfoEntity.java @@ -0,0 +1,58 @@ +/** + * 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.vaccine.house.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 房屋租赁信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_house_rent_info") +public class HouseRentInfoEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 承租人姓名 + */ + private String tenantName; + + /** + * 承租人电话 + */ + private String tenantPhone; + + /** + * 承租人身份证号 + */ + private String tenantIdentityNo; + + /** + * 房屋ID + */ + private String houseId; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseResidentEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseResidentEntity.java new file mode 100644 index 0000000..cd15c84 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseResidentEntity.java @@ -0,0 +1,62 @@ +/** + * 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.vaccine.house.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 房屋人员关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_house_resident") +public class HouseResidentEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 房屋ID + */ + private String houseId; + /** + * 户主ID + */ + private String houseHeadId; + + /** + * 居民ID + */ + private String residentId; + + /** + * 与户主关系 (0:子女 1:夫妻 2:其他) + */ + private String houseHeadRelation; + + /** + * 是否为户主 (0:否 1:是) + */ + private String isHouseHead; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HousingInformationEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HousingInformationEntity.java new file mode 100644 index 0000000..237704d --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HousingInformationEntity.java @@ -0,0 +1,104 @@ +/** + * 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.vaccine.house.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 房屋信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_housing_information") +public class HousingInformationEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 房屋地址 + */ + private String houseAddress; + + /** + * 购房时间 + */ + private String buyingTime; + + /** + * 房屋面积 + */ + private BigDecimal houseArea; + + /** + * 产权人 + */ + private String propertyOwner; + + /** + * 产权人身份证号 + */ + private String propertyOwnerIdentityNo; + + /** + * 联系电话 + */ + private String propertyOwnerMobile; + /** + * 产权证 + */ + private String propertyOwnerCard; + + /** + * 房屋用途 (0:自住 1:租赁 2:经营) + */ + private String houseUse; + + /** + * 所属网格ID + */ + private Long gridId; + + /** + * 父所有部门 + */ + private String parentDeptIds; + + /** + * 父所有部门名称 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/PopulationInformationEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/PopulationInformationEntity.java new file mode 100644 index 0000000..627e3ab --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/PopulationInformationEntity.java @@ -0,0 +1,220 @@ +/** + * 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.vaccine.house.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("epdc_population_information") +public class PopulationInformationEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 姓名 + */ + private String residentsName; + + /** + * 性别 (0:女 1:男) + */ + private String residentsSex; + + /** + * 民族 + */ + private String residentsNation; + + /** + * 出生年/月 + */ + private Date residentsBirthday; + + /** + * 文化程度 + */ + private String educationLevel; + + /** + * 政治面貌 (0:群众 1:党员) + */ + private String politicsStatus; + + /** + * 入党时间 + */ + private String joinTime; + + /** + * 组织关系所在地 + */ + private String organizationalRelationshipLocation; + + /** + * 身份证号码 + */ + private String residentsIdentityNo; + + /** + * 联系电话 + */ + private String residentsPhone; + + /** + * 身体状况 (0:病残 1:健康) + */ + private String bodyStatus; + + /** + * 婚姻状况 (0:未婚 1:已婚) + */ + private String maritalStatus; + + /** + * 户口类型 (0:城镇 1:农业) + */ + private String accountType; + + /** + * 服兵役 (0:否 1:是) + */ + private String militaryService; + + /** + * 户籍地 + */ + private String householdRegistrationPlace; + + /** + * 就业情况 (0:在岗 1:就业) + */ + private String employmentStatus; + + /** + * 现工作单位 + */ + private String currentEmployer; + + /** + * 现单位地址 + */ + private String currentEmployerAddress; + + /** + * 失业原因 (0:原单位破产 1:解除合同 2:效益不好 3:减员 4:其他) + */ + private String unemploymentReason; + + /** + * 再就业优惠证 (0:无 1:有) + */ + private String reemploymentPermit; + + /** + * 失业登记 (0:否 1:是) + */ + private String unemploymentRegister; + + /** + * 失业登记时间 + */ + private String unemploymentRegisterTime; + + /** + * 家庭类别 (0:普通家庭 1:五好家庭 2:军烈家庭 3:优抚家庭 4:单亲家庭 5:空巢老人 6:困难家庭) + */ + private String familyCategory; + + /** + * 救助情况 (0:低保 1:大病 2:廉租 3:教育 4:临时 5:其他) + */ + private String helpStatus; + + /** + * 机动车数量 + */ + private Integer motorVehicleNum; + + /** + * 机动车类型 (0:轿车 1:摩托 2:其他) + */ + private String motorVehicleCategory; + + /** + * 宠物犬状况 (0:无 1:有) + */ + private String dogStatus; + + /** + * 家庭成员数 + */ + private Integer familyMemberNum; + + /** + * 家庭外出成员数 + */ + private Integer familyMemberOutNum; + + /** + * 外出原因 (0:务工 1:上学 2:探亲 3:其他) + */ + private String familyMemberOutReason; + + /** + * 在外月数 + */ + private Integer familyMemberOutMonth; + + /** + * 现居住地址- 保存居住人使用 + */ + private String currentAddress; + + /** + * 核酸检测状态:0已检测 1未检测 + */ + private String checkState; + + /** + * 核酸检测时间 + */ + private Date checkDate; + + /** + * 接种次数 + */ + private Integer vaccinationNum; + + /** + * 接种状态 0未接种 1接种中 2接种完成 + */ + private Integer vaccinationState; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExcel.java new file mode 100644 index 0000000..ccb4863 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExcel.java @@ -0,0 +1,156 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class BasePopulationInformationExcel { + + @Excel(name = "房屋地址") + private String houseAddress; + + @Excel(name = "购房时间") + private String buyingTime; + + @Excel(name = "房屋面积") + private BigDecimal houseArea; + + @Excel(name = "产权人姓名") + private String propertyOwner; + + @Excel(name = "产权人身份证号",width = 20) + private String propertyOwnerIdentityNo; + + @Excel(name = "产权人联系电话",width = 20) + private String propertyOwnerMobile; + + @Excel(name = "房屋用途",replace = {"自住_0","租赁_1","经营_2"}) + private String houseUse; + + @Excel(name = "承租人姓名") + private String tenantName; + + @Excel(name = "承租人电话",width = 20) + private String tenantPhone; + + @Excel(name = "承租人身份证号",width = 20) + private String tenantIdentityNo; + + @Excel(name = "企业名称",width = 20) + private String enterpriseName; + + @Excel(name = "社会统一代码",width = 20) + private String socialUniformCode; + + @Excel(name = "法人代表") + private String legalRepresentative; + + @Excel(name = "电话",width = 20) + private String enterprisePhone; + + @Excel(name = "户主姓名") + private String residentsName; + + private String residentsSex; + + private Date residentsBirthday; + + @Excel(name = "民族") + private String residentsNation; + + @Excel(name = "文化程度") + private String educationLevel; + + @Excel(name = "政治面貌") + private String politicsStatus; + + @Excel(name = "入党时间") + private String joinTime; + + @Excel(name = "组织关系所在地",width = 20) + private String organizationalRelationshipLocation; + + @Excel(name = "身份证号码",width = 20) + private String residentsIdentityNo; + + @Excel(name = "户主联系电话",width = 20) + private String residentsPhone; + + @Excel(name = "身体状况") + private String bodyStatus; + + @Excel(name = "婚姻状况") + private String maritalStatus; + + @Excel(name = "户口类型") + private String accountType; + + @Excel(name = "服兵役",replace = {"否_0","是_1"}) + private String militaryService; + + @Excel(name = "户籍地",width = 20) + private String householdRegistrationPlace; + + @Excel(name = "就业情况") + private String employmentStatus; + + @Excel(name = "现工作单位") + private String currentEmployer; + + @Excel(name = "现单位地址",width = 20) + private String currentEmployerAddress; + + @Excel(name = "失业原因",width = 20) + private String unemploymentReason; + + @Excel(name = "再就业优惠证",replace = {"无_0","有_1"}) + private String reemploymentPermit; + + @Excel(name = "失业登记",replace = {"否_0","是_1"}) + private String unemploymentRegister; + + @Excel(name = "失业登记时间") + private String unemploymentRegisterTime; + + @Excel(name = "家庭类别") + private String familyCategory; + + @Excel(name = "救助情况") + private String helpStatus; + + @Excel(name = "机动车数量") + private Integer motorVehicleNum; + + @Excel(name = "机动车类型") + private String motorVehicleCategory; + + @Excel(name = "宠物犬状况",replace = {"无_0","有_1"}) + private String dogStatus; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExportExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExportExcel.java new file mode 100644 index 0000000..07518b2 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExportExcel.java @@ -0,0 +1,163 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class BasePopulationInformationExportExcel { + + @Excel(name = "所属网格") + private String gridName; + + @Excel(name = "房屋地址") + private String houseAddress; + + @Excel(name = "购房时间") + private String buyingTime; + + @Excel(name = "房屋面积") + private BigDecimal houseArea; + + @Excel(name = "产权人姓名") + private String propertyOwner; + + @Excel(name = "产权人身份证号") + private String propertyOwnerIdentityNo; + + @Excel(name = "产权证") + private String propertyOwnerCard; + + @Excel(name = "产权人联系电话") + private String propertyOwnerMobile; + + @Excel(name = "房屋用途",replace = {"自住_0","租赁_1","经营_2"}) + private String houseUse; + + @Excel(name = "承租人姓名") + private String tenantName; + + @Excel(name = "承租人电话") + private String tenantPhone; + + @Excel(name = "承租人身份证号") + private String tenantIdentityNo; + + @Excel(name = "企业名称") + private String enterpriseName; + + @Excel(name = "社会统一代码") + private String socialUniformCode; + + @Excel(name = "法人代表") + private String legalRepresentative; + + @Excel(name = "电话") + private String enterprisePhone; + + @Excel(name = "户主姓名") + private String residentsName; + + @Excel(name = "性别",replace = {"女_0","男_1"}) + private String residentsSex; + + @Excel(name = "出生年月") + private String residentsBirthday; + + @Excel(name = "民族") + private String residentsNation; + + @Excel(name = "文化程度") + private String educationLevel; + + @Excel(name = "政治面貌") + private String politicsStatus; + + @Excel(name = "入党时间") + private String joinTime; + + @Excel(name = "组织关系所在地") + private String organizationalRelationshipLocation; + + @Excel(name = "身份证号码") + private String residentsIdentityNo; + + @Excel(name = "户主联系电话") + private String residentsPhone; + + @Excel(name = "身体状况") + private String bodyStatus; + + @Excel(name = "婚姻状况") + private String maritalStatus; + + @Excel(name = "户口类型") + private String accountType; + + @Excel(name = "服兵役",replace = {"否_0","是_1"}) + private String militaryService; + + @Excel(name = "户籍地") + private String householdRegistrationPlace; + + @Excel(name = "就业情况") + private String employmentStatus; + + @Excel(name = "现工作单位") + private String currentEmployer; + + @Excel(name = "现单位地址") + private String currentEmployerAddress; + + @Excel(name = "失业原因") + private String unemploymentReason; + + @Excel(name = "再就业优惠证",replace = {"无_0","有_1"}) + private String reemploymentPermit; + + @Excel(name = "失业登记",replace = {"否_0","是_1"}) + private String unemploymentRegister; + + @Excel(name = "失业登记时间") + private String unemploymentRegisterTime; + + @Excel(name = "家庭类别") + private String familyCategory; + + @Excel(name = "救助情况") + private String helpStatus; + + @Excel(name = "机动车数量") + private Integer motorVehicleNum; + + @Excel(name = "机动车类型") + private String motorVehicleCategory; + + @Excel(name = "宠物犬状况",replace = {"无_0","有_1"}) + private String dogStatus; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExcel.java new file mode 100644 index 0000000..47fcbdf --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExcel.java @@ -0,0 +1,53 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class BaseResidentInformationExcel { + + @Excel(name = "户主身份证号码") + private String residentsIdentityNo; + + @Excel(name = "与户主关系",replace = {"子女_0","夫妻_1","父母_2","其他_3"}) + private String houseHeadRelation; + + @Excel(name = "居住人姓名") + private String residentsName; + + @Excel(name = "性别",replace = {"女_0","男_1"}) + private String residentsSex; + + @Excel(name = "民族") + private String residentsNation; + + @Excel(name = "现工作单位或学校") + private String currentEmployer; + + @Excel(name = "现居住地") + private String currentAddress; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExportExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExportExcel.java new file mode 100644 index 0000000..f46b99f --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExportExcel.java @@ -0,0 +1,56 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class BaseResidentInformationExportExcel { + + @Excel(name = "户主身份证号码") + private String residentsIdentityNo; + + @Excel(name = "户主姓名") + private String houseHeadName; + + @Excel(name = "与户主关系",replace = {"子女_0","夫妻_1","父母_2","其他_3"}) + private String houseHeadRelation; + + @Excel(name = "居住人姓名") + private String residentsName; + + @Excel(name = "性别",replace = {"女_0","男_1"}) + private String residentsSex; + + @Excel(name = "民族") + private String residentsNation; + + @Excel(name = "现工作单位或学校") + private String currentEmployer; + + @Excel(name = "现居住地") + private String currentAddress; + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/EpdcScreenResidentInfoByCurrentAddressExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/EpdcScreenResidentInfoByCurrentAddressExcel.java new file mode 100644 index 0000000..7e1f9f2 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/EpdcScreenResidentInfoByCurrentAddressExcel.java @@ -0,0 +1,44 @@ +package com.elink.esua.epdc.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @author songyunpeng + * @Description 大屏以人找人结果 + * @create 2020-09-14 + */ +@Data +public class EpdcScreenResidentInfoByCurrentAddressExcel { + + /** + * 居住人姓名 + */ + @Excel(name = "姓名") + private String residentName; + + /** + * 当前居住地址 + */ + @Excel(name = "现居住地") + private String currentAddress; + /** + * 户主姓名 + */ + @Excel(name = "户主姓名") + private String houseHeadName; + /** + * 户主电话 + */ + @Excel(name = "户主电话") + private String houseHeadPhone; + /** + * 户主居住地址 + */ + @Excel(name = "户主居住地址") + private String houseHeadAddress; + + + + +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/FamilyInformationExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/FamilyInformationExcel.java new file mode 100644 index 0000000..b37b296 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/FamilyInformationExcel.java @@ -0,0 +1,50 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class FamilyInformationExcel { + + @Excel(name = "辖区范围") + private String gridNames; + + @Excel(name = "户主姓名") + private String residentsName; + + @Excel(name = "救助情况",replace = {"低保_0", "大病_1","廉租_2","教育_3","临时_4","其他_5"}) + private String helpStatus; + + + @Excel(name = "家庭类别",replace = {"普通家庭_0", "军烈家庭_1","优抚家庭_2","困难家庭_3"}) + private String familyCategory; + + @Excel(name = "家庭住址") + private String houseAddress; + + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseBusinessInfoExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseBusinessInfoExcel.java new file mode 100644 index 0000000..09b2d77 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseBusinessInfoExcel.java @@ -0,0 +1,54 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 房屋经营信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class HouseBusinessInfoExcel { + + @Excel(name = "辖区范围") + private String gridName; + + @Excel(name = "经营者姓名") + private String legalRepresentative; + + + @Excel(name = "联系电话") + private String enterprisePhone; + + @Excel(name = "企业名称") + private String enterpriseName; + + @Excel(name = "企业注册号") + private String socialUniformCode; + + + + + + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseRentInfoExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseRentInfoExcel.java new file mode 100644 index 0000000..9dfce7a --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseRentInfoExcel.java @@ -0,0 +1,68 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 房屋租赁信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class HouseRentInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "承租人姓名") + private String tenantName; + + @Excel(name = "承租人电话") + private String tenantPhone; + + @Excel(name = "承租人身份证号") + private String tenantIdentityNo; + + @Excel(name = "房屋ID") + private String houseId; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseResidentExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseResidentExcel.java new file mode 100644 index 0000000..3d5f46b --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseResidentExcel.java @@ -0,0 +1,68 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 房屋人员关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class HouseResidentExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "房屋ID") + private String houseId; + + @Excel(name = "居民ID") + private String residentId; + + @Excel(name = "与户主关系 (0:子女 1:夫妻 2:其他)") + private String houseHeadRelation; + + @Excel(name = "是否为户主 (0:否 1:是)") + private String isHouseHead; + + @Excel(name = "删除标识 (0:否 1:是)") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HousingInformationExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HousingInformationExcel.java new file mode 100644 index 0000000..7a5b9f8 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HousingInformationExcel.java @@ -0,0 +1,93 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 房屋信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class HousingInformationExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "房屋地址") + private String houseAddress; + + @Excel(name = "购房时间") + private Date buyingTime; + + @Excel(name = "房屋面积") + private BigDecimal houseArea; + + @Excel(name = "产权人") + private String propertyOwner; + + @Excel(name = "产权人身份证号") + private String propertyOwnerIdentityNo; + + @Excel(name = "联系电话") + private String propertyOwnerMobile; + + @Excel(name = "房屋用途 (0:自住 1:租赁 2:经营)") + private String houseUse; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "所属网格ID") + private Long gridId; + + @Excel(name = "父所有部门") + private String parentDeptIds; + + @Excel(name = "父所有部门名称") + private String parentDeptNames; + + @Excel(name = "所有部门ID") + private String allDeptIds; + + @Excel(name = "所有部门名称") + private String allDeptNames; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationInformationExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationInformationExcel.java new file mode 100644 index 0000000..d1f1d2d --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationInformationExcel.java @@ -0,0 +1,164 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class PopulationInformationExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "姓名") + private String residentsName; + + @Excel(name = "性别 (0:女 1:男)") + private String residentsSex; + + @Excel(name = "民族") + private String residentsNation; + + @Excel(name = "出生年/月") + private Date residentsBirthday; + + @Excel(name = "文化程度") + private String educationLevel; + + @Excel(name = "政治面貌 (0:群众 1:党员)") + private String politicsStatus; + + @Excel(name = "入党时间") + private Date joinTime; + + @Excel(name = "组织关系所在地") + private String organizationalRelationshipLocation; + + @Excel(name = "身份证号码") + private String residentsIdentityNo; + + @Excel(name = "联系电话") + private String residentsPhone; + + @Excel(name = "身体状况 (0:病残 1:健康)") + private String bodyStatus; + + @Excel(name = "婚姻状况 (0:未婚 1:已婚)") + private String maritalStatus; + + @Excel(name = "户口类型 (0:城镇 1:农业)") + private String accountType; + + @Excel(name = "服兵役 (0:否 1:是)") + private String militaryService; + + @Excel(name = "户籍地") + private String householdRegistrationPlace; + + @Excel(name = "就业情况 (0:在岗 1:就业)") + private String employmentStatus; + + @Excel(name = "现工作单位") + private String currentEmployer; + + @Excel(name = "现单位地址") + private String currentEmployerAddress; + + @Excel(name = "失业原因 (0:原单位破产 1:解除合同 2:效益不好 3:减员 4:其他)") + private String unemploymentReason; + + @Excel(name = "再就业优惠证 (0:无 1:有)") + private String reemploymentPermit; + + @Excel(name = "失业登记 (0:否 1:是)") + private String unemploymentRegister; + + @Excel(name = "失业登记时间") + private Date unemploymentRegisterTime; + + @Excel(name = "家庭类别 (0:普通家庭 1:五好家庭 2:军烈家庭 3:优抚家庭 4:单亲家庭 5:空巢老人 6:困难家庭)") + private String familyCategory; + + @Excel(name = "救助情况 (0:低保 1:大病 2:廉租 3:教育 4:临时 5:其他)") + private String helpStatus; + + @Excel(name = "机动车数量") + private Integer motorVehicleNum; + + @Excel(name = "机动车类型 (0:轿车 1:摩托 2:其他)") + private String motorVehicleCategory; + + @Excel(name = "宠物犬状况 (0:无 1:有)") + private String dogStatus; + + @Excel(name = "家庭成员数") + private Integer familyMemberNum; + + @Excel(name = "家庭外出成员数") + private Integer familyMemberOutNum; + + @Excel(name = "外出原因 (0:务工 1:上学 2:探亲 3:其他)") + private String familyMemberOutReason; + + @Excel(name = "在外月数") + private Integer familyMemberOutMonth; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "所属网格ID") + private Long gridId; + + @Excel(name = "父所有部门") + private String parentDeptIds; + + @Excel(name = "父所有部门") + private String parentDeptNames; + + @Excel(name = "所有部门ID") + private String allDeptIds; + + @Excel(name = "所有部门名称") + private String allDeptNames; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationMotorVehicleExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationMotorVehicleExcel.java new file mode 100644 index 0000000..9ed558b --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationMotorVehicleExcel.java @@ -0,0 +1,43 @@ +/** + * 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.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class PopulationMotorVehicleExcel { + + + @Excel(name = "车主姓名") + private String residentsName; + + @Excel(name = "联系电话") + private String residentsPhone; + + @Excel(name = "机动车类型") + private String motorVehicleCategory; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseBusinessInfoRedis.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseBusinessInfoRedis.java new file mode 100644 index 0000000..4d5700c --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseBusinessInfoRedis.java @@ -0,0 +1,47 @@ +/** + * 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.vaccine.house.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 房屋经营信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Component +public class HouseBusinessInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseRentInfoRedis.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseRentInfoRedis.java new file mode 100644 index 0000000..e587ed0 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseRentInfoRedis.java @@ -0,0 +1,47 @@ +/** + * 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.vaccine.house.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 房屋租赁信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Component +public class HouseRentInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseResidentRedis.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseResidentRedis.java new file mode 100644 index 0000000..34fa50a --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseResidentRedis.java @@ -0,0 +1,47 @@ +/** + * 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.vaccine.house.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 房屋人员关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Component +public class HouseResidentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HousingInformationRedis.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HousingInformationRedis.java new file mode 100644 index 0000000..437c4f1 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HousingInformationRedis.java @@ -0,0 +1,47 @@ +/** + * 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.vaccine.house.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 房屋信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Component +public class HousingInformationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/PopulationInformationRedis.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/PopulationInformationRedis.java new file mode 100644 index 0000000..c4ef412 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/PopulationInformationRedis.java @@ -0,0 +1,47 @@ +/** + * 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.vaccine.house.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Component +public class PopulationInformationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseBusinessInfoService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseBusinessInfoService.java new file mode 100644 index 0000000..7f3221e --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseBusinessInfoService.java @@ -0,0 +1,112 @@ +/** + * 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.vaccine.house.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.house.HouseBusinessInfoDTO; +import com.elink.esua.epdc.vaccine.house.entity.HouseBusinessInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 房屋经营信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface HouseBusinessInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HouseBusinessInfoDTO + * @author generator + * @date 2020-08-19 + */ + HouseBusinessInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + void save(HouseBusinessInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + void update(HouseBusinessInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-19 + */ + void delete(String[] ids); + + /** + * @Description 根据房屋ID查询企业经营信息 + * @Author songyunpeng + * @Date 2020/8/19 + * @Param [houseID] + * @return com.elink.esua.epdc.entity.HouseRentInfoEntity + **/ + HouseBusinessInfoEntity getHouseBusinessInfoEntityByHouseId(String houseID); + /** + * @Description 前端类表 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData listPage(Map params); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseRentInfoService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseRentInfoService.java new file mode 100644 index 0000000..50cdf87 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseRentInfoService.java @@ -0,0 +1,104 @@ +/** + * 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.vaccine.house.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.house.HouseRentInfoDTO; +import com.elink.esua.epdc.vaccine.house.entity.HouseRentInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 房屋租赁信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface HouseRentInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HouseRentInfoDTO + * @author generator + * @date 2020-08-19 + */ + HouseRentInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + void save(HouseRentInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + void update(HouseRentInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-19 + */ + void delete(String[] ids); + + /** + * @Description 根据房屋ID查询承租人信息 + * @Author songyunpeng + * @Date 2020/8/19 + * @Param [houseID] + * @return com.elink.esua.epdc.entity.HouseRentInfoEntity + **/ + HouseRentInfoEntity getHouseRentInfoEntityByHouseId(String houseID); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseResidentService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseResidentService.java new file mode 100644 index 0000000..0a15490 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseResidentService.java @@ -0,0 +1,121 @@ +/** + * 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.vaccine.house.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.house.HouseResidentDTO; +import com.elink.esua.epdc.dto.house.PopulationInformationDTO; +import com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 房屋人员关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface HouseResidentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HouseResidentDTO + * @author generator + * @date 2020-08-19 + */ + PopulationInformationDTO get(String id); + + /** + * 带身份证的居民信息保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + Result saveWithIdentifyNo(HouseResidentDTO dto); + + /** + * 带身份证的居民信息更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + Result updateWithIdentifyNo(HouseResidentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-19 + */ + void delete(String[] ids); + /** + * @Description 获取居住人列表 + * @Author songyunpeng + * @Date 2020/8/21 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData listPage(Map params); + /** + * @Description 不带身份证的居民信息保存 + * @Author songyunpeng + * @Date 2020/8/24 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result saveWithoutIdentifyNo(HouseResidentDTO dto); + /** + * @Description 不带身份证的居民信息更新 + * @Author songyunpeng + * @Date 2020/8/24 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result updateWithoutIdentifyNo(HouseResidentDTO dto); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HousingInformationService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HousingInformationService.java new file mode 100644 index 0000000..00b592b --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HousingInformationService.java @@ -0,0 +1,149 @@ +/** + * 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.vaccine.house.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.dto.house.BasePopulationInformationExportDto; +import com.elink.esua.epdc.dto.house.BaseResidentInformationExportDto; +import com.elink.esua.epdc.dto.house.HousingInformationDTO; +import com.elink.esua.epdc.vaccine.house.entity.HousingInformationEntity; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 房屋信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface HousingInformationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HousingInformationDTO + * @author generator + * @date 2020-08-19 + */ + HousingInformationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + Result save(HousingInformationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + Result update(HousingInformationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-19 + */ + void delete(String[] ids); + /** + * @Description 前端分页列表 + * @Author songyunpeng + * @Date 2020/8/19 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData listOfPage(Map params); + /** + * @Description 批量导入居民信息 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [file] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result importPopulationInfo(MultipartFile file,String gridId); + /** + * @Description 查询导出的 房屋信息和户主信息 + * @Author songyunpeng + * @Date 2020/9/1 + * @Param [params] + * @return java.util.List + **/ + List selectBasePopulationInformationExcelList(Map params); + /** + * @Description 根据户主ID列表获取居住人信息 + * @Author songyunpeng + * @Date 2020/9/1 + * @Param [houseHeadIds] + * @return java.util.List + **/ + List selectBaseResidentInformationExcelList(Set houseHeadIds); + /** + * @Description 根据户主ID获取所有房子信息 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [populationId] + * @return java.util.List + **/ + List getHouseInfoByHouseHeadID(String houseHeadId); + /** + * @Description 房屋信息修改组织结构信息 + * @Author songyunpeng + * @Date 2020/11/25 + * @Param [dto] + * @return void + **/ + void modifyOrganizationInfo(OrganizationModifyDTO dto); +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/PopulationInformationService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/PopulationInformationService.java new file mode 100644 index 0000000..b6f46e0 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/PopulationInformationService.java @@ -0,0 +1,254 @@ +/** + * 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.vaccine.house.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.house.PopulationInfoOverviewDTO; +import com.elink.esua.epdc.dto.house.PopulationInformationDTO; +import com.elink.esua.epdc.dto.house.form.*; +import com.elink.esua.epdc.dto.house.result.*; +import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface PopulationInformationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PopulationInformationDTO + * @author generator + * @date 2020-08-19 + */ + PopulationInformationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + Result save(PopulationInformationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-19 + */ + Result update(PopulationInformationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-19 + */ + void delete(String[] ids); + /** + * @Description 根据房屋ID获取户主信息 + * @Author songyunpeng + * @Date 2020/8/21 + * @Param [id] + * @return com.elink.esua.epdc.dto.PopulationInformationDTO + **/ + PopulationInformationDTO getHouseHeadInfo(String id); + /** + * @Description 根据身份证获取人口信息 + * @Author songyunpeng + * @Date 2020/8/21 + * @Param [residentsIdentityNo] + * @return com.elink.esua.epdc.dto.PopulationInformationDTO + **/ + PopulationInformationEntity getInfoByIdentityNo(String residentsIdentityNo); + /** + * @Description 人口信息列表 + * @Author songyunpeng + * @Date 2020/8/25 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData listPage(Map params); + /** + * @Description 获取机动车列表信息 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData motorVehiclePage(Map params); + + /** + * @Description 获取机动车列表信息 --导出查询 + * @Author songyunpeng + * @Date 2020/8/26 + * @Param [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + List motorVehicleList(Map params); + /** + * @Description 获取居民信息采集总览数据 + * @Author songyunpeng + * @Date 2020/8/28 + * @Param [] + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + **/ + PopulationInfoOverviewDTO getPopulationInfoOverview(); + /** + * @Description 获取居民信息采集总览 + * @Author songyunpeng + * @Date 2021/6/23 + * @Param [communityId] + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + **/ + PopulationInfoOverviewDTO getPopulationInfoOverviewForScreen(String communityId); + /** + * @Description 清空入党时间 + * @Author songyunpeng + * @Date 2020/9/4 + * @Param [id] + * @return void + **/ + void setJionTimeToNull(String id); + /** + * @Description 清空失业登记时间 + * @Author songyunpeng + * @Date 2020/9/4 + * @Param [id] + * @return void + **/ + void setUnemploymentRegisterTimeToNull(String id); + /** + * @Description 大屏找人接口 + * @Author songyunpeng + * @Date 2020/9/14 + * @Param [epdcScreenSelectPeopleFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + PageData 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); + /** + * @Description 房屋用途数据接口 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result housingUse(); + /** + * @Description 网格排名 + * @Author songyunpeng + * @Date 2020/9/15 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + PageData gridRanking(EpdcScreenGridRankingFormDTO dto); + /** + * @Description 一人找房接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); + /** + * @Description 以房找人接口 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); + /** + * @Description 以城找人 + * @Author songyunpeng + * @Date 2020/9/19 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.page.PageData + **/ + PageData selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); + + /** + * @Description 以城找人 - pc + * @Author songyunpeng + * @Date 2021/1/4 + * @Param [params] + * @return java.util.List + **/ + List selectPeopleByCurrentAddressForPc(Map params); + /** + * 以城找人 - pc导出 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-19 + */ + List selectPeopleByCurrentAddressExportList(Map params); + /** + * @Description 以城找人 - pc - count + * @Author songyunpeng + * @Date 2021/1/4 + * @Param [params] + * @return java.util.List + **/ + Integer selectCountPeopleByCurrentAddressForPc(Map params); +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseBusinessInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseBusinessInfoServiceImpl.java new file mode 100644 index 0000000..0b57df7 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseBusinessInfoServiceImpl.java @@ -0,0 +1,120 @@ +/** + * 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.vaccine.house.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dto.house.HouseBusinessInfoDTO; +import com.elink.esua.epdc.vaccine.house.dao.HouseBusinessInfoDao; +import com.elink.esua.epdc.vaccine.house.entity.HouseBusinessInfoEntity; +import com.elink.esua.epdc.vaccine.house.redis.HouseBusinessInfoRedis; +import com.elink.esua.epdc.vaccine.house.service.HouseBusinessInfoService; +import org.apache.commons.lang3.StringUtils; +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; + +/** + * 房屋经营信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class HouseBusinessInfoServiceImpl extends BaseServiceImpl implements HouseBusinessInfoService { + + @Autowired + private HouseBusinessInfoRedis houseBusinessInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HouseBusinessInfoDTO.class); + } + + @Override + public List list(Map params) { + return baseDao.selectHouseBusinessInfoDTO(params); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public HouseBusinessInfoDTO get(String id) { + HouseBusinessInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HouseBusinessInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HouseBusinessInfoDTO dto) { + HouseBusinessInfoEntity entity = ConvertUtils.sourceToTarget(dto, HouseBusinessInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HouseBusinessInfoDTO dto) { + HouseBusinessInfoEntity entity = ConvertUtils.sourceToTarget(dto, HouseBusinessInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public HouseBusinessInfoEntity getHouseBusinessInfoEntityByHouseId(String houseID) { + Map params = new HashMap<>(); + params.put("HOUSE_ID", houseID); + List houseBusinessInfoEntities = baseDao.selectByMap(params); + if(houseBusinessInfoEntities.size()>0){ + return houseBusinessInfoEntities.get(0); + } + return null; + } + + @Override + public PageData listPage(Map params) { + IPage page = getPage(params); + List list = baseDao.selectHouseBusinessInfoDTO(params); + return new PageData<>(list, page.getTotal()); } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseRentInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseRentInfoServiceImpl.java new file mode 100644 index 0000000..b31c0aa --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseRentInfoServiceImpl.java @@ -0,0 +1,116 @@ +/** + * 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.vaccine.house.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dto.house.HouseRentInfoDTO; +import com.elink.esua.epdc.vaccine.house.dao.HouseRentInfoDao; +import com.elink.esua.epdc.vaccine.house.entity.HouseRentInfoEntity; +import com.elink.esua.epdc.vaccine.house.redis.HouseRentInfoRedis; +import com.elink.esua.epdc.vaccine.house.service.HouseRentInfoService; +import org.apache.commons.lang3.StringUtils; +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; + +/** + * 房屋租赁信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class HouseRentInfoServiceImpl extends BaseServiceImpl implements HouseRentInfoService { + + @Autowired + private HouseRentInfoRedis houseRentInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HouseRentInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HouseRentInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public HouseRentInfoDTO get(String id) { + HouseRentInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HouseRentInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HouseRentInfoDTO dto) { + HouseRentInfoEntity entity = ConvertUtils.sourceToTarget(dto, HouseRentInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HouseRentInfoDTO dto) { + HouseRentInfoEntity entity = ConvertUtils.sourceToTarget(dto, HouseRentInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public HouseRentInfoEntity getHouseRentInfoEntityByHouseId(String houseID) { + Map params = new HashMap<>(); + params.put("HOUSE_ID", houseID); + List houseRentInfoEntities = baseDao.selectByMap(params); + if(houseRentInfoEntities!=null && houseRentInfoEntities.size()>0){ + return houseRentInfoEntities.get(0); + } + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseResidentServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseResidentServiceImpl.java new file mode 100644 index 0000000..bdafe88 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseResidentServiceImpl.java @@ -0,0 +1,380 @@ +/** + * 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.vaccine.house.service.impl; + +import cn.hutool.core.date.DateUtil; +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.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.dto.house.HouseResidentDTO; +import com.elink.esua.epdc.dto.house.PopulationInformationDTO; +import com.elink.esua.epdc.vaccine.house.dao.HouseResidentDao; +import com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity; +import com.elink.esua.epdc.vaccine.house.entity.HousingInformationEntity; +import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; +import com.elink.esua.epdc.vaccine.house.redis.HouseResidentRedis; +import com.elink.esua.epdc.vaccine.house.service.HouseResidentService; +import com.elink.esua.epdc.vaccine.house.service.HousingInformationService; +import com.elink.esua.epdc.vaccine.house.service.PopulationInformationService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 房屋人员关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class HouseResidentServiceImpl extends BaseServiceImpl implements HouseResidentService { + + @Autowired + private HouseResidentRedis houseResidentRedis; + + @Autowired + private PopulationInformationService populationInformationService; + + @Autowired + private HousingInformationService housingInformationService; + @Autowired + private HouseResidentDao houseResidentDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HouseResidentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HouseResidentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PopulationInformationDTO get(String id) { + PopulationInformationDTO populationInformationDTO = baseDao.selectByHouseResidentId(id); + return populationInformationDTO; + } + /** 居住人的新增和更新逻辑: + * 新增:1.判断填写的身份证是否已存在 + * 不存在:直接新增人口信息和关联表信息 + * 存在:更新原有的人口信息和关联信息(若是有户主身份,且在此是第一次新增居住信息,则直接更新原有人口信息和新增关联信息) + * 更新:1.若是身份证被修改:判断填写的身份证是否存在 + * 不存在:代表更新关联表信息和新增人口信息,原先的人口信息如果只有居住人身份的话则直接删除 + * ****存在(只有人才才会走到这个逻辑): + * 1.判断修改的身份证信息是不是在当前房屋下,存在则返回错误信息 + * 2.不在此房屋下: + * 若是此身份证有户主身份: + * (1)更新原先的人口信息 + * (2)新增居民关联关系为表单的身份证和表单房子关联 + * (3)删除被更新的人口信息(非户主)和人口关系 + * 若是此身份证有居住人身份(或者既有户主又有居民身份): + * (1)更新原先居民关联关系为表单的身份证和表单房子关联 + * (2)更新原先的人口信息 + * (3)删除被更新的人口信息(非户主)和人口关系 + * + * */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result saveWithIdentifyNo(HouseResidentDTO dto) { + //先判断身份证是否合法 + String result = IdentityNoUtils.IdentityNoVerification(dto.getResidentsIdentityNo()); + if(result != null){ + return new Result().error(result); + } + String sex = IdentityNoUtils.getSex(dto.getResidentsIdentityNo()); + String birthday = IdentityNoUtils.getBirthday(dto.getResidentsIdentityNo()); + //根据身份证查询新人口信息 + PopulationInformationEntity newPopulationInformationEntity = populationInformationService.getInfoByIdentityNo(dto.getResidentsIdentityNo()); + if(newPopulationInformationEntity==null){ + newPopulationInformationEntity = new PopulationInformationEntity(); + newPopulationInformationEntity.setResidentsName(dto.getResidentsName()); + newPopulationInformationEntity.setResidentsNation(dto.getResidentsNation()); + newPopulationInformationEntity.setEducationLevel(dto.getEducationLevel()); + newPopulationInformationEntity.setPoliticsStatus(dto.getPoliticsStatus()); + newPopulationInformationEntity.setResidentsIdentityNo(dto.getResidentsIdentityNo()); + newPopulationInformationEntity.setResidentsPhone(dto.getResidentsPhone()); + newPopulationInformationEntity.setCurrentEmployer(dto.getCurrentEmployer()); + newPopulationInformationEntity.setCurrentAddress(dto.getCurrentAddress()); + newPopulationInformationEntity.setResidentsSex(sex); + newPopulationInformationEntity.setResidentsBirthday(DateUtil.parse(birthday)); + //插入人口信息 + populationInformationService.insert(newPopulationInformationEntity); + //插入关联表信息 + HouseResidentEntity entity = new HouseResidentEntity(); + entity.setHouseId(dto.getHouseId()); + entity.setHouseHeadRelation(dto.getHouseHeadRelation()); + entity.setResidentId(newPopulationInformationEntity.getId()); + entity.setIsHouseHead("0"); + insert(entity); + }else if(newPopulationInformationEntity!=null){ + //人口信息不是空,则新人口信息转变为旧人口信息 + //1.查询表单身份证的人口的和房子的关联关系(查询条件是非户主身份的) + HouseResidentEntity oldHouseResidentEntity = baseDao.getHouseResidentInfoByResidentId(newPopulationInformationEntity.getId()); + if(oldHouseResidentEntity==null){ + //此时说明此人有户主身份,则直接更新人口信息和新增关联信息 + newPopulationInformationEntity.setResidentsName(dto.getResidentsName()); + newPopulationInformationEntity.setResidentsNation(dto.getResidentsNation()); + newPopulationInformationEntity.setEducationLevel(dto.getEducationLevel()); + newPopulationInformationEntity.setPoliticsStatus(dto.getPoliticsStatus()); + newPopulationInformationEntity.setResidentsIdentityNo(dto.getResidentsIdentityNo()); + newPopulationInformationEntity.setResidentsPhone(dto.getResidentsPhone()); + newPopulationInformationEntity.setCurrentEmployer(dto.getCurrentEmployer()); + newPopulationInformationEntity.setCurrentAddress(dto.getCurrentAddress()); + newPopulationInformationEntity.setResidentsSex(sex); + newPopulationInformationEntity.setResidentsBirthday(DateUtil.parse(birthday)); + //更新人口信息 + populationInformationService.updateById(newPopulationInformationEntity); + //新增关联表信息为当前房屋 + oldHouseResidentEntity.setHouseId(dto.getHouseId()); + oldHouseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); + oldHouseResidentEntity.setResidentId(newPopulationInformationEntity.getId()); + insert(oldHouseResidentEntity); + return new Result(); + } + //2.查询表单身份证的人口的房子的信息 + HousingInformationEntity oldHousingInformationEntity = housingInformationService.selectById(oldHouseResidentEntity.getHouseId()); + //3.第一次修改 + //比较当前房屋和表单身份证的旧房屋信息 + //如果不同则提示是否要进行修改 + if("0".equals(dto.getIsEditResidentInfo()) && !dto.getHouseId().equals(oldHouseResidentEntity.getHouseId())){ + return new Result().ok("您在地址为"+oldHousingInformationEntity.getHouseAddress()+"房屋下已有居住信息,确认要更新吗?"); + }else if("1".equals(dto.getIsEditResidentInfo())){//第二次确认修改居住信息 + newPopulationInformationEntity.setResidentsName(dto.getResidentsName()); + newPopulationInformationEntity.setResidentsNation(dto.getResidentsNation()); + newPopulationInformationEntity.setEducationLevel(dto.getEducationLevel()); + newPopulationInformationEntity.setPoliticsStatus(dto.getPoliticsStatus()); + newPopulationInformationEntity.setResidentsIdentityNo(dto.getResidentsIdentityNo()); + newPopulationInformationEntity.setResidentsPhone(dto.getResidentsPhone()); + newPopulationInformationEntity.setCurrentEmployer(dto.getCurrentEmployer()); + newPopulationInformationEntity.setCurrentAddress(dto.getCurrentAddress()); + newPopulationInformationEntity.setResidentsSex(sex); + newPopulationInformationEntity.setResidentsBirthday(DateUtil.parse(birthday)); + //更新人口信息 + populationInformationService.updateById(newPopulationInformationEntity); + //更新旧的关联表信息为当前房屋 + oldHouseResidentEntity.setHouseId(dto.getHouseId()); + oldHouseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); + updateById(oldHouseResidentEntity); + }else if ("0".equals(dto.getIsEditResidentInfo()) && dto.getHouseId().equals(oldHouseResidentEntity.getHouseId())){ + //如果相同,则表示新增时,填写的身份证在房屋居住人列表中已存在! + return new Result().error("当前房屋下已存在此人!"); + } else { + return new Result().error("参数传递出错"); + } + } + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result updateWithIdentifyNo(HouseResidentDTO dto) { + //判断身份证是否发生修改 + HouseResidentEntity oldHouseResident = baseDao.selectById(dto.getId()); + PopulationInformationEntity oldPopulationInformation = populationInformationService.selectById(oldHouseResident.getResidentId()); + //如果身份证相同,则更新人口信息和关系表信息 + if(dto.getResidentsIdentityNo().equals(oldPopulationInformation.getResidentsIdentityNo())){ + oldPopulationInformation.setResidentsName(dto.getResidentsName()); + oldPopulationInformation.setResidentsNation(dto.getResidentsNation()); + oldPopulationInformation.setEducationLevel(dto.getEducationLevel()); + oldPopulationInformation.setPoliticsStatus(dto.getPoliticsStatus()); + oldPopulationInformation.setResidentsPhone(dto.getResidentsPhone()); + oldPopulationInformation.setCurrentEmployer(dto.getCurrentEmployer()); + oldPopulationInformation.setCurrentAddress(dto.getCurrentAddress()); + //更新人口信息 + populationInformationService.updateById(oldPopulationInformation); + //更新关联表信息 + oldHouseResident.setHouseHeadRelation(dto.getHouseHeadRelation()); + updateById(oldHouseResident); + } else { + //先判断身份证是否合法 + String result = IdentityNoUtils.IdentityNoVerification(dto.getResidentsIdentityNo()); + if(result != null){ + return new Result().error(result); + } + String sex = IdentityNoUtils.getSex(dto.getResidentsIdentityNo()); + String birthday = IdentityNoUtils.getBirthday(dto.getResidentsIdentityNo()); + //根据身份证判断此人是否已有居住信息 + //新的居住人信息 + PopulationInformationEntity populationInformationEntity = populationInformationService.getInfoByIdentityNo(dto.getResidentsIdentityNo()); + if(populationInformationEntity==null){ + //新的居住人信息是空,代表添加新的人口信息到表中。并且由于此处是更新,则当前选择的被更新人的数据要从人口信息表中删除,且之前的关联关系也得更新 + populationInformationEntity = new PopulationInformationEntity(); + populationInformationEntity.setResidentsName(dto.getResidentsName()); + populationInformationEntity.setResidentsNation(dto.getResidentsNation()); + populationInformationEntity.setEducationLevel(dto.getEducationLevel()); + populationInformationEntity.setPoliticsStatus(dto.getPoliticsStatus()); + populationInformationEntity.setResidentsIdentityNo(dto.getResidentsIdentityNo()); + populationInformationEntity.setResidentsPhone(dto.getResidentsPhone()); + populationInformationEntity.setCurrentEmployer(dto.getCurrentEmployer()); + populationInformationEntity.setCurrentAddress(dto.getCurrentAddress()); + populationInformationEntity.setResidentsSex(sex); + populationInformationEntity.setResidentsBirthday(DateUtil.parse(birthday)); + //获取原先关联表信息 + HouseResidentEntity entity = selectById(dto.getId()); + //查询原先绑定的居住人的信息,如果此居住人只有居住人身份则删除此人人口信息 + Map params = new HashMap<>(); + params.put("RESIDENT_ID",entity.getResidentId()); + params.put("IS_HOUSE_HEAD","0"); + List houseResidentEntities = baseDao.selectByMap(params); + if(houseResidentEntities!=null && houseResidentEntities.size()>0){ + //没有户主身份,删除人口信息 + populationInformationService.deleteById(entity.getResidentId()); + } + //插入人口信息 + populationInformationService.insert(populationInformationEntity); + entity.setHouseHeadRelation(dto.getHouseHeadRelation()); + entity.setResidentId(populationInformationEntity.getId()); + //更新关联表信息 + updateById(entity); + }else if(populationInformationEntity!=null){ + //1.判断查出的表单身份证的这个人是不是已经在这个房屋下了 + Map params = new HashMap<>(); + //当前表单身份证对应的人口ID + params.put("RESIDENT_ID",populationInformationEntity.getId()); + //当前表单房屋ID + params.put("HOUSE_ID",dto.getHouseId()); + params.put("IS_HOUSE_HEAD","0"); + List houseResidentEntities = houseResidentDao.selectByMap(params); + if(houseResidentEntities!=null && houseResidentEntities.size()>0){ + return new Result().error("当前房屋下已存在此人!"); + } + //2.此人不在此屋子下 + //(1)先更新原先的人口信息 - 组装信息 + populationInformationEntity.setResidentsName(dto.getResidentsName()); + populationInformationEntity.setResidentsNation(dto.getResidentsNation()); + populationInformationEntity.setEducationLevel(dto.getEducationLevel()); + populationInformationEntity.setPoliticsStatus(dto.getPoliticsStatus()); + populationInformationEntity.setResidentsPhone(dto.getResidentsPhone()); + populationInformationEntity.setCurrentEmployer(dto.getCurrentEmployer()); + populationInformationEntity.setCurrentAddress(dto.getCurrentAddress()); + //(2)删除被更新的人的人口信息和关联信息 - 组装信息 + //获取原先关联表信息 + HouseResidentEntity entity = selectById(dto.getId()); + //查询原先绑定的居住人的信息,如果此居住人只有居住人身份则删除此人人口信息 + Map oldParams = new HashMap<>(); + oldParams.put("RESIDENT_ID",entity.getResidentId()); + oldParams.put("IS_HOUSE_HEAD","0"); + List oldHouseResidentEntities = baseDao.selectByMap(oldParams); + //(3)更新表单身份证与房屋关联关系为当前房屋(若是表单身份证存在户主身份,且第一次添加居住人,则新增关联关系) + //获取表单身份证之前的居住地关联关系表的信息 + HouseResidentEntity newHouseResidentEntity = houseResidentDao.getHouseResidentInfoByResidentId(populationInformationEntity.getId()); + if(newHouseResidentEntity==null){ + //此处判断代表此人有户主身份,且第一次更新为居民身份,此时新增关联关系 + newHouseResidentEntity.setHouseId(dto.getHouseId()); + newHouseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); + newHouseResidentEntity.setResidentId(populationInformationEntity.getId()); + houseResidentDao.insert(newHouseResidentEntity); + }else { + houseResidentDao.updateById(newHouseResidentEntity); + } + baseDao.deleteById(entity.getId()); + if(oldHouseResidentEntities!=null && oldHouseResidentEntities.size()>0){ + //没有户主身份,删除人口信息 + populationInformationService.deleteById(entity.getResidentId()); + } + + populationInformationService.updateById(populationInformationEntity); + }else { + return new Result().error("参数传递出错"); + } + } + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + //删除人口信息 + HouseResidentEntity houseResidentEntity = selectById(ids[0]); + populationInformationService.deleteById(houseResidentEntity.getResidentId()); + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PageData listPage(Map params) { + IPage page = getPage(params); + PopulationInformationDTO populationInformationDTO = populationInformationService.getHouseHeadInfo(params.get("houseId") + ""); + if(populationInformationDTO==null){ + return new PageData<>(new ArrayList<>(), page.getTotal()); + } + params.put("houseHeadId",populationInformationDTO.getId()); + List list = baseDao.selectListOfPopulationInformationDTO(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public Result saveWithoutIdentifyNo(HouseResidentDTO dto) { + //先取房屋的户主ID + PopulationInformationDTO houseHeadInfo = populationInformationService.getHouseHeadInfo(dto.getHouseId()); + if(houseHeadInfo==null){ + return new Result().error("请先填写户主信息!"); + } + PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(dto,PopulationInformationEntity.class); + populationInformationService.insert(populationInformationEntity); + HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); + //居住人与户主关联,与房屋不关联 + houseResidentEntity.setResidentId(populationInformationEntity.getId()); + houseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); + houseResidentEntity.setHouseHeadId(houseHeadInfo.getId()); + houseResidentEntity.setIsHouseHead("0"); + this.insert(houseResidentEntity); + return new Result(); + } + + @Override + public Result updateWithoutIdentifyNo(HouseResidentDTO dto) { + PopulationInformationEntity populationInformationEntity = populationInformationService.selectById(dto.getResidentId()); + populationInformationEntity.setResidentsName(dto.getResidentsName()); + populationInformationEntity.setResidentsSex(dto.getResidentsSex()); + populationInformationEntity.setResidentsNation(dto.getResidentsNation()); + populationInformationEntity.setCurrentEmployer(dto.getCurrentEmployer()); + populationInformationEntity.setCurrentAddress(dto.getCurrentAddress()); + populationInformationService.updateById(populationInformationEntity); + HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); + houseResidentEntity.setHouseHeadRelation(dto.getHouseHeadRelation()); + houseResidentEntity.setId(dto.getId()); + this.updateById(houseResidentEntity); + return new Result(); + } + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java new file mode 100644 index 0000000..885b635 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java @@ -0,0 +1,1318 @@ +/** + * 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.vaccine.house.service.impl; + +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.hutool.core.date.DateUtil; +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.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.*; +import com.elink.esua.epdc.constant.HouseUseConstant; +import com.elink.esua.epdc.constant.PopulationDictConstant; +import com.elink.esua.epdc.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.house.*; +import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; +import com.elink.esua.epdc.dto.house.result.EpdcPopulationErrorResultDTO; +import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient; +import com.elink.esua.epdc.vaccine.house.dao.HouseResidentDao; +import com.elink.esua.epdc.vaccine.house.dao.HousingInformationDao; +import com.elink.esua.epdc.vaccine.house.entity.*; +import com.elink.esua.epdc.vaccine.house.excel.BasePopulationInformationExcel; +import com.elink.esua.epdc.vaccine.house.excel.BaseResidentInformationExcel; +import com.elink.esua.epdc.vaccine.house.redis.HousingInformationRedis; +import com.elink.esua.epdc.vaccine.house.service.*; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 房屋信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class HousingInformationServiceImpl extends BaseServiceImpl implements HousingInformationService { + + @Autowired + private HousingInformationRedis housingInformationRedis; + + + @Autowired + private HouseRentInfoService houseRentInfoService; + + @Autowired + private HouseBusinessInfoService houseBusinessInfoService; + + @Autowired + private VimAdminFeignClient adminFeignClient; + + @Autowired + private HouseResidentDao houseResidentDao; + + @Autowired + private PopulationInformationService populationInformationService; + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HousingInformationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectListOfHousingInformationDTO(params); + + return entityList; + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public HousingInformationDTO get(String id) { + HousingInformationEntity entity = baseDao.selectById(id); + //判断房屋类型 + Map params = new HashMap<>(); + params.put("id", id); + if (HouseUseConstant.SINCE_THE_LIVING.equals(entity.getHouseUse())) { + params.put("used", HouseUseConstant.SINCE_THE_LIVING); + } else if (HouseUseConstant.RENT.equals(entity.getHouseUse())) { + params.put("used", HouseUseConstant.RENT); + } else if (HouseUseConstant.BUSINESS.equals(entity.getHouseUse())) { + params.put("used", HouseUseConstant.BUSINESS); + + } + HousingInformationDTO housingInformationDTO = baseDao.selectByIdAndUsed(params); + housingInformationDTO.setDeptIdList(Arrays.asList(entity.getAllDeptIds().substring(entity.getAllDeptIds().indexOf(",") + 1).split(","))); + return housingInformationDTO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(HousingInformationDTO dto) { + if (HouseUseConstant.RENT.equals(dto.getHouseUse())) { + if (StringUtils.isNotBlank(dto.getTenantIdentityNo())) { + //判断身份证是否合法 + String result = IdentityNoUtils.IdentityNoVerification(dto.getTenantIdentityNo()); + if (result != null) { + return new Result().error("承租人人身份证不合法:" + result); + } + } + + } + HousingInformationEntity entity = ConvertUtils.sourceToTarget(dto, HousingInformationEntity.class); + //赋值部门信息 + setDept(entity); + insert(entity); + //新增承租人信息和企业信息 + insertOrUpdateHouseRentOrBusinessInfo(dto, entity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result update(HousingInformationDTO dto) { + if (HouseUseConstant.RENT.equals(dto.getHouseUse())) { + if (StringUtils.isNotBlank(dto.getTenantIdentityNo())) { + //判断身份证是否合法 + String result = IdentityNoUtils.IdentityNoVerification(dto.getTenantIdentityNo()); + if (result != null) { + return new Result().error("承租人人身份证不合法:" + result); + } + } + + } + HousingInformationEntity entity = ConvertUtils.sourceToTarget(dto, HousingInformationEntity.class); + //赋值部门信息 + setDept(entity); + updateById(entity); + insertOrUpdateHouseRentOrBusinessInfo(dto, entity); + return new Result(); + } + + private void setDept(HousingInformationEntity entity) { + Result parentAndAllDept = adminFeignClient.getParentAndAllDept(String.valueOf(entity.getGridId())); + if (parentAndAllDept == null || !parentAndAllDept.success()) { + throw new RenException("获取部门信息失败"); + } + ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); + entity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + entity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); + entity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + entity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + } + + private void insertOrUpdateHouseRentOrBusinessInfo(HousingInformationDTO dto, HousingInformationEntity entity) { + //更新或者新增承租人信息和企业信息 + if (HouseUseConstant.RENT.equals(dto.getHouseUse())) { + HouseRentInfoEntity oldHouseRentInfoEntity = houseRentInfoService.getHouseRentInfoEntityByHouseId(entity.getId()); + if (oldHouseRentInfoEntity == null) { + HouseRentInfoEntity houseRentInfoEntity = new HouseRentInfoEntity(); + houseRentInfoEntity.setTenantIdentityNo(dto.getTenantIdentityNo()); + houseRentInfoEntity.setTenantName(dto.getTenantName()); + houseRentInfoEntity.setTenantPhone(dto.getTenantPhone()); + houseRentInfoEntity.setHouseId(entity.getId()); + houseRentInfoService.insert(houseRentInfoEntity); + //删除企业信息 + HouseBusinessInfoEntity oldHouseBusinessInfoEntity = houseBusinessInfoService.getHouseBusinessInfoEntityByHouseId(entity.getId()); + if (oldHouseBusinessInfoEntity != null) { + houseBusinessInfoService.deleteById(oldHouseBusinessInfoEntity.getId()); + } + } else { + oldHouseRentInfoEntity.setTenantIdentityNo(dto.getTenantIdentityNo()); + oldHouseRentInfoEntity.setTenantName(dto.getTenantName()); + oldHouseRentInfoEntity.setTenantPhone(dto.getTenantPhone()); + oldHouseRentInfoEntity.setHouseId(entity.getId()); + houseRentInfoService.updateById(oldHouseRentInfoEntity); + } + } else if (HouseUseConstant.BUSINESS.equals(dto.getHouseUse())) { + HouseBusinessInfoEntity oldHouseBusinessInfoEntity = houseBusinessInfoService.getHouseBusinessInfoEntityByHouseId(entity.getId()); + if (oldHouseBusinessInfoEntity == null) { + HouseBusinessInfoEntity houseBusinessInfoEntity = new HouseBusinessInfoEntity(); + houseBusinessInfoEntity.setEnterpriseName(dto.getEnterpriseName()); + houseBusinessInfoEntity.setEnterprisePhone(dto.getEnterprisePhone()); + houseBusinessInfoEntity.setLegalRepresentative(dto.getLegalRepresentative()); + houseBusinessInfoEntity.setSocialUniformCode(dto.getSocialUniformCode()); + houseBusinessInfoEntity.setHouseId(entity.getId()); + houseBusinessInfoService.insert(houseBusinessInfoEntity); + //删除承租信息 + HouseRentInfoEntity oldHouseRentInfoEntity = houseRentInfoService.getHouseRentInfoEntityByHouseId(entity.getId()); + if (oldHouseRentInfoEntity != null) { + houseRentInfoService.deleteById(oldHouseRentInfoEntity.getId()); + } + } else { + oldHouseBusinessInfoEntity.setEnterpriseName(dto.getEnterpriseName()); + oldHouseBusinessInfoEntity.setEnterprisePhone(dto.getEnterprisePhone()); + oldHouseBusinessInfoEntity.setLegalRepresentative(dto.getLegalRepresentative()); + oldHouseBusinessInfoEntity.setSocialUniformCode(dto.getSocialUniformCode()); + oldHouseBusinessInfoEntity.setHouseId(entity.getId()); + houseBusinessInfoService.updateById(oldHouseBusinessInfoEntity); + } + } else if (HouseUseConstant.SINCE_THE_LIVING.equals(dto.getHouseUse())) { + //删除企业信息 + HouseBusinessInfoEntity oldHouseBusinessInfoEntity = houseBusinessInfoService.getHouseBusinessInfoEntityByHouseId(entity.getId()); + if (oldHouseBusinessInfoEntity != null) { + houseBusinessInfoService.deleteById(oldHouseBusinessInfoEntity.getId()); + } + //删除承租信息 + HouseRentInfoEntity oldHouseRentInfoEntity = houseRentInfoService.getHouseRentInfoEntityByHouseId(entity.getId()); + if (oldHouseRentInfoEntity != null) { + houseRentInfoService.deleteById(oldHouseRentInfoEntity.getId()); + } + } + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + //删除房屋户主信息,房屋居住人信息 + //1.根据房屋信息查询所有与房屋关联的人 + Map params = new HashMap<>(); + params.put("HOUSE_ID", ids[0]); + //其实此时查看与房子有关系的人,只会查出一个就是户主,居住人的关联关系只与户主有关 + List houseResidentEntities = houseResidentDao.selectByMap(params); + List populationIds = new ArrayList<>(); + if (houseResidentEntities != null && houseResidentEntities.size() > 0) { + for (HouseResidentEntity houseResidentEntity : houseResidentEntities) { + //删除条件:与此房屋有关联的人有户主 + //判断是否还有其他房子的关联关系,如果有只删除与此房子的关联关系,没有则删除人口信息+关联关系 + Map residentParams = new HashMap<>(); + residentParams.put("RESIDENT_ID", houseResidentEntity.getResidentId()); + List allHouseResidentEntities = houseResidentDao.selectByMap(residentParams); + if (allHouseResidentEntities != null && allHouseResidentEntities.size() == 1) { + //此户主只与此房屋关联 + populationIds.add(houseResidentEntity.getResidentId()); + } + } + //删除人口信息 -- 删户主信息,居住人信息,户主房屋关联信息,居住人户主关联信息 + if (populationIds.size() > 0) { + //(1)删户主信息 - 根据人口ID删 + populationInformationService.deleteBatchIds(populationIds); + //(3)删居住人信息 - 根据人口ID删 + Map residentParams = new HashMap<>(); + residentParams.put("HOUSE_HEAD_ID", populationIds.get(0)); + List houseResidentEntityList = houseResidentDao.selectByMap(residentParams); + if (houseResidentEntityList != null && houseResidentEntityList.size() > 0) { + List residentIds = houseResidentEntityList.stream().map(HouseResidentEntity::getResidentId).collect(Collectors.toList()); + populationInformationService.deleteBatchIds(residentIds); + //(4)删居住人关联信息 - 根据户主ID删 + houseResidentDao.deleteByMap(residentParams); + } + } + //删除户主关联信息 - 根据房屋ID删 + houseResidentDao.deleteByMap(params); + } + //删除房屋信息 + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PageData listOfPage(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfHousingInformationDTO(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result importPopulationInfo(MultipartFile file, String gridId) { + if (StringUtils.isBlank(gridId)) { + return new Result().error("归属部门不能为空"); + } + Result parentAndAllDept = adminFeignClient.getParentAndAllDept(gridId); + if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) { + return new Result().error("获取归属部门信息失败"); + } + ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); + //获取字典信息 + SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO = new SysPopulationSimpleDictFormDTO(); + List dicTypes = new ArrayList<>(); + Collections.addAll(dicTypes, PopulationDictConstant.ACCOUNT_TYPE, PopulationDictConstant.BODY_STATUS, PopulationDictConstant.EDUCATION_LEVEL + , PopulationDictConstant.EMPLOYMENT_STATUS, PopulationDictConstant.FAMILY_CATEGORY, PopulationDictConstant.GENDER, PopulationDictConstant.HELP_STATUS, PopulationDictConstant.MARITAL_STATUS + , PopulationDictConstant.MOTOR_VEHICLE_CATEGORY, PopulationDictConstant.POLITICS_STATUS, PopulationDictConstant.UNEMPLOYMENT_REASON); + sysPopulationSimpleDictFormDTO.setDicTypes(dicTypes); + Result> listResult = adminFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO); + if (listResult == null || !listResult.success()) { + return new Result().error("获取字典信息失败"); + } + List sysPopulationSimpleDictDTOS = listResult.getData(); + + + File f = StreamUtils.conversionFile(file); + ImportParams importParams = new ImportParams(); + try { + //获取多个sheet页 + Workbook workBook = ExcelUtils.getWorkBook(file); + //户主身份证和插入的ID,便于保存居住人信息时匹配户主信息 + Map populationIdNoAndIdMap = new HashMap<>(); + //户主导入数据 + List basePopulationInformationExcels = null; + //户主导入数据异常提示 + List epdcHouseAndHouseHeadErrorResultDTOS = null; + //居民导入数据 + List baseResidentInformationExcels = null; + //居民导入数据异常提示 + List epdcResidentErrorResultDTOS = null; + //户主身份证列表,便于校验居住人页填写的身份证信息是否正确 + Set residentIdentifyNo = new HashSet<>(); + for (int numSheet = 0; numSheet < workBook.getNumberOfSheets(); numSheet++) { + //第几个sheet + importParams.setStartSheetIndex(numSheet); + + if (numSheet == 0) {//校验和新增房屋和户主信息 + basePopulationInformationExcels = ExcelImportUtil.importExcel(f, BasePopulationInformationExcel.class, importParams); + // 校验数据 + epdcHouseAndHouseHeadErrorResultDTOS = this.checkPopulationExcel(basePopulationInformationExcels, sysPopulationSimpleDictDTOS); + basePopulationInformationExcels.forEach(basePopulationInformationExcel -> + residentIdentifyNo.add(basePopulationInformationExcel.getResidentsIdentityNo()) + ); + } else if (numSheet == 1) {//检验和新增居住人信息 + baseResidentInformationExcels = ExcelImportUtil.importExcel(f, BaseResidentInformationExcel.class, importParams); + // 校验数据 + epdcResidentErrorResultDTOS = this.checkResidentsExcel(baseResidentInformationExcels, sysPopulationSimpleDictDTOS, residentIdentifyNo); + } + } + if (epdcHouseAndHouseHeadErrorResultDTOS != null && epdcHouseAndHouseHeadErrorResultDTOS.size() > 0) { + return new Result().ok(epdcHouseAndHouseHeadErrorResultDTOS); + } + if (epdcResidentErrorResultDTOS != null && epdcResidentErrorResultDTOS.size() > 0) { + return new Result().ok(epdcResidentErrorResultDTOS); + } + if (basePopulationInformationExcels != null && basePopulationInformationExcels.size() > 0) { + populationIdNoAndIdMap = savePopulationListEnd(basePopulationInformationExcels, parentAndAllDeptDTO); + } + if (baseResidentInformationExcels != null && baseResidentInformationExcels.size() > 0) { + saveResidentList(baseResidentInformationExcels, populationIdNoAndIdMap); + } + } catch (Exception e1) { + throw new RenException("导入失败:请检查导入模板或导入数据"); + } + return new Result(); + } + + @Override + public List selectBasePopulationInformationExcelList(Map params) { + return baseDao.selectBasePopulationInformationExcelList(params); + } + + @Override + public List selectBaseResidentInformationExcelList(Set houseHeadIds) { + return baseDao.selectBaseResidentInformationExcelList(houseHeadIds); + } + + @Override + public List getHouseInfoByHouseHeadID(String houseHeadId) { + return baseDao.getHouseInfoByHouseHeadID(houseHeadId); + } + + @Override + public void modifyOrganizationInfo(OrganizationModifyDTO dto) { + // 查询需要修改的组织机构信息 + List userList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString()); + if (null != userList && userList.size() > 0) { + // 组织机构信息处理 + List entities = handleOrganizationInfo(dto, userList); + // 更新事件组织机构信息 + updateBatchById(entities); + } + } + + /** + * 组织机构信息处理 + * + * @return java.util.List + * @params [dto, userList] + * @author liuchuang + * @since 2020/3/7 15:22 + */ + private List handleOrganizationInfo(OrganizationModifyDTO dto, List userList) { + List entities = new ArrayList<>(); + for (HousingInformationDTO user : userList) { + HousingInformationEntity entity = new HousingInformationEntity(); + if (StringUtils.isNotEmpty(user.getParentDeptIds()) && StringUtils.isNotEmpty(user.getParentDeptNames())) { + List parentDeptIds = Arrays.asList(user.getParentDeptIds().split(",")); + List parentDeptNames = Arrays.asList(user.getParentDeptNames().split("-")); + int index = parentDeptIds.indexOf(dto.getDeptId().toString()); + if (index >= 0 && parentDeptNames.size() > index) { + parentDeptNames.set(index, dto.getNewDeptName()); + entity.setId(user.getId()); + entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-")); + } + } + + if (StringUtils.isNotEmpty(user.getAllDeptIds()) && StringUtils.isNotEmpty(user.getAllDeptNames())) { + List allDeptIds = Arrays.asList(user.getAllDeptIds().split(",")); + List allDeptNames = Arrays.asList(user.getAllDeptNames().split("-")); + int index = allDeptIds.indexOf(dto.getDeptId().toString()); + if (index >= 0 && allDeptNames.size() > index) { + allDeptNames.set(index, dto.getNewDeptName()); + entity.setId(user.getId()); + entity.setAllDeptNames(StringUtils.join(allDeptNames, "-")); + } + } + + entities.add(entity); + } + + return entities; + } + + /** + * @return void + * @Description 校验完成后插入居民信息 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [baseResidentInformationExcels] + **/ + private void saveResidentList(List baseResidentInformationExcels, Map populationIdNoAndIdMap) { + for (BaseResidentInformationExcel baseResidentInformationExcel : baseResidentInformationExcels) { + //插入居民信息 + PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, PopulationInformationEntity.class); + populationInformationEntity.setResidentsIdentityNo(null); + populationInformationService.insert(populationInformationEntity); + //插入房屋人员关联关系表 + HouseResidentEntity houseResidentEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, HouseResidentEntity.class); + houseResidentEntity.setResidentId(populationInformationEntity.getId()); + //根据身份证获取户主ID + //查找户主ID + String houseHeadId; + PopulationInformationEntity infoByIdentityNo = populationInformationService.getInfoByIdentityNo(baseResidentInformationExcel.getResidentsIdentityNo()); + if (infoByIdentityNo == null) { + //查找不到户主则从Map中取 + houseHeadId = populationIdNoAndIdMap.get(baseResidentInformationExcel.getResidentsIdentityNo()); + } else { + houseHeadId = infoByIdentityNo.getId(); + } + houseResidentEntity.setHouseHeadId(houseHeadId); + houseResidentEntity.setIsHouseHead("0"); + houseResidentEntity.setHouseHeadRelation(baseResidentInformationExcel.getHouseHeadRelation()); + houseResidentDao.insert(houseResidentEntity); + + } + + } + + /** + * @return void + * @Description 校验完成后新增人口信息 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [basePopulationInformationExcels] + **/ + private Map savePopulationListEnd(List basePopulationInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO) { + Map populationIdNoAndIdMap = new HashMap<>(); + for (BasePopulationInformationExcel basePopulationInformationExcel : basePopulationInformationExcels) { + //插入房屋信息 + HousingInformationEntity housingInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HousingInformationEntity.class); + housingInformationEntity.setGridId(parentAndAllDeptDTO.getGridId()); + housingInformationEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); + housingInformationEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + housingInformationEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + housingInformationEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + baseDao.insert(housingInformationEntity); + if (HouseUseConstant.RENT.equals(housingInformationEntity.getHouseUse())) { + //房屋租赁信息 + HouseRentInfoEntity houseRentInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HouseRentInfoEntity.class); + houseRentInfoEntity.setHouseId(housingInformationEntity.getId()); + houseRentInfoService.insert(houseRentInfoEntity); + } else if (HouseUseConstant.BUSINESS.equals(housingInformationEntity.getHouseUse())) { + //房屋经营信息 + HouseBusinessInfoEntity houseBusinessInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HouseBusinessInfoEntity.class); + houseBusinessInfoEntity.setHouseId(housingInformationEntity.getId()); + houseBusinessInfoService.insert(houseBusinessInfoEntity); + } + //插入户主信息 + PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, PopulationInformationEntity.class); + PopulationInformationEntity oldPopulationInformationEntity = populationInformationService.getInfoByIdentityNo(populationInformationEntity.getResidentsIdentityNo()); + //校验户主信息 + validateHouseHeadInfo(populationInformationEntity, basePopulationInformationExcel); + if (oldPopulationInformationEntity != null) { + //身份证在列表已存在,则更新户主信息 + populationInformationEntity.setId(oldPopulationInformationEntity.getId()); + populationInformationService.updateById(populationInformationEntity); + } else { + //校验户主信息 + populationInformationService.insert(populationInformationEntity); + } + //插入房屋人员关联关系表 + HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); + houseResidentEntity.setHouseId(housingInformationEntity.getId()); + houseResidentEntity.setResidentId(populationInformationEntity.getId()); + houseResidentEntity.setIsHouseHead("1"); + houseResidentDao.insert(houseResidentEntity); + populationIdNoAndIdMap.put(basePopulationInformationExcel.getResidentsIdentityNo(), populationInformationEntity.getId()); + } + return populationIdNoAndIdMap; + } + + + /** + * @return void + * @Description 校验excel新增时户主的一些信息 + * @Author songyunpeng + * @Date 2020/9/4 + * @Param [populationInformationEntity] + **/ + private void validateHouseHeadInfo(PopulationInformationEntity populationInformationEntity, BasePopulationInformationExcel basePopulationInformationExcel) { + //如果状态为群众。清空excel中多余的入党时间和组织关系所在地 + if ("0".equals(basePopulationInformationExcel.getPoliticsStatus())) { + if (StringUtils.isNotBlank(populationInformationEntity.getId())) { + //ID不为空为更新,此时手动置空入党时间 + populationInformationService.setJionTimeToNull(populationInformationEntity.getId()); + } + populationInformationEntity.setJoinTime(null); + populationInformationEntity.setOrganizationalRelationshipLocation(""); + } + if ("0".equals(basePopulationInformationExcel.getEmploymentStatus())) { + clearEmployedInfo(populationInformationEntity); + } else if ("1".equals(basePopulationInformationExcel.getEmploymentStatus())) { + clearUnEmployedInfo(populationInformationEntity); + } else { + clearEmployedInfo(populationInformationEntity); + clearUnEmployedInfo(populationInformationEntity); + } + if (basePopulationInformationExcel.getMotorVehicleNum() != null && basePopulationInformationExcel.getMotorVehicleNum() == 0) { + //如果机动车数量为0 清空机动车类型 + populationInformationEntity.setMotorVehicleCategory(""); + } + } + + /** + * @return void + * @Description 清空在岗信息 + * @Author songyunpeng + * @Date 2020/9/16 + * @Param [populationInformationEntity] + **/ + private void clearUnEmployedInfo(PopulationInformationEntity populationInformationEntity) { + //如果选择失业,也清空 工作单位 和工作单位地址 + populationInformationEntity.setCurrentEmployer(""); + populationInformationEntity.setCurrentEmployerAddress(""); + //如果失业且失业登记为否,清空失业登记时间 + if ("0".equals(populationInformationEntity.getUnemploymentRegister())) { + if (StringUtils.isNotBlank(populationInformationEntity.getId())) { + //ID不为空为更新,此时手动置空失业登记时间时间 + populationInformationService.setUnemploymentRegisterTimeToNull(populationInformationEntity.getId()); + } + populationInformationEntity.setUnemploymentRegisterTime(null); + } + } + + /** + * @return void + * @Description 清空失业 + * @Author songyunpeng + * @Date 2020/9/16 + * @Param [populationInformationEntity] + **/ + private void clearEmployedInfo(PopulationInformationEntity populationInformationEntity) { + //如果选在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间 + populationInformationEntity.setUnemploymentReason(""); + populationInformationEntity.setReemploymentPermit(""); + populationInformationEntity.setUnemploymentRegister(""); + if (StringUtils.isNotBlank(populationInformationEntity.getId())) { + //ID不为空为更新,此时手动置空失业登记时间时间 + populationInformationService.setUnemploymentRegisterTimeToNull(populationInformationEntity.getId()); + } + populationInformationEntity.setUnemploymentRegisterTime(null); + } + + /** + * @return java.util.List + * @Description 校验居住人数据 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [basePopulationInformationExcels, basePopulationInformationExcels1] + **/ + private List checkResidentsExcel(List basePopulationInformationExcels, List sysPopulationSimpleDictDTOS, Set residentIdentifyNo) { + // 不匹配信息 + List errorLineInfoList = new ArrayList<>(); + EpdcPopulationErrorResultDTO errorLineInfoDto; + for (int i = 0; i < basePopulationInformationExcels.size(); i++) { + BaseResidentInformationExcel baseResidentInformationExcel = basePopulationInformationExcels.get(i); + String residentsIdentityNo = baseResidentInformationExcel.getResidentsIdentityNo() == null ? null : baseResidentInformationExcel.getResidentsIdentityNo().trim(); + String houseHeadRelation = baseResidentInformationExcel.getHouseHeadRelation() == null ? null : baseResidentInformationExcel.getHouseHeadRelation().trim(); + String residentsName = baseResidentInformationExcel.getResidentsName() == null ? null : baseResidentInformationExcel.getResidentsName().trim(); + String residentsSex = baseResidentInformationExcel.getResidentsSex() == null ? null : baseResidentInformationExcel.getResidentsSex().trim(); + String residentsNation = baseResidentInformationExcel.getResidentsNation() == null ? null : baseResidentInformationExcel.getResidentsNation().trim(); + String currentEmployer = baseResidentInformationExcel.getCurrentEmployer() == null ? null : baseResidentInformationExcel.getCurrentEmployer().trim(); + String currentAddress = baseResidentInformationExcel.getCurrentAddress() == null ? null : baseResidentInformationExcel.getCurrentAddress().trim(); + if (StringUtils.isBlank(residentsIdentityNo)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主身份证号为空"); + errorLineInfoDto.setSheetName("居住人信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((residentsIdentityNo))) { + //根据身份证获取户主信息 + PopulationInformationEntity infoByIdentityNo = populationInformationService.getInfoByIdentityNo(residentsIdentityNo); + //校验是否有此户主 excel中没有 且库中没有则提示信息 + if (!residentIdentifyNo.contains(residentsIdentityNo) && infoByIdentityNo == null) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("未查询到此户主信息"); + errorLineInfoDto.setSheetName("居住人信息"); + errorLineInfoList.add(errorLineInfoDto); + } + baseResidentInformationExcel.setResidentsIdentityNo(residentsIdentityNo); + } + if (StringUtils.isBlank(houseHeadRelation)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("与户主关系为空"); + errorLineInfoDto.setSheetName("居住人信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((houseHeadRelation))) { + baseResidentInformationExcel.setHouseHeadRelation(houseHeadRelation); + } + if (StringUtils.isNotBlank(houseHeadRelation) && !"0".equals(houseHeadRelation) && !"1".equals(houseHeadRelation) && !"2".equals(houseHeadRelation) && !"3".equals(houseHeadRelation)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("与户主关系数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + if (StringUtils.isBlank(residentsName)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("姓名为空"); + errorLineInfoDto.setSheetName("居住人信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((residentsName))) { + baseResidentInformationExcel.setResidentsName(residentsName); + } + if (StringUtils.isBlank(residentsSex)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("性别为空"); + errorLineInfoDto.setSheetName("居住人信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((residentsSex))) { + baseResidentInformationExcel.setResidentsSex(residentsSex); + } + if (StringUtils.isNotBlank(residentsSex) && !"0".equals(residentsSex) && !"1".equals(residentsSex)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("性别不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + if (StringUtils.isBlank(residentsNation)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("民族为空"); + errorLineInfoDto.setSheetName("居住人信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((residentsNation))) { + baseResidentInformationExcel.setResidentsNation(residentsNation); + } + if (StringUtils.isBlank(currentEmployer)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("工作单位或学校地址为空"); + errorLineInfoDto.setSheetName("居住人信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((currentEmployer))) { + baseResidentInformationExcel.setCurrentEmployer(currentEmployer); + } + if (StringUtils.isBlank(currentAddress)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("现居住地址为空"); + errorLineInfoDto.setSheetName("居住人信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((currentAddress))) { + baseResidentInformationExcel.setCurrentAddress(currentAddress); + } + + } + return errorLineInfoList; + } + + + /** + * @return java.util.List + * @Description 校验户主和房屋数据 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [basePopulationInformationExcels, populationInformationDTOS] + **/ + private List checkPopulationExcel(List basePopulationInformationExcels, List sysPopulationSimpleDictDTOS) { + // 不匹配信息 + List errorLineInfoList = new ArrayList<>(); + EpdcPopulationErrorResultDTO errorLineInfoDto; + for (int i = 0; i < basePopulationInformationExcels.size(); i++) { + BasePopulationInformationExcel basePopulationInformationExcel = basePopulationInformationExcels.get(i); + String houseAddress = basePopulationInformationExcel.getHouseAddress() == null ? null : basePopulationInformationExcel.getHouseAddress().trim(); + String buyingTime = basePopulationInformationExcel.getBuyingTime() == null ? null : basePopulationInformationExcel.getBuyingTime().trim(); + BigDecimal houseArea = basePopulationInformationExcel.getHouseArea(); + String propertyOwner = basePopulationInformationExcel.getPropertyOwner() == null ? null : basePopulationInformationExcel.getPropertyOwner().trim(); + String propertyOwnerIdentityNo = basePopulationInformationExcel.getPropertyOwnerIdentityNo() == null ? null : basePopulationInformationExcel.getPropertyOwnerIdentityNo().trim(); + String propertyOwnerMobile = basePopulationInformationExcel.getPropertyOwnerMobile() == null ? null : basePopulationInformationExcel.getPropertyOwnerMobile().trim(); + String houseUse = basePopulationInformationExcel.getHouseUse() == null ? null : basePopulationInformationExcel.getHouseUse().trim(); + String tenantName = basePopulationInformationExcel.getTenantName() == null ? null : basePopulationInformationExcel.getTenantName().trim(); + String tenantIdentityNo = basePopulationInformationExcel.getTenantIdentityNo() == null ? null : basePopulationInformationExcel.getTenantIdentityNo().trim(); + String tenantPhone = basePopulationInformationExcel.getTenantPhone() == null ? null : basePopulationInformationExcel.getTenantPhone().trim(); + String enterpriseName = basePopulationInformationExcel.getEnterpriseName() == null ? null : basePopulationInformationExcel.getEnterpriseName().trim(); + String legalRepresentative = basePopulationInformationExcel.getLegalRepresentative() == null ? null : basePopulationInformationExcel.getLegalRepresentative().trim(); + String enterprisePhone = basePopulationInformationExcel.getEnterprisePhone() == null ? null : basePopulationInformationExcel.getEnterprisePhone().trim(); + String socialUniformCode = basePopulationInformationExcel.getSocialUniformCode() == null ? null : basePopulationInformationExcel.getSocialUniformCode().trim(); + String residentsName = basePopulationInformationExcel.getResidentsName() == null ? null : basePopulationInformationExcel.getResidentsName().trim(); + String residentsNation = basePopulationInformationExcel.getResidentsNation() == null ? null : basePopulationInformationExcel.getResidentsNation().trim(); + String educationLevel = basePopulationInformationExcel.getEducationLevel() == null ? null : basePopulationInformationExcel.getEducationLevel().trim(); + String politicsStatus = basePopulationInformationExcel.getPoliticsStatus() == null ? null : basePopulationInformationExcel.getPoliticsStatus().trim(); + String joinTime = basePopulationInformationExcel.getJoinTime() == null ? null : basePopulationInformationExcel.getJoinTime().trim(); + String organizationalRelationshipLocation = basePopulationInformationExcel.getOrganizationalRelationshipLocation() == null ? null : basePopulationInformationExcel.getOrganizationalRelationshipLocation().trim(); + String residentsIdentityNo = basePopulationInformationExcel.getResidentsIdentityNo() == null ? null : basePopulationInformationExcel.getResidentsIdentityNo().trim(); + String residentsPhone = basePopulationInformationExcel.getResidentsPhone() == null ? null : basePopulationInformationExcel.getResidentsPhone().trim(); + String bodyStatus = basePopulationInformationExcel.getBodyStatus() == null ? null : basePopulationInformationExcel.getBodyStatus().trim(); + String maritalStatus = basePopulationInformationExcel.getMaritalStatus() == null ? null : basePopulationInformationExcel.getMaritalStatus().trim(); + String accountType = basePopulationInformationExcel.getAccountType() == null ? null : basePopulationInformationExcel.getAccountType().trim(); + String militaryService = basePopulationInformationExcel.getMilitaryService() == null ? null : basePopulationInformationExcel.getMilitaryService().trim(); + String householdRegistrationPlace = basePopulationInformationExcel.getHouseholdRegistrationPlace() == null ? null : basePopulationInformationExcel.getHouseholdRegistrationPlace().trim(); + String employmentStatus = basePopulationInformationExcel.getEmploymentStatus() == null ? null : basePopulationInformationExcel.getEmploymentStatus().trim(); + String currentEmployer = basePopulationInformationExcel.getCurrentEmployer() == null ? null : basePopulationInformationExcel.getCurrentEmployer().trim(); + String currentEmployerAddress = basePopulationInformationExcel.getCurrentEmployerAddress() == null ? null : basePopulationInformationExcel.getCurrentEmployerAddress().trim(); + String unemploymentReason = basePopulationInformationExcel.getUnemploymentReason() == null ? null : basePopulationInformationExcel.getUnemploymentReason().trim(); + String reemploymentPermit = basePopulationInformationExcel.getReemploymentPermit() == null ? null : basePopulationInformationExcel.getReemploymentPermit().trim(); + String unemploymentRegister = basePopulationInformationExcel.getUnemploymentRegister() == null ? null : basePopulationInformationExcel.getUnemploymentRegister().trim(); + String unemploymentRegisterTime = basePopulationInformationExcel.getUnemploymentRegisterTime() == null ? null : basePopulationInformationExcel.getUnemploymentRegisterTime().trim(); + String familyCategory = basePopulationInformationExcel.getFamilyCategory() == null ? null : basePopulationInformationExcel.getFamilyCategory().trim(); + String helpStatus = basePopulationInformationExcel.getHelpStatus() == null ? null : basePopulationInformationExcel.getHelpStatus().trim(); + Integer motorVehicleNum = basePopulationInformationExcel.getMotorVehicleNum(); + String motorVehicleCategory = basePopulationInformationExcel.getMotorVehicleCategory() == null ? null : basePopulationInformationExcel.getMotorVehicleCategory().trim(); + String dogStatus = basePopulationInformationExcel.getDogStatus() == null ? null : basePopulationInformationExcel.getDogStatus().trim(); + if (StringUtils.isBlank(houseAddress)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("房屋地址为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((houseAddress))) { + if (houseAddress.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("房屋地址字数不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setHouseAddress(houseAddress); + } + if (StringUtils.isNotBlank(buyingTime)) { + basePopulationInformationExcel.setBuyingTime(buyingTime); + } + if (StringUtils.isBlank(propertyOwner)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((propertyOwner))) { + if (propertyOwner.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人字数不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setPropertyOwner(propertyOwner); + } + if (StringUtils.isNotBlank((propertyOwnerIdentityNo))) { + if (propertyOwnerIdentityNo.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人身份证号不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setPropertyOwnerIdentityNo(propertyOwnerIdentityNo); + } + if (StringUtils.isNotBlank((propertyOwnerMobile))) { + if (propertyOwnerMobile.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人电话不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setPropertyOwnerMobile(propertyOwnerMobile); + } + if (StringUtils.isBlank(houseUse)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("房屋用途为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((houseUse))) { + basePopulationInformationExcel.setHouseUse(houseUse); + } + if (StringUtils.isNotBlank(houseUse) && !"0".equals(houseUse) && !"1".equals(houseUse) && !"2".equals(houseUse)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("房屋用途数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + if (HouseUseConstant.RENT.equals(houseUse)) { + if (StringUtils.isBlank(tenantName)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((tenantName))) { + if (tenantName.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setTenantName(tenantName); + } + if (StringUtils.isBlank(tenantPhone)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人电话为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((tenantPhone))) { + if (tenantPhone.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人电话不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setTenantPhone(tenantPhone); + } + if (StringUtils.isBlank(tenantIdentityNo)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人身份证号为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + if (StringUtils.isNotBlank(tenantIdentityNo)) { + String result = IdentityNoUtils.IdentityNoVerification(tenantIdentityNo); + if (result != null) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人身份证号有误"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setTenantIdentityNo(tenantIdentityNo); + + } + } else if (HouseUseConstant.BUSINESS.equals(houseUse)) { + if (StringUtils.isNotBlank((enterpriseName))) { + if (enterpriseName.length() > 128) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("企业名称不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setEnterpriseName(enterpriseName); + } + if (StringUtils.isNotBlank((legalRepresentative))) { + if (legalRepresentative.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("法人代表不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setLegalRepresentative(legalRepresentative); + } + if (StringUtils.isBlank(enterprisePhone)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("企业联系电话为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((enterprisePhone))) { + if (enterprisePhone.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("企业联系电话大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setEnterprisePhone(enterprisePhone); + } + if (StringUtils.isNotBlank((socialUniformCode))) { + if (socialUniformCode.length() > 128) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("社会统一代码不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setSocialUniformCode(socialUniformCode); + } + } + if (StringUtils.isBlank(residentsName)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主姓名为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((residentsName))) { + if (residentsName.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主姓名不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setResidentsName(residentsName); + } + if (StringUtils.isNotBlank((residentsNation))) { + if (residentsNation.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("民族不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setResidentsNation(residentsNation); + } + if (StringUtils.isNotBlank(educationLevel)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.EDUCATION_LEVEL.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (educationLevel.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setEducationLevel(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("文化程度数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + } + if (StringUtils.isNotBlank(politicsStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.POLITICS_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDictList = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDictList) { + if (politicsStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setPoliticsStatus(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("政治面貌数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + } + if ("党员".equals(politicsStatus)) { + if (StringUtils.isNotBlank(joinTime)) { + basePopulationInformationExcel.setJoinTime(joinTime); + } + if (StringUtils.isNotBlank((organizationalRelationshipLocation))) { + if (organizationalRelationshipLocation.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("组织关系所在地不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setOrganizationalRelationshipLocation(organizationalRelationshipLocation); + } + } + if (StringUtils.isBlank(residentsIdentityNo)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主身份证号码为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + if (StringUtils.isNotBlank(residentsIdentityNo)) { + String result = IdentityNoUtils.IdentityNoVerification(residentsIdentityNo); + if (result != null) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主身份证号码有误"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else { + basePopulationInformationExcel.setResidentsSex(IdentityNoUtils.getSex(residentsIdentityNo)); + basePopulationInformationExcel.setResidentsBirthday(DateUtil.parse(IdentityNoUtils.getBirthday(residentsIdentityNo))); + } + basePopulationInformationExcel.setResidentsIdentityNo(residentsIdentityNo); + } + if (StringUtils.isBlank(residentsPhone)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主联系电话为空"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else if (StringUtils.isNotBlank((residentsPhone))) { + if (residentsPhone.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主联系电话不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setResidentsPhone(residentsPhone); + } + if (StringUtils.isNotBlank(bodyStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.BODY_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (bodyStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setBodyStatus(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("身体状况数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + } + if (StringUtils.isNotBlank(maritalStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.MARITAL_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (maritalStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setMaritalStatus(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("婚姻状况数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + + } + if (StringUtils.isNotBlank(accountType)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.ACCOUNT_TYPE.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (accountType.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setAccountType(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户口类型数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + + } + if (StringUtils.isNotBlank((militaryService))) { + basePopulationInformationExcel.setMilitaryService(militaryService); + } + if (StringUtils.isNotBlank(militaryService) && !"0".equals(militaryService) && !"1".equals(militaryService)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主是否服兵役数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + if (StringUtils.isNotBlank((householdRegistrationPlace))) { + if (householdRegistrationPlace.length() > 32) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户籍地不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setHouseholdRegistrationPlace(householdRegistrationPlace); + } + if (StringUtils.isNotBlank(employmentStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.EMPLOYMENT_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (employmentStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setEmploymentStatus(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主是否就业数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + } + if ("在岗".equals(employmentStatus)) { + if (StringUtils.isNotBlank((currentEmployer))) { + if (currentEmployer.length() > 128) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("现工作单位不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setCurrentEmployer(currentEmployer); + } + if (StringUtils.isNotBlank((currentEmployerAddress))) { + if (currentEmployerAddress.length() > 128) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("现单位地址不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + basePopulationInformationExcel.setCurrentEmployerAddress(currentEmployerAddress); + } + } else if ("失业".equals(employmentStatus)) { + if (StringUtils.isNotBlank(unemploymentReason)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.UNEMPLOYMENT_REASON.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (unemploymentReason.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setUnemploymentReason(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主失业原因数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + } + if (StringUtils.isNotBlank((reemploymentPermit))) { + basePopulationInformationExcel.setReemploymentPermit(reemploymentPermit); + } + if (StringUtils.isNotBlank(reemploymentPermit) && !"0".equals(reemploymentPermit) && !"1".equals(reemploymentPermit)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主是否有再就业优惠证数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + if (StringUtils.isNotBlank((unemploymentRegister))) { + basePopulationInformationExcel.setUnemploymentRegister(unemploymentRegister); + } + if (StringUtils.isNotBlank(unemploymentRegister) && !"0".equals(unemploymentRegister) && !"1".equals(unemploymentRegister)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主是否失业登记数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + if (StringUtils.isNotBlank(unemploymentRegister) && "1".equals(unemploymentRegister)) { + if (StringUtils.isNotBlank(unemploymentRegisterTime)) { + basePopulationInformationExcel.setUnemploymentRegisterTime(unemploymentRegisterTime); + } + } + } + if (StringUtils.isNotBlank(familyCategory)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.FAMILY_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (familyCategory.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setFamilyCategory(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主家庭类别数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + } + if (StringUtils.isNotBlank(helpStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.HELP_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (helpStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + basePopulationInformationExcel.setHelpStatus(sysSimpleDict.getDictValue()); + + } + } + } + } + if (!isMatch) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主家庭救助情况数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + } + if (StringUtils.isNotBlank(motorVehicleCategory)) { + //处理多选类型 + String[] motorVehicleCategoryStrings = motorVehicleCategory.split(","); + Integer matchNum = 0; + String motorVehicleCategoryEnd = ""; + for (String motorVehicleCategoryStr : Arrays.asList(motorVehicleCategoryStrings)) { + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.MOTOR_VEHICLE_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (motorVehicleCategoryStr.equals(sysSimpleDict.getDictName())) { + matchNum++; + motorVehicleCategoryEnd += sysSimpleDict.getDictValue() + ","; + } + } + } + } + } + if (matchNum != motorVehicleCategoryStrings.length) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("机动车类型数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } else { + basePopulationInformationExcel.setMotorVehicleCategory(motorVehicleCategoryEnd.substring(0, motorVehicleCategoryEnd.lastIndexOf(","))); + } + } + if (StringUtils.isNotBlank(dogStatus)) { + basePopulationInformationExcel.setDogStatus(dogStatus); + } + if (StringUtils.isNotBlank(dogStatus) && !"0".equals(dogStatus) && !"1".equals(dogStatus)) { + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("宠物犬情况数据不匹配"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } + } + return errorLineInfoList; + } + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java new file mode 100644 index 0000000..431dcfa --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java @@ -0,0 +1,585 @@ +/** + * 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.vaccine.house.service.impl; + +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.exception.RenException; +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.PopulationDictConstant; +import com.elink.esua.epdc.constant.PopulationIdentify; +import com.elink.esua.epdc.dto.house.*; +import com.elink.esua.epdc.dto.house.form.*; +import com.elink.esua.epdc.dto.house.result.*; +import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient; +import com.elink.esua.epdc.vaccine.house.dao.HouseResidentDao; +import com.elink.esua.epdc.vaccine.house.dao.PopulationInformationDao; +import com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity; +import com.elink.esua.epdc.vaccine.house.entity.HousingInformationEntity; +import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; +import com.elink.esua.epdc.vaccine.house.redis.PopulationInformationRedis; +import com.elink.esua.epdc.vaccine.house.service.HouseResidentService; +import com.elink.esua.epdc.vaccine.house.service.HousingInformationService; +import com.elink.esua.epdc.vaccine.house.service.PopulationInformationService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.beans.IntrospectionException; +import java.beans.PropertyDescriptor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.*; + +/** + * 人口信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class PopulationInformationServiceImpl extends BaseServiceImpl implements PopulationInformationService { + + @Autowired + private PopulationInformationRedis populationInformationRedis; + + @Autowired + private HouseResidentService houseResidentService; + @Autowired + private HouseResidentDao houseResidentDao; + @Autowired + private HousingInformationService housingInformationService; + @Autowired + private VimAdminFeignClient adminFeignClient; + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PopulationInformationDTO.class); + } + + @Override + public List list(Map params) { + return baseDao.selectListOfPopulationInformationDTO(params); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PopulationInformationDTO get(String id) { + return baseDao.selectDetailOfPopulationInformationDTO(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(PopulationInformationDTO dto) { + //校验身份证信息 + //1.获取表单身份证的人口信息 + PopulationInformationEntity infoByIdentityNo = getInfoByIdentityNo(dto.getResidentsIdentityNo()); + if (infoByIdentityNo != null) { + Map params = new HashMap<>(); + params.put("RESIDENT_ID", infoByIdentityNo.getId()); + List houseResidentEntities = houseResidentDao.selectByMap(params); + if (houseResidentEntities.size() > 0) { + //2.此人有房屋信息,且为第一次提交则此时提示前端 + 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) + "下已有房产信息,点击确认则新增此房产且更新居民信息!"; + return new Result().ok(result.substring(1)); + } + //2.第二次提交,则更新户主信息且新增关联信息 + PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class); + entity.setId(infoByIdentityNo.getId()); + updateById(entity); + //插入房屋关联关系表 + HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); + houseResidentEntity.setIsHouseHead("1"); + houseResidentEntity.setResidentId(entity.getId()); + houseResidentEntity.setHouseId(dto.getHouseId()); + houseResidentService.insert(houseResidentEntity); + return new Result(); + } + } + PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class); + insert(entity); + //插入房屋关联关系表 + HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); + houseResidentEntity.setIsHouseHead("1"); + houseResidentEntity.setResidentId(entity.getId()); + houseResidentEntity.setHouseId(dto.getHouseId()); + houseResidentService.insert(houseResidentEntity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result update(PopulationInformationDTO dto) { + PopulationInformationEntity infoByIdentityNo = selectById(dto.getId()); + if (dto.getResidentsIdentityNo().equals(infoByIdentityNo.getResidentsIdentityNo())) { + PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class); + //置空其他选择信息-防止导出时数据出错 + if ("0".equals(dto.getPoliticsStatus())) { + //如果表单选择的是群众,则清空入党时间和组织关系所在地 + this.setJionTimeToNull(entity.getId()); + entity.setJoinTime(null); + entity.setOrganizationalRelationshipLocation(""); + } + if ("0".equals(dto.getEmploymentStatus())) { + //如果表单选择的是在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间 + entity.setUnemploymentReason(""); + entity.setReemploymentPermit(""); + entity.setUnemploymentRegister(""); + this.setUnemploymentRegisterTimeToNull(entity.getId()); + entity.setUnemploymentRegisterTime(null); + } else if ("1".equals(dto.getEmploymentStatus())) { + //如果选择为失业,则置空工作单位和工作地址 + entity.setCurrentEmployer(""); + entity.setCurrentEmployerAddress(""); + if ("0".equals(dto.getUnemploymentRegister())) { + //如果表单选择的是失业 且就业登记为否 则也置空失业登记时间 + this.setUnemploymentRegisterTimeToNull(entity.getId()); + entity.setUnemploymentRegisterTime(null); + } + } else { + //如果表单选择的是在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间 + entity.setUnemploymentReason(""); + entity.setReemploymentPermit(""); + entity.setUnemploymentRegister(""); + this.setUnemploymentRegisterTimeToNull(entity.getId()); + entity.setUnemploymentRegisterTime(null); + //如果选择为失业,则置空工作单位和工作地址 + entity.setCurrentEmployer(""); + entity.setCurrentEmployerAddress(""); + if ("0".equals(dto.getUnemploymentRegister())) { + //如果表单选择的是失业 且就业登记为否 则也置空失业登记时间 + this.setUnemploymentRegisterTimeToNull(entity.getId()); + entity.setUnemploymentRegisterTime(null); + } + } + + if (dto.getMotorVehicleNum() == 0) { + //如果机动车数量为0 清空机动车类型 + entity.setMotorVehicleCategory(""); + } + updateById(entity); + return new Result(); + } else { + //修改了身份证信息 - 提示信息 + Map params = new HashMap<>(); + params.put("RESIDENT_ID", infoByIdentityNo.getId()); + List houseResidentEntities = houseResidentDao.selectByMap(params); + if (houseResidentEntities.size() > 0) { + //2.此人有房屋信息,且为第一次提交则此时提示前端 + 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) + "下已有房产信息,点击确认则新增此房产且更新居民信息!"; + return new Result().ok(result.substring(1)); + } + //2.第二次提交,则更新户主信息 + PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class); + entity.setId(infoByIdentityNo.getId()); + //置空其他选择信息-防止导出时数据出错 + if ("0".equals(dto.getPoliticsStatus())) { + //如果表单选择的是群众,则清空入党时间和组织关系所在地 + this.setJionTimeToNull(entity.getId()); + entity.setJoinTime(null); + entity.setOrganizationalRelationshipLocation(""); + } + if ("0".equals(dto.getEmploymentStatus())) { + //如果表单选择的是在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间 + entity.setUnemploymentReason(""); + entity.setReemploymentPermit(""); + entity.setUnemploymentRegister(""); + entity.setUnemploymentRegisterTime(null); + this.setUnemploymentRegisterTimeToNull(entity.getId()); + } + if ("1".equals(dto.getEmploymentStatus())) { + //如果选择为失业,则置空工作单位和工作地址 + entity.setCurrentEmployer(""); + entity.setCurrentEmployerAddress(""); + if ("0".equals(dto.getUnemploymentRegister())) { + //如果表单选择的是失业 且就业登记为否 则也置空失业登记时间 + this.setUnemploymentRegisterTimeToNull(entity.getId()); + entity.setUnemploymentRegisterTime(null); + + } + } + this.updateById(entity); + return new Result(); + } + } + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PopulationInformationDTO getHouseHeadInfo(String houseId) { + PopulationInformationDTO houseHeadInfo = baseDao.getHouseHeadInfo(houseId); + //处理机动车类型 + if (houseHeadInfo != null && StringUtils.isNotBlank(houseHeadInfo.getMotorVehicleCategory())) { + String[] motorVehicleCategoryStrings = houseHeadInfo.getMotorVehicleCategory().split(","); + houseHeadInfo.setMotorVehicleCategoryList(Arrays.asList(motorVehicleCategoryStrings)); + } + return houseHeadInfo; + } + + @Override + public PopulationInformationEntity getInfoByIdentityNo(String residentsIdentityNo) { + return baseDao.getInfoByIdentityNo(residentsIdentityNo); + } + + @Override + public PageData listPage(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfPopulationInformationDTO(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public PageData motorVehiclePage(Map params) { + IPage page = getPage(params); + List list = baseDao.motorVehiclePage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List motorVehicleList(Map params) { + return baseDao.motorVehiclePage(params); + } + + @Override + public PopulationInfoOverviewDTO getPopulationInfoOverview() { + return baseDao.getPopulationInfoOverview(); + } + + @Override + public PopulationInfoOverviewDTO getPopulationInfoOverviewForScreen(String communityId) { + return baseDao.getPopulationInfoOverviewForScreen(communityId); + } + + @Override + public void setJionTimeToNull(String id) { + baseDao.setJionTimeToNull(id); + } + + @Override + public void setUnemploymentRegisterTimeToNull(String id) { + baseDao.setUnemploymentRegisterTimeToNull(id); + } + + @Override + public PageData selectPeople(EpdcScreenSelectPeopleFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectListPeople(dto); + return new PageData<>(list, baseDao.selectCountListPeople(dto)); + } + + @Override + public Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) { + EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO = new EpdcScreenSelectPeopleDetailResultDTO(); + //根据身份标识寻找对应人员信息 + if (PopulationIdentify.HOUSE_HEAD.equals(dto.getIdentifyFlag())) { + if (StringUtils.isBlank(dto.getPopulationId())) { + return new Result().error("查询产权人信息失败:人口ID为空"); + } + //根据户主ID组装信息 + setHouseHeadInfo(dto.getPopulationId(), epdcScreenSelectPeopleDetailResultDTO); + return new Result().ok(epdcScreenSelectPeopleDetailResultDTO); + } else if (PopulationIdentify.HOUSE_RESIDENT.equals(dto.getIdentifyFlag())) { + if (StringUtils.isBlank(dto.getPopulationId())) { + return new Result().error("查询居住人信息失败:人口ID为空"); + } + //查找居住人对应的户主细腻 + Map params = new HashMap<>(); + params.put("RESIDENT_ID", dto.getPopulationId()); + List houseResidentEntityList = houseResidentDao.selectByMap(params); + if (houseResidentEntityList == null || houseResidentEntityList.size() == 0) { + return new Result().error("根据居住人查询户主失败"); + } + HouseResidentEntity houseResidentEntity = houseResidentEntityList.get(0); + //根据户主ID组装信息 + setHouseHeadInfo(houseResidentEntity.getHouseHeadId(), epdcScreenSelectPeopleDetailResultDTO); + return new Result().ok(epdcScreenSelectPeopleDetailResultDTO); + } + return new Result().error("查询错误:身份标识参数无法匹配"); + } + + private void setHouseHeadInfo(String houseHeadId, EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO) { + //如果是户主,人口信息从人口表拿 + PopulationInformationEntity populationInformationEntity = this.selectById(houseHeadId); + epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName()); + epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex()) ? "女" : "男"); + epdcScreenSelectPeopleDetailResultDTO.setDogStatus("0".equals(populationInformationEntity.getDogStatus()) ? "无" : "有"); + if (IdentityNoUtils.IdentityNoVerification(populationInformationEntity.getResidentsIdentityNo()) == null) { + epdcScreenSelectPeopleDetailResultDTO.setAge(IdentityNoUtils.getAge(populationInformationEntity.getResidentsIdentityNo()) + ""); + } else { + epdcScreenSelectPeopleDetailResultDTO.setAge(""); + } + epdcScreenSelectPeopleDetailResultDTO.setPhone(populationInformationEntity.getResidentsPhone()); + epdcScreenSelectPeopleDetailResultDTO.setFamilyCategory(populationInformationEntity.getFamilyCategory()); + epdcScreenSelectPeopleDetailResultDTO.setEmploymentStatus(populationInformationEntity.getEmploymentStatus()); + epdcScreenSelectPeopleDetailResultDTO.setEducationLevel(populationInformationEntity.getEducationLevel()); + epdcScreenSelectPeopleDetailResultDTO.setPoliticsStatus(populationInformationEntity.getPoliticsStatus()); + epdcScreenSelectPeopleDetailResultDTO.setMotorVehicleNum(String.valueOf(populationInformationEntity.getMotorVehicleNum())); + //根据字典信息赋值 + //获取字典信息 + SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO = new SysPopulationSimpleDictFormDTO(); + List dicTypes = new ArrayList<>(); + Collections.addAll(dicTypes, PopulationDictConstant.ACCOUNT_TYPE, PopulationDictConstant.BODY_STATUS, PopulationDictConstant.EDUCATION_LEVEL + , PopulationDictConstant.EMPLOYMENT_STATUS, PopulationDictConstant.FAMILY_CATEGORY, PopulationDictConstant.GENDER, PopulationDictConstant.HELP_STATUS, PopulationDictConstant.MARITAL_STATUS + , PopulationDictConstant.MOTOR_VEHICLE_CATEGORY, PopulationDictConstant.POLITICS_STATUS, PopulationDictConstant.UNEMPLOYMENT_REASON); + sysPopulationSimpleDictFormDTO.setDicTypes(dicTypes); + Result> listResult = adminFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO); + if (listResult == null || !listResult.success()) { + throw new RenException("获取字典失败!"); + } + List sysPopulationSimpleDictDTOS = listResult.getData(); + String educationLevel = epdcScreenSelectPeopleDetailResultDTO.getEducationLevel(); + String politicsStatus = epdcScreenSelectPeopleDetailResultDTO.getPoliticsStatus(); + String employmentStatus = epdcScreenSelectPeopleDetailResultDTO.getEmploymentStatus(); + String familyCategory = epdcScreenSelectPeopleDetailResultDTO.getFamilyCategory(); + try { + setDicNameByValue(sysPopulationSimpleDictDTOS, epdcScreenSelectPeopleDetailResultDTO, "educationLevel", educationLevel, PopulationDictConstant.EDUCATION_LEVEL); + setDicNameByValue(sysPopulationSimpleDictDTOS, epdcScreenSelectPeopleDetailResultDTO, "politicsStatus", politicsStatus, PopulationDictConstant.POLITICS_STATUS); + setDicNameByValue(sysPopulationSimpleDictDTOS, epdcScreenSelectPeopleDetailResultDTO, "employmentStatus", employmentStatus, PopulationDictConstant.EMPLOYMENT_STATUS); + setDicNameByValue(sysPopulationSimpleDictDTOS, epdcScreenSelectPeopleDetailResultDTO, "familyCategory", familyCategory, PopulationDictConstant.FAMILY_CATEGORY); + } catch (Exception e) { + throw new RenException("根据字典赋值出错!"); + } + //房屋信息 + List housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(houseHeadId); + 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(houseHeadId); + List baseResidentInformationExportDtos = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds); + baseResidentInformationExportDtos.forEach(a -> { + FamilyMember familyMember = new FamilyMember(); + 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); + } + + private static Object checkNull(Object obj) { + Class clazz = obj.getClass(); + // 获取实体类的所有属性,返回Field数组 + Field[] fields = clazz.getDeclaredFields(); + for (Field field : fields) { + // 可访问私有变量 + field.setAccessible(true); + // 获取属性类型 + String type = field.getGenericType().toString(); + // 如果type是类类型,则前面包含"class ",后面跟类名 + if ("class java.lang.String".equals(type)) { + // 将属性的首字母大写 + String methodName = field.getName().replaceFirst(field.getName().substring(0, 1), + field.getName().substring(0, 1).toUpperCase()); + try { + Method methodGet = clazz.getMethod("get" + methodName); + // 调用getter方法获取属性值 + String str = (String) methodGet.invoke(obj); + if (StringUtils.isBlank(str)) { + // 如果为null的String类型的属性则重新复制为空字符串 + field.set(obj, field.getType().getConstructor(field.getType()).newInstance("")); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + return obj; + } + + /** + * @param column 实体类的属性名 + * @param columnValue 实体类的属性值 + * @param dicType 字典的类型 + * @return java.lang.String + * @Description 根据字典值匹配键 + * @Author songyunpeng + * @Date 2020/9/8 + * @Param [sysPopulationSimpleDictDTOS, basePopulationInformationExportDto, column] + **/ + private void setDicNameByValue(List sysPopulationSimpleDictDTOS, EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO, String column, String columnValue, String dicType) throws IntrospectionException, InvocationTargetException, IllegalAccessException { + if (StringUtils.isNotBlank(columnValue)) { + a: + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (dicType.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (columnValue.equals(sysSimpleDict.getDictValue())) { + Class basePopulationInformationExportDtoClass = epdcScreenSelectPeopleDetailResultDTO.getClass(); + PropertyDescriptor pd = new PropertyDescriptor(column, basePopulationInformationExportDtoClass); + Method wM = pd.getWriteMethod();//获得写方法 + wM.invoke(epdcScreenSelectPeopleDetailResultDTO, sysSimpleDict.getDictName()); + break a; + } + } + } + } + } + } + + @Override + public Result housingUse() { + EpdcScreenHouseUseResultDTO epdcScreenHouseUseResultDTO = baseDao.selectHouseUseDataForScreen(); + PopulationInfoOverviewDTO populationInfoOverview = this.getPopulationInfoOverview(); + epdcScreenHouseUseResultDTO.setHouseNum(populationInfoOverview.getHouseNum()); + epdcScreenHouseUseResultDTO.setPopulationNum(populationInfoOverview.getPopulationNum()); + epdcScreenHouseUseResultDTO.setMotorVehicleNum(populationInfoOverview.getMotorVehicleNum()); + epdcScreenHouseUseResultDTO.setPopulationNum(populationInfoOverview.getPopulationNum()); + epdcScreenHouseUseResultDTO.setEnterpriseNum(populationInfoOverview.getBusiness()); + return new Result().ok(epdcScreenHouseUseResultDTO); + } + + @Override + public PageData gridRanking(EpdcScreenGridRankingFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectListGridRanking(dto); + return new PageData<>(list, baseDao.selectCountListGridRanking(dto)); + } + + @Override + public PageData selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectHouseByPeople(dto); + return new PageData<>(list, baseDao.selectCountHouseByPeople(dto)); + } + + @Override + public PageData selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectPeopleByHouse(dto); + return new PageData<>(list, baseDao.selectCountPeopleByHouse(dto)); + } + + @Override + public PageData selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectPeopleByCurrentAddress(dto); + return new PageData<>(list, baseDao.selectCountPeopleByCurrentAddress(dto)); + } + + @Override + public List selectPeopleByCurrentAddressForPc(Map params) { + EpdcScreenResidentInfoByCurrentAddressFormDTO formDTO = new EpdcScreenResidentInfoByCurrentAddressFormDTO(); + int pageIndex = (Integer.parseInt(params.get("page") + "") - NumConstant.ONE) * Integer.parseInt(params.get("limit") + ""); + formDTO.setPageIndex(pageIndex); + formDTO.setPageSize(Integer.parseInt(params.get("limit") + "")); + formDTO.setCurrentAddress(params.get("houseAddress") == null ? null : String.valueOf(params.get("houseAddress"))); + formDTO.setResidentName(params.get("residentName") == null ? null : String.valueOf(params.get("residentName"))); + return baseDao.selectPeopleByCurrentAddress(formDTO); + } + + @Override + public List selectPeopleByCurrentAddressExportList(Map params) { + return baseDao.selectPeopleByCurrentAddressExportList(params); + } + + @Override + public Integer selectCountPeopleByCurrentAddressForPc(Map params) { + EpdcScreenResidentInfoByCurrentAddressFormDTO formDTO = new EpdcScreenResidentInfoByCurrentAddressFormDTO(); + int pageIndex = (Integer.parseInt(params.get("page") + "") - NumConstant.ONE) * Integer.parseInt(params.get("limit") + ""); + formDTO.setPageIndex(pageIndex); + formDTO.setPageSize(Integer.parseInt(params.get("limit") + "")); + formDTO.setCurrentAddress(params.get("houseAddress") == null ? null : String.valueOf(params.get("houseAddress"))); + formDTO.setResidentName(params.get("residentName") == null ? null : String.valueOf(params.get("residentName"))); + return baseDao.selectCountPeopleByCurrentAddress(formDTO); + } + + 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; + } + } +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/enums/VaccinationStateEnum.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/enums/VaccinationStateEnum.java new file mode 100644 index 0000000..9338afd --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/enums/VaccinationStateEnum.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.vaccine.vim.enums; + +/** + * 用户性别 枚举类 + * + * @author work@yujt.net.cn + * @date 2019/11/18 14:30 + */ +public enum VaccinationStateEnum { + + /** + * 未接种 + */ + VACCINATION_STATE_NOT_START(0), + + /** + * 接种中 + */ + VACCINATION_STATE_UNFINISH(1), + + /** + * 接种完成 + */ + VACCINATION_STATE_FINISH(2); + + private int state; + + VaccinationStateEnum(int state) { + this.state = state; + } + + public int state() { + return state; + } +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java index 5d89e9a..559dd73 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java @@ -23,6 +23,8 @@ import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInoutRecordEntity; import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService; import com.elink.esua.epdc.vaccine.epidemic.utils.StreamUtils; +import com.elink.esua.epdc.vaccine.house.dao.PopulationInformationDao; +import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; import com.elink.esua.epdc.vaccine.vim.dao.VaccinationErrorDao; import com.elink.esua.epdc.vaccine.vim.dao.VaccinationInfoDao; import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; @@ -30,9 +32,12 @@ import com.elink.esua.epdc.vaccine.vim.dto.result.EpdcAppVimInfoResultDTO; import com.elink.esua.epdc.vaccine.vim.dto.result.VaccineDto; import com.elink.esua.epdc.vaccine.vim.entity.VaccinationErrorEntity; import com.elink.esua.epdc.vaccine.vim.entity.VaccinationInfoEntity; +import com.elink.esua.epdc.vaccine.vim.enums.VaccinationStateEnum; import com.elink.esua.epdc.vaccine.vim.excel.VaccinationInfoAllExcel; import com.elink.esua.epdc.vaccine.vim.service.*; +import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -63,13 +68,16 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl getWrapper(Map params) { @@ -196,231 +204,287 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl recordList = ExcelImportUtil.importExcel(f, VaccinationInfoAllExcel.class, new ImportParams()); - if (CollUtil.isEmpty(recordList)) { - return new Result().error("导入内容不能为空"); + private boolean updateEpidemicUserInfo(List addressList, Map maxDoseMap) { + List idCards = new ArrayList<>(maxDoseMap.keySet()); + if (!idCards.isEmpty()) { + addressList = epidemicUserInoutRecordDao.getAddressInfo(idCards); + + List updateList = Lists.newArrayList(); +// List existUserList = epidemicUserInfoDao.selectByIdCards(idCards); + List existUserList = populationInformationDao.selectListByIdentityNos(idCards); + for (EpidemicUserInfoDTO item : existUserList) { + if (null == item) { + continue; + } + String idCard = item.getIdCard(); + EpidemicUserInfoDTO epidemicUserInfo = maxDoseMap.get(idCard.toUpperCase()); + if (null == epidemicUserInfo) { + log.error(idCard); + continue; + } + PopulationInformationEntity updateDto = new PopulationInformationEntity(); + // 已经接种完的不需要处理,excel的剂次数据小于数据库时不需要处理 + if (VaccinationStateEnum.VACCINATION_STATE_FINISH.state() != item.getVaccinationState() + && item.getVaccinationNum() <= epidemicUserInfo.getVaccinationNum()) { + updateDto.setResidentsIdentityNo(idCard); + updateDto.setVaccinationNum(epidemicUserInfo.getVaccinationNum()); + if (epidemicUserInfo.getVaccinationNum().equals(epidemicUserInfo.getMaxDose())) { + // 如果最大剂次同于excel的剂次就是接种完成,否则是接种中 + updateDto.setVaccinationState(VaccinationStateEnum.VACCINATION_STATE_FINISH.state()); + } else { + updateDto.setVaccinationState(VaccinationStateEnum.VACCINATION_STATE_UNFINISH.state()); + } + + // 更新人员的接种信息 + populationInformationDao.updatePersonInfo(updateDto); + } } + log.info("实际需要更新的人员信息数量为:" + updateList.size()); + } + return Boolean.TRUE; +// log.info("待处理人员数量为:" + idCards.size() + "||可用地址数量为" + addressList.size() + "||实际需要更新的人员信息数量为:" + updateList.size()); + } - // 存储需要逻辑删除的身份证号 - List deleteIdCardArr = new ArrayList<>(); - // 存储批量插入实体 - List addList = new ArrayList<>(); - // 存储错误数据批量插入实体 - List addErrorList = new ArrayList<>(); - // 记录单人最高剂次 - Map maxDoseMap = new HashMap<>(); - // 检查重复数据,对旧数据进行覆盖 - List checkList; + /** + * 批量插入错误数据 + * + * @return boolean + * @describe: + * @author rongchao + * @date 2021/8/26 + * @params + */ + private boolean insertBatchVaccinationErrors(List addErrorList) { + if (!addErrorList.isEmpty()) { + List insertErrorList = ConvertUtils.sourceToTarget(addErrorList, VaccinationErrorEntity.class); + Integer insertNo = vaccinationErrorDao.getMaxInsertNo(); + for (VaccinationErrorEntity entity : insertErrorList) { + entity.setInsertNo(insertNo); + } + boolean is = vaccinationErrorService.insertBatch(insertErrorList); + log.info("错误信息记录:" + insertErrorList.size()); + return is; + } + return Boolean.TRUE; + } - log.info("准备进入Excel数据导入循环"); + /** + * @return boolean + * @describe: + * @author rongchao + * @date 2021/8/26 + * @params addList + * addressList + */ + private boolean insertBatchVaccination(List addList, List addressList, List deleteIdCardArr) { + // 对历史数据根据身份证号进行逻辑删除// 对历史数据根据身份证号进行逻辑删除 + if (!deleteIdCardArr.isEmpty()) { + baseDao.deleteDistinctDose(deleteIdCardArr); + } + log.info("已删除用户数量:" + deleteIdCardArr.size()); + // 插入接种数据 + if (!addList.isEmpty()) { + List insertUserList = ConvertUtils.sourceToTarget(addList, VaccinationInfoEntity.class); + List finalAddressList = addressList; + insertUserList.forEach(entity -> { + entity.setIdentityNo(entity.getIdentityNo().toUpperCase()); + Optional addressOptional = finalAddressList.stream().filter(address -> address.getIdCard().equals(entity.getIdentityNo())).findFirst(); + if (addressOptional.isPresent()) { + entity.setStreet(addressOptional.get().getLiveAddressName()); + entity.setStreetId(addressOptional.get().getLiveAddressCode()); + entity.setCommunity(addressOptional.get().getCommunity()); + entity.setGrid(addressOptional.get().getGridName()); + entity.setVillageName(addressOptional.get().getPlot()); + } + }); + boolean is = insertBatch(insertUserList); + log.info("已插入接种记录" + insertUserList.size()); + return is; + } + return Boolean.TRUE; + } - List companyList = vaccineCompanyService.compantyList(); - List siteList = vaccinationSiteService.getSiteList(); - // 校验疫苗生产商 - String companyName; - // 校验疫苗接种点 - String siteName; + private List validatorExcelFile(MultipartFile file) { + File f = StreamUtils.conversionFile(file); + //判断上传文件类型 + String originalFilename = file.getOriginalFilename(); + if (originalFilename != null && !originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2003) && !originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2007)) { + throw new RenException("请选择.xls或者.xlsx格式文件"); + } + // 判断导入文件是否为空 + List recordList = ExcelImportUtil.importExcel(f, VaccinationInfoAllExcel.class, new ImportParams()); + if (CollUtil.isEmpty(recordList)) { + throw new RenException("导入内容不能为空"); + } + return recordList; + } - List allUserList = epidemicUserInfoDao.selectAllUserInfo(null); - List allUserIdCards = allUserList.stream().map(EpidemicUserInfoEntity::getIdCard).collect(Collectors.toList()); + /** + * @return void + * @describe: 提取excel数据 + * @author rongchao + * @date 2021/8/27 + * @params file + * @params recordList + * @params deleteIdCardArr + * @params addList + * @params addErrorList + * @params maxDoseMap + */ + private void extractExcelData( + MultipartFile file, List deleteIdCardArr, + List addList, + List addErrorList, + Map maxDoseMap) { + //校验excel数据并返回excel行数据 + List recordList = validatorExcelFile(file); + List companyList = vaccineCompanyService.compantyList(); + List siteList = vaccinationSiteService.getSiteList(); - VaccinationInfoAllExcel epidemicReportUserInfoAllExcel; - VaccinationInfoDTO vaccinationInfoDTO; - VaccineDto vimCompanyOrSiteByExcel; - String excelIdCard; - Integer excelDose; - Integer maxDose; + List allUserList = epidemicUserInfoDao.selectAllUserInfo(null); + List allUserIdCards = allUserList.stream().map(EpidemicUserInfoEntity::getIdCard).collect(Collectors.toList()); - for (int i = 0; i < recordList.size(); i++) { - epidemicReportUserInfoAllExcel = recordList.get(i); - vaccinationInfoDTO = ConvertUtils.sourceToTarget(epidemicReportUserInfoAllExcel, VaccinationInfoDTO.class); - // 校验是否存在空单元格(校验必填) - if (checkNullCell(epidemicReportUserInfoAllExcel)) { - epidemicReportUserInfoAllExcel.setErrorInfo("存在空单元格"); - addErrorList.add(epidemicReportUserInfoAllExcel); - continue; - } - excelIdCard = epidemicReportUserInfoAllExcel.getIdentityNo(); - // 人员校验 - if (!allUserIdCards.contains(excelIdCard)) { - epidemicReportUserInfoAllExcel.setErrorInfo("查无此人"); - addErrorList.add(epidemicReportUserInfoAllExcel); - continue; - } + for (int i = 0; i < recordList.size(); i++) { + VaccinationInfoAllExcel epidemicReportUserInfoAllExcel = recordList.get(i); + // 校验是否存在空单元格(校验必填) + if (checkNullCell(epidemicReportUserInfoAllExcel)) { + epidemicReportUserInfoAllExcel.setErrorInfo("存在空单元格"); + addErrorList.add(epidemicReportUserInfoAllExcel); + continue; + } + String excelIdCard = epidemicReportUserInfoAllExcel.getIdentityNo(); + // 人员校验 + if (!allUserIdCards.contains(excelIdCard)) { + epidemicReportUserInfoAllExcel.setErrorInfo("查无此人"); + addErrorList.add(epidemicReportUserInfoAllExcel); + continue; + } - // 校验身份证号是否合法 - if (StringUtils.isBlank(excelIdCard) || excelIdCard.length() != 18) { - epidemicReportUserInfoAllExcel.setErrorInfo("身份证号不合法"); - addErrorList.add(epidemicReportUserInfoAllExcel); - continue; - } - // 校验疫苗生产商 - companyName = epidemicReportUserInfoAllExcel.getCompanyName(); - if (StringUtils.isNotBlank(companyName)) { - vimCompanyOrSiteByExcel = filterCompanyOrSiteByExcel(companyList, companyName); - if (null != vimCompanyOrSiteByExcel) { - epidemicReportUserInfoAllExcel.setCompanyId(vimCompanyOrSiteByExcel.getValue()); - maxDose = vimCompanyOrSiteByExcel.getMaxDose(); - } else { - epidemicReportUserInfoAllExcel.setErrorInfo("不存在的疫苗生产商"); - addErrorList.add(epidemicReportUserInfoAllExcel); - continue; - } + // 校验身份证号是否合法 + if (StringUtils.isBlank(excelIdCard) || excelIdCard.length() != 18) { + epidemicReportUserInfoAllExcel.setErrorInfo("身份证号不合法"); + addErrorList.add(epidemicReportUserInfoAllExcel); + continue; + } + // 校验疫苗生产商 + Integer maxDose; + String companyName = epidemicReportUserInfoAllExcel.getCompanyName(); + VaccineDto vimCompanyOrSiteByExcel; + if (StringUtils.isNotBlank(companyName)) { + vimCompanyOrSiteByExcel = filterCompanyOrSiteByExcel(companyList, companyName); + if (null != vimCompanyOrSiteByExcel) { + epidemicReportUserInfoAllExcel.setCompanyId(vimCompanyOrSiteByExcel.getValue()); + maxDose = vimCompanyOrSiteByExcel.getMaxDose(); } else { - epidemicReportUserInfoAllExcel.setErrorInfo("未填写疫苗生产商"); + epidemicReportUserInfoAllExcel.setErrorInfo("不存在的疫苗生产商"); addErrorList.add(epidemicReportUserInfoAllExcel); continue; } - // 校验疫苗接种点 - siteName = epidemicReportUserInfoAllExcel.getSiteName(); - if (StringUtils.isNotBlank(siteName)) { - vimCompanyOrSiteByExcel = filterCompanyOrSiteByExcel(siteList, siteName); - if (null != vimCompanyOrSiteByExcel) { - epidemicReportUserInfoAllExcel.setSiteId(vimCompanyOrSiteByExcel.getValue()); - } else { - epidemicReportUserInfoAllExcel.setErrorInfo("不存在的疫苗接种点"); - addErrorList.add(epidemicReportUserInfoAllExcel); - continue; - } + } else { + epidemicReportUserInfoAllExcel.setErrorInfo("未填写疫苗生产商"); + addErrorList.add(epidemicReportUserInfoAllExcel); + continue; + } + // 校验疫苗接种点 + String siteName = epidemicReportUserInfoAllExcel.getSiteName(); + if (StringUtils.isNotBlank(siteName)) { + vimCompanyOrSiteByExcel = filterCompanyOrSiteByExcel(siteList, siteName); + if (null != vimCompanyOrSiteByExcel) { + epidemicReportUserInfoAllExcel.setSiteId(vimCompanyOrSiteByExcel.getValue()); } else { - epidemicReportUserInfoAllExcel.setErrorInfo("未填写疫苗接种点"); + epidemicReportUserInfoAllExcel.setErrorInfo("不存在的疫苗接种点"); addErrorList.add(epidemicReportUserInfoAllExcel); continue; } - excelDose = epidemicReportUserInfoAllExcel.getDose(); - - // map用来记录身份证号的最大剂次 - if (maxDoseMap.containsKey(excelIdCard.toUpperCase())) { - if (maxDoseMap.get(excelIdCard.toUpperCase()).getVaccinationNum() < excelDose) { - EpidemicUserInfoDTO dto = new EpidemicUserInfoDTO(); - dto.setVaccinationNum(excelDose); - dto.setMaxDose(maxDose); - maxDoseMap.put(excelIdCard.toUpperCase(), dto); - } - } else { + } else { + epidemicReportUserInfoAllExcel.setErrorInfo("未填写疫苗接种点"); + addErrorList.add(epidemicReportUserInfoAllExcel); + continue; + } + Integer excelDose = epidemicReportUserInfoAllExcel.getDose(); + + // map用来记录身份证号的最大剂次 + if (maxDoseMap.containsKey(excelIdCard.toUpperCase())) { + if (maxDoseMap.get(excelIdCard.toUpperCase()).getVaccinationNum() < excelDose) { EpidemicUserInfoDTO dto = new EpidemicUserInfoDTO(); dto.setVaccinationNum(excelDose); dto.setMaxDose(maxDose); maxDoseMap.put(excelIdCard.toUpperCase(), dto); } + } else { + EpidemicUserInfoDTO dto = new EpidemicUserInfoDTO(); + dto.setVaccinationNum(excelDose); + dto.setMaxDose(maxDose); + maxDoseMap.put(excelIdCard.toUpperCase(), dto); + } - addList.add(epidemicReportUserInfoAllExcel); + addList.add(epidemicReportUserInfoAllExcel); - // 检查重复数据,对旧数据进行覆盖 - checkList = checkVaccination(vaccinationInfoDTO); - if (!checkList.isEmpty()) { - deleteIdCardArr.addAll(checkList.stream().map(VaccinationInfoEntity::getId).collect(Collectors.toList())); - } - } - log.info("循环结束,判断人员信息是否需要更新"); - - List idCards = new ArrayList<>(maxDoseMap.keySet()); - List insertUserList = new ArrayList<>(); - List updateList = new ArrayList<>(); - List insertErrorList = new ArrayList<>(); - List addressList = new ArrayList<>(); - EpidemicUserInfoDTO epidemicUserInfo; - String idCard; - - if (!idCards.isEmpty()) { - List existUserList = epidemicUserInfoDao.selectByIdCards(idCards); - addressList = epidemicUserInoutRecordDao.getAddressInfo(idCards); - - EpidemicUserInfoDTO updateDto; - for (EpidemicUserInfoDTO item : existUserList) { - if (null == item) { - continue; - } - idCard = item.getIdCard(); - epidemicUserInfo = maxDoseMap.get(idCard.toUpperCase()); - if (null == epidemicUserInfo) { - log.error(idCard); - continue; - } - updateDto = new EpidemicUserInfoDTO(); - epidemicUserInfo = maxDoseMap.get(idCard.toUpperCase()); - // 已经接种完的不需要处理,excel的剂次数据小于数据库时不需要处理,已经接种完的不需要处理 - if (item.getVaccinationState() != NumConstant.TWO && item.getVaccinationNum() <= epidemicUserInfo.getVaccinationNum()) { - updateDto.setIdCard(idCard); - updateDto.setVaccinationNum(epidemicUserInfo.getVaccinationNum()); - if (epidemicUserInfo.getVaccinationNum().equals(epidemicUserInfo.getMaxDose())) { - // 如果最大剂次同于excel的剂次就是接种完成,否则是接种中 - updateDto.setVaccinationState(2); - } else { - updateDto.setVaccinationState(1); - } - updateList.add(updateDto); - } - } + // 检查重复数据,对旧数据进行覆盖 + VaccinationInfoDTO vaccinationInfoDTO = ConvertUtils.sourceToTarget(epidemicReportUserInfoAllExcel, VaccinationInfoDTO.class); + // 检查重复数据,对旧数据进行覆盖 + List checkList = checkVaccination(vaccinationInfoDTO); + if (!checkList.isEmpty()) { + deleteIdCardArr.addAll(checkList.stream().map(VaccinationInfoEntity::getId).collect(Collectors.toList())); } - log.info("待处理人员数量为:" + idCards.size() + "||可用地址数量为" + addressList.size() + "||实际需要更新的人员信息数量为:" + updateList.size()); + } + } - // 对历史数据根据身份证号进行逻辑删除 - if (!deleteIdCardArr.isEmpty()) { - baseDao.deleteDistinctDose(deleteIdCardArr); - } - // 插入接种数据 - if (!addList.isEmpty()) { - insertUserList = ConvertUtils.sourceToTarget(addList, VaccinationInfoEntity.class); - List finalAddressList = addressList; - insertUserList.forEach(entity -> { - entity.setIdentityNo(entity.getIdentityNo().toUpperCase()); - Optional addressOptional = finalAddressList.stream().filter(address -> address.getIdCard().equals(entity.getIdentityNo())).findFirst(); - if (addressOptional.isPresent()) { - entity.setStreet(addressOptional.get().getLiveAddressName()); - entity.setStreetId(addressOptional.get().getLiveAddressCode()); - entity.setCommunity(addressOptional.get().getCommunity()); - entity.setGrid(addressOptional.get().getGridName()); - entity.setVillageName(addressOptional.get().getPlot()); - } - }); - insertBatch(insertUserList); - } - // 更新人员的接种信息 - for (EpidemicUserInfoDTO dto : updateList) { - epidemicUserInfoDao.updateVaccinationInfo(dto); - } - // 批量插入错误数据 - if (!addErrorList.isEmpty()) { - insertErrorList = ConvertUtils.sourceToTarget(addErrorList, VaccinationErrorEntity.class); - Integer insertNo = vaccinationErrorDao.getMaxInsertNo(); - for (VaccinationErrorEntity entity : insertErrorList) { - entity.setInsertNo(insertNo); - } - vaccinationErrorService.insertBatch(insertErrorList); - } - log.info("已删除用户数量:" + deleteIdCardArr.size() + "||已插入接种记录" + insertUserList.size() + "||已更新用户记录:" + updateList.size() + "||错误信息记录:" + insertErrorList.size()); + /** + * 批量导入 + * + * @param file + * @return Result + * @author wanggongfeng + * @date 2021-01-21 + */ + @Override + @Transactional(rollbackFor = {RuntimeException.class, Exception.class}) + public Result importManualScoreExcel(MultipartFile file) { + log.info("进入Excel数据导入"); + // 存储需要逻辑删除的身份证号 + List deleteIdCardArr = Lists.newArrayList(); + // 存储批量插入实体 + List addList = Lists.newArrayList(); + // 存储错误数据批量插入实体 + List addErrorList = Lists.newArrayList(); + // 记录单人最高剂次 + Map maxDoseMap = Maps.newHashMap(); - // 提示报错信息 - if (CollUtil.isNotEmpty(addErrorList)) { - return new Result().ok("数据异常,请下载Excel后重新导入!"); - } - } catch (Exception e) { - e.printStackTrace(); - return new Result().error("数据异常,解析Excel文件失败"); - } finally { - // 删除文件 - FileUtils.deleteAllFilesOfDir(f); + log.info("准备进入Excel数据导入循环"); + + extractExcelData(file, deleteIdCardArr, addList, addErrorList, maxDoseMap); + + log.info("循环结束,判断人员信息是否需要更新"); + + // 批量插入错误数据 + if (!insertBatchVaccinationErrors(addErrorList)) { + throw new RenException("批量插入错误数据失败"); + } + + List addressList = Lists.newArrayList(); + + // 更新人员的接种信息 + if (!updateEpidemicUserInfo(addressList, maxDoseMap)) { + throw new RenException("更新人员的接种信息失败"); + } + + // 插入接种数据 + if (insertBatchVaccination(addList, addressList, deleteIdCardArr)) { + throw new RenException("插入接种数据失败"); + } + + // 提示报错信息 + if (CollUtil.isNotEmpty(addErrorList)) { + return new Result().ok("数据异常,请下载Excel后重新导入!"); } return new Result(); } diff --git a/epdc-cloud-vim-yushan/src/main/resources/excel/居民信息录入模板.xls b/epdc-cloud-vim-yushan/src/main/resources/excel/居民信息录入模板.xls new file mode 100644 index 0000000000000000000000000000000000000000..7a667503b8d0dde376e142ac22fbabc88b81eafc GIT binary patch literal 36352 zcmeHw2S8NE*8kjPfu$)TB4WD&3Mggis8KqiB8VWyN?jC1AT%+ywZ-0IViGmR#2AfH zV>fnev0>~j%@z|)Vo6?%nzsMnxp(h27RC48|9kI!-@9=3&YU@O&Y77rXWHGnr%yGy z_U=Zv>&)cp$}HGl8XIP1faee<5H3f?+9MzX{H4)oL?mMf{`dM1s)0YDs}CB_0w4!i z0;tWc0SbT(z!qQ!um?B*8UPvsU;?ZWzzNV8;0$O2Z~-(0xB{91+yKo1EdVV6tpKe7 zJfIE09pC}*1hfUT19$4{Vx|-j8s?T3wQ;6 zGFB~ovIOxae)isxA8j%FBG&=YC~8Dp{UE)RjbJ%~9wS8Lb9_268AmoL=}@1nq~VEP zB4sAaK>J6tOxBzAVJWN!>LHe;BOc580`siPopBroBI+O1Pt08p2ImUpmdbBPBT6^K zJYQG=k1Um)`mNdPSCt^2j}z_+;z`U=S;z ze%-4ex3svdIKP}v$GW ztY2~Ih@9f$5lfNO2+oGcVG{UkEPQ?}FxV}8c0r0}LJg;xP@Y1rfd;b|Wl;j%9O2Vl z_-uerj%^q6d@f)D;lhrBUNd1nwKXnFE*fTAz_M8(T#z$+0Gxt}sjt8!XAMkCd4BxU zrL<>qNZ0G&z$LK?mJ2QNpa;*oL8EMR;yk7jblL))Bx=1*?j|L%;Sxb#$SUz!4qmz7 z5eQdpSl(Bd6_%j>{@i8eFG zhvYh&k^3cvJ9`1o8ObI3MrP?bv~X=bNp46TcpI~L83xDNmO^rE>%fQ9fq%g)o@0?_ z<>tUw{WD_x=DSCSpFA{13!b zOofq+XuJ`7dY(bZb4^%|F!oRbQ`TM8JmG1g_E3Ye{30d%bMeI09RL5#c#d3#?h@;h zCdEQM&{Tvjd2^xuYvTjzz}wV;cdG;6x(QpbFVfS3+PHp1 z`r3F=pW1j)pW67k_y-Dl)~4?$;4Lvj6Z*?zp|$WKwj(XD%-J(-1PJ)^jE~~0;qFCx z+8i*4M~^eWM`52pq}Sn1`Xg;F7}t-VpeJoOnA3+gA&lw8c6XNW=UH|Xzfq^BCEEdd zo-vd1TEc&r!^6pm{9kL-=ncC!?3i4vf7YJ&_+xWxLz z8W(t8+~G37({_?TPX=RvR|t4s+yOJdi}b+L&Y5tD{Att79DflHeaHZWOKM;9^p$7eqehr@Sv{DL#n#P){N6K})FeHcQmctwa8~9!#FzI&@-C4<=7< z9lm}{p58ib>c_;mbxgf89eC(nA$d|0?`-PDJdLE*%AnBt`KLE$+kXa=cJ*PRi8R*4 zwESLR@?7Qj)=8ytYALhQ7*!aVGbLz_e5TQREK{jII;lhpYGWp~#|}E<6s=Ckkj;!U zNK!w&Zz#2|$tczVOyqTsV%BDw&agS9D53zw}KTy3T3Xil#b9Zr~SsFf>M)>0}mGP0IZgfmr&a9W+P zm=~2d#MPeLC_yfon^aIErD|uOgGGG?NHZ=)ZA-xhq=BW>Y7423HEK>*?AlC1jhHM| znMjq)P4mN2116?cLFb?P1`z5+yOSbJ{3Isktb&M5t%7jR-vFjc(SfX?QkBN_DJi9? zc}rKaf4-@jx`PNPrEg?4QyVK)yL~$9+DCA}h#8p?m4XtCU7x8Z?^Hh~Pajk1K>V4* zp?H?BcZa5$yih+TPajk1NWC7KJbg^_~xQ{IZo!~1e=l5&a9kZ6j@syD^>p8yLZjYX>49jh#5KU&B_VU%duAFYksaV zFNZdJ&9qOb89DxD<%k|xs5gZw|H}2B&C6+GUQU=9IYDOSkki)In~f^}#{JLD%W)w& zA!e+ow!O869CMU9Ir5sMJ(up8m($d|9CP;OVOEZzz11W=KC#Zc99Q#l%-NflSviLG zR+IF_7hjl{)6BdabN1H3tQ#TTt+ar{|h0kDR%yEj6zyTEJ~W1MS6G zT52rV_)4oj=SL7~q09ycgm_5Ddf1z9zN+Y8Ol;9mBV&|8Q#)ZS#f&U2eYj+64mdo- zvqVH8j?-OC@;hqeLVijm+pWdJ8dD5wOz{RTxd2fMWeynpbsWiJO*uBwaTKkz9vs{0 zIg)Lfa&*#h6z#DNj+)4|HQ#G>^wM)AD-19xbz>bzvOKdjXN{v*j&b(}zp5bnqNWfp zj%%*r*uBA0Pq(Dy64v3Q6@_WBuI=flHZ?;FyO}Ux&@y7kp&7(*A!ctrY6YnLjHzS_ z*um5}f4#OcS5lGKlPl4(x5kqoP;p%U+A6w1#c}-&Ris6`q#~Yrl6ctQv<1f1t*~=e ztwGhI8T6zSn&S(VZa7h+xu;|p99BE}n3Yf{U$wk;(Jkd*={1KNLIt6s`>Cx##Tysh z(i*A~)j;@SRJ1^AgEMky`tGbZ#=NR1HqIb(0b5F;Wfx6fsHSMiCzY61s6wp?GiD^x zj)15&k%}<|&8BrR8>84lSwlRAYst9kVYi0%O^Z!^Vc4sR3KK1wLY_X|P#0SNOSCNYcfaq>C7nbP;2ui;{G?Ipg>OudHb*-=VK6Xc8{el<>jHLLpC|ZfHSN zSgi#)px2`_=g;bqE^;yHC^9>A6e-n^2lSM9G{ig~x{#ep^%7~Kiz{@|r%P^z3ae`u zvL8awj)7=D!DdW#+b|jnc zm;9pEFjqH&S zdV3UOhBmjC^N7zRE~G?KVi|h>WZ>mjC?yLCzx7HmG+K?iGDPpPc!zSP)u&>3GxGCutpva@kx$XlYVrBtawB#%P{p_RI>GttP@Nzac) zCR2WGbo>nGPmJ9i7bsLrEqKOH~Ac@O3XrH9P(>#FBRa~)HDfjWMM^BcxW)^#(-&jycXqJ!Kn zJig#n#Sri_bWgT0P)fnm#X5(r!S;pZ6KU%~-yg)7)E~r{)E~syT*ZrQu7QO45Y`BP z=@{#B@WihQPxF@JaeoT+5}vLqz|*}W;k$a{S>Ho;iUhS_kDIXwqmPbtotogSXkIhjIJu{md3Ab3`$`%{wB#xfq!TJh3 zioU`ijdIRL^=II3Js$r?#mSqZ$I}L`cwwYx`#A-Gu{j|!makY3kW$Gx<4KeUm4n%f`cj(%=tvR7QQ3B*XPkGb;N<^+V8aPGruns$X8$VsqZOKN^O)DmixO&g66b z9nvwa5F;PW{WE$0tVd}&M7sL-v7r@T&C=%du5g}@v^ynxFtKJKNxMr zxUQq!Qm&3?$v2a^Dx_Q}+=<|@>1c8-A2KQu3QVKIQ!3C*Q@Nzsz5Kxt5~A8wnDfT$ z*$Apq2c(kHkauYOk@01zzmJW|@$RSW2h}CfTooh|LjyfOnwyrgt#oTDSPU5Odw*>( zJm+TGn6b0^VPnQ&XhrJiOa#JndW}_5{R9qjOFo>nH5HsUl-(LUD5Wn3VIe{RZ6yZw zcT0XJ?OFyT&Pk;lt|`~D_EXJJ%9zRxvydVMwY9x%;JP7W#&+lfqEyv~eY7$<4PD(Q ze_n~|)B?y5BcvK4%Lf*et}P{%QEDoezMx2LkW4752t?usrKE_hhl=#d>d*(@AJHrC zl9NBM%`k}FP)3Bxezr_bRvV-YQu--_@GtCx316-P8W+Z2B6tyh4F`2fqx;wb`lNXe z-QOQ*n#EGgB3c8rt|hmXYufaV4%Q=5^ zngzJibMQ}ae~f#s!UX^V?d2i`*dj%R-6De&O6c9w0*|y>K@NR+?atQ?_hE|0TA(8~ z#(iLHaZ$Ods5~=$bcw2Luz%Ia!nF%dBp*~d#y?8@WAZJ(9!obxDcatdbY$+4_r_Kq zeaqA3*yT;D`u_eX>1=w;YTl*L_e$`iWu0%9?rCkk_28RJSM~V#=a>$jKQ!+)c;(gb zlq>5pW=wQ*eIa{g!#97~xp%jB_%wC*8H@X@9P@3-(4CvSS*n7?IbWLWar9 z3CCPw{EzSOdg%XthZ*ml?0+ErNwW>Nhp0l&gs%RY|JiP~)4>h)Gcr#N<(v6^yRY-I z89#n;v47$2ujX!=J2q@cP4a$?bJoMi+l|lFOc*!;HKM_C&A7f+UR?EEHR>r0^-fQL zW|pc7%L4rAbIQC^!w)L$r`?~rXY!eGsb>$mwyg|UIX^aF#W;4|d%`gH=3g}b;fs_b zR<^qoQ{KP-=)*35t)KPe`fK0uE{oS#9lQ}6d1Bc0$}amROgc98{Z(xh1FK42Suy5| zt(m)fpIPz3$-w3-6SpZ}cWOBOO3Lm&>tpiH9CJL|BmRq!9M1`>7QB>ssr8%7nq3P^ zI``0}&!zCJ_48IA(`-JdtXY<_f5OMUx8mhR;jbkXe3SF;>VTVRd*-iJtvTQ7^wv+F zT>KM7sa?($k^8?^0`rnW~fi)3-ku>$|G? z>dzBf9QG}|ex%8_cdA^EZJE>fYWJgMspC8@%%8e$>sS26tsO43x$pbckR6`GyUgm= z@AkPzJ~!fj=+Mqq7GYlb@7tYv=Prhzux8?yIStenix5a^|Jc7*ar1D;Jxy;jFhxb={bKAGKYwVOYVbt|)Df>sY zpX#RYZry%WRmsR@4`sw8C zxLZ~O4;C%g*zP*OFD<&$ade2k*Sbs1AAURJPNv1`K}Q}A{4;-F|KH9rXZeP+OK08L zyz%PS_d{*ha>pY(jeRs=&)vmS!~ZD$_@%E$te#-^ar6$&Z*Jq2w_}|Bc3a(g{HfdC zA;lvresCEwxpZuq!__tS9)9l!s=&5)${hxe4B5VG)`dm$ZB|$(SM5q|y=9y2cRiic zWBU&tKGUY>tq%tDJZ}86GV|hpREo*bRQO}P*&iv!?Z-;~LKb*B{)x2fzbp7qtFF)Np*Ddn9y}k!6 zUQ77k`bYQoJ^uZRls)^FjeGR{v3^Cnl|Sv%{Bosu-}pOL2f7Xjdilx2bCJs;$2~du z-Gsj$9OACt99DRso9F%myJn>9?(92p>z(S$H9x(%@2$h$35PaC1wO9)Zs)2;5sB07sz&}=eWTOtCrM66YQk?ElC=sxV6cW6=S~cx?+9bM-Mj6nc^^U_2fSkX&q)? zI-T_1poQ7Nd;dtzFd}+jY6KDKjXYXj0J@n>`A2$|+Cv^YzK!fgXOD@kl?A*h7^!B&P_s@HCPwe?oM=g4UfAD*& z{TVw?xlG!%d}+Its)?(;g6|!@6yi z&%624m>BPt$2%UL7V}QEWytapHu-pRW~Y}%w>**acy(n^Qr30%xm)HOdFziUN2^>{ z*eBl)&FnZM?s_MuA)m^>bbGkr-1Y z{)o{F+kZ7;+k(A6`76A?2yc^}l)vzD<@{lOR(DBS7ltA^3DDoYi@>rpCwBu85!d|t$oVqHBGNvI5u|4TVFdTeI#4+pwEicYSjl{ z%>3cgTOVGywX$+<(m>DIrJK9oK6<-VyBy~m?{&Ixd-Sl~1?#^!@!Ei2(!FQC=o&KM z4b7ax@nsH`AAKH`mgY0;`?t&g__orbN4u#0N8YKv+p=rBX6NVj_8J)HQT3!r;Xy?@u2 z&0ddLnxa8m?6`J5s@Ns>{=(*Y?a|HQ%=~w@VN`35vCqq7bQ6bkVaPBT;~G3A?3hpR>7_}-aghi zH|XoYVQbtJo$kE;(&GIiKlyQPR3De*8CN>zZOEE5w>bQ6lc5WGdiQGQ*~i;I@XgW& zUOg5rJv}r1iF$p+ig_8|xUcvi`sl9HiH|DAE&pi=H}YDR`%-}LJ1MJ^`E!kj{{%3l^gDt^Uz!HOrHxk%v;AR`(i0%!X6un`98+EdUx@t^X z)2kh$EE|T$T%s>}iQjN{H2Q|SoeXPi?S=9(w&SMr*~wgfNwA0>7W2P1&mr)5{OLOVjG{fJtiV$Kb8yPdod;p)Ki4db~@_Y zk@QVh@wy%9tqVVh^f3tc!Z#r;c&Z12Jb*6(1QPCDd|Q@73T=weH|2dfN~P;sq;%)l zQbjv}7=QX_U+}PHtBxAPvbUGPf&iZsKbe+Bq`gCh- zW2g<{v^~L`_31X)*fq>=OG^cVbbIJ@p@E*>0qtf;-vFCjhWa?+i~nmJ^!hZWrJ4ah zXZrS{fxa&Ey;OtpxY1Wg4CtHFjNTxUA`$yqz3527F7jqSD z0=PfXx^zVepJI%|yD*4AjLDEjZ7#+v5JNj_V{%ZEjf-iPh|!jn7_$N;b!stYjhBGX zBcWnUfta5zW`lgRr6s1>A|IKi7_&o+oPij#M~w6pV-Cni%SSQR0BN+~7h??(gFR?t zj)+kWiD``xqk0o#PT)dyCB_;f4R)iAIU~(U7i)qTE$>B27f@247Gq5jgZ*e@u87eF zf|%9}F>JJHV{VAK>SE0igPm#9S|CPW9T4-iM2x-zAjVoDMr%kh)*3N-DqoE8h|%Vs z7;6JPTkB%(NaJ-e55(H&VxEY(>tbyY^U%fGAqI;Sc#<{53vb>b3Domrh0Vyls8#YZ z(Zc&uV$u3ydPBU1!e5uyi6siuVpsMN%Vbif7M>Z6E8BQSZte8 zYfONjmUH6fDfZW)%{~j9cp=5{0a*Yiv;+b|8&G{P*60C!4u&l^ft5IehNG(0UG{=~ zh*9#$WVzG>8?$?89_+(04jn`WS@Z-ZUd$kKVtdgM$g;$D6%lq8M!Z>61-gssn|M(> zQ2v%wD`Kjs7`Ro-?8PfSCUf>eF2YIR zhrZRc3HMGK?P`Wptx9G%M9o{INViXCEKzm5(jl3S)la3qh_C|)qDF8k|}0$LEZ1=!p%yvA!!y|Kt5hgg)(j*LX!lIhG)ERZ-#FC z42hrh>-IVxgGhBl<&Zqe?h0SHPWcLr6-qw};D;SCfvu=o}2|a!j%u;+g#xTp%Bz!3D^&BLTM;auPkWU&Ui5HDD!5AcIurM4XX?UbTM;aaxgf9?5 zMv+>>BaXP*2npH`)8UcO`r(l{NyB5JkV6OEbMN;s`G*2HMVHxmw zG(0}FQ}-TNhC#4H|6TYDD?N$v#ds(rQG2-nvwlH4zJ$X;5|ds1iI{dCER6g>&@=o1 zlzjdx9Y^{FtnBZ851$)ec1F$!T?Q(P$J_PMVys-GN`rhA{^+rSzvsf^065+jW!G0e z8T6F~qBOnypua~vX2CL!IuI47zVgZMmut&k*ZT+Ss|@O2kV~@Zs!zTw5G|l7A1>+& zWZu-FNhK-^nLM>8)hn&QXvRsaEm~tyHmbUY0GdeCiizHrNvk7T6VXbD)<3lBq1kma z0Ih3iKH366D;HX?&?h z3qa+?sEx;D7)u580i*#iH^e(586H=m_gd1aIOaM4%---Ndc05zK#y)>V#YE7#3vi~ z96&B051<0%1BL>I0SW-a0dOdIP>1319EKP0F+7}uhl~I(0ZIX7fN}tQh%iiy!o3PG z8t^h;3}7r^9AG?P0zeJmT+s5rAVB+mmvNWl4!tyA;U0*zg8;fXz)jok2PoA8;pu>F z2y>JmqOCrfs#c7VZ&}(7{=`V;ONqdeZ!}7-f=#Rco7J**S5j{i1D2+m~TC6@* zqM~~U`U+VDT_lC$q7ag)#W&#cS}gT5^76O|7g5qB#aklK7C^Wt0V$S72x{?^Mi=44 zkn!i!@M4;juP#cFyU3Mju&NYqf8Xa{$H}mXow5Cy$B1J8b)PVvk2kRB^77JxoQiU$ z;xl40le0%6(1mx$i&B~Nrqt;p+-+^A$7GkurZeRjr4mo}M63?%=*JwD7K&KrJXz+% zc`B75VdLyyj_OueoReM1)ubs(vU9ol^hP(C$}T6iRFz$xEzc=*Zq>U~m8VL~EzD+C z-SgPGba`ooeN=o^Nihf;H&0iMEGf)Zm#gAbr3IBT4{kwJMOk_A$by$Gr7)#SVMDxxqr1d|LL%NUmm#G{t)~IqRW$qGeUSsjY)q{X=9dB+HO(eP zJ=`bS3-e3`A%LejpQ8{KPJ@KG8|9_+C|%>93wRmLjc*&^sjVfvf|^oGBb>h= zOmjSM5ih5_!i#yK1Ib!0;;l&525p#VKB2Id=BNS9WihPqMe;Q&%t8=GMuR4AH%)94*;`bdpdw$!sGw=Fdy!^?QGw;%D z{h^%l(fv*BeS?tKU)F|2$ksC2+h2m!!eZ7*Hk{RfKegZkaF3Gl>;+j{?Co<{u>{G8 zPYtL_g#1CWO|VaWP9O!mKXL`hJXs8Ci71u|_?yfEa`KA#qT=#l1w}*iP*2`S*$Fvu zGH;eZRf>yeq*tQMi-idoN{xx?A%q_rrQ>ONAsz;K{@{?PjZ^+4l*+Sdvs<5qxR;-QQfBN{5t)B<(KfPk@+3GEyRbM;# z>58>SzYE@b^7xTh!iH0*+y2v}XNYVEU7!4V=G{~G zh!^D-WrZM@nAcvL*OPq-i`LgDwUe5Y=&39mdQl_1c9K@R$ubKa?M>|FROvPvOg#|?_J_pmj5#$3zdRHxdK~Y(` zDm#xa&Ie&`@yLr7-Vw3GFT_AhHE>(!2F(qvs; zrm{OEOx6|I(qw(UN}8;%Qs70+;$$6!+Q~Z0)=t(fWFCzsij#G#mua$|Qc_+}EHC2K zeuV|O1?9}vHmxFu?^moS9Z|+D%#0m|pB@;h@{Spuf!{>n#m46O=rX>~L|Y$Q=B0JE zO!Br&a<@$Kx9nZpxPp;$NW$`nspuwmTm3k18!w<(7L-PWH7q7~{hyHMAvL_97=8>uejppPPr` zmy|G-tgXU7z9@QRe5I-=sk|&|TI?vEKa|v^p=A$spnA@%27Qb2itk6c9vU>)c5*xa zmtYV7`D@HmMRa*sjwCL=0;RcgDF_T=e&5?=6k8o=8z)W(%O!C1@ za>7xf7ml_JUl1*W3syJhdDh~|r{3=FF>VJePb8>&s99uOB4?p?NQhqTaKoW{(Yx1D zyaRoCi-x}6_(b{eFLdRVxh;8_S8RXLnU;_@o#K?&FhkLS=aW=L-m#5+_yK-d{kpiz zVjX-|*m>!k=LYgcoWpcGerBir)d5MW{BrNMO(xnsjJNUY<=}Hvk=QocWxZ`)9~D0> zS7l{4#it$P-F@ACd3SfU5AQ_|&Y=kx)m7^X=aVnI<4}|r)$x>-Y=1)!#ZB*1_p-Y3 zJ`c$AO>AXl`D5?g=E?j4$K`B=ldV^*Yci7@Ta@V8vbJZdwVqAARzAY_uv~CuO!8$} zf-`GtvCtvY@~{QZHxNA3Y^Bf8hOrHKKHjE9z;rGF&kh`7wu;v~*-oo^`NqbHR_GSm zB`bNJXI;;^|F--ca%LXjIvw!e{kMP6ebX57&)9$a=dFLENTdJmzhQIyKW+bQRh|29 z;!qy+Z!?s`#B^6p_LsE2)5sM#>%r>9$IC*OMoT9gTXXGka*=4X;~au>5_*nL+DkSJ z)n~`Y1G7TdTYF%Z9*uQ+3C=gfpC6*1Au7fxM;TIj3Aj?k%K-T}Ej*&>oazcp5lv~-+{U}Od_`dV|2@WV;; zb51HjW(F`SNJ$p7EQg#NXqkcZGVr0FeByCtl#Lka%cCZUFJEUVbQOxg5Hqz&`}e{B zP;CaHCa5NN*Z*9icca ziN{|c>N*~E6(QJgAVPs?J3qul3bN)PNF$0^zXu1E6b)Ap%K^lwv zQ8S{|nyXdOUPr=yvDYA!roMH`u|B#wrB};QUB<$815tB+_>4zA1|bxRP>5jD5x|6i z#t-)doXRQzV%>)W8-rNwI_(S1ROnIEi_3(b8er5wEt34)d3UC9o z0JM@hGG4p0PhN%g5>)HsvgN{l!t+i&X-8jrR)fv|r?8Eu#dpA?98 z&j;ke2j)W$FYJ5Nl}DqY<9gwu-MwQN*)w6op41jeETMl>^ z@E(BZ-`Czhz=hTWG2gt03f~MJ!!(s;IR} zs&bB_LyG^D%BOnxPtle1gzu@BzSJoH%5n`nxH)ynyx1Kxm!C-TRyS0VF61t^x6WVp zb$-&=Jzv#aaPpqnOv3NVnA-8l_3oWE58m`sS;^9F5}xj~RjdZ!5i-sbzhPPufFlQa zd{wThP~9PmS;#YDq95JJ0{QDE5q@!DW;ko5#@Ff61BK?`}W?A*G~qJkOiiymAC zMWGzFL5r3bP$l+J;hB%CZ zwv=UfsGBja)l?-r;=mezsOGq7AU$*`1tDfYW+HoNeewEu3GNGCeFsd;E11B?>cD;mN;CLc8TK;T z+2HWdIKPC1kZ`}~h=g#zu!xY5prDB8n2@lLaqbSbamBe6BVp2A47Cnumx#wOh0B0K zRQM@rK}KnK)>GBRUGnp}XupaS%c>Ea&UF*+tXB03It0f6ro+r>Rp85$HC2oV0F z9_(PND{)|#F~JeRL2+RrO262Ij!M74z}N)82L8du$ja!evU-0<04YkhPfSxedroQv@layhOA1zR@4qltD&~%j6xK;p4 zrzaW|fGB_yAPYc#d+kz0FS|-;Uv|Gy)z&Poe7=6 zKhR(4-?3w0-HwUFj);Y@8po3`!qaz*Rf7SpgqHYl)f<8^w({uQ!Ms*`q+4Q7uo%0X z^x{|X?1aur>OUWefa=dX|Jn$-g;YVf=zRjTXIrA()fch#|8)90`nCgt;% m|CtP*li(kc-vGh{%kUQ*rGEtbrQ@cTo>PPWlK-dH!2bh^PiPnb literal 0 HcmV?d00001 diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseBusinessInfoDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseBusinessInfoDao.xml new file mode 100644 index 0000000..bc55c24 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseBusinessInfoDao.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseRentInfoDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseRentInfoDao.xml new file mode 100644 index 0000000..58ade6f --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseRentInfoDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml new file mode 100644 index 0000000..e1bb98d --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HousingInformationDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HousingInformationDao.xml new file mode 100644 index 0000000..5369118 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/HousingInformationDao.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml new file mode 100644 index 0000000..cf6093c --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml @@ -0,0 +1,696 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update epdc_population_information + set JOIN_TIME = null + where ID = #{id} + + + update epdc_population_information + set UNEMPLOYMENT_REGISTER_TIME = null + where ID = #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE epdc_population_information + set VACCINATION_NUM = #{vaccinationNum} + + ,VACCINATION_STATE = #{vaccinationState} + + WHERE + RESIDENTS_IDENTITY_NO = #{residentsIdentityNo} + + + From 01049cce62b0750bd67b017ecb118bc79e935cc5 Mon Sep 17 00:00:00 2001 From: rongchao Date: Sat, 28 Aug 2021 20:23:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epdc-cloud-commons-yushan | 2 +- .../vaccine/house/controller/HousingInformationController.java | 1 + .../house/controller/PopulationInformationController.java | 2 +- .../house/service/impl/HousingInformationServiceImpl.java | 1 + .../house/service/impl/PopulationInformationServiceImpl.java | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/epdc-cloud-commons-yushan b/epdc-cloud-commons-yushan index 72b0a45..31d32c8 160000 --- a/epdc-cloud-commons-yushan +++ b/epdc-cloud-commons-yushan @@ -1 +1 @@ -Subproject commit 72b0a4547c75aa6788dcd05749994bc094a38010 +Subproject commit 31d32c81a8018a5c93745bcca1a538cc0bf59e13 diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java index 8f475cd..3ecd08e 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java @@ -28,6 +28,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.constant.PopulationDictConstant; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; import com.elink.esua.epdc.dto.house.*; import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient; diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java index ad6acac..00e2cab 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java @@ -31,7 +31,7 @@ import com.elink.esua.epdc.constant.PopulationDictConstant; import com.elink.esua.epdc.dto.house.PopulationInfoOverviewDTO; import com.elink.esua.epdc.dto.house.PopulationInformationDTO; import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO; -import com.elink.esua.epdc.dto.house.SysSimpleDictDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; import com.elink.esua.epdc.dto.house.result.EpdcScreenResidentInfoByCurrentAddressResultDTO; import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient; diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java index 885b635..20184d6 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java @@ -31,6 +31,7 @@ import com.elink.esua.epdc.constant.HouseUseConstant; import com.elink.esua.epdc.constant.PopulationDictConstant; import com.elink.esua.epdc.dto.OrganizationModifyDTO; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; import com.elink.esua.epdc.dto.house.*; import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; import com.elink.esua.epdc.dto.house.result.EpdcPopulationErrorResultDTO; diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java index 431dcfa..d890fbc 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java @@ -31,6 +31,7 @@ import com.elink.esua.epdc.constant.HouseHeadRelationConstant; import com.elink.esua.epdc.constant.HouseUseConstant; import com.elink.esua.epdc.constant.PopulationDictConstant; import com.elink.esua.epdc.constant.PopulationIdentify; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; import com.elink.esua.epdc.dto.house.*; import com.elink.esua.epdc.dto.house.form.*; import com.elink.esua.epdc.dto.house.result.*; From 7957f018605f84894db44c55e9ddc68f3410200f Mon Sep 17 00:00:00 2001 From: rongchao Date: Tue, 31 Aug 2021 18:17:07 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1.=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=202.=E7=96=AB=E8=8B=97=E6=8E=A5=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epdc-cloud-client-yushan | 2 +- .../v2/PersonTestingV2Controller.java | 2 +- .../impl/PersonTestingServiceImpl.java | 67 +-- .../src/main/resources/application.yml | 2 +- .../v2/EpidemicUserInfoV2Controller.java | 68 +++ .../epidemic/dao/EpidemicUserInfoDao.java | 32 +- .../epidemic/dto/EpidemicUserInfoDTOV2.java | 82 +++ .../dto/result/EpidemicPageResultV2DTO.java | 66 +++ .../result/VaccinationInfoResultV2DTO.java | 36 ++ .../service/EpidemicUserInfoService.java | 21 + .../impl/EpidemicUserInfoServiceImpl.java | 52 ++ .../PopulationInformationController.java | 21 + .../house/dao/PopulationInformationDao.java | 14 +- .../entity/PopulationInformationEntity.java | 6 +- .../excel/BaseResidentInformationExcel.java | 9 +- .../service/PopulationInformationService.java | 142 ++++-- .../impl/HousingInformationServiceImpl.java | 5 +- .../PopulationInformationServiceImpl.java | 69 +++ .../v2/VaccinationInfoV2Controller.java | 50 ++ .../vaccine/vim/dao/VaccinationInfoDao.java | 11 + .../vaccine/vim/dto/VaccinationInfoV2DTO.java | 110 ++++ .../vim/service/VaccinationInfoService.java | 19 + .../impl/VaccinationInfoServiceImpl.java | 37 +- .../mapper/epidemic/EpidemicUserInfoDao.xml | 472 +++++++++++------- .../mapper/house/PopulationInformationDao.xml | 100 +++- .../mapper/vim/VaccinationInfoDao.xml | 13 + 26 files changed, 1225 insertions(+), 283 deletions(-) create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/v2/EpidemicUserInfoV2Controller.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTOV2.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/result/EpidemicPageResultV2DTO.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/result/VaccinationInfoResultV2DTO.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/v2/VaccinationInfoV2Controller.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationInfoV2DTO.java diff --git a/epdc-cloud-client-yushan b/epdc-cloud-client-yushan index 8c5f912..492ca0b 160000 --- a/epdc-cloud-client-yushan +++ b/epdc-cloud-client-yushan @@ -1 +1 @@ -Subproject commit 8c5f912270a32bf7cf695349c0681fb6198e2e5e +Subproject commit 492ca0bd1716eca3439b0604c60ebda5910f62f2 diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java index 26ad77e..718b224 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java @@ -74,7 +74,7 @@ public class PersonTestingV2Controller { public Result save(@RequestBody PersonTestingDTO dto) throws ParseException { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - return personTestingService.saveScanningInfo(dto); + return personTestingService.saveScanningInfoV2(dto); } @PutMapping diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java index d753ab3..3c62725 100644 --- a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java +++ b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java @@ -22,6 +22,7 @@ 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.enums.UserSexEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; 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.Result; @@ -164,7 +165,7 @@ public class PersonTestingServiceImpl extends BaseServiceImpl uploadResult = ossFeignClient.uploadBase64(form); if (!uploadResult.success()) { - return new Result().error("上传图片错误"); + throw new RenException("上传图片错误"); } if (StringUtils.isNotBlank(uploadResult.getData())) { entity.setImgUrl(uploadResult.getData()); @@ -186,24 +187,26 @@ public class PersonTestingServiceImpl extends BaseServiceImpl uploadResult = ossFeignClient.uploadBase64(form); - if (!uploadResult.success()) { - return new Result().error("上传图片错误"); - } - if (StringUtils.isNotBlank(uploadResult.getData())) { - entity.setImgUrl(uploadResult.getData()); - } entity.setTestingTime(date); + if (StringUtils.isNotBlank(dto.getImgCode())) { + UploadFormDTO form = new UploadFormDTO(); + form.setBase64String("data:image/png;base64," + dto.getImgCode()); + Result uploadResult = ossFeignClient.uploadBase64(form); + if (!uploadResult.success()) { + throw new RenException("上传图片错误"); + } + if (StringUtils.isNotBlank(uploadResult.getData())) { + entity.setImgUrl(uploadResult.getData()); + } + } insert(entity); return new Result().ok("录入成功"); } @@ -248,26 +251,6 @@ public class PersonTestingServiceImpl extends BaseServiceImpl> + * @describe: 接种信息列表 + * @author wangtong + * @date 2021/4/15 16:40 + * @params [params] + */ + @GetMapping("getEpidemicPage") + public Result> getEpidemicPage(@RequestParam Map params) { + // 按人员录入时间倒序排列 + PageData page = epidemicUserInfoService.getEpidemicPageV2(params); + return new Result>().ok(page); + } + + @GetMapping("getinfo/{id}") + public Result getinfo(@PathVariable("id") String id) { + VaccinationInfoResultV2DTO data = epidemicUserInfoService.getInfoV2(id); + return new Result().ok(data); + } +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java index faa1cce..5458f60 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java @@ -6,7 +6,9 @@ import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordDetailDTO; import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordListDTO; import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTO; import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO; +import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultV2DTO; import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO; +import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO; import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -71,12 +73,12 @@ public interface EpidemicUserInfoDao extends BaseDao { EpidemicUserInfoEntity selectByIdCard(@Param("id") Long id); /** - * @describe: 根据身份证号查询信息 - * @author wangtong - * @date 2021/8/21 16:15 - * @params [idCard] - * @return com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity - */ + * @return com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity + * @describe: 根据身份证号查询信息 + * @author wangtong + * @date 2021/8/21 16:15 + * @params [idCard] + */ EpidemicUserInfoEntity selectInfoByIdCard(@Param("idCard") String idCard); /** @@ -97,6 +99,15 @@ public interface EpidemicUserInfoDao extends BaseDao { */ List getEpidemicPage(Map params); + /** + * @return List + * @describe: 接种信息列表 + * @author rongchao + * @date 2021/8/30 + * @params params + */ + List getEpidemicPageV2(Map params); + /** * 查询接种信息 * @@ -107,6 +118,15 @@ public interface EpidemicUserInfoDao extends BaseDao { */ VaccinationInfoResultDTO selectInfo(Long id); + /** + * @return VaccinationInfoResultDTO + * @describe: 查询接种信息 + * @author rongchao + * @date 2021/8/31 + * @params id + */ + VaccinationInfoResultV2DTO selectInfoV2(String id); + /** * 查询异类接种信息 * diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTOV2.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTOV2.java new file mode 100644 index 0000000..98e390e --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTOV2.java @@ -0,0 +1,82 @@ +package com.elink.esua.epdc.vaccine.epidemic.dto; + +// import io.swagger.annotations.ApiModel; +// import io.swagger.annotations.ApiModelProperty; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 疫情防控信息表 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2021-01-26 + */ +@Data +// @ApiModel(value = "疫情防控信息表") +public class EpidemicUserInfoDTOV2 implements Serializable { + private static final long serialVersionUID = 1L; + + // @ApiModelProperty(value = "主键") + private String id; + + // @ApiModelProperty(value = "姓名") + private String userName; + + // @ApiModelProperty(value = "身份证号") + private String idCard; + + // @ApiModelProperty(value = "户籍地code") + private String householdRegisterCode; + + // @ApiModelProperty(value = "户籍地名称") + private String householdRegisterName; + + // @ApiModelProperty(value = "户籍地详细地址") + private String householdRegisterDetail; + + // @ApiModelProperty(value = "乐观锁") + private Integer revision; + + // @ApiModelProperty(value = "创建人") + private String createdBy; + + // @ApiModelProperty(value = "创建时间") + private Date createdTime; + + // @ApiModelProperty(value = "更新人") + private String updatedBy; + + // @ApiModelProperty(value = "更新时间") + private Date updatedTime; + + // @ApiModelProperty(value = "逻辑删除标识") + private String delFlag; + + // @ApiModelProperty(value = "接种次数") + private Integer vaccinationNum; + + // @ApiModelProperty(value = "接种状态") + private Integer vaccinationState; + + // @ApiModelProperty(value = "是否接种") + private String isInoculate; + + private Integer maxDose; + + /** + * 县内居住地名称 + */ + private String liveAddressName; + /** + * 社区/村庄 + */ + private String community; + /** + * 网格名称 + */ + private String gridName; +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/result/EpidemicPageResultV2DTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/result/EpidemicPageResultV2DTO.java new file mode 100644 index 0000000..79e3732 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/result/EpidemicPageResultV2DTO.java @@ -0,0 +1,66 @@ +package com.elink.esua.epdc.vaccine.epidemic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author rongchao + * @since 2021/8/31 + */ +@Data +public class EpidemicPageResultV2DTO implements Serializable { + /** + * + */ + private String id; + /** + * 姓名 + */ + private String residentsName; + /** + * 性别 + */ + private String residentsSex; + /** + * 手机号 + */ + private String residentsPhone; + /** + * 身份证号 + */ + private String residentsIdentityNo; + /** + * + */ + private String residentsNation; + /** + * 户籍 + */ + private String householdRegistrationPlace; + /** + * + */ + private String helpStatus; + + /** + * 出生年月 + */ + private String residentsBirthday; + /** + * + */ + private String familyCategory; + /** + * 疫苗接种状态 + */ + private String vaccinationState; + /** + * 疫苗接种次数 + */ + private String vaccinationNum; + /** + * 房屋地址 + */ + private String houseAddress; +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/result/VaccinationInfoResultV2DTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/result/VaccinationInfoResultV2DTO.java new file mode 100644 index 0000000..526bd53 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/result/VaccinationInfoResultV2DTO.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.vaccine.epidemic.dto.result; + +// import io.swagger.annotations.ApiModel; +// import io.swagger.annotations.ApiModelProperty; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 接种信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2021-04-16 + */ +@Data +public class VaccinationInfoResultV2DTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String id; + private String residentsName; + private String residentsIdentityNo; + private String residentsPhone; + private String residentsSex; + private String residentsBirthday; + private Integer vaccinationNum; + private String vaccinationState; + private String companyId; + private String siteId; + private Integer dose; + private String batchNo; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java index 1deedfd..dce5649 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java @@ -9,9 +9,12 @@ import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordListDTO; import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicReportUserInfoDTO; import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTO; import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO; +import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultV2DTO; import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO; +import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO; import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoV2DTO; import java.util.List; import java.util.Map; @@ -100,6 +103,15 @@ public interface EpidemicUserInfoService extends CrudService getEpidemicPage(Map params); + /** + * @return PageData + * @describe: 接种信息列表 + * @author rongchao + * @date 2021/8/30 + * @params params + */ + PageData getEpidemicPageV2(Map params); + /** * 查询接种信息 * @@ -110,6 +122,15 @@ public interface EpidemicUserInfoService extends CrudService getEpiPageV2(Map params) { + //分页参数 + long curPage = 1; + long limit = 10; + + if (params.get(Constant.PAGE) != null) { + curPage = Long.parseLong((String) params.get(Constant.PAGE)); + } + if (params.get(Constant.LIMIT) != null) { + limit = Long.parseLong((String) params.get(Constant.LIMIT)); + } + + //分页对象 + Page page = new Page<>(curPage, limit); + + //分页参数 + params.put(Constant.PAGE, page); + + return page; + } + @Override public PageData getEpidemicPage(Map params) { IPage page = getEpiPage(params); @@ -473,6 +504,21 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl(list, page.getTotal()); } + @Override + public PageData getEpidemicPageV2(Map params) { + IPage page = getEpiPageV2(params); + + UserDetail user = SecurityUser.getUser(); + if (user == null) { + throw new RenException("用户未登录"); + } + Map authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId()); + params.putAll(authParams); + + List list = baseDao.getEpidemicPageV2(params); + return new PageData<>(list, page.getTotal()); + } + @Override public VaccinationInfoResultDTO getInfo(Long id) { VaccinationInfoResultDTO dto = baseDao.selectInfo(id); @@ -489,6 +535,12 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl>().ok(page); } + @GetMapping("pageV2") + public Result> pageV2(@RequestParam Map params) { + PageData page = populationInformationService.listPageV2(params); + return new Result>().ok(page); + } + @GetMapping("{id}") public Result get(@PathVariable("id") String id) { PopulationInformationDTO populationInformationDTOS = populationInformationService.get(id); @@ -89,6 +97,19 @@ public class PopulationInformationController { return populationInformationService.save(dto); } + @PutMapping("updatePopulationInformation") + public Result updatePopulationInformation(@RequestBody PopulationInformationDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + PopulationInformationEntity entity = new PopulationInformationEntity(); + BeanUtils.copyProperties(dto, entity); + boolean success = populationInformationService.updateById(entity); + if (success) { + return new Result(); + } + return new Result().error(); + } + @PutMapping public Result update(@RequestBody PopulationInformationDTO dto) { //效验数据 diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java index 3a398ee..73fff0f 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.dto.house.PopulationInformationDTO; import com.elink.esua.epdc.dto.house.form.*; import com.elink.esua.epdc.dto.house.result.*; import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTO; +import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTOV2; import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -54,7 +55,7 @@ public interface PopulationInformationDao extends BaseDao selectListByIdentityNos(@Param("residentsIdentityNos") List residentsIdentityNos); + List selectListByIdentityNos(@Param("residentsIdentityNos") List residentsIdentityNos); /** * @return com.elink.esua.epdc.dto.PopulationInformationDTO @@ -74,6 +75,15 @@ public interface PopulationInformationDao extends BaseDao selectListOfPopulationInformationDTO(Map params); + /** + * @return List + * @describe: + * @author rongchao + * @date 2021/8/28 + * @params params + */ + List selectListOfPopulationInformationDTOV2(Map params); + /** * @return java.util.List * @Description 人口信息详细列表 @@ -244,4 +254,6 @@ public interface PopulationInformationDao extends BaseDao + * @Description 人口信息列表 * @Author songyunpeng - * @Date 2020/8/25 + * @Date 2020/8/25 * @Param [params] - * @return com.elink.esua.epdc.commons.tools.page.PageData **/ PageData listPage(Map params); + /** - * @Description 获取机动车列表信息 + * @return PageData + * @describe: 人口信息列表 + * @author rongchao + * @date 2021/8/28 + * @params params + */ + PageData listPageV2(Map params); + + /** + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Description 获取机动车列表信息 * @Author songyunpeng - * @Date 2020/8/26 + * @Date 2020/8/26 * @Param [params] - * @return com.elink.esua.epdc.commons.tools.page.PageData **/ PageData motorVehiclePage(Map params); /** - * @Description 获取机动车列表信息 --导出查询 + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Description 获取机动车列表信息 --导出查询 * @Author songyunpeng - * @Date 2020/8/26 + * @Date 2020/8/26 * @Param [params] - * @return com.elink.esua.epdc.commons.tools.page.PageData **/ List motorVehicleList(Map params); + /** - * @Description 获取居民信息采集总览数据 + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + * @Description 获取居民信息采集总览数据 * @Author songyunpeng - * @Date 2020/8/28 + * @Date 2020/8/28 * @Param [] - * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO **/ PopulationInfoOverviewDTO getPopulationInfoOverview(); + /** - * @Description 获取居民信息采集总览 + * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO + * @Description 获取居民信息采集总览 * @Author songyunpeng - * @Date 2021/6/23 + * @Date 2021/6/23 * @Param [communityId] - * @return com.elink.esua.epdc.dto.PopulationInfoOverviewDTO **/ PopulationInfoOverviewDTO getPopulationInfoOverviewForScreen(String communityId); + /** - * @Description 清空入党时间 + * @return void + * @Description 清空入党时间 * @Author songyunpeng - * @Date 2020/9/4 + * @Date 2020/9/4 * @Param [id] - * @return void **/ void setJionTimeToNull(String id); + /** - * @Description 清空失业登记时间 + * @return void + * @Description 清空失业登记时间 * @Author songyunpeng - * @Date 2020/9/4 + * @Date 2020/9/4 * @Param [id] - * @return void **/ void setUnemploymentRegisterTimeToNull(String id); + /** - * @Description 大屏找人接口 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Description 大屏找人接口 * @Author songyunpeng - * @Date 2020/9/14 + * @Date 2020/9/14 * @Param [epdcScreenSelectPeopleFormDTO] - * @return com.elink.esua.epdc.commons.tools.utils.Result> **/ PageData selectPeople(EpdcScreenSelectPeopleFormDTO epdcScreenSelectPeopleFormDTO); + /** - * @Description 大屏找人详情接口 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 大屏找人详情接口 * @Author songyunpeng - * @Date 2020/9/14 + * @Date 2020/9/14 * @Param [dto] - * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto); + /** - * @Description 房屋用途数据接口 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 房屋用途数据接口 * @Author songyunpeng - * @Date 2020/9/15 + * @Date 2020/9/15 * @Param [] - * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result housingUse(); + /** - * @Description 网格排名 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 网格排名 * @Author songyunpeng - * @Date 2020/9/15 + * @Date 2020/9/15 * @Param [dto] - * @return com.elink.esua.epdc.commons.tools.utils.Result **/ PageData gridRanking(EpdcScreenGridRankingFormDTO dto); + /** - * @Description 一人找房接口 + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Description 一人找房接口 * @Author songyunpeng - * @Date 2020/9/19 + * @Date 2020/9/19 * @Param [dto] - * @return com.elink.esua.epdc.commons.tools.page.PageData **/ PageData selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); + /** - * @Description 以房找人接口 + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Description 以房找人接口 * @Author songyunpeng - * @Date 2020/9/19 + * @Date 2020/9/19 * @Param [dto] - * @return com.elink.esua.epdc.commons.tools.page.PageData **/ PageData selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); + /** - * @Description 以城找人 + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @Description 以城找人 * @Author songyunpeng - * @Date 2020/9/19 + * @Date 2020/9/19 * @Param [dto] - * @return com.elink.esua.epdc.commons.tools.page.PageData **/ PageData selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); /** + * @return java.util.List * @Description 以城找人 - pc * @Author songyunpeng - * @Date 2021/1/4 + * @Date 2021/1/4 * @Param [params] - * @return java.util.List **/ List selectPeopleByCurrentAddressForPc(Map params); + /** * 以城找人 - pc导出 * @@ -243,12 +270,23 @@ public interface PopulationInformationService extends BaseService selectPeopleByCurrentAddressExportList(Map params); + /** + * @return java.util.List * @Description 以城找人 - pc - count * @Author songyunpeng - * @Date 2021/1/4 + * @Date 2021/1/4 * @Param [params] - * @return java.util.List **/ Integer selectCountPeopleByCurrentAddressForPc(Map params); + + /** + * @return Result + * @describe: + * @author rongchao + * @date 2021/8/31 + * @params dto + * @params methodFlag + */ + Result updateVaccinationInfo(VaccinationInfoV2DTO dto, boolean methodFlag); } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java index 20184d6..14d7075 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java @@ -450,7 +450,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl(list, page.getTotal()); } + @Override + public PageData listPageV2(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfPopulationInformationDTOV2(params); + return new PageData<>(list, page.getTotal()); + } + @Override public PageData motorVehiclePage(Map params) { IPage page = getPage(params); @@ -583,4 +596,60 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl 0) { + // 如果还有接种记录那么就是接种中 + // 虽然更新接种剂次为最大值-1,但实际上不一定能查到最大值-1条数据,数据不对应时需要补录 + entity.setVaccinationNum(dose - 1); + entity.setVaccinationState(1); + } else { + // 如果库里没有接种记录了,直接归为未接种,数据需要补录 + entity.setVaccinationNum(0); + entity.setVaccinationState(0); + } + + } + int successNum = baseDao.updateById(entity); + if (successNum == 0) { + return new Result(); + } else { + return new Result().error(); + } + } } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/v2/VaccinationInfoV2Controller.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/v2/VaccinationInfoV2Controller.java new file mode 100644 index 0000000..ab1f0ee --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/controller/v2/VaccinationInfoV2Controller.java @@ -0,0 +1,50 @@ +package com.elink.esua.epdc.vaccine.vim.controller.v2; + +import com.elink.esua.epdc.commons.api.version.ApiVersion; +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoV2DTO; +import com.elink.esua.epdc.vaccine.vim.dto.result.EpdcAppVimInfoResultDTO; +import com.elink.esua.epdc.vaccine.vim.excel.VaccinationInfoExcel; +import com.elink.esua.epdc.vaccine.vim.service.VaccinationInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 接种信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2021-04-16 + */ +@ApiVersion(2) +@RestController +@RequestMapping("vaccinationinfo" + Constant.VERSION_CONTROL) +public class VaccinationInfoV2Controller { + @Autowired + private VaccinationInfoService vaccinationInfoService; + + + @PostMapping + @LogOperation("保存") + public Result save(@RequestBody VaccinationInfoV2DTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + return vaccinationInfoService.saveNewV2(dto); + } +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationInfoDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationInfoDao.java index 80847c3..51919b2 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationInfoDao.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationInfoDao.java @@ -2,6 +2,7 @@ package com.elink.esua.epdc.vaccine.vim.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoV2DTO; import com.elink.esua.epdc.vaccine.vim.dto.result.EpdcAppVimInfoResultDTO; import com.elink.esua.epdc.vaccine.vim.entity.VaccinationInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -39,6 +40,16 @@ public interface VaccinationInfoDao extends BaseDao { */ List checkVaccination(VaccinationInfoDTO dto); + /** + * 检验接种情况 + * + * @param dto + * @return java.util.List + * @author zhy + * @date 2021/4/22 18:35 + */ + List checkVaccinationV2(VaccinationInfoV2DTO dto); + /** * 查询地址为空的记录 * diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationInfoV2DTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationInfoV2DTO.java new file mode 100644 index 0000000..54628cd --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dto/VaccinationInfoV2DTO.java @@ -0,0 +1,110 @@ +package com.elink.esua.epdc.vaccine.vim.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 接种信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 2021-04-16 + */ +@Data +// @ApiModel(value = "接种信息") +public class VaccinationInfoV2DTO implements Serializable { + private static final long serialVersionUID = 1L; + + // @ApiModelProperty(value = "ID") + private String id; + + // @ApiModelProperty(value = "真实姓名") + private String residentsName; + + // @ApiModelProperty(value = "身份证号") + private String residentsIdentityNo; + + // @ApiModelProperty(value = "手机号") + private String residentsPhone; + + // @ApiModelProperty(value = "性别(女性-0,男性-1)") + private String sex; + + // @ApiModelProperty(value = "接种人县/区") + private String county; + + // @ApiModelProperty(value = "接种人街道/乡镇") + private String street; + + // @ApiModelProperty(value = "接种人街道/乡镇ID") + private String streetId; + + // @ApiModelProperty(value = "接种人社区/村") + private String community; + + // @ApiModelProperty(value = "接种人网格") + private String grid; + + // @ApiModelProperty(value = "小区名称") + private String villageName; + + // @ApiModelProperty(value = "住处(楼栋-单元-房间)") + private String dwellingPlace; + + // @ApiModelProperty(value = "接种时间") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private String vaccinationTime; + + // @ApiModelProperty(value = "接种时年龄") + private Integer age; + + // @ApiModelProperty(value = "剂次,第几针") + private Integer dose; + + private Integer maxDose; + + // @ApiModelProperty(value = "疫苗种类id") + private Long vaccineId; + + // @ApiModelProperty(value = "生产企业id") + private Long companyId; + private String company; + + // @ApiModelProperty(value = "接种单位/地点ID") + private Long siteId; + private String site; + + // @ApiModelProperty(value = "疫苗生成批次、批号") + private String batchNo; + + // @ApiModelProperty(value = "接种状态") + private Integer vaccinationState; + + // @ApiModelProperty(value = "删除标识 0:未删除,1:已删除") + private String delFlag; + + // @ApiModelProperty(value = "乐观锁") + private Integer revision; + + // @ApiModelProperty(value = "创建人") + private String createdBy; + + // @ApiModelProperty(value = "创建时间") + private Date createdTime; + + // @ApiModelProperty(value = "更新人") + private String updatedBy; + + // @ApiModelProperty(value = "更新时间") + private Date updatedTime; + + // @ApiModelProperty(value = "创建人姓名") + private String creatorName; + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationInfoService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationInfoService.java index 0be039b..2d8e558 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationInfoService.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/VaccinationInfoService.java @@ -4,6 +4,7 @@ package com.elink.esua.epdc.vaccine.vim.service; import com.elink.esua.epdc.commons.mybatis.service.CrudService; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; +import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoV2DTO; import com.elink.esua.epdc.vaccine.vim.dto.result.EpdcAppVimInfoResultDTO; import com.elink.esua.epdc.vaccine.vim.entity.VaccinationInfoEntity; import org.springframework.web.multipart.MultipartFile; @@ -29,6 +30,15 @@ public interface VaccinationInfoService extends CrudService checkVaccination(VaccinationInfoDTO dto); + /** + * @return List + * @describe: 检验接种情况 + * @author rongchao + * @date 2021/8/31 + * @params dto + */ + List checkVaccinationV2(VaccinationInfoV2DTO dto); + /** * 获取接种信息 * @@ -59,6 +69,15 @@ public interface VaccinationInfoService extends CrudService checkVaccinationV2(VaccinationInfoV2DTO dto) { + return baseDao.checkVaccinationV2(dto); + } + @Override public boolean beforeDelete(VaccinationInfoDTO dto) { VaccinationInfoDTO checkDto = new VaccinationInfoDTO(); @@ -155,6 +165,24 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl updateList = Lists.newArrayList(); -// List existUserList = epidemicUserInfoDao.selectByIdCards(idCards); - List existUserList = populationInformationDao.selectListByIdentityNos(idCards); - for (EpidemicUserInfoDTO item : existUserList) { + List existUserList = populationInformationDao.selectListByIdentityNos(idCards); + for (EpidemicUserInfoDTOV2 item : existUserList) { if (null == item) { continue; } @@ -246,7 +272,6 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl UPDATE epidemic_user_info set DEL_FLAG = '1' - WHERE - ID_CARD = #{idCard} + WHERE ID_CARD = #{idCard} UPDATE epidemic_user_info @@ -30,7 +29,7 @@ ,VACCINATION_STATE = #{vaccinationState} WHERE - ID_CARD = #{idCard} + ID_CARD = #{idCard} + + + + + + + + UPDATE epidemic_user_info + SET age = IFNULL( + ( + YEAR (now()) - IFNULL(substring (ID_CARD, 7, 4), 0) + ), + 0 + ) + WHERE DEL_FLAG = '0' + AND ID_CARD IS NOT NULL + AND REVISION = '0' + AND LENGTH(ID_CARD) = 18 + + + + + - - - - - - - - UPDATE epidemic_user_info - SET age = IFNULL( + - select * from epidemic_user_info - where ID_CARD=#{idCard} - and del_flag='0' + select + id, + MAX(DOSE) DOSE, + COMPANY_ID, + SITE_ID, + BATCH_NO, + IDENTITY_NO + from + vaccination_info + group by + IDENTITY_NO) + + t on + i.RESIDENTS_IDENTITY_NO = t.IDENTITY_NO + where + i.DEL_FLAG = '0' + and i.id = #{id} diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml index cf6093c..d32814b 100644 --- a/epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml @@ -145,6 +145,90 @@ group by t.ID order by t.CREATED_TIME desc + + + @@ -662,7 +746,7 @@ + UPDATE epdc_population_information diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml index 9842da5..419a201 100644 --- a/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml @@ -90,6 +90,19 @@ v.CREATED_TIME DESC + +