Browse Source

人口信息和房屋信息迁移

origin/epidemic_user
荣超 4 years ago
parent
commit
67b5e41ef8
  1. 2
      epdc-cloud-client-yushan
  2. 2
      epdc-cloud-commons-yushan
  3. 2
      epdc-cloud-custom/pom.xml
  4. 56
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/config/StreamUtils.java
  5. 3
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorInfoService.java
  6. 2
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java
  7. 3
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/EnterpriseInfoService.java
  8. 4
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/enterprise/service/impl/EnterpriseInfoServiceImpl.java
  9. 1
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/PersonTestingController.java
  10. 127
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/v2/PersonTestingV2Controller.java
  11. 9
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/PersonTestingService.java
  12. 3
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/EpidemicSentryPostServiceImpl.java
  13. 140
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java
  14. 2
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateDeptService.java
  15. 2
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateDeptServiceImpl.java
  16. 14
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/feign/AdminFeignClient.java
  17. 7
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java
  18. 4
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java
  19. 37
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java
  20. 1
      epdc-cloud-custom/src/main/resources/application.yml
  21. 2
      epdc-cloud-parent-yushan
  22. 12
      epdc-cloud-vim-yushan/pom.xml
  23. 2
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoDTO.java
  24. 56
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java
  25. 36
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/fallback/VimAdminFeignClientFallback.java
  26. 94
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseBusinessInfoController.java
  27. 94
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseRentInfoController.java
  28. 93
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HouseResidentController.java
  29. 283
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/HousingInformationController.java
  30. 241
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/controller/PopulationInformationController.java
  31. 44
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseBusinessInfoDao.java
  32. 33
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseRentInfoDao.java
  33. 61
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseResidentDao.java
  34. 93
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HousingInformationDao.java
  35. 247
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/PopulationInformationDao.java
  36. 63
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseBusinessInfoEntity.java
  37. 58
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseRentInfoEntity.java
  38. 62
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HouseResidentEntity.java
  39. 104
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/HousingInformationEntity.java
  40. 220
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/entity/PopulationInformationEntity.java
  41. 156
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExcel.java
  42. 163
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExportExcel.java
  43. 53
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExcel.java
  44. 56
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExportExcel.java
  45. 44
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/EpdcScreenResidentInfoByCurrentAddressExcel.java
  46. 50
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/FamilyInformationExcel.java
  47. 54
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseBusinessInfoExcel.java
  48. 68
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseRentInfoExcel.java
  49. 68
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HouseResidentExcel.java
  50. 93
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/HousingInformationExcel.java
  51. 164
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationInformationExcel.java
  52. 43
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/PopulationMotorVehicleExcel.java
  53. 47
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseBusinessInfoRedis.java
  54. 47
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseRentInfoRedis.java
  55. 47
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HouseResidentRedis.java
  56. 47
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/HousingInformationRedis.java
  57. 47
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/redis/PopulationInformationRedis.java
  58. 112
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseBusinessInfoService.java
  59. 104
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseRentInfoService.java
  60. 121
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HouseResidentService.java
  61. 149
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/HousingInformationService.java
  62. 254
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/PopulationInformationService.java
  63. 120
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseBusinessInfoServiceImpl.java
  64. 116
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseRentInfoServiceImpl.java
  65. 380
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HouseResidentServiceImpl.java
  66. 1318
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java
  67. 585
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/PopulationInformationServiceImpl.java
  68. 43
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/enums/VaccinationStateEnum.java
  69. 466
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java
  70. BIN
      epdc-cloud-vim-yushan/src/main/resources/excel/居民信息录入模板.xls
  71. 46
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseBusinessInfoDao.xml
  72. 21
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseRentInfoDao.xml
  73. 65
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml
  74. 201
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/HousingInformationDao.xml
  75. 696
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml

2
epdc-cloud-client-yushan

@ -1 +1 @@
Subproject commit a87f857cb65f7fc7a32937c714ae520c79f3a67c
Subproject commit 8c5f912270a32bf7cf695349c0681fb6198e2e5e

2
epdc-cloud-commons-yushan

@ -1 +1 @@
Subproject commit 235f56d5ea756317efe54c5e0d4be0ac45e09155
Subproject commit 72b0a4547c75aa6788dcd05749994bc094a38010

2
epdc-cloud-custom/pom.xml

@ -179,7 +179,7 @@
<spring.datasource.druid.username>yushan_epdc_test</spring.datasource.druid.username>
<spring.datasource.druid.password>elink-epdc@yushan</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>115.29.142.202:8848</nacos.server-addr>
<nacos.ip></nacos.ip>
<nacos.namespace>8831513c-2f72-42e8-899f-eb6c2c5ae110</nacos.namespace>

56
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/config/StreamUtils.java

@ -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();
}
}
}

3
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;

2
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;

3
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;

4
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;

1
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 {

127
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<PersonTestingPageDTO>> page(@RequestParam Map<String, Object> params) {
PageData<PersonTestingPageDTO> page = personTestingService.page(params);
return new Result<PageData<PersonTestingPageDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PersonTestingDTO> get(@PathVariable("id") String id) {
PersonTestingDTO data = personTestingService.get(id);
return new Result<PersonTestingDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<PersonTestingPageDTO> 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);
}
}

9
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/PersonTestingService.java

@ -105,6 +105,15 @@ public interface PersonTestingService extends BaseService<PersonTestingEntity> {
*/
Result saveScanningInfo(PersonTestingDTO dto);
/**
* @describe: 读卡器录入数据V2
* @author rongchao
* @date 2021/8/26
* @params dto
* @return Result
*/
Result saveScanningInfoV2(PersonTestingDTO dto);
/**
* @describe: 通过身份证号码查询手机号
* @author wangtong

3
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;

140
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<PersonTestingDao,
@Autowired
private EpidemicUserInoutRecordDao epidemicUserInoutRecordDao;
@Autowired
private PopulationInformationDao populationInformationDao;
@Override
public PageData<PersonTestingPageDTO> page(Map<String, Object> params) {
@ -85,8 +91,8 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
return ConvertUtils.sourceToTarget(entityList, PersonTestingDTO.class);
}
private QueryWrapper<PersonTestingEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<PersonTestingEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<PersonTestingEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -106,39 +112,40 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
PersonTestingEntity entity = ConvertUtils.sourceToTarget(dto, PersonTestingEntity.class);
String bir = getBirthday(entity.getIdcard());
entity.setBirthday(format.parse( bir ));
entity.setBirthday(format.parse(bir));
insert(entity);
}
/**
* 获取出生日期 yyyy年MM月dd日
*
* @param IDCard
* @return
*/
public static String getBirthday(String IDCard){
String birthday="";
String year="";
String month="";
String day="";
if (StringUtils.isNotBlank(IDCard)){
public static String getBirthday(String IDCard) {
String birthday = "";
String year = "";
String month = "";
String day = "";
if (StringUtils.isNotBlank(IDCard)) {
//15位身份证号
if (IDCard.length() == 15){
if (IDCard.length() == 15) {
// 身份证上的年份(15位身份证为1980年前的)
year = "19" + IDCard.substring(6, 8);
//身份证上的月份
month = IDCard.substring(8, 10);
//身份证上的日期
day= IDCard.substring(10, 12);
day = IDCard.substring(10, 12);
//18位身份证号
}else if(IDCard.length() == 18){
} else if (IDCard.length() == 18) {
// 身份证上的年份
year = IDCard.substring(6).substring(0, 4);
// 身份证上的月份
month = IDCard.substring(10).substring(0, 2);
//身份证上的日期
day=IDCard.substring(12).substring(0,2);
day = IDCard.substring(12).substring(0, 2);
}
birthday=year+"-"+month+"-"+day;
birthday = year + "-" + month + "-" + day;
}
return birthday;
}
@ -165,13 +172,35 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
dto.setTestingTime(date);
saveScanningInfoForUser(dto);
UploadFormDTO form = new UploadFormDTO();
form.setBase64String("data:image/png;base64,"+dto.getImgCode());
form.setBase64String("data:image/png;base64," + dto.getImgCode());
PersonTestingEntity entity = ConvertUtils.sourceToTarget(dto, PersonTestingEntity.class);
Result<String> 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<String> 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<PersonTestingDao,
public Result getMobileByIdCard(PersonTestingDTO dto) {
String result = epidemicUserInoutRecordDao.getMobileByIdCard(dto.getIdcard());
if(StringUtils.isBlank(result)){
if (StringUtils.isBlank(result)) {
result = baseDao.getMobileByIdCard(dto.getIdcard());
}
return new Result().ok(result);
}
/**
* @describe: 匹配到更新人员的核酸检测状态和最后一次核酸检测时间匹配不到用户新增一条人员信息
* @author wangtong
* @date 2021/8/21 15:12
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
private Result saveScanningInfoForUser(PersonTestingDTO dto){
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @describe: 匹配到更新人员的核酸检测状态和最后一次核酸检测时间匹配不到用户新增一条人员信息
* @author wangtong
* @date 2021/8/21 15:12
* @params [dto]
*/
private Result saveScanningInfoForUser(PersonTestingDTO dto) {
EpidemicUserInfoEntity en = epidemicUserInfoDao.selectInfoByIdCard(dto.getIdcard());
if(en != null){
if (en != null) {
en.setCheckDate(dto.getTestingTime());
en.setCheckState("0");
epidemicUserInfoDao.updateById(en);
}else{
} else {
EpidemicUserInfoEntity entity = new EpidemicUserInfoEntity();
entity.setUserName(dto.getName());
entity.setGender(dto.getSex());
@ -221,11 +249,59 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
}
/**
*根据生日计算年龄
* dateStr 这样格式的生日 1990-01-01
* @return void
* @describe: 匹配到更新人员的核酸检测状态和最后一次核酸检测时间匹配不到用户新增一条人员信息
* @author rongchao
* @date 2021/8/26
* @params dto
*/
private void saveScanningInfoForUserV2(PersonTestingDTO dto) {
PopulationInformationEntity en = populationInformationDao.getInfoByIdentityNo(dto.getIdcard());
if (en != null) {
en.setCheckDate(dto.getTestingTime());
en.setCheckState("0");
populationInformationDao.updateById(en);
} else {
PopulationInformationEntity entity = new PopulationInformationEntity();
personTestingDTO2EpidemicUserInfoEntityTransfor(dto, entity);
populationInformationDao.insert(entity);
}
}
/**
* @return String
* @describe: 性别翻译器
* @author rongchao
* @date 2021/8/26
* @params flag
*/
private String sexTransfor(String flag) {
if ("男".equals(flag)) {
return UserSexEnum.MALE.sex();
} else if ("女".equals(flag)) {
return UserSexEnum.FEMALE.sex();
} else {
return UserSexEnum.UNKNOWN_SEX.sex();
}
}
private void personTestingDTO2EpidemicUserInfoEntityTransfor(PersonTestingDTO sDto, PopulationInformationEntity dDto) {
dDto.setResidentsName(sDto.getName());
dDto.setResidentsSex(sexTransfor(sDto.getSex()));
dDto.setResidentsNation(sDto.getNation());
dDto.setCurrentAddress(sDto.getAddress());
dDto.setResidentsBirthday(sDto.getBirthday());
dDto.setResidentsIdentityNo(sDto.getIdcard());
dDto.setCheckDate(sDto.getTestingTime());
dDto.setCheckState("0");
}
/**
* 根据生日计算年龄
* dateStr 这样格式的生日 1990-01-01
*/
public int getAgeByDateString(String dateStr) {
public int getAgeByDateString(String dateStr) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
Date birthday = simpleDateFormat.parse(dateStr);
@ -236,7 +312,7 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
}
public int getAgeByDate(Date birthday) {
public int getAgeByDate(Date birthday) {
Calendar calendar = Calendar.getInstance();
//calendar.before()有的点bug

2
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateDeptService.java

@ -22,7 +22,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.evaluate.result.EvaluateDeptCountResultDTO;
import com.elink.esua.epdc.dto.evaluate.EvaluateDeptDTO;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateDeptEntity;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;

2
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateDeptServiceImpl.java

@ -29,7 +29,7 @@ import com.elink.esua.epdc.modules.evaluate.dao.EvaluateDeptDao;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateDeptEntity;
import com.elink.esua.epdc.modules.evaluate.redis.EvaluateDeptRedis;
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 org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

14
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/feign/AdminFeignClient.java

@ -3,10 +3,14 @@ package com.elink.esua.epdc.modules.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.modules.feign.fallback.AdminFeignClientFallback;
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;
@ -39,4 +43,14 @@ public interface AdminFeignClient {
*/
@GetMapping("/sys/dept/getParentAndAllDept/{deptId}")
Result<ParentAndAllDeptDTO> getParentAndAllDept(@PathVariable("deptId") String deptId);
/**
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.SysPopulationSimpleDictDTO>>
* @Description 获取多个字典值列表
* @Author songyunpeng
* @Date 2020/8/31
* @Param [sysPopulationSimpleDictFormDTO]
**/
@PostMapping("sys/dict/listPopulationSimple")
Result<List<SysPopulationSimpleDictDTO>> listPopulationSimple(@RequestBody SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO);
}

7
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<ParentAndAllDeptDTO> getParentAndAllDept(String depId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId);
}
@Override
public Result<List<SysPopulationSimpleDictDTO>> listPopulationSimple(SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listPopulationSimple", sysPopulationSimpleDictFormDTO);
}
}

4
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消息

37
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java

@ -1,37 +0,0 @@
package com.elink.esua.epdc.rocketmq.dto;
import lombok.Data;
import java.io.Serializable;
/**
*
* 组织机构信息修改-接收MQ消息DTO
*
* @Authorliuchuang
* @Date2020/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;
}

1
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:

2
epdc-cloud-parent-yushan

@ -1 +1 @@
Subproject commit db9213163f8005cba05ad21334bebb72484174b7
Subproject commit 6c53fd985cbaae46046a44a2d84f1eb9bff86a9d

12
epdc-cloud-vim-yushan/pom.xml

@ -43,6 +43,18 @@
<version>4.4.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.esua.epdc.yushan</groupId>
<artifactId>epdc-cloud-custom-client</artifactId>
<version>${epdc-cloud-client.version}</version>
</dependency>
<dependency>
<groupId>com.esua.epdc.yushan</groupId>
<artifactId>epdc-cloud-admin-client</artifactId>
<version>${epdc-cloud-client.version}</version>
</dependency>
</dependencies>

2
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;

56
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<java.util.List < java.lang.Long>>
* @author yujintao
* @date 2019/9/5 14:49
*/
@GetMapping("/sys/dept/listGridId/{pid}")
Result<List<Long>> listGridIdByDeptPid(@PathVariable("pid") Long pid);
/**
* 根据部门ID获取上级所有部门信息
*
* @param deptId
* @return com.elink.esua.epdc.commons.tools.utils.Result<ParentAndAllDeptDTO>
* @author gp
* @date 2019-11-29
*/
@GetMapping("/sys/dept/getParentAndAllDept/{deptId}")
Result<ParentAndAllDeptDTO> getParentAndAllDept(@PathVariable("deptId") String deptId);
/**
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.SysPopulationSimpleDictDTO>>
* @Description 获取多个字典值列表
* @Author songyunpeng
* @Date 2020/8/31
* @Param [sysPopulationSimpleDictFormDTO]
**/
@PostMapping("sys/dict/listPopulationSimple")
Result<List<SysPopulationSimpleDictDTO>> listPopulationSimple(@RequestBody SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO);
}

36
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<List<Long>> listGridIdByDeptPid(Long pid) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listGridIdByDeptPid", pid);
}
@Override
public Result<ParentAndAllDeptDTO> getParentAndAllDept(String depId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId);
}
@Override
public Result<List<SysPopulationSimpleDictDTO>> listPopulationSimple(SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listPopulationSimple", sysPopulationSimpleDictFormDTO);
}
}

94
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<HouseBusinessInfoDTO>> page(@RequestParam Map<String, Object> params) {
PageData<HouseBusinessInfoDTO> page = houseBusinessInfoService.listPage(params);
return new Result<PageData<HouseBusinessInfoDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<HouseBusinessInfoDTO> get(@PathVariable("id") String id) {
HouseBusinessInfoDTO data = houseBusinessInfoService.get(id);
return new Result<HouseBusinessInfoDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<HouseBusinessInfoDTO> list = houseBusinessInfoService.list(params);
ExcelUtils.exportExcelToTarget(response, "经营信息", list, HouseBusinessInfoExcel.class);
}
}

94
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<HouseRentInfoDTO>> page(@RequestParam Map<String, Object> params){
PageData<HouseRentInfoDTO> page = houseRentInfoService.page(params);
return new Result<PageData<HouseRentInfoDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<HouseRentInfoDTO> get(@PathVariable("id") String id){
HouseRentInfoDTO data = houseRentInfoService.get(id);
return new Result<HouseRentInfoDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<HouseRentInfoDTO> list = houseRentInfoService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, HouseRentInfoExcel.class);
}
}

93
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<PopulationInformationDTO>> page(@RequestParam Map<String, Object> params){
PageData<PopulationInformationDTO> page = houseResidentService.listPage(params);
return new Result<PageData<PopulationInformationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PopulationInformationDTO> get(@PathVariable("id") String id){
PopulationInformationDTO data = houseResidentService.get(id);
return new Result<PopulationInformationDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<HouseResidentDTO> list = houseResidentService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, HouseResidentExcel.class);
}
}

283
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<HousingInformationDTO>> page(@RequestParam Map<String, Object> params){
PageData<HousingInformationDTO> page = housingInformationService.listOfPage(params);
return new Result<PageData<HousingInformationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<HousingInformationDTO> get(@PathVariable("id") String id){
HousingInformationDTO data = housingInformationService.get(id);
return new Result<HousingInformationDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
//查询房屋和人口信息
List<BasePopulationInformationExportDto> basePopulationInformationExcelList = housingInformationService.selectBasePopulationInformationExcelList(params);
List<Class<?>> classes = new ArrayList<>(2);
classes.add(BasePopulationInformationExportExcel.class);
classes.add(BaseResidentInformationExportExcel.class);
List<String> 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<String> 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<List<SysPopulationSimpleDictDTO>> listResult = adminFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO);
if (listResult == null || !listResult.success()) {
throw new RenException("获取字典失败!");
}
List<SysPopulationSimpleDictDTO> 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<SysSimpleDictDTO> 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<BasePopulationInformationExportDto> basePopulationInformationExcelListWithHouseHead = new ArrayList<>(basePopulationInformationExcelList);
//先去除没有户主的房屋
basePopulationInformationExcelListWithHouseHead.removeIf(basePopulationInformationExportDto -> StringUtils.isBlank(basePopulationInformationExportDto.getId()));
Map<String,List<BasePopulationInformationExportDto>> baseMap = basePopulationInformationExcelListWithHouseHead.stream().collect(Collectors.groupingBy(BasePopulationInformationExportDto::getId));
//获取所有的户主ID
Set<String> houseHeadIds = baseMap.keySet();
List<BaseResidentInformationExportDto> 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<SysPopulationSimpleDictDTO> 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<SysSimpleDictDTO> 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<? extends Object> 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();
}
}

241
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<PopulationInformationDTO>> page(@RequestParam Map<String, Object> params) {
PageData<PopulationInformationDTO> page = populationInformationService.listPage(params);
return new Result<PageData<PopulationInformationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PopulationInformationDTO> get(@PathVariable("id") String id) {
PopulationInformationDTO populationInformationDTOS = populationInformationService.get(id);
return new Result<PopulationInformationDTO>().ok(populationInformationDTOS);
}
@GetMapping("getHouseHeadInfo")
public Result<PopulationInformationDTO> getHouseHeadInfo(String id) {
PopulationInformationDTO data = populationInformationService.getHouseHeadInfo(id);
return new Result<PopulationInformationDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<PopulationInformationDTO> 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<com.elink.esua.epdc.commons.tools.page.PageData < com.elink.esua.epdc.dto.PopulationInformationDTO>>
* @Description 获取机动车信息列表
* @Author songyunpeng
* @Date 2020/8/26
* @Param [params]
**/
@GetMapping("motorVehicle/page")
public Result<PageData<PopulationInformationDTO>> motorVehiclePage(@RequestParam Map<String, Object> params) {
PageData<PopulationInformationDTO> page = populationInformationService.motorVehiclePage(params);
return new Result<PageData<PopulationInformationDTO>>().ok(page);
}
/**
* @return void
* @Description 机动车信息列表导出
* @Author songyunpeng
* @Date 2020/8/26
* @Param [params, response]
**/
@GetMapping("motorVehicle/export")
public void motorVehicleExport(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PopulationInformationDTO> list = populationInformationService.motorVehicleList(params);
//处理机动车类型
//获取字典信息
SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO = new SysPopulationSimpleDictFormDTO();
List<String> dicTypes = new ArrayList<>();
Collections.addAll(dicTypes, PopulationDictConstant.MOTOR_VEHICLE_CATEGORY);
sysPopulationSimpleDictFormDTO.setDicTypes(dicTypes);
Result<List<SysPopulationSimpleDictDTO>> listResult = adminFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO);
if (listResult == null || !listResult.success()) {
throw new RenException("获取字典失败!");
}
List<SysPopulationSimpleDictDTO> 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<SysSimpleDictDTO> 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<String, Object> params, HttpServletResponse response) throws Exception {
List<PopulationInformationDTO> 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<com.elink.esua.epdc.commons.tools.page.PageData < com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>>
* @Description 以城找人
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
**/
@GetMapping("selectPeopleByCurrentAddress")
public Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> selectPeopleByCurrentAddress(@RequestParam Map<String, Object> params) {
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> pointDeptStatisticsResultDTOS = populationInformationService.selectPeopleByCurrentAddressForPc(params);
Integer total = populationInformationService.selectCountPeopleByCurrentAddressForPc(params);
PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO> page = new PageData<>(pointDeptStatisticsResultDTOS, total);
return new Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>>().ok(page);
}
/**
* @return void
* @Description 以城找人 - 导出
* @Author songyunpeng
* @Date 2020/8/28
* @Param [params, response]
**/
@GetMapping("selectPeopleByCurrentAddress/export")
public void selectPeopleByCurrentAddressExport(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> pointDeptStatisticsResultDTOS = populationInformationService.selectPeopleByCurrentAddressExportList(params);
ExcelUtils.exportExcelToTarget(response, "居民信息", pointDeptStatisticsResultDTOS, EpdcScreenResidentInfoByCurrentAddressExcel.class);
}
}

44
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseBusinessInfoEntity> {
/**
* @return java.util.List<com.elink.esua.epdc.dto.HouseBusinessInfoDTO>
* @Description 前端列表
* @Author songyunpeng
* @Date 2020/8/26
* @Param [params]
**/
List<HouseBusinessInfoDTO> selectHouseBusinessInfoDTO(Map<String, Object> params);
}

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseRentInfoEntity> {
}

61
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseResidentEntity> {
/**
* @Description 根据户主ID查询居住人信息
* @Author songyunpeng
* @Date 2020/8/21
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.PopulationInformationDTO>
**/
List<PopulationInformationDTO> selectListOfPopulationInformationDTO(Map<String, Object> 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);
}

93
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HousingInformationEntity> {
/**
* @return java.util.List<com.elink.esua.epdc.dto.HousingInformationDTO>
* @Description 前端分页查询
* @Author songyunpeng
* @Date 2020/8/19
* @Param [params]
**/
List<HousingInformationDTO> selectListOfHousingInformationDTO(Map<String, Object> params);
/**
* @return com.elink.esua.epdc.dto.HousingInformationDTO
* @Description 根据ID和房屋使用方式查询详情
* @Author songyunpeng
* @Date 2020/8/19
* @Param [params]
**/
HousingInformationDTO selectByIdAndUsed(Map<String, Object> params);
/**
* @return java.util.List<com.elink.esua.epdc.excel.BasePopulationInformationExcel>
* @Description 查询导出的 房屋信息和户主信息
* @Author songyunpeng
* @Date 2020/9/1
* @Param [params]
**/
List<BasePopulationInformationExportDto> selectBasePopulationInformationExcelList(Map<String, Object> params);
/**
* @return java.util.List<com.elink.esua.epdc.dto.BaseResidentInformationExportDto>
* @Description 根据户主ID列表获取居住人信息
* @Author songyunpeng
* @Date 2020/9/1
* @Param [houseHeadIds]
**/
List<BaseResidentInformationExportDto> selectBaseResidentInformationExcelList(@Param("houseHeadIds") Set<String> houseHeadIds);
/**
* @return java.util.List<com.elink.esua.epdc.dto.HousingInformationDTO>
* @Description 根据户主ID获取所有房子信息
* @Author songyunpeng
* @Date 2020/9/14
* @Param [houseHeadId]
**/
List<HousingInformationDTO> getHouseInfoByHouseHeadID(String houseHeadId);
/**
* @return java.util.List<com.elink.esua.epdc.dto.VolunteerInfoDTO>
* @Description 查询需要修改的组织机构信息
* @Author songyunpeng
* @Date 2020/11/24
* @Param [toString]
**/
List<HousingInformationDTO> selectListOfOrganizationInfo(String deptId);
}

247
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PopulationInformationEntity> {
/**
* @return com.elink.esua.epdc.dto.PopulationInformationDTO
* @Description 根据身份证信息获取人口信息
* @Author songyunpeng
* @Date 2020/8/21
* @Param [residentsIdentityNo]
**/
PopulationInformationEntity getInfoByIdentityNo(@Param("residentsIdentityNo") String residentsIdentityNo);
/**
* @return List<EpidemicUserInfoDTO>
* @describe: 根据居民多个身份证信息获取相关人口信息
* @author rongchao
* @date 2021/8/27
* @params residentsIdentityNos
*/
List<EpidemicUserInfoDTO> selectListByIdentityNos(@Param("residentsIdentityNos") List<String> 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<com.elink.esua.epdc.dto.PopulationInformationDTO>
* @Description 人口信息列表
* @Author songyunpeng
* @Date 2020/8/25
* @Param [params]
**/
List<PopulationInformationDTO> selectListOfPopulationInformationDTO(Map<String, Object> params);
/**
* @return java.util.List<com.elink.esua.epdc.dto.PopulationInformationDTO>
* @Description 人口信息详细列表
* @Author songyunpeng
* @Date 2020/8/25
* @Param [params]
**/
PopulationInformationDTO selectDetailOfPopulationInformationDTO(@Param("id") String id);
/**
* @return java.util.List<com.elink.esua.epdc.dto.PopulationInformationDTO>
* @Description 获取机动车列表信息
* @Author songyunpeng
* @Date 2020/8/26
* @Param [params]
**/
List<PopulationInformationDTO> motorVehiclePage(Map<String, Object> 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<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>
* @Description 大屏找人接口
* @Author songyunpeng
* @Date 2020/9/14
* @Param [dto]
**/
List<EpdcScreenSelectPeopleResultDTO> selectListPeople(EpdcScreenSelectPeopleFormDTO dto);
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>
* @Description 大屏找人接口 - count
* @Author songyunpeng
* @Date 2020/9/14
* @Param [dto]
**/
Integer selectCountListPeople(EpdcScreenSelectPeopleFormDTO dto);
/**
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseUseResultDTO>
* @Description 房屋用途数据接口
* @Author songyunpeng
* @Date 2020/9/15
* @Param []
**/
EpdcScreenHouseUseResultDTO selectHouseUseDataForScreen();
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO>
* @Description 网格排名
* @Author songyunpeng
* @Date 2020/9/15
* @Param [dto]
**/
List<EpdcScreenGridRankingResultDTO> selectListGridRanking(EpdcScreenGridRankingFormDTO dto);
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO>
* @Description 网格排名 count
* @Author songyunpeng
* @Date 2020/9/15
* @Param [dto]
**/
Integer selectCountListGridRanking(EpdcScreenGridRankingFormDTO dto);
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO>
* @Description 一人找房接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
**/
List<EpdcScreenHouseInfoByPeopleResultDTO> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseInfoByPeopleResultDTO>
* @Description 一人找房接口 - count
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
**/
Integer selectCountHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>
* @Description 以房找人
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
**/
List<EpdcScreenPopulationInfoByHouseResultDTO> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>
* @Description 以房找人 - count
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
**/
Integer selectCountPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO>
* @Description 以城找人
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
**/
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> 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<com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO>
* @Description 以城找人 - 导出
* @Author songyunpeng
* @Date 2021/1/5
* @Param [params]
**/
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddressExportList(Map<String, Object> params);
/**
* @return void
* @describe:
* @author rongchao
* @date 2021/8/28
* @params entity
*/
void updatePersonInfo(PopulationInformationEntity entity);
}

63
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

58
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

62
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

220
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

156
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

163
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

53
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

56
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

44
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;
}

50
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

54
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

68
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

68
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

93
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

164
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

43
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

112
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseBusinessInfoEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<HouseBusinessInfoDTO>
* @author generator
* @date 2020-08-19
*/
PageData<HouseBusinessInfoDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<HouseBusinessInfoDTO>
* @author generator
* @date 2020-08-19
*/
List<HouseBusinessInfoDTO> list(Map<String, Object> 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<com.elink.esua.epdc.dto.HouseBusinessInfoDTO>
**/
PageData<HouseBusinessInfoDTO> listPage(Map<String, Object> params);
}

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseRentInfoEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<HouseRentInfoDTO>
* @author generator
* @date 2020-08-19
*/
PageData<HouseRentInfoDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<HouseRentInfoDTO>
* @author generator
* @date 2020-08-19
*/
List<HouseRentInfoDTO> list(Map<String, Object> 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);
}

121
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseResidentEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<HouseResidentDTO>
* @author generator
* @date 2020-08-19
*/
PageData<HouseResidentDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<HouseResidentDTO>
* @author generator
* @date 2020-08-19
*/
List<HouseResidentDTO> list(Map<String, Object> 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<com.elink.esua.epdc.dto.HouseResidentDTO>
**/
PageData<PopulationInformationDTO> listPage(Map<String, Object> 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);
}

149
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HousingInformationEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<HousingInformationDTO>
* @author generator
* @date 2020-08-19
*/
PageData<HousingInformationDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<HousingInformationDTO>
* @author generator
* @date 2020-08-19
*/
List<HousingInformationDTO> list(Map<String, Object> 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<com.elink.esua.epdc.dto.HousingInformationDTO>
**/
PageData<HousingInformationDTO> listOfPage(Map<String, Object> 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<com.elink.esua.epdc.excel.BasePopulationInformationExcel>
**/
List<BasePopulationInformationExportDto> selectBasePopulationInformationExcelList(Map<String, Object> params);
/**
* @Description 根据户主ID列表获取居住人信息
* @Author songyunpeng
* @Date 2020/9/1
* @Param [houseHeadIds]
* @return java.util.List<com.elink.esua.epdc.dto.BaseResidentInformationExportDto>
**/
List<BaseResidentInformationExportDto> selectBaseResidentInformationExcelList(Set<String> houseHeadIds);
/**
* @Description 根据户主ID获取所有房子信息
* @Author songyunpeng
* @Date 2020/9/14
* @Param [populationId]
* @return java.util.List<com.elink.esua.epdc.dto.HousingInformationDTO>
**/
List<HousingInformationDTO> getHouseInfoByHouseHeadID(String houseHeadId);
/**
* @Description 房屋信息修改组织结构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

254
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PopulationInformationEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PopulationInformationDTO>
* @author generator
* @date 2020-08-19
*/
PageData<PopulationInformationDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PopulationInformationDTO>
* @author generator
* @date 2020-08-19
*/
List<PopulationInformationDTO> list(Map<String, Object> 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<com.elink.esua.epdc.dto.PopulationInformationDTO>
**/
PageData<PopulationInformationDTO> listPage(Map<String, Object> params);
/**
* @Description 获取机动车列表信息
* @Author songyunpeng
* @Date 2020/8/26
* @Param [params]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.PopulationInformationDTO>
**/
PageData<PopulationInformationDTO> motorVehiclePage(Map<String, Object> params);
/**
* @Description 获取机动车列表信息 --导出查询
* @Author songyunpeng
* @Date 2020/8/26
* @Param [params]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.PopulationInformationDTO>
**/
List<PopulationInformationDTO> motorVehicleList(Map<String, Object> 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<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>>
**/
PageData<EpdcScreenSelectPeopleResultDTO> selectPeople(EpdcScreenSelectPeopleFormDTO epdcScreenSelectPeopleFormDTO);
/**
* @Description 大屏找人详情接口
* @Author songyunpeng
* @Date 2020/9/14
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleDetailResultDTO>
**/
Result<EpdcScreenSelectPeopleDetailResultDTO> selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto);
/**
* @Description 房屋用途数据接口
* @Author songyunpeng
* @Date 2020/9/15
* @Param []
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenHouseUseResultDTO>
**/
Result<EpdcScreenHouseUseResultDTO> housingUse();
/**
* @Description 网格排名
* @Author songyunpeng
* @Date 2020/9/15
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcScreenGridRankingResultDTO>
**/
PageData<EpdcScreenGridRankingResultDTO> gridRanking(EpdcScreenGridRankingFormDTO dto);
/**
* @Description 一人找房接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenSelectPeopleResultDTO>
**/
PageData<EpdcScreenHouseInfoByPeopleResultDTO> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @Description 以房找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenPopulationInfoByHouseResultDTO>
**/
PageData<EpdcScreenPopulationInfoByHouseResultDTO> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @Description 以城找人
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.form.EpdcScreenResidentInfoByCurrentAddressFormDTO>
**/
PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto);
/**
* @Description 以城找人 - pc
* @Author songyunpeng
* @Date 2021/1/4
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO>
**/
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddressForPc(Map<String, Object> params);
/**
* 以城找人 - pc导出
*
* @param params
* @return java.util.List<PopulationInformationDTO>
* @author generator
* @date 2020-08-19
*/
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddressExportList(Map<String, Object> params);
/**
* @Description 以城找人 - pc - count
* @Author songyunpeng
* @Date 2021/1/4
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO>
**/
Integer selectCountPeopleByCurrentAddressForPc(Map<String, Object> params);
}

120
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseBusinessInfoDao, HouseBusinessInfoEntity> implements HouseBusinessInfoService {
@Autowired
private HouseBusinessInfoRedis houseBusinessInfoRedis;
@Override
public PageData<HouseBusinessInfoDTO> page(Map<String, Object> params) {
IPage<HouseBusinessInfoEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, HouseBusinessInfoDTO.class);
}
@Override
public List<HouseBusinessInfoDTO> list(Map<String, Object> params) {
return baseDao.selectHouseBusinessInfoDTO(params);
}
private QueryWrapper<HouseBusinessInfoEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<HouseBusinessInfoEntity> 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<String,Object> params = new HashMap<>();
params.put("HOUSE_ID", houseID);
List<HouseBusinessInfoEntity> houseBusinessInfoEntities = baseDao.selectByMap(params);
if(houseBusinessInfoEntities.size()>0){
return houseBusinessInfoEntities.get(0);
}
return null;
}
@Override
public PageData<HouseBusinessInfoDTO> listPage(Map<String, Object> params) {
IPage<HouseBusinessInfoDTO> page = getPage(params);
List<HouseBusinessInfoDTO> list = baseDao.selectHouseBusinessInfoDTO(params);
return new PageData<>(list, page.getTotal()); }
}

116
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseRentInfoDao, HouseRentInfoEntity> implements HouseRentInfoService {
@Autowired
private HouseRentInfoRedis houseRentInfoRedis;
@Override
public PageData<HouseRentInfoDTO> page(Map<String, Object> params) {
IPage<HouseRentInfoEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, HouseRentInfoDTO.class);
}
@Override
public List<HouseRentInfoDTO> list(Map<String, Object> params) {
List<HouseRentInfoEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, HouseRentInfoDTO.class);
}
private QueryWrapper<HouseRentInfoEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<HouseRentInfoEntity> 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<String,Object> params = new HashMap<>();
params.put("HOUSE_ID", houseID);
List<HouseRentInfoEntity> houseRentInfoEntities = baseDao.selectByMap(params);
if(houseRentInfoEntities!=null && houseRentInfoEntities.size()>0){
return houseRentInfoEntities.get(0);
}
return null;
}
}

380
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<HouseResidentDao, HouseResidentEntity> implements HouseResidentService {
@Autowired
private HouseResidentRedis houseResidentRedis;
@Autowired
private PopulationInformationService populationInformationService;
@Autowired
private HousingInformationService housingInformationService;
@Autowired
private HouseResidentDao houseResidentDao;
@Override
public PageData<HouseResidentDTO> page(Map<String, Object> params) {
IPage<HouseResidentEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, HouseResidentDTO.class);
}
@Override
public List<HouseResidentDTO> list(Map<String, Object> params) {
List<HouseResidentEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, HouseResidentDTO.class);
}
private QueryWrapper<HouseResidentEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<HouseResidentEntity> 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<String,Object> params = new HashMap<>();
params.put("RESIDENT_ID",entity.getResidentId());
params.put("IS_HOUSE_HEAD","0");
List<HouseResidentEntity> 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<String,Object> params = new HashMap<>();
//当前表单身份证对应的人口ID
params.put("RESIDENT_ID",populationInformationEntity.getId());
//当前表单房屋ID
params.put("HOUSE_ID",dto.getHouseId());
params.put("IS_HOUSE_HEAD","0");
List<HouseResidentEntity> 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<String,Object> oldParams = new HashMap<>();
oldParams.put("RESIDENT_ID",entity.getResidentId());
oldParams.put("IS_HOUSE_HEAD","0");
List<HouseResidentEntity> 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<PopulationInformationDTO> listPage(Map<String, Object> params) {
IPage<PopulationInformationDTO> 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<PopulationInformationDTO> 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();
}
}

1318
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java

File diff suppressed because it is too large

585
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PopulationInformationDao, PopulationInformationEntity> 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<PopulationInformationDTO> page(Map<String, Object> params) {
IPage<PopulationInformationEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PopulationInformationDTO.class);
}
@Override
public List<PopulationInformationDTO> list(Map<String, Object> params) {
return baseDao.selectListOfPopulationInformationDTO(params);
}
private QueryWrapper<PopulationInformationEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<PopulationInformationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
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<String, Object> params = new HashMap<>();
params.put("RESIDENT_ID", infoByIdentityNo.getId());
List<HouseResidentEntity> 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<String, Object> params = new HashMap<>();
params.put("RESIDENT_ID", infoByIdentityNo.getId());
List<HouseResidentEntity> 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<PopulationInformationDTO> listPage(Map<String, Object> params) {
IPage<PopulationInformationDTO> page = getPage(params);
List<PopulationInformationDTO> list = baseDao.selectListOfPopulationInformationDTO(params);
return new PageData<>(list, page.getTotal());
}
@Override
public PageData<PopulationInformationDTO> motorVehiclePage(Map<String, Object> params) {
IPage<PopulationInformationDTO> page = getPage(params);
List<PopulationInformationDTO> list = baseDao.motorVehiclePage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<PopulationInformationDTO> motorVehicleList(Map<String, Object> 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<EpdcScreenSelectPeopleResultDTO> selectPeople(EpdcScreenSelectPeopleFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenSelectPeopleResultDTO> list = baseDao.selectListPeople(dto);
return new PageData<>(list, baseDao.selectCountListPeople(dto));
}
@Override
public Result<EpdcScreenSelectPeopleDetailResultDTO> selectPeopleDetail(EpdcScreenSelectPeopleDetailFormDTO dto) {
EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO = new EpdcScreenSelectPeopleDetailResultDTO();
//根据身份标识寻找对应人员信息
if (PopulationIdentify.HOUSE_HEAD.equals(dto.getIdentifyFlag())) {
if (StringUtils.isBlank(dto.getPopulationId())) {
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询产权人信息失败:人口ID为空");
}
//根据户主ID组装信息
setHouseHeadInfo(dto.getPopulationId(), epdcScreenSelectPeopleDetailResultDTO);
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().ok(epdcScreenSelectPeopleDetailResultDTO);
} else if (PopulationIdentify.HOUSE_RESIDENT.equals(dto.getIdentifyFlag())) {
if (StringUtils.isBlank(dto.getPopulationId())) {
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询居住人信息失败:人口ID为空");
}
//查找居住人对应的户主细腻
Map<String, Object> params = new HashMap<>();
params.put("RESIDENT_ID", dto.getPopulationId());
List<HouseResidentEntity> houseResidentEntityList = houseResidentDao.selectByMap(params);
if (houseResidentEntityList == null || houseResidentEntityList.size() == 0) {
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("根据居住人查询户主失败");
}
HouseResidentEntity houseResidentEntity = houseResidentEntityList.get(0);
//根据户主ID组装信息
setHouseHeadInfo(houseResidentEntity.getHouseHeadId(), epdcScreenSelectPeopleDetailResultDTO);
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().ok(epdcScreenSelectPeopleDetailResultDTO);
}
return new Result<EpdcScreenSelectPeopleDetailResultDTO>().error("查询错误:身份标识参数无法匹配");
}
private void setHouseHeadInfo(String houseHeadId, EpdcScreenSelectPeopleDetailResultDTO epdcScreenSelectPeopleDetailResultDTO) {
//如果是户主,人口信息从人口表拿
PopulationInformationEntity populationInformationEntity = this.selectById(houseHeadId);
epdcScreenSelectPeopleDetailResultDTO.setName(populationInformationEntity.getResidentsName());
epdcScreenSelectPeopleDetailResultDTO.setSex("0".equals(populationInformationEntity.getResidentsSex()) ? "女" : "男");
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<String> 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<List<SysPopulationSimpleDictDTO>> listResult = adminFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO);
if (listResult == null || !listResult.success()) {
throw new RenException("获取字典失败!");
}
List<SysPopulationSimpleDictDTO> 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<HousingInformationDTO> housingInformationDTOList = housingInformationService.getHouseInfoByHouseHeadID(houseHeadId);
List<HousingInfo> housingInfoList = ConvertUtils.sourceToTarget(housingInformationDTOList, HousingInfo.class);
housingInfoList.forEach(housingInfo -> {
setHouseUse(housingInfo.getHouseUse(), housingInfo);
});
epdcScreenSelectPeopleDetailResultDTO.setHousingInfo(housingInfoList);
//居住人信息
List<FamilyMember> familyMemberList = new ArrayList<>();
Set<String> houseHeadIds = new HashSet<>(1);
houseHeadIds.add(houseHeadId);
List<BaseResidentInformationExportDto> baseResidentInformationExportDtos = housingInformationService.selectBaseResidentInformationExcelList(houseHeadIds);
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<? extends Object> 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<SysPopulationSimpleDictDTO> 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<SysSimpleDictDTO> 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<EpdcScreenHouseUseResultDTO> 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<EpdcScreenHouseUseResultDTO>().ok(epdcScreenHouseUseResultDTO);
}
@Override
public PageData<EpdcScreenGridRankingResultDTO> gridRanking(EpdcScreenGridRankingFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenGridRankingResultDTO> list = baseDao.selectListGridRanking(dto);
return new PageData<>(list, baseDao.selectCountListGridRanking(dto));
}
@Override
public PageData<EpdcScreenHouseInfoByPeopleResultDTO> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenHouseInfoByPeopleResultDTO> list = baseDao.selectHouseByPeople(dto);
return new PageData<>(list, baseDao.selectCountHouseByPeople(dto));
}
@Override
public PageData<EpdcScreenPopulationInfoByHouseResultDTO> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenPopulationInfoByHouseResultDTO> list = baseDao.selectPeopleByHouse(dto);
return new PageData<>(list, baseDao.selectCountPeopleByHouse(dto));
}
@Override
public PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcScreenResidentInfoByCurrentAddressResultDTO> list = baseDao.selectPeopleByCurrentAddress(dto);
return new PageData<>(list, baseDao.selectCountPeopleByCurrentAddress(dto));
}
@Override
public List<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddressForPc(Map<String, Object> 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<EpdcScreenResidentInfoByCurrentAddressResultDTO> selectPeopleByCurrentAddressExportList(Map<String, Object> params) {
return baseDao.selectPeopleByCurrentAddressExportList(params);
}
@Override
public Integer selectCountPeopleByCurrentAddressForPc(Map<String, Object> 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;
}
}
}

43
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.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
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;
}
}

466
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<Vaccinati
@Autowired
private VaccinationErrorService vaccinationErrorService;
@Autowired
public VaccinationUserRoleService vaccinationUserRoleService;
@Resource
private VaccinationUserRoleService vaccinationUserRoleService;
@Autowired
private VaccinationErrorDao vaccinationErrorDao;
@Resource
@Autowired
private EpidemicUserInfoDao epidemicUserInfoDao;
@Resource
@Autowired
private EpidemicUserInoutRecordDao epidemicUserInoutRecordDao;
@Autowired
private PopulationInformationDao populationInformationDao;
@Override
public QueryWrapper<VaccinationInfoEntity> getWrapper(Map<String, Object> params) {
@ -196,231 +204,287 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati
/**
* 批量导入
*
* @param file
* @return Result
* @author wanggongfeng
* @date 2021-01-21
* @return boolean
* @describe: 更新疫情人员信息
* @author rongchao
* @date 2021/8/27
* @params addressList
* @params maxDoseMap
*/
@Override
@Transactional
public Result importManualScoreExcel(MultipartFile file) {
log.info("进入Excel数据导入");
File f = StreamUtils.conversionFile(file);
try {
//判断上传文件类型
String originalFilename = file.getOriginalFilename();
if (originalFilename != null && !originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2003) && !originalFilename.endsWith(StrConstant.EXCEL_SUFFIX_2007)) {
return new Result().error("请选择.xls或者.xlsx格式文件");
}
// 判断导入文件是否为空
List<VaccinationInfoAllExcel> recordList = ExcelImportUtil.importExcel(f, VaccinationInfoAllExcel.class, new ImportParams());
if (CollUtil.isEmpty(recordList)) {
return new Result().error("导入内容不能为空");
private boolean updateEpidemicUserInfo(List<EpidemicUserInoutRecordEntity> addressList, Map<String, EpidemicUserInfoDTO> maxDoseMap) {
List<String> idCards = new ArrayList<>(maxDoseMap.keySet());
if (!idCards.isEmpty()) {
addressList = epidemicUserInoutRecordDao.getAddressInfo(idCards);
List<EpidemicUserInfoDTO> updateList = Lists.newArrayList();
// List<EpidemicUserInfoDTO> existUserList = epidemicUserInfoDao.selectByIdCards(idCards);
List<EpidemicUserInfoDTO> 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<Long> deleteIdCardArr = new ArrayList<>();
// 存储批量插入实体
List<VaccinationInfoAllExcel> addList = new ArrayList<>();
// 存储错误数据批量插入实体
List<VaccinationInfoAllExcel> addErrorList = new ArrayList<>();
// 记录单人最高剂次
Map<String, EpidemicUserInfoDTO> maxDoseMap = new HashMap<>();
// 检查重复数据,对旧数据进行覆盖
List<VaccinationInfoEntity> checkList;
/**
* 批量插入错误数据
*
* @return boolean
* @describe:
* @author rongchao
* @date 2021/8/26
* @params
*/
private boolean insertBatchVaccinationErrors(List<VaccinationInfoAllExcel> addErrorList) {
if (!addErrorList.isEmpty()) {
List<VaccinationErrorEntity> 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<VaccinationInfoAllExcel> addList, List<EpidemicUserInoutRecordEntity> addressList, List<Long> deleteIdCardArr) {
// 对历史数据根据身份证号进行逻辑删除// 对历史数据根据身份证号进行逻辑删除
if (!deleteIdCardArr.isEmpty()) {
baseDao.deleteDistinctDose(deleteIdCardArr);
}
log.info("已删除用户数量:" + deleteIdCardArr.size());
// 插入接种数据
if (!addList.isEmpty()) {
List<VaccinationInfoEntity> insertUserList = ConvertUtils.sourceToTarget(addList, VaccinationInfoEntity.class);
List<EpidemicUserInoutRecordEntity> finalAddressList = addressList;
insertUserList.forEach(entity -> {
entity.setIdentityNo(entity.getIdentityNo().toUpperCase());
Optional<EpidemicUserInoutRecordEntity> 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<VaccineDto> companyList = vaccineCompanyService.compantyList();
List<VaccineDto> siteList = vaccinationSiteService.getSiteList();
// 校验疫苗生产商
String companyName;
// 校验疫苗接种点
String siteName;
private List<VaccinationInfoAllExcel> 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<VaccinationInfoAllExcel> recordList = ExcelImportUtil.importExcel(f, VaccinationInfoAllExcel.class, new ImportParams());
if (CollUtil.isEmpty(recordList)) {
throw new RenException("导入内容不能为空");
}
return recordList;
}
List<EpidemicUserInfoEntity> allUserList = epidemicUserInfoDao.selectAllUserInfo(null);
List<String> 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<Long> deleteIdCardArr,
List<VaccinationInfoAllExcel> addList,
List<VaccinationInfoAllExcel> addErrorList,
Map<String, EpidemicUserInfoDTO> maxDoseMap) {
//校验excel数据并返回excel行数据
List<VaccinationInfoAllExcel> recordList = validatorExcelFile(file);
List<VaccineDto> companyList = vaccineCompanyService.compantyList();
List<VaccineDto> siteList = vaccinationSiteService.getSiteList();
VaccinationInfoAllExcel epidemicReportUserInfoAllExcel;
VaccinationInfoDTO vaccinationInfoDTO;
VaccineDto vimCompanyOrSiteByExcel;
String excelIdCard;
Integer excelDose;
Integer maxDose;
List<EpidemicUserInfoEntity> allUserList = epidemicUserInfoDao.selectAllUserInfo(null);
List<String> 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<String> idCards = new ArrayList<>(maxDoseMap.keySet());
List<VaccinationInfoEntity> insertUserList = new ArrayList<>();
List<EpidemicUserInfoDTO> updateList = new ArrayList<>();
List<VaccinationErrorEntity> insertErrorList = new ArrayList<>();
List<EpidemicUserInoutRecordEntity> addressList = new ArrayList<>();
EpidemicUserInfoDTO epidemicUserInfo;
String idCard;
if (!idCards.isEmpty()) {
List<EpidemicUserInfoDTO> 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<VaccinationInfoEntity> 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<EpidemicUserInoutRecordEntity> finalAddressList = addressList;
insertUserList.forEach(entity -> {
entity.setIdentityNo(entity.getIdentityNo().toUpperCase());
Optional<EpidemicUserInoutRecordEntity> 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<Long> deleteIdCardArr = Lists.newArrayList();
// 存储批量插入实体
List<VaccinationInfoAllExcel> addList = Lists.newArrayList();
// 存储错误数据批量插入实体
List<VaccinationInfoAllExcel> addErrorList = Lists.newArrayList();
// 记录单人最高剂次
Map<String, EpidemicUserInfoDTO> 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<EpidemicUserInoutRecordEntity> 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();
}

BIN
epdc-cloud-vim-yushan/src/main/resources/excel/居民信息录入模板.xls

Binary file not shown.

46
epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseBusinessInfoDao.xml

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.vaccine.house.dao.HouseBusinessInfoDao">
<resultMap type="com.elink.esua.epdc.vaccine.house.entity.HouseBusinessInfoEntity" id="houseBusinessInfoMap">
<result property="id" column="ID"/>
<result property="enterpriseName" column="ENTERPRISE_NAME"/>
<result property="socialUniformCode" column="SOCIAL_UNIFORM_CODE"/>
<result property="legalRepresentative" column="LEGAL_REPRESENTATIVE"/>
<result property="enterprisePhone" column="ENTERPRISE_PHONE"/>
<result property="houseId" column="HOUSE_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectHouseBusinessInfoDTO" resultType="com.elink.esua.epdc.dto.house.HouseBusinessInfoDTO">
select
t.ID,t.ENTERPRISE_NAME,t.SOCIAL_UNIFORM_CODE,t.LEGAL_REPRESENTATIVE,t.ENTERPRISE_PHONE,
substring_index(t1.ALL_DEPT_NAMES,'-',-1) as gridName
from epdc_house_business_info t
left join epdc_housing_information t1 on t.HOUSE_ID = t1.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0'
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},t1.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},t1.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},t1.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},t1.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (t1.grid_id = #{gridId}
OR find_in_set(#{gridId},t1.ALL_DEPT_IDS))
</if>
<if test="enterpriseName!= null and enterpriseName != '' ">and t.ENTERPRISE_NAME like concat('%',#{enterpriseName},'%') </if>
<if test="socialUniformCode != null and socialUniformCode != '' ">and t.SOCIAL_UNIFORM_CODE like concat('%',#{socialUniformCode},'%') </if>
<if test="legalRepresentative != null and legalRepresentative != '' ">and t.LEGAL_REPRESENTATIVE like concat('%',#{legalRepresentative},'%') </if>
order by t.CREATED_TIME desc
</select>
</mapper>

21
epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseRentInfoDao.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.vaccine.house.dao.HouseRentInfoDao">
<resultMap type="com.elink.esua.epdc.vaccine.house.entity.HouseRentInfoEntity" id="houseRentInfoMap">
<result property="id" column="ID"/>
<result property="tenantName" column="TENANT_NAME"/>
<result property="tenantPhone" column="TENANT_PHONE"/>
<result property="tenantIdentityNo" column="TENANT_IDENTITY_NO"/>
<result property="houseId" column="HOUSE_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

65
epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.vaccine.house.dao.HouseResidentDao">
<resultMap type="com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity" id="houseResidentMap">
<result property="id" column="ID"/>
<result property="houseId" column="HOUSE_ID"/>
<result property="residentId" column="RESIDENT_ID"/>
<result property="houseHeadRelation" column="HOUSE_HEAD_RELATION"/>
<result property="isHouseHead" column="IS_HOUSE_HEAD"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListOfPopulationInformationDTO"
resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select
t1.ID,
t.RESIDENTS_NAME,
t.RESIDENTS_SEX,
t.RESIDENTS_NATION,
t.RESIDENTS_BIRTHDAY,
t.EDUCATION_LEVEL,
t.POLITICS_STATUS,
t.RESIDENTS_IDENTITY_NO,
t.RESIDENTS_PHONE,
t.CURRENT_EMPLOYER,
t.CURRENT_ADDRESS,
t1.HOUSE_HEAD_RELATION,
t1.HOUSE_HEAD_ID
from epdc_population_information t left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '0' and t1.HOUSE_HEAD_ID = #{houseHeadId}
order by t1.CREATED_TIME desc
</select>
<select id="selectByHouseResidentId" resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select
t1.ID,
t.RESIDENTS_NAME,
t.RESIDENTS_SEX,
t.RESIDENTS_NATION,
t.RESIDENTS_BIRTHDAY,
t.EDUCATION_LEVEL,
t.POLITICS_STATUS,
t.RESIDENTS_IDENTITY_NO,
t.RESIDENTS_PHONE,
t.CURRENT_EMPLOYER,
t.CURRENT_ADDRESS,
t1.HOUSE_HEAD_RELATION,
t.ID as residentId,
t1.HOUSE_HEAD_ID
from epdc_population_information t left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '0' and t1.ID = #{id}
</select>
<select id="getHouseResidentInfoByResidentId"
resultType="com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity">
select * from epdc_house_resident where RESIDENT_ID = #{residentId} and DEL_FLAG ='0'
and IS_HOUSE_HEAD = '0' limit 1
</select>
</mapper>

201
epdc-cloud-vim-yushan/src/main/resources/mapper/house/HousingInformationDao.xml

@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.vaccine.house.dao.HousingInformationDao">
<resultMap type="com.elink.esua.epdc.vaccine.house.entity.HousingInformationEntity" id="housingInformationMap">
<result property="id" column="ID"/>
<result property="houseAddress" column="HOUSE_ADDRESS"/>
<result property="buyingTime" column="BUYING_TIME"/>
<result property="houseArea" column="HOUSE_AREA"/>
<result property="propertyOwner" column="PROPERTY_OWNER"/>
<result property="propertyOwnerIdentityNo" column="PROPERTY_OWNER_IDENTITY_NO"/>
<result property="propertyOwnerMobile" column="PROPERTY_OWNER_MOBILE"/>
<result property="houseUse" column="HOUSE_USE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="gridId" column="GRID_ID"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
</resultMap>
<select id="selectListOfHousingInformationDTO" resultType="com.elink.esua.epdc.dto.house.HousingInformationDTO">
select t.ID,
t.HOUSE_ADDRESS,
t.BUYING_TIME,
t.HOUSE_AREA,
t.PROPERTY_OWNER,
t.PROPERTY_OWNER_IDENTITY_NO,
t.PROPERTY_OWNER_CARD,
t.PROPERTY_OWNER_MOBILE,
t.HOUSE_USE,
t.DEL_FLAG,
t.REVISION,
t.CREATED_BY,
t.CREATED_TIME,
t.UPDATED_BY,
t.UPDATED_TIME,
t.GRID_ID,
t.PARENT_DEPT_IDS,
t.PARENT_DEPT_NAMES,
t.ALL_DEPT_IDS,
t.ALL_DEPT_NAMES,
SUBSTRING_INDEX(t.ALL_DEPT_NAMES, '-', -1) as gridName
from epdc_housing_information t
where DEL_FLAG = '0'
<if test="houseAddress != '' and houseAddress != null">and t.HOUSE_ADDRESS like concat('%',#{houseAddress},'%') </if>
<if test="propertyOwner != '' and propertyOwner != null">and t.PROPERTY_OWNER like concat('%',#{propertyOwner},'%')</if>
<if test="propertyOwnerMobile != '' and propertyOwnerMobile != null">and t.PROPERTY_OWNER_MOBILE like concat('%',#{propertyOwnerMobile},'%')</if>
<if test="houseUse != '' and houseUse != null">and t.HOUSE_USE = #{houseUse}</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},t.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},t.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},t.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},t.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (t.grid_id = #{gridId}
OR find_in_set(#{gridId},t.ALL_DEPT_IDS))
</if>
order by CREATED_TIME desc
</select>
<select id="selectByIdAndUsed" resultType="com.elink.esua.epdc.dto.house.HousingInformationDTO">
select t.ID,
t.HOUSE_ADDRESS,
t.BUYING_TIME,
t.HOUSE_AREA,
t.PROPERTY_OWNER,
t.PROPERTY_OWNER_IDENTITY_NO,
t.PROPERTY_OWNER_MOBILE,
t.PROPERTY_OWNER_CARD,
t.GRID_ID,
SUBSTRING_INDEX(t.ALL_DEPT_NAMES, '-', -1) as gridName,
<if test="used != '' and used != null and used == '1'.toString()">
t1.TENANT_NAME,t1.TENANT_PHONE,t1.TENANT_IDENTITY_NO,
</if>
<if test="used != '' and used != null and used == '2'.toString()">
t1.ENTERPRISE_NAME,t1.SOCIAL_UNIFORM_CODE,t1.LEGAL_REPRESENTATIVE,t1.ENTERPRISE_PHONE,
</if>
t.HOUSE_USE
from epdc_housing_information t
<if test="used != '' and used != null and used == '1'.toString()">
left join epdc_house_rent_Info t1 on t.ID = t1.HOUSE_ID and t1.DEL_FLAG = '0'
</if>
<if test="used != '' and used != null and used == '2'.toString()">
left join epdc_house_business_info t1 on t.ID = t1.HOUSE_ID and t1.DEL_FLAG = '0'
</if>
where t.DEL_FLAG ='0' and t.ID = #{id}
</select>
<select id="selectBasePopulationInformationExcelList"
resultType="com.elink.esua.epdc.dto.house.BasePopulationInformationExportDto">
select
t2.ID,
t.HOUSE_ADDRESS,
t.BUYING_TIME,
t.HOUSE_AREA,
t.PROPERTY_OWNER,
t.PROPERTY_OWNER_IDENTITY_NO,
t.PROPERTY_OWNER_MOBILE,
t.PROPERTY_OWNER_CARD,
t.HOUSE_USE,
SUBSTRING_INDEX(t.ALL_DEPT_NAMES, '-', -1) as gridName,
t3.TENANT_NAME,
t3.TENANT_PHONE,
t3.TENANT_IDENTITY_NO,
t4.ENTERPRISE_NAME,
t4.SOCIAL_UNIFORM_CODE,
t4.LEGAL_REPRESENTATIVE,
t4.ENTERPRISE_PHONE,
t2.RESIDENTS_NAME,
t2.RESIDENTS_SEX,
t2.RESIDENTS_NATION,
t2.RESIDENTS_BIRTHDAY,
t2.EDUCATION_LEVEL,
t2.POLITICS_STATUS,
t2.JOIN_TIME,
t2.ORGANIZATIONAL_RELATIONSHIP_LOCATION,
t2.RESIDENTS_IDENTITY_NO,
t2.RESIDENTS_PHONE,
t2.BODY_STATUS,
t2.MARITAL_STATUS,
t2.ACCOUNT_TYPE,
t2.MILITARY_SERVICE,
t2.HOUSEHOLD_REGISTRATION_PLACE,
t2.EMPLOYMENT_STATUS,
t2.CURRENT_EMPLOYER,
t2.CURRENT_EMPLOYER_ADDRESS,
t2.UNEMPLOYMENT_REASON,
t2.REEMPLOYMENT_PERMIT,
t2.UNEMPLOYMENT_REGISTER,
t2.UNEMPLOYMENT_REGISTER_TIME,
t2.FAMILY_CATEGORY,
t2.HELP_STATUS,
t2.MOTOR_VEHICLE_NUM,
t2.MOTOR_VEHICLE_CATEGORY,
t2.DOG_STATUS
from epdc_housing_information t
left join epdc_house_resident t1 on t1.HOUSE_ID = t.ID and t1.DEL_FLAG = '0'
left join epdc_population_information t2 on t1.RESIDENT_ID = t2.ID and t2.DEL_FLAG = '0' and t2.RESIDENTS_IDENTITY_NO != '' and t2.RESIDENTS_IDENTITY_NO is not null
left join epdc_house_rent_info t3 on t.ID = t3.HOUSE_ID and t3.DEL_FLAG = '0'
left join epdc_house_business_info t4 on t.ID = t4.HOUSE_ID and t4.DEL_FLAG = '0'
where t.DEL_FLAG = '0'
<if test="houseAddress != '' and houseAddress != null">and t.HOUSE_ADDRESS like concat('%',#{houseAddress},'%') </if>
<if test="propertyOwner != '' and propertyOwner != null">and t.PROPERTY_OWNER like concat('%',#{propertyOwner},'%')</if>
<if test="propertyOwnerMobile != '' and propertyOwnerMobile != null">and t.PROPERTY_OWNER_MOBILE like concat('%',#{propertyOwnerMobile},'%')</if>
<if test="houseUse != '' and houseUse != null">and t.HOUSE_USE = #{houseUse}</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},t.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},t.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},t.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},t.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (t.grid_id = #{gridId}
OR find_in_set(#{gridId},t.ALL_DEPT_IDS))
</if>
order by t.CREATED_TIME desc
</select>
<select id="selectBaseResidentInformationExcelList"
resultType="com.elink.esua.epdc.dto.house.BaseResidentInformationExportDto">
select t2.RESIDENTS_NAME as houseHeadName,t2.RESIDENTS_IDENTITY_NO,t1.RESIDENTS_NAME,t.HOUSE_HEAD_RELATION,t1.RESIDENTS_SEX,t1.RESIDENTS_NATION,t1.CURRENT_EMPLOYER,t1.CURRENT_ADDRESS
from epdc_house_resident t
left join epdc_population_information t1 on t.RESIDENT_ID = t1.ID
left join epdc_population_information t2 on t.HOUSE_HEAD_ID = t2.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG = '0' and t2.DEL_FLAG ='0'
and t.HOUSE_HEAD_ID in
<foreach collection="houseHeadIds" index="index" item="houseHeadId" open="(" separator="," close=")">
#{houseHeadId}
</foreach>
order by t.CREATED_TIME desc
</select>
<select id="getHouseInfoByHouseHeadID" resultType="com.elink.esua.epdc.dto.house.HousingInformationDTO">
select t.HOUSE_ADDRESS,t.HOUSE_AREA,t.HOUSE_USE,t.PROPERTY_OWNER,t.PROPERTY_OWNER_MOBILE
from epdc_housing_information t
left join epdc_house_resident t1 on t1.HOUSE_ID = t.ID and t1.DEL_FLAG = '0'
where t.DEL_FLAG ='0' and t1.RESIDENT_ID = #{houseHeadId} and t1.IS_HOUSE_HEAD = '1'
</select>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.dto.house.HousingInformationDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_housing_information
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
</mapper>

696
epdc-cloud-vim-yushan/src/main/resources/mapper/house/PopulationInformationDao.xml

@ -0,0 +1,696 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.vaccine.house.dao.PopulationInformationDao">
<resultMap type="com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity"
id="populationInformationMap">
<result property="id" column="ID"/>
<result property="residentsName" column="RESIDENTS_NAME"/>
<result property="residentsSex" column="RESIDENTS_SEX"/>
<result property="residentsNation" column="RESIDENTS_NATION"/>
<result property="residentsBirthday" column="RESIDENTS_BIRTHDAY"/>
<result property="educationLevel" column="EDUCATION_LEVEL"/>
<result property="politicsStatus" column="POLITICS_STATUS"/>
<result property="joinTime" column="JOIN_TIME"/>
<result property="organizationalRelationshipLocation" column="ORGANIZATIONAL_RELATIONSHIP_LOCATION"/>
<result property="residentsIdentityNo" column="RESIDENTS_IDENTITY_NO"/>
<result property="residentsPhone" column="RESIDENTS_PHONE"/>
<result property="bodyStatus" column="BODY_STATUS"/>
<result property="maritalStatus" column="MARITAL_STATUS"/>
<result property="accountType" column="ACCOUNT_TYPE"/>
<result property="militaryService" column="MILITARY_SERVICE"/>
<result property="householdRegistrationPlace" column="HOUSEHOLD_REGISTRATION_PLACE"/>
<result property="employmentStatus" column="EMPLOYMENT_STATUS"/>
<result property="currentEmployer" column="CURRENT_EMPLOYER"/>
<result property="currentEmployerAddress" column="CURRENT_EMPLOYER_ADDRESS"/>
<result property="unemploymentReason" column="UNEMPLOYMENT_REASON"/>
<result property="reemploymentPermit" column="REEMPLOYMENT_PERMIT"/>
<result property="unemploymentRegister" column="UNEMPLOYMENT_REGISTER"/>
<result property="unemploymentRegisterTime" column="UNEMPLOYMENT_REGISTER_TIME"/>
<result property="familyCategory" column="FAMILY_CATEGORY"/>
<result property="helpStatus" column="HELP_STATUS"/>
<result property="motorVehicleNum" column="MOTOR_VEHICLE_NUM"/>
<result property="motorVehicleCategory" column="MOTOR_VEHICLE_CATEGORY"/>
<result property="dogStatus" column="DOG_STATUS"/>
<result property="familyMemberNum" column="FAMILY_MEMBER_NUM"/>
<result property="familyMemberOutNum" column="FAMILY_MEMBER_OUT_NUM"/>
<result property="familyMemberOutReason" column="FAMILY_MEMBER_OUT_REASON"/>
<result property="familyMemberOutMonth" column="FAMILY_MEMBER_OUT_MONTH"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="setJionTimeToNull">
update epdc_population_information
set JOIN_TIME = null
where ID = #{id}
</update>
<update id="setUnemploymentRegisterTimeToNull">
update epdc_population_information
set UNEMPLOYMENT_REGISTER_TIME = null
where ID = #{id}
</update>
<select id="getInfoByIdentityNo" resultType="com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity">
select *
from epdc_population_information
where RESIDENTS_IDENTITY_NO = #{residentsIdentityNo}
and DEL_FLAG = '0' limit 1
</select>
<select id="getHouseHeadInfo" resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select t.ID,
t.RESIDENTS_NAME,
t.RESIDENTS_SEX,
t.RESIDENTS_NATION,
t.RESIDENTS_BIRTHDAY,
t.EDUCATION_LEVEL,
t.POLITICS_STATUS,
t.JOIN_TIME,
t.ORGANIZATIONAL_RELATIONSHIP_LOCATION,
t.RESIDENTS_IDENTITY_NO,
t.RESIDENTS_PHONE,
t.BODY_STATUS,
t.MARITAL_STATUS,
t.ACCOUNT_TYPE,
t.MILITARY_SERVICE,
t.HOUSEHOLD_REGISTRATION_PLACE,
t.EMPLOYMENT_STATUS,
t.CURRENT_EMPLOYER,
t.CURRENT_EMPLOYER_ADDRESS,
t.UNEMPLOYMENT_REASON,
t.REEMPLOYMENT_PERMIT,
t.UNEMPLOYMENT_REGISTER,
t.UNEMPLOYMENT_REGISTER_TIME,
t.FAMILY_CATEGORY,
t.HELP_STATUS,
t.MOTOR_VEHICLE_NUM,
t.MOTOR_VEHICLE_CATEGORY,
t.DOG_STATUS,
t.CURRENT_ADDRESS,
t1.HOUSE_ID as houseId
from epdc_population_information t
left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG = '0'
and t1.DEL_FLAG = '0'
and t1.IS_HOUSE_HEAD = '1'
and t1.HOUSE_ID = #{houseId} limit 1
</select>
<select id="selectListOfPopulationInformationDTO"
resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select
t.ID,t.RESIDENTS_NAME,t.RESIDENTS_SEX,t.RESIDENTS_PHONE,t.RESIDENTS_IDENTITY_NO,t.RESIDENTS_NATION,t.HOUSEHOLD_REGISTRATION_PLACE,
group_concat(DISTINCT substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as
gridNames,t.HELP_STATUS,t.FAMILY_CATEGORY,group_concat(t2.HOUSE_ADDRESS) as houseAddress,
CASE t.VACCINATION_STATE
WHEN 0 THEN '未接种'
WHEN 1 THEN '接种中'
WHEN 2 THEN '接种完成'
ELSE '' END VACCINATION_STATE,
CASE t.CHECK_STATE
WHEN 0 THEN '已检测'
WHEN 1 THEN '未检测'
ELSE '' END CHECK_STATE,
t.CHECK_DATE
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID
left join epdc_housing_information t2 on t1.HOUSE_ID = t2.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t2.DEL_FLAG ='0' and t.RESIDENTS_IDENTITY_NO is not null and
t.RESIDENTS_IDENTITY_NO != ''
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},t2.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},t2.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},t2.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},t2.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (t2.grid_id = #{gridId}
OR find_in_set(#{gridId},t2.ALL_DEPT_IDS))
</if>
<if test="residentsName != '' and residentsName != null">and t.RESIDENTS_NAME like
concat('%',#{residentsName},'%')
</if>
<if test="residentsPhone != '' and residentsPhone != null">and t.RESIDENTS_PHONE like
concat('%',#{residentsPhone},'%')
</if>
<if test="residentsIdentityNo != '' and residentsIdentityNo != null">and t.RESIDENTS_IDENTITY_NO like
concat('%',#{residentsIdentityNo},'%')
</if>
<if test="familyCategory != '' and familyCategory != null">and FAMILY_CATEGORY = #{familyCategory}</if>
<if test="helpStatus != '' and helpStatus != null">and HELP_STATUS = #{helpStatus}</if>
group by t.ID
order by t.CREATED_TIME desc
</select>
<resultMap type="com.elink.esua.epdc.dto.house.PopulationInformationDTO" id="populationInformationMap2">
<result property="id" column="ID"/>
<result property="residentsName" column="RESIDENTS_NAME"/>
<result property="residentsSex" column="RESIDENTS_SEX"/>
<result property="residentsNation" column="RESIDENTS_NATION"/>
<result property="residentsIdentityNo" column="RESIDENTS_IDENTITY_NO"/>
<result property="residentsPhone" column="RESIDENTS_PHONE"/>
<result property="householdRegistrationPlace" column="HOUSEHOLD_REGISTRATION_PLACE"/>
<collection property="housingInformationList" ofType="com.elink.esua.epdc.dto.house.HousingInformationDTO">
<result property="houseAddress" column="HOUSE_ADDRESS"/>
<result property="propertyOwner" column="PROPERTY_OWNER"/>
<result property="propertyOwnerIdentityNo" column="PROPERTY_OWNER_IDENTITY_NO"/>
<result property="propertyOwnerMobile" column="PROPERTY_OWNER_MOBILE"/>
<result property="gridName" column="gridName"/>
</collection>
</resultMap>
<select id="selectDetailOfPopulationInformationDTO" resultMap="populationInformationMap2">
select t.ID,
t.RESIDENTS_NAME,
t.RESIDENTS_SEX,
t.RESIDENTS_PHONE,
t.RESIDENTS_IDENTITY_NO,
t.RESIDENTS_NATION,
t.HOUSEHOLD_REGISTRATION_PLACE,
substring_index(t2.ALL_DEPT_NAMES, '-', -1) as gridName,
t2.HOUSE_ADDRESS,
t2.PROPERTY_OWNER,
t2.PROPERTY_OWNER_IDENTITY_NO,
t2.PROPERTY_OWNER_MOBILE
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID
left join epdc_housing_information t2 on t1.HOUSE_ID = t2.ID
where t.DEL_FLAG = '0'
and t1.DEL_FLAG = '0'
and t2.DEL_FLAG = '0'
and t.ID = #{id};
</select>
<select id="motorVehiclePage" resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select MOTOR_VEHICLE_NUM,MOTOR_VEHICLE_CATEGORY,RESIDENTS_NAME,RESIDENTS_PHONE
from epdc_population_information
where DEL_FLAG ='0' and MOTOR_VEHICLE_NUM is not null and MOTOR_VEHICLE_NUM > 0
<if test="motorVehicleCategory != '' and motorVehicleCategory != null">and
find_in_set(#{motorVehicleCategory},MOTOR_VEHICLE_CATEGORY)
</if>
<if test="residentsName != '' and residentsName != null">and RESIDENTS_NAME like
concat('%',#{residentsName},'%')
</if>
order by CREATED_TIME desc
</select>
<select id="getPopulationInfoOverview" resultType="com.elink.esua.epdc.dto.house.PopulationInfoOverviewDTO">
select count(t.HOUSE_USE = '0' or null) as sinceTheLiving,
count(t.HOUSE_USE = '1' or null) as rent,
count(t.HOUSE_USE = '2' or null) as business,
count(t.ID) as houseNum,
employment,
unemployment,
populationNum,
motorVehicleNum,
partyMemberNum
from epdc_housing_information t
left join(
select count(EMPLOYMENT_STATUS = '0' or null) as employment,
count(EMPLOYMENT_STATUS = '1' or null) as unemployment,
(select (select count(1) as houseHeadNum
from epdc_population_information
where DEL_FLAG = 0
and RESIDENTS_IDENTITY_NO is not null
and RESIDENTS_IDENTITY_NO !='') +
(select count(1) as residentNum from epdc_house_resident t
left join epdc_population_information t1 on t.RESIDENT_ID = t1.ID
left join epdc_population_information t2 on t.HOUSE_HEAD_ID = t2.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG = '0' and t2.DEL_FLAG ='0'
order by t.CREATED_TIME desc)) as populationNum,
sum(MOTOR_VEHICLE_NUM) as motorVehicleNum,
count(POLITICS_STATUS= '1' or null) as partyMemberNum
from epdc_population_information
where DEL_FLAG = 0 and RESIDENTS_IDENTITY_NO is not null and RESIDENTS_IDENTITY_NO != '') a
on 1=1
where t.DEL_FLAG ='0';
</select>
<select id="getPopulationInfoOverviewForScreen"
resultType="com.elink.esua.epdc.dto.house.PopulationInfoOverviewDTO">
select count(t.HOUSE_USE = '0' or null) as sinceTheLiving,
count(t.HOUSE_USE = '1' or null) as rent,
count(t.HOUSE_USE = '2' or null) as business,
count(t.ID) as houseNum,
employment,
unemployment,
populationNum,
motorVehicleNum,
partyMemberNum
from epdc_housing_information t
left join(
select count(EMPLOYMENT_STATUS = '0' or null) as employment,
count(EMPLOYMENT_STATUS = '1' or null) as unemployment,
(select count(a.ID)
+
(select a.residentNum
from (
SELECT hi.PARENT_DEPT_IDS,
SUM(t2.num1) as residentNum
FROM `epdc_housing_information` hi
LEFT JOIN(
SELECT hr1.`HOUSE_ID`, SUM(t.num) as num1
FROM `epdc_house_resident` hr1
LEFT JOIN(
SELECT hr.`HOUSE_HEAD_ID`, COUNT(hr.`ID`) AS num
FROM `epdc_house_resident` hr
WHERE hr.`DEL_FLAG` = '0'
AND `IS_HOUSE_HEAD` = '0'
GROUP BY hr.`HOUSE_HEAD_ID`
ORDER BY COUNT(hr.`ID`) DESC) t on t.HOUSE_HEAD_ID = hr1.`RESIDENT_ID`
WHERE hr1.`DEL_FLAG` = '0'
AND hr1.`IS_HOUSE_HEAD` = '1'
GROUP BY hr1.`HOUSE_ID`) t2 on t2.HOUSE_ID = hi.`ID`
AND hi.`DEL_FLAG` = '0'
GROUP BY hi.`PARENT_DEPT_NAMES`) a
where find_in_set(#{communityId}, a.PARENT_DEPT_IDS))) as populationNum,
sum(MOTOR_VEHICLE_NUM) as motorVehicleNum,
count(POLITICS_STATUS = '1' or null) as partyMemberNum
from epdc_population_information a
left join epdc_house_resident b on a.ID = b.RESIDENT_ID and b.DEL_FLAG = '0'
left join epdc_housing_information c on c.ID = b.HOUSE_ID
where a.DEL_FLAG = 0
and b.IS_HOUSE_HEAD = 1
and find_in_set(#{communityId}, c.PARENT_DEPT_IDS)) a on 1 = 1
where t.DEL_FLAG = '0'
and find_in_set(#{communityId}, t.PARENT_DEPT_IDS);
</select>
<select id="selectListPeople"
resultType="com.elink.esua.epdc.dto.house.result.EpdcScreenSelectPeopleResultDTO">
select
data.name,data.gridName,data.identityFlag,data.houseId,data.populationId,data.identity,data.CREATED_TIME,data.identity
as identityName from (
select
t.RESIDENTS_NAME as name,
group_concat(DISTINCT substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as gridName,
1 as identityFlag,
'户主' as identity,
'' as houseId,
t.ID as populationId,
t.CREATED_TIME
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID and t1.DEL_FLAG = '0'
left join epdc_housing_information t2 on t2.ID = t1.HOUSE_ID and t2.DEL_FLAG = '0'
where t.DEL_FLAG = '0' and t.RESIDENTS_IDENTITY_NO is not null and t.RESIDENTS_IDENTITY_NO != '' and
t1.IS_HOUSE_HEAD ='1'
<if test="name != null and name != ''">
and t.RESIDENTS_NAME like concat('%', #{name}, '%')
</if>
<if test="phone != null and phone != ''">
and t.RESIDENTS_PHONE like concat('%', #{phone}, '%')
</if>
<if test="communityId != null and communityId != ''">
and find_in_set(#{communityId},t2.ALL_DEPT_IDS)
</if>
<if test="gridId != null and gridId != ''">
and find_in_set(#{gridId},t2.ALL_DEPT_IDS)
</if>
group by t.ID
union all
select
t.RESIDENTS_NAME as name,
t2.gridName,
2 as identityFlag,
'居住人' as identity,
'' as houseId,
t.ID as populationId,
t.CREATED_TIME
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID
left join
(select
t.ID,group_concat(DISTINCT substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as gridName
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID and t1.DEL_FLAG ='0'
left join epdc_housing_information t2 on t2.ID = t1.HOUSE_ID and t2.DEL_FLAG = '0'
where t.DEL_FLAG = '0' and t.RESIDENTS_IDENTITY_NO is not null and t.RESIDENTS_IDENTITY_NO != '' and
t1.IS_HOUSE_HEAD ='1'
<if test="communityId != null and communityId != ''">
and find_in_set(#{communityId},t2.ALL_DEPT_IDS)
</if>
<if test="gridId != null and gridId != ''">
and find_in_set(#{gridId},t2.ALL_DEPT_IDS)
</if>
group by t.ID
)t2 on t2.ID = t1.HOUSE_HEAD_ID
where t.DEL_FLAG = '0' and t1.DEL_FLAG ='0' and t2.gridName is not null
and (t.RESIDENTS_IDENTITY_NO is null or t.RESIDENTS_IDENTITY_NO = '') and t1.IS_HOUSE_HEAD = '0'
<if test="name != null and name != ''">
and t.RESIDENTS_NAME like concat('%', #{name}, '%')
</if>
<if test="phone != null and phone != ''">
and t.RESIDENTS_PHONE like concat('%', #{phone}, '%')
</if>
group by t.ID)data
order by CREATED_TIME desc
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectCountListPeople"
resultType="java.lang.Integer">
select count(1) from(
select
data.name,data.gridName,data.identityFlag,data.houseId,data.populationId,data.identity,data.CREATED_TIME,data.identity
as identityName from (
select
t.RESIDENTS_NAME as name,
group_concat(DISTINCT substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as gridName,
1 as identityFlag,
'户主' as identity,
'' as houseId,
t.ID as populationId,
t.CREATED_TIME
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID and t1.DEL_FLAG = '0'
left join epdc_housing_information t2 on t2.ID = t1.HOUSE_ID and t2.DEL_FLAG = '0'
where t.DEL_FLAG = '0' and t.RESIDENTS_IDENTITY_NO is not null and t.RESIDENTS_IDENTITY_NO != '' and
t1.IS_HOUSE_HEAD ='1'
<if test="name != null and name != ''">
and t.RESIDENTS_NAME like concat('%', #{name}, '%')
</if>
<if test="phone != null and phone != ''">
and t.RESIDENTS_PHONE like concat('%', #{phone}, '%')
</if>
<if test="communityId != null and communityId != ''">
and find_in_set(#{communityId},t2.ALL_DEPT_IDS)
</if>
<if test="gridId != null and gridId != ''">
and find_in_set(#{gridId},t2.ALL_DEPT_IDS)
</if>
group by t.ID
union all
select
t.RESIDENTS_NAME as name,
t2.gridName,
2 as identityFlag,
'居住人' as identity,
'' as houseId,
t.ID as populationId,
t.CREATED_TIME
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID
left join
(select
t.ID,group_concat(DISTINCT substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as gridName
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID and t1.DEL_FLAG ='0'
left join epdc_housing_information t2 on t2.ID = t1.HOUSE_ID and t2.DEL_FLAG = '0'
where t.DEL_FLAG = '0' and t.RESIDENTS_IDENTITY_NO is not null and t.RESIDENTS_IDENTITY_NO != '' and
t1.IS_HOUSE_HEAD ='1'
<if test="communityId != null and communityId != ''">
and find_in_set(#{communityId},t2.ALL_DEPT_IDS)
</if>
<if test="gridId != null and gridId != ''">
and find_in_set(#{gridId},t2.ALL_DEPT_IDS)
</if>
group by t.ID
)t2 on t2.ID = t1.HOUSE_HEAD_ID
where t.DEL_FLAG = '0' and t1.DEL_FLAG ='0' and t2.gridName is not null
and (t.RESIDENTS_IDENTITY_NO is null or t.RESIDENTS_IDENTITY_NO = '') and t1.IS_HOUSE_HEAD = '0'
<if test="name != null and name != ''">
and t.RESIDENTS_NAME like concat('%', #{name}, '%')
</if>
<if test="phone != null and phone != ''">
and t.RESIDENTS_PHONE like concat('%', #{phone}, '%')
</if>
group by t.ID)data
order by CREATED_TIME desc
)a
</select>
<select id="selectHouseUseDataForScreen"
resultType="com.elink.esua.epdc.dto.house.result.EpdcScreenHouseUseResultDTO">
select count(HOUSE_USE = 0 or null) as sinceTheLivingNumber,
count(HOUSE_USE = 1 or null) as rentNumber,
count(HOUSE_USE = 2 or null) as businessNumber,
ROUND(count(HOUSE_USE = 0 or null) / count(*) * 100) as sinceTheLivingNumberPercent,
ROUND(count(HOUSE_USE = 1 or null) / count(*) * 100) as rentPercent,
ROUND(count(HOUSE_USE = 2 or null) / count(*) * 100) as businessPercent
from epdc_housing_information
where DEL_FLAG = '0';
</select>
<select id="selectListGridRanking"
resultType="com.elink.esua.epdc.dto.house.result.EpdcScreenGridRankingResultDTO">
<if test="rankCategory!=null and rankCategory == 0">
select ifnull(houseHead.houseHeadNum,0)+IFNULL(resident.residentNum,0) as total,houseHead.gridName from(
select count(1) as houseHeadNum,GRID_ID,gridName from(
select t2.GRID_ID,substring_index(t2.ALL_DEPT_NAMES,'-',-1) as gridName
from epdc_population_information t
left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
left join epdc_housing_information t2 on t2.ID = t1.HOUSE_ID
where t.DEL_FLAG = '0'
and t1.DEL_FLAG = '0' and t2.DEL_FLAG='0'
and t1.IS_HOUSE_HEAD ='1'
group by t2.GRID_ID,t.ID)end
group by end.GRID_ID)houseHead
left join
(select count(1) as residentNum,GRID_ID,gridName from(
select count(1),t3.GRID_ID,substring_index(t3.ALL_DEPT_NAMES,'-',-1) as gridName from
epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID
left join epdc_house_resident t2 on t1.HOUSE_HEAD_ID = t2.RESIDENT_ID
left join epdc_housing_information t3 on t3.Id =t2.HOUSE_ID
where t.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD='0' and t2.DEL_FLAG ='0' and t3.DEL_FLAG ='0'
group by t3.GRID_ID,t.ID)end
group by end.GRID_ID)resident on houseHead.GRID_ID = resident.GRID_ID
order by total desc
LIMIT #{pageIndex},#{pageSize}
</if>
<if test="rankCategory!=null and rankCategory == 1">
select substring_index(ALL_DEPT_NAMES,'-',-1)gridName,count(1) as total from epdc_housing_information where
DEL_FLAG ='0'
group by GRID_ID
order by total desc
LIMIT #{pageIndex},#{pageSize}
</if>
</select>
<select id="selectCountListGridRanking" resultType="java.lang.Integer">
<if test="rankCategory!=null and rankCategory == 0">
select count(1) from (
select ifnull(houseHead.houseHeadNum,0)+IFNULL(resident.residentNum,0) as total,houseHead.gridName from(
select count(1) as houseHeadNum,GRID_ID,gridName from(
select t2.GRID_ID,substring_index(t2.ALL_DEPT_NAMES,'-',-1) as gridName
from epdc_population_information t
left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
left join epdc_housing_information t2 on t2.ID = t1.HOUSE_ID
where t.DEL_FLAG = '0'
and t1.DEL_FLAG = '0' and t2.DEL_FLAG='0'
and t1.IS_HOUSE_HEAD ='1'
group by t2.GRID_ID,t.ID)end
group by end.GRID_ID)houseHead
left join
(select count(1) as residentNum,GRID_ID,gridName from(
select count(1),t3.GRID_ID,substring_index(t3.ALL_DEPT_NAMES,'-',-1) as gridName from
epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID
left join epdc_house_resident t2 on t1.HOUSE_HEAD_ID = t2.RESIDENT_ID
left join epdc_housing_information t3 on t3.Id =t2.HOUSE_ID
where t.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD='0' and t2.DEL_FLAG ='0' and t3.DEL_FLAG ='0'
group by t3.GRID_ID,t.ID)end
group by end.GRID_ID)resident on houseHead.GRID_ID = resident.GRID_ID
order by total desc)a
</if>
<if test="rankCategory!=null and rankCategory == 1">
select count(1) from (
select substring_index(ALL_DEPT_NAMES,'-',-1)gridName,count(1) as total from epdc_housing_information where
DEL_FLAG ='0'
group by GRID_ID
order by total desc)a
</if>
</select>
<select id="selectHouseByPeople"
resultType="com.elink.esua.epdc.dto.house.result.EpdcScreenHouseInfoByPeopleResultDTO">
select
epi.ID as populationId,
1 as identityFlag,
epi.RESIDENTS_NAME as houseHeadName,
substring_index(t.ALL_DEPT_NAMES, '-', -1) gridName,
t.HOUSE_ADDRESS as houseAddress,
epi.RESIDENTS_PHONE as houseHeadPhone
from epdc_housing_information t
left join epdc_house_resident ehr on t.ID = ehr.HOUSE_ID
left join epdc_population_information epi on ehr.RESIDENT_ID = epi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and epi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},t.ALL_DEPT_IDS)
</if>
<if test="houseHeadName!=null and houseHeadName!=''">
and epi.RESIDENTS_NAME like concat('%', #{houseHeadName}, '%')
</if>
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectCountHouseByPeople"
resultType="java.lang.Integer">
select
count(1)
from epdc_housing_information t
left join epdc_house_resident ehr on t.ID = ehr.HOUSE_ID
left join epdc_population_information epi on ehr.RESIDENT_ID = epi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and epi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},t.ALL_DEPT_IDS)
</if>
<if test="houseHeadName!=null and houseHeadName!=''">
and epi.RESIDENTS_NAME like concat('%', #{houseHeadName}, '%')
</if>
</select>
<select id="selectPeopleByHouse"
resultType="com.elink.esua.epdc.dto.house.result.EpdcScreenPopulationInfoByHouseResultDTO">
select
t.ID as populationId,
1 as identityFlag,
t.RESIDENTS_NAME as houseHeadName,
substring_index(ehi.ALL_DEPT_NAMES, '-', -1) gridName,
ehi.HOUSE_ADDRESS as houseAddress,
t.RESIDENTS_PHONE as houseHeadPhone
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
left join epdc_housing_information ehi on ehr.HOUSE_ID = ehi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and ehi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},ehi.ALL_DEPT_IDS)
</if>
<if test="houseAddress!=null and houseAddress!=''">
and HOUSE_ADDRESS like concat('%', #{houseAddress}, '%')
</if>
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectCountPeopleByHouse" resultType="java.lang.Integer">
select
count(1)
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
left join epdc_housing_information ehi on ehr.HOUSE_ID = ehi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0' and ehr.IS_HOUSE_HEAD = '1'
and ehi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},ehi.ALL_DEPT_IDS)
</if>
<if test="houseAddress!=null and houseAddress!=''">
and HOUSE_ADDRESS like concat('%', #{houseAddress}, '%')
</if>
</select>
<select id="selectPeopleByCurrentAddress"
resultType="com.elink.esua.epdc.dto.house.result.EpdcScreenResidentInfoByCurrentAddressResultDTO">
select t.ID as populationId,
2 as identityFlag,
t.RESIDENTS_NAME as residentName,
t.CURRENT_ADDRESS as currentAddress,
hh.RESIDENTS_NAME as houseHeadName,
hh.RESIDENTS_PHONE as houseHeadPhone,
GROUP_CONCAT(distinct ehi.HOUSE_ADDRESS) as houseHeadAddress
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
left join epdc_population_information hh on hh.ID = ehr.HOUSE_HEAD_ID
left join epdc_house_resident hhehr on hh.ID = hhehr.RESIDENT_ID
left join epdc_housing_information ehi on hhehr.HOUSE_ID = ehi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0'
and ehr.IS_HOUSE_HEAD = '0'
and hh.DEL_FLAG = '0'
and hhehr.DEL_FLAG ='0' and ehi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},ehi.ALL_DEPT_IDS)
</if>
<if test="currentAddress!=null and currentAddress!=''">
and t.CURRENT_ADDRESS like concat('%', #{currentAddress}, '%')
</if>
<if test="residentName!=null and residentName!=''">
and t.RESIDENTS_NAME like concat('%', #{residentName}, '%')
</if>
group by t.ID
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectCountPeopleByCurrentAddress" resultType="java.lang.Integer">
select count(1) from (
select t.ID as populationId,
2 as identityFlag,
t.RESIDENTS_NAME as residentName,
t.CURRENT_ADDRESS as currentAddress,
hh.RESIDENTS_NAME as houseHeadName,
hh.RESIDENTS_PHONE as houseHeadPhone,
GROUP_CONCAT(distinct ehi.HOUSE_ADDRESS) as houseHeadAddress
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
left join epdc_population_information hh on hh.ID = ehr.HOUSE_HEAD_ID
left join epdc_house_resident hhehr on hh.ID = hhehr.RESIDENT_ID
left join epdc_housing_information ehi on hhehr.HOUSE_ID = ehi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0'
and ehr.IS_HOUSE_HEAD = '0'
and hh.DEL_FLAG = '0'
and hhehr.DEL_FLAG ='0' and ehi.DEL_FLAG = '0'
<if test="communityId != null and communityId != ''">
and find_in_set(${communityId},ehi.ALL_DEPT_IDS)
</if>
<if test="currentAddress!=null and currentAddress!=''">
and t.CURRENT_ADDRESS like concat('%', #{currentAddress}, '%')
</if>
<if test="residentName!=null and residentName!=''">
and t.RESIDENTS_NAME like concat('%', #{residentName}, '%')
</if>
group by t.ID)a
</select>
<select id="selectPeopleByCurrentAddressExportList"
resultType="com.elink.esua.epdc.dto.house.result.EpdcScreenResidentInfoByCurrentAddressResultDTO">
select t.ID as populationId,
2 as identityFlag,
t.RESIDENTS_NAME as residentName,
t.CURRENT_ADDRESS as currentAddress,
hh.RESIDENTS_NAME as houseHeadName,
hh.RESIDENTS_PHONE as houseHeadPhone,
GROUP_CONCAT(distinct ehi.HOUSE_ADDRESS) as houseHeadAddress
from epdc_population_information t
left join epdc_house_resident ehr on t.ID = ehr.RESIDENT_ID
left join epdc_population_information hh on hh.ID = ehr.HOUSE_HEAD_ID
left join epdc_house_resident hhehr on hh.ID = hhehr.RESIDENT_ID
left join epdc_housing_information ehi on hhehr.HOUSE_ID = ehi.ID
where t.DEL_FLAG = '0'
and ehr.DEL_FLAG = '0'
and ehr.IS_HOUSE_HEAD = '0'
and hh.DEL_FLAG = '0'
and hhehr.DEL_FLAG ='0' and ehi.DEL_FLAG = '0'
<if test="houseAddress!=null and houseAddress!=''">
and t.CURRENT_ADDRESS like concat('%', #{houseAddress}, '%')
</if>
group by t.ID
</select>
<select id="selectListByIdentityNos"
resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTO">
SELECT
ui.ID as ID,
ui.RESIDENTS_IDENTITY_NO as idCard,
ui.VACCINATION_NUM,
ui.VACCINATION_STATE,
vc.MAX_DOSE
FROM
epdc_population_information ui
LEFT JOIN vaccination_info vi ON vi.IDENTITY_NO = ui.RESIDENTS_IDENTITY_NO
AND vi.DEL_FLAG = '0'
LEFT JOIN vaccine_company vc ON vc.id = vi.COMPANY_ID
AND vi.DEL_FLAG = '0'
WHERE ui.DEL_FLAG = '0'
AND ui.RESIDENTS_IDENTITY_NO IN
<foreach collection="residentsIdentityNos" index="index" item="residentsIdentityNo" open="(" separator=","
close=")">
#{residentsIdentityNo}
</foreach>
</select>
<update id="updatePersonInfo">
UPDATE epdc_population_information
set VACCINATION_NUM = #{vaccinationNum}
<if test="vaccinationState != null">
,VACCINATION_STATE = #{vaccinationState}
</if>
WHERE
RESIDENTS_IDENTITY_NO = #{residentsIdentityNo}
</update>
</mapper>
Loading…
Cancel
Save