Browse Source

人员防控管理修改

origin/epidemic_user
Jackwang 4 years ago
parent
commit
f5cd8862fe
  1. 13
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java
  2. 27
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicRecordDetailDTO.java
  3. 2
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicReportUserInfoDTO.java
  4. 28
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoEntity.java
  5. 9
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java
  6. 622
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java
  7. 6
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java
  8. 117
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationUpdateExcel.java
  9. 11
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java
  10. 77
      epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml

13
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java

@ -23,6 +23,7 @@ import com.elink.esua.epdc.vaccine.epidemic.service.impl.EpidemicUserInfoExportS
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.util.Map;
@ -139,4 +140,16 @@ public class EpidemicUserInfoController {
public Result updateVaccination() {
return epidemicUserInfoService.updateVaccination();
}
/*
* @describe: 批量导入
* @author wangtong
* @date 2021/10/27 17:07
* @params [file, gridId]
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
@PostMapping("importExcel")
public Result importExcel(@RequestParam("file") MultipartFile file, String gridId) {
return epidemicUserInfoService.importEpidemicUser(file,gridId);
}
}

27
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicRecordDetailDTO.java

@ -272,8 +272,33 @@ public class EpidemicRecordDetailDTO implements Serializable {
*/
private String livingSituation;
/**
* 所属组织
* 网格
*/
private String deptName;
/**
* 网格ID
*/
private Long deptId;
/**
* 父所有部门ID
*/
private String parentDeptIds;
/**
* 父所有部门
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门
*/
private String allDeptNames;
/**
* 详情复现
*/
private String[] deptIdList;
}

2
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicReportUserInfoDTO.java

@ -291,5 +291,7 @@ public class EpidemicReportUserInfoDTO implements Serializable {
// @ApiModelProperty(value = "接种状态")
private Integer vaccinationState;
private String deptId;
}

28
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoEntity.java

@ -185,6 +185,8 @@ public class EpidemicUserInfoEntity extends BasePingyinEntity {
*/
private Integer age;
private String liveAddressCode;
/**
* 县内居住地镇街
*/
@ -302,4 +304,30 @@ public class EpidemicUserInfoEntity extends BasePingyinEntity {
private Integer familyMemberOutMonth;
private String houseProperty;
/**
* 网格
*/
private String deptName;
/**
* 网格ID
*/
private Long deptId;
/**
* 父所有部门ID
*/
private String parentDeptIds;
/**
* 父所有部门
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门
*/
private String allDeptNames;
}

9
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java

@ -14,6 +14,7 @@ import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO;
import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO;
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity;
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
@ -160,4 +161,12 @@ public interface EpidemicUserInfoService extends CrudService<EpidemicUserInfoEnt
*/
EpidemicUserInfoEntity selectInfoByIdCard(String idCard);
/*
* @describe: 批量导入
* @author wangtong
* @date 2021/10/27 17:07
* @params [file, gridId]
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result importEpidemicUser(MultipartFile file, String gridId);
}

622
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java

@ -1,20 +1,25 @@
package com.elink.esua.epdc.vaccine.epidemic.service.impl;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elink.esua.epdc.commons.mybatis.service.impl.CrudServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant;
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.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
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.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.vaccine.common.uitls.ValidateUtils;
import com.elink.esua.epdc.commons.tools.utils.*;
import com.elink.esua.epdc.constant.PopulationDictConstant;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO;
import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO;
import com.elink.esua.epdc.dto.house.result.EpdcPopulationErrorResultDTO;
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.dao.SelectAreaDao;
@ -27,22 +32,28 @@ import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultV2DTO;
import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO;
import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO;
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity;
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInoutRecordEntity;
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicReportUserInfoService;
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService;
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInoutRecordService;
import com.elink.esua.epdc.vaccine.feign.VimAdminFeignClient;
import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity;
import com.elink.esua.epdc.vaccine.house.excel.BaseResidentInformationUpdateExcel;
import com.elink.esua.epdc.vaccine.vim.dao.VaccinationInfoDao;
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO;
import com.elink.esua.epdc.vaccine.vim.entity.VaccinationInfoEntity;
import com.elink.esua.epdc.vaccine.vim.service.VaccinationInfoService;
import com.elink.esua.epdc.vaccine.vim.service.VaccinationUserRoleService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.util.*;
import java.util.stream.Collectors;
@ -76,6 +87,8 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
public EpidemicUserInfoDao epidemicUserInfoDao;
@Resource
public VaccinationInfoDao vaccinationInfoDao;
@Autowired
private VimAdminFeignClient adminVimFeignClient;
@Override
@ -99,7 +112,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
Map<String, Object> authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId());
params.putAll(authParams);
// 街道和超管有权查看所有数据
if (NumConstant.ZERO == user.getSuperAdmin() && user.getDeptId() != 1258587398679126017L) {
if (NumConstant.ZERO == user.getSuperAdmin() && !user.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_PARTY)) {
params.put("deptIdList", user.getDeptIdList());
}
List<EpidemicRecordListDTO> list = baseDao.getEpidemicUserRecordList(params);
@ -115,6 +128,10 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
if (result == null) {
return null;
}
if(StringUtils.isNotBlank(result.getAllDeptIds())){
result.setAllDeptIds(result.getAllDeptIds().replace(result.getAllDeptIds().substring(0,result.getAllDeptIds().indexOf(",")+1),""));
result.setDeptIdList(result.getAllDeptIds().split(","));
}
// result.setIdCard(idEncrypt(result.getIdCard()));
// result.setMobile(mobileEncrypt(result.getMobile()));
result.setUserName(nameDesensitization(result.getUserName()));
@ -262,6 +279,21 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
} catch (RenException e) {
return new Result().error(e.getMsg());
}
if (StringUtils.isNotBlank(dto.getDeptId())) {
Result<ParentAndAllDeptDTO> parentAndAllDept = adminVimFeignClient.getParentAndAllDept(dto.getDeptId());
if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
return new Result().error("获取所属组织信息失败");
}
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData();
userInfoDTO.setDeptId(parentAndAllDeptDTO.getGridId());
userInfoDTO.setDeptName(parentAndAllDeptDTO.getGrid());
userInfoDTO.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds());
userInfoDTO.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames());
userInfoDTO.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds());
userInfoDTO.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames());
}
this.updateById(userInfoDTO);
// inoutRecordService.updateById(userInoutRecordDTO);
return new Result();
@ -496,7 +528,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
Map<String, Object> authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId());
params.putAll(authParams);
// 街道和超管有权查看所有数据
if (NumConstant.ZERO == user.getSuperAdmin() && user.getDeptId() != 1258587398679126017L) {
if (NumConstant.ZERO == user.getSuperAdmin() && !user.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_PARTY)) {
params.put("deptIdList", user.getDeptIdList());
}
List<EpidemicPageResultDTO> list = baseDao.getEpidemicPage(params);
@ -591,4 +623,578 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
return baseDao.selectInfoByIdCard(idCard);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result importEpidemicUser(MultipartFile file, String gridId) {
ParentAndAllDeptDTO parentAndAllDeptDTO = null;
if (StringUtils.isNotBlank(gridId)) {
Result<ParentAndAllDeptDTO> parentAndAllDept = adminVimFeignClient.getParentAndAllDept(gridId);
if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
return new Result().error("获取归属部门信息失败");
}
parentAndAllDeptDTO = parentAndAllDept.getData();
}
//获取字典信息
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,
PopulationDictConstant.SPECIAL_CROWD,
PopulationDictConstant.PEOPLE_CATEGORIES);
sysPopulationSimpleDictFormDTO.setDicTypes(dicTypes);
Result<List<SysPopulationSimpleDictDTO>> listResult = adminVimFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO);
if (listResult == null || !listResult.success()) {
return new Result().error("获取字典信息失败");
}
List<SysPopulationSimpleDictDTO> sysPopulationSimpleDictDTOS = listResult.getData();
File f = StreamUtils.conversionFile(file);
ImportParams importParams = new ImportParams();
try {
//获取多个sheet页
Workbook workBook = ExcelUtils.getWorkBook(file);
//户主身份证和插入的ID,便于保存居住人信息时匹配户主信息
Map<String, String> populationIdNoAndIdMap = new HashMap<>();
//户主导入数据
// List<BasePopulationInformationExcel> basePopulationInformationExcels = null;
//户主导入数据异常提示
// List<EpdcPopulationErrorResultDTO> epdcHouseAndHouseHeadErrorResultDTOS = null;
//居民导入数据
List<BaseResidentInformationUpdateExcel> BaseResidentInformationUpdateExcels = null;
//居民导入数据异常提示
List<EpdcPopulationErrorResultDTO> epdcResidentErrorResultDTOS = null;
//户主身份证列表,便于校验居住人页填写的身份证信息是否正确
// Set<String> residentIdentifyNo = new HashSet<>();
// for (int numSheet = 0; numSheet < workBook.getNumberOfSheets(); numSheet++) {
//第几个sheet
// importParams.setStartSheetIndex(numSheet);
// if (numSheet == 0) {//校验和新增房屋和户主信息
// basePopulationInformationExcels = ExcelImportUtil.importExcel(f, BasePopulationInformationExcel.class, importParams);
// // 校验数据
// epdcHouseAndHouseHeadErrorResultDTOS = this.checkPopulationExcel(basePopulationInformationExcels, sysPopulationSimpleDictDTOS);
// basePopulationInformationExcels.forEach(basePopulationInformationExcel ->
// residentIdentifyNo.add(basePopulationInformationExcel.getResidentsIdentityNo())
// );
// } else if (numSheet == 1) {//检验和新增居住人信息
BaseResidentInformationUpdateExcels = ExcelImportUtil.importExcel(f, BaseResidentInformationUpdateExcel.class, importParams);
// 校验数据
epdcResidentErrorResultDTOS = this.checkResidentsExcel(BaseResidentInformationUpdateExcels, sysPopulationSimpleDictDTOS);
// }
// }
// 校验户主和房屋信息
// if (epdcHouseAndHouseHeadErrorResultDTOS != null && epdcHouseAndHouseHeadErrorResultDTOS.size() > 0) {
// return new Result().ok(epdcHouseAndHouseHeadErrorResultDTOS);
// }
// 校验居住人信息
if (epdcResidentErrorResultDTOS != null && epdcResidentErrorResultDTOS.size() > 0) {
return new Result().ok(epdcResidentErrorResultDTOS);
}
// 保存户主和房屋信息
// if (basePopulationInformationExcels != null && basePopulationInformationExcels.size() > 0) {
// populationIdNoAndIdMap = savePopulationListEnd(basePopulationInformationExcels, parentAndAllDeptDTO);
// }
// 保存居住人信息
if (BaseResidentInformationUpdateExcels != null && BaseResidentInformationUpdateExcels.size() > 0) {
saveResidentList(BaseResidentInformationUpdateExcels, parentAndAllDeptDTO, populationIdNoAndIdMap);
}
} catch (Exception e1) {
throw new RenException("导入失败:请检查导入模板或导入数据");
}
return new Result();
}
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcPopulationErrorResultDTO>
* @Description 校验居住人数据
* @Author songyunpeng
* @Date 2020/8/31
* @Param [basePopulationInformationExcels, basePopulationInformationExcels1]
**/
private List<EpdcPopulationErrorResultDTO> checkResidentsExcel(List<BaseResidentInformationUpdateExcel> basePopulationInformationExcels, List<SysPopulationSimpleDictDTO> sysPopulationSimpleDictDTOS) {
// 不匹配信息
List<EpdcPopulationErrorResultDTO> errorLineInfoList = new ArrayList<>();
EpdcPopulationErrorResultDTO errorLineInfoDto = null;
for (int i = 0; i < basePopulationInformationExcels.size(); i++) {
String errorInfo = "";
BaseResidentInformationUpdateExcel BaseResidentInformationUpdateExcel = basePopulationInformationExcels.get(i);
// String residentsIdentityNo = BaseResidentInformationUpdateExcel.getResidentsIdentityNo() == null ? null : BaseResidentInformationUpdateExcel.getResidentsIdentityNo().trim();
String selfIdentityNo = BaseResidentInformationUpdateExcel.getSelfIdentityNo() == null ? null : BaseResidentInformationUpdateExcel.getSelfIdentityNo().trim();
// String houseHeadRelation = BaseResidentInformationUpdateExcel.getHouseHeadRelation() == null ? null : BaseResidentInformationUpdateExcel.getHouseHeadRelation().trim();
String residentsName = BaseResidentInformationUpdateExcel.getUserName() == null ? null : BaseResidentInformationUpdateExcel.getUserName().trim();
String residentsSex = BaseResidentInformationUpdateExcel.getGender() == null ? null : BaseResidentInformationUpdateExcel.getGender().trim();
String residentsNation = BaseResidentInformationUpdateExcel.getNation() == null ? null : BaseResidentInformationUpdateExcel.getNation().trim();
String currentEmployer = BaseResidentInformationUpdateExcel.getCurrentEmployer() == null ? null : BaseResidentInformationUpdateExcel.getCurrentEmployer().trim();
String currentAddress = BaseResidentInformationUpdateExcel.getCurrentAddress() == null ? null : BaseResidentInformationUpdateExcel.getCurrentAddress().trim();
String specialCrowd = BaseResidentInformationUpdateExcel.getSpecialCrowd() == null ? null : BaseResidentInformationUpdateExcel.getSpecialCrowd().trim();
String peopleCategories = BaseResidentInformationUpdateExcel.getPeopleCategories() == null ? null : BaseResidentInformationUpdateExcel.getPeopleCategories().trim();
String politicsStatus = BaseResidentInformationUpdateExcel.getPoliticsStatus() == null ? null : BaseResidentInformationUpdateExcel.getPoliticsStatus().trim();
String standardOfCulture = BaseResidentInformationUpdateExcel.getStandardOfCulture() == null ? null : BaseResidentInformationUpdateExcel.getStandardOfCulture().trim();
String health = BaseResidentInformationUpdateExcel.getHealth() == null ? null : BaseResidentInformationUpdateExcel.getHealth().trim();
String maritalStatus = BaseResidentInformationUpdateExcel.getMaritalStatus() == null ? null : BaseResidentInformationUpdateExcel.getMaritalStatus().trim();
String accountType = BaseResidentInformationUpdateExcel.getAccountType() == null ? null : BaseResidentInformationUpdateExcel.getAccountType().trim();
String workStatus = BaseResidentInformationUpdateExcel.getWorkStatus() == null ? null : BaseResidentInformationUpdateExcel.getWorkStatus().trim();
String unemploymentReason = BaseResidentInformationUpdateExcel.getUnemploymentReason() == null ? null : BaseResidentInformationUpdateExcel.getUnemploymentReason().trim();
String familyCategory = BaseResidentInformationUpdateExcel.getFamilyCategory() == null ? null : BaseResidentInformationUpdateExcel.getFamilyCategory().trim();
String helpStatus = BaseResidentInformationUpdateExcel.getHelpStatus() == null ? null : BaseResidentInformationUpdateExcel.getHelpStatus().trim();
String motorVehicleCategory = BaseResidentInformationUpdateExcel.getMotorVehicleCategory() == null ? null : BaseResidentInformationUpdateExcel.getMotorVehicleCategory().trim();
if (StringUtils.isBlank(selfIdentityNo)) {
errorInfo += "本人身份证号为空;";
} else if (StringUtils.isNotBlank(selfIdentityNo)) {
String result = IdentityNoUtils.IdentityNoVerification(selfIdentityNo);
if (result != null) {
errorInfo += "本人身份证号码有误;";
} else {
BaseResidentInformationUpdateExcel.setGender(IdentityNoUtils.getSex(selfIdentityNo));
BaseResidentInformationUpdateExcel.setAge(IdentityNoUtils.getAge(selfIdentityNo));
BaseResidentInformationUpdateExcel.setBirthday(IdentityNoUtils.getBirthday(selfIdentityNo));
}
BaseResidentInformationUpdateExcel.setSelfIdentityNo(selfIdentityNo);
}
if (StringUtils.isBlank(residentsName)) {
errorInfo += "姓名为空;";
} else if (StringUtils.isNotBlank((residentsName))) {
BaseResidentInformationUpdateExcel.setUserName(residentsName);
}
if (StringUtils.isNotBlank((residentsSex))) {
BaseResidentInformationUpdateExcel.setGender(residentsSex);
}
if (StringUtils.isNotBlank(residentsSex) && !"0".equals(residentsSex) && !"1".equals(residentsSex)) {
errorInfo += "性别不匹配;";
}
if (StringUtils.isNotBlank((residentsNation))) {
BaseResidentInformationUpdateExcel.setNation(residentsNation);
}
if (StringUtils.isNotBlank((currentEmployer))) {
BaseResidentInformationUpdateExcel.setCurrentEmployer(currentEmployer);
}
if (StringUtils.isNotBlank((currentAddress))) {
BaseResidentInformationUpdateExcel.setCurrentAddress(currentAddress);
}
if (StringUtils.isNotBlank(politicsStatus)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.POLITICS_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDictList = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDictList) {
if (politicsStatus.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setPoliticsStatus(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "政治面貌数据不匹配;";
}
}
if (StringUtils.isNotBlank(specialCrowd)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.SPECIAL_CROWD.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (specialCrowd.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setSpecialCrowd(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "特殊人群数据不匹配;";
}
}
if (StringUtils.isNotBlank(peopleCategories)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.PEOPLE_CATEGORIES.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (peopleCategories.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setPeopleCategories(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "人口类型数据不匹配;";
}
}
//新增字典校验
if (StringUtils.isNotBlank(standardOfCulture)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.EDUCATION_LEVEL.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (standardOfCulture.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setStandardOfCulture(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "文化程度数据不匹配;";
}
}
if (StringUtils.isNotBlank(health)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.BODY_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (health.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setHealth(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "身体状况数据不匹配;";
}
}
if (StringUtils.isNotBlank(maritalStatus)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.MARITAL_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (maritalStatus.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setMaritalStatus(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "婚姻状况数据不匹配;";
}
}
if (StringUtils.isNotBlank(accountType)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.ACCOUNT_TYPE.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (accountType.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setAccountType(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "户口类型数据不匹配;";
}
}
if (StringUtils.isNotBlank(workStatus)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.EMPLOYMENT_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (workStatus.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setWorkStatus(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "就业情况数据不匹配;";
}
}
if (StringUtils.isNotBlank(unemploymentReason)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.UNEMPLOYMENT_REASON.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (unemploymentReason.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setUnemploymentReason(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "失业原因数据不匹配;";
}
}
if (StringUtils.isNotBlank(familyCategory)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.FAMILY_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (familyCategory.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setFamilyCategory(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "家庭类别数据不匹配;";
}
}
if (StringUtils.isNotBlank(helpStatus)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.HELP_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (helpStatus.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setHelpStatus(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "救助情况数据不匹配;";
}
}
if (StringUtils.isNotBlank(motorVehicleCategory)) {
boolean isMatch = false;
for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) {
if (PopulationDictConstant.MOTOR_VEHICLE_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())) {
List<SysSimpleDictDTO> sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts();
for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) {
if (motorVehicleCategory.equals(sysSimpleDict.getDictName())) {
isMatch = true;
BaseResidentInformationUpdateExcel.setMotorVehicleCategory(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorInfo += "机动车类型数据不匹配;";
}
}
//如果有错误信息
if(StringUtils.isNotBlank(errorInfo)){
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorInfo(errorInfo);
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoList.add(errorLineInfoDto);
}
}
return errorLineInfoList;
}
/**
* @return void
* @Description 校验完成后插入居民信息
* @Author songyunpeng
* @Date 2020/8/31
* @Param [baseResidentInformationExcels]
**/
private void saveResidentList(List<BaseResidentInformationUpdateExcel> baseResidentInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO, Map<String, String> populationIdNoAndIdMap) {
for (BaseResidentInformationUpdateExcel baseResidentInformationExcel : baseResidentInformationExcels) {
//插入居民信息
EpidemicUserInfoEntity epidemicUserInfoEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, EpidemicUserInfoEntity.class);
// populationInformationEntity.setResidentsIdentityNo(baseResidentInformationExcel.getResidentsFamilyIdentityNo());
// EpidemicUserInfoEntity epidemicUserInfoEntity = convertInformationToUserInfo(populationInformationEntity);
epidemicUserInfoEntity.setIdCard(baseResidentInformationExcel.getSelfIdentityNo());
epidemicUserInfoEntity.setMotorVehicleNum(Integer.valueOf(baseResidentInformationExcel.getMotorVehicleNum()));
if(null != parentAndAllDeptDTO){
epidemicUserInfoEntity.setDeptId(parentAndAllDeptDTO.getGridId());
epidemicUserInfoEntity.setDeptName(parentAndAllDeptDTO.getGrid());
epidemicUserInfoEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds());
epidemicUserInfoEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames());
epidemicUserInfoEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds());
epidemicUserInfoEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames());
}
//备注字典转换,不是数据字典
//再就业优惠证
if("无".equals(epidemicUserInfoEntity.getReemploymentPermit())){
epidemicUserInfoEntity.setReemploymentPermit("0");
}else if("有".equals(epidemicUserInfoEntity.getReemploymentPermit())){
epidemicUserInfoEntity.setReemploymentPermit("1");
}else{
epidemicUserInfoEntity.setReemploymentPermit("");
}
//失业登记
if("否".equals(epidemicUserInfoEntity.getUnemploymentRegister())){
epidemicUserInfoEntity.setUnemploymentRegister("0");
}else if("是".equals(epidemicUserInfoEntity.getUnemploymentRegister())){
epidemicUserInfoEntity.setUnemploymentRegister("1");
}else{
epidemicUserInfoEntity.setUnemploymentRegister("");
}
// 已存在的居民信息进行更新,否则进行插入操作
EpidemicUserInfoEntity check = epidemicUserInfoService.selectInfoByIdCard(baseResidentInformationExcel.getSelfIdentityNo());
if (null == check) {
// epidemicUserInfoEntity.setRelation(baseResidentInformationExcel.getHouseHeadRelation());
epidemicUserInfoService.insert(epidemicUserInfoEntity);
} else {
// check.setRelation(baseResidentInformationExcel.getHouseHeadRelation());
check.setUserName(epidemicUserInfoEntity.getUserName());
check.setGender(epidemicUserInfoEntity.getGender());
check.setNation(epidemicUserInfoEntity.getNation());
check.setMobile(epidemicUserInfoEntity.getMobile());
check.setWorkUnits(epidemicUserInfoEntity.getWorkUnits());
check.setLiveAddressName(epidemicUserInfoEntity.getLiveAddressName());
check.setHouseholdRegisterDetail(epidemicUserInfoEntity.getLiveAddressName());
check.setPeopleCategories(epidemicUserInfoEntity.getPeopleCategories());
check.setSpecialCrowd(epidemicUserInfoEntity.getSpecialCrowd());
check.setPoliticsStatus(epidemicUserInfoEntity.getPoliticsStatus());
check.setStandardOfCulture(epidemicUserInfoEntity.getStandardOfCulture());
check.setHealth(epidemicUserInfoEntity.getHealth());
check.setMaritalStatus(epidemicUserInfoEntity.getMaritalStatus());
check.setAccountType(epidemicUserInfoEntity.getAccountType());
check.setWorkStatus(epidemicUserInfoEntity.getWorkStatus());
check.setUnemploymentReason(epidemicUserInfoEntity.getUnemploymentReason());
check.setFamilyCategory(epidemicUserInfoEntity.getFamilyCategory());
check.setHelpStatus(epidemicUserInfoEntity.getHelpStatus());
check.setMotorVehicleCategory(epidemicUserInfoEntity.getMotorVehicleCategory());
check.setJoinTime(epidemicUserInfoEntity.getJoinTime());
check.setOrganizationalRelationshipLocation(epidemicUserInfoEntity.getOrganizationalRelationshipLocation());
check.setMilitary(epidemicUserInfoEntity.getMilitary());
check.setCurrentEmployerAddress(epidemicUserInfoEntity.getCurrentEmployerAddress());
check.setReemploymentPermit(epidemicUserInfoEntity.getReemploymentPermit());
check.setUnemploymentRegister(epidemicUserInfoEntity.getUnemploymentRegister());
check.setUnemploymentRegisterTime(epidemicUserInfoEntity.getUnemploymentRegisterTime());
check.setMotorVehicleNum(epidemicUserInfoEntity.getMotorVehicleNum());
check.setDogStatus(epidemicUserInfoEntity.getDogStatus());
check.setDeptId(epidemicUserInfoEntity.getDeptId());
check.setDeptName(epidemicUserInfoEntity.getDeptName());
check.setParentDeptIds(epidemicUserInfoEntity.getParentDeptIds());
check.setParentDeptNames(epidemicUserInfoEntity.getParentDeptNames());
check.setAllDeptIds(epidemicUserInfoEntity.getAllDeptIds());
check.setAllDeptNames(epidemicUserInfoEntity.getAllDeptNames());
epidemicUserInfoService.updateById(check);
}
//插入房屋人员关联关系表
// HouseResidentEntity houseResidentEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, HouseResidentEntity.class);
// if (null == check) {
// houseResidentEntity.setResidentId(epidemicUserInfoEntity.getId().toString());
// } else {
// houseResidentEntity.setResidentId(check.getId().toString());
// }
//根据身份证获取户主ID
//查找户主ID
// String houseHeadId;
// String houseId;
// EpidemicUserInfoEntity infoByIdentityNo = epidemicUserInfoDao.selectInfoByIdCard(baseResidentInformationExcel.getResidentsIdentityNo());
// if (infoByIdentityNo == null) {
// //查找不到户主则从Map中取
// houseHeadId = populationIdNoAndIdMap.get(baseResidentInformationExcel.getResidentsIdentityNo());
// houseId = populationIdNoAndIdMap.get(houseHeadId);
// } else {
// houseHeadId = infoByIdentityNo.getId().toString();
// houseId = populationIdNoAndIdMap.get(houseHeadId);
// }
// houseResidentEntity.setHouseHeadId(houseHeadId);
// houseResidentEntity.setHouseId(houseId);
// houseResidentEntity.setIsHouseHead("0");
// houseResidentEntity.setHouseHeadRelation(baseResidentInformationExcel.getHouseHeadRelation());
// houseResidentDao.insert(houseResidentEntity);
if (null != parentAndAllDeptDTO) {
// 更新疫苗接种记录
vaccinationInfoHandle(baseResidentInformationExcel.getSelfIdentityNo(), parentAndAllDeptDTO);
}
}
}
/**
* 转换新旧人员信息实体类
*
* @param informationEntity
* @return com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity
* @author zhy
* @date 2021/9/3 16:36
*/
private EpidemicUserInfoEntity convertInformationToUserInfo(PopulationInformationEntity informationEntity) {
EpidemicUserInfoEntity entity = new EpidemicUserInfoEntity();
if (informationEntity.getId() != null) {
entity.setId(Long.parseLong(informationEntity.getId()));
}
entity.setUserName(informationEntity.getResidentsName());
entity.setGender(informationEntity.getResidentsSex());
entity.setNation(informationEntity.getResidentsNation());
if (informationEntity.getResidentsBirthday() != null) {
entity.setBirthday(DateUtils.format(informationEntity.getResidentsBirthday()));
}
entity.setStandardOfCulture(informationEntity.getEducationLevel());
entity.setPoliticsStatus(informationEntity.getPoliticsStatus());
entity.setJoinTime(informationEntity.getJoinTime());
entity.setOrganizationalRelationshipLocation(informationEntity.getOrganizationalRelationshipLocation());
entity.setIdCard(informationEntity.getResidentsIdentityNo());
entity.setMobile(informationEntity.getResidentsPhone());
entity.setHealth(informationEntity.getBodyStatus());
entity.setMaritalStatus(informationEntity.getMaritalStatus());
entity.setAccountType(informationEntity.getAccountType());
entity.setMilitary(informationEntity.getMilitaryService());
entity.setHouseholdRegisterDetail(informationEntity.getHouseholdRegistrationPlace());
entity.setWorkStatus(informationEntity.getEmploymentStatus());
entity.setWorkUnits(informationEntity.getCurrentEmployer());
entity.setCurrentEmployerAddress(informationEntity.getCurrentEmployerAddress());
entity.setUnemploymentReason(informationEntity.getUnemploymentReason());
entity.setReemploymentPermit(informationEntity.getReemploymentPermit());
entity.setUnemploymentRegister(informationEntity.getUnemploymentRegister());
entity.setUnemploymentRegisterTime(informationEntity.getUnemploymentRegisterTime());
entity.setSpecialCrowd(informationEntity.getSpecialCrowd());
entity.setFamilyCategory(informationEntity.getFamilyCategory());
entity.setHelpStatus(informationEntity.getHelpStatus());
entity.setMotorVehicleNum(informationEntity.getMotorVehicleNum());
entity.setMotorVehicleCategory(informationEntity.getMotorVehicleCategory());
entity.setDogStatus(informationEntity.getDogStatus());
entity.setFamilyMemberNum(informationEntity.getFamilyMemberNum());
entity.setFamilyMemberOutNum(informationEntity.getFamilyMemberOutNum());
entity.setFamilyMemberOutMonth(informationEntity.getFamilyMemberOutMonth());
entity.setFamilyMemberOutReason(informationEntity.getFamilyMemberOutReason());
entity.setSpecialCrowd(informationEntity.getSpecialCrowd());
entity.setPeopleCategories(informationEntity.getPeopleCategories());
entity.setRelation(NumConstant.ONE_STR);
entity.setLiveAddressName(informationEntity.getCurrentAddress());
entity.setHouseholdRegisterDetail(informationEntity.getCurrentAddress());
return entity;
}
/**
* 更新疫苗接种信息
*
* @param idCard
* @param parentAndAllDeptDTO
* @return void
* @author zhy
* @date 2021/9/16 14:09
*/
private void vaccinationInfoHandle(String idCard, ParentAndAllDeptDTO parentAndAllDeptDTO) {
// 更新疫苗接种网格信息
VaccinationInfoEntity vaccinationInfoEntity = new VaccinationInfoEntity();
vaccinationInfoEntity.setIdentityNo(idCard);
vaccinationInfoEntity.setGridId(parentAndAllDeptDTO.getGridId());
vaccinationInfoEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames());
vaccinationInfoEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds());
vaccinationInfoEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames());
vaccinationInfoEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds());
vaccinationInfoDao.updateDeptInfo(vaccinationInfoEntity);
}
}

6
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java

@ -7,10 +7,10 @@ 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.http.MediaType;
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;
@ -51,6 +51,6 @@ public interface VimAdminFeignClient {
* @Date 2020/8/31
* @Param [sysPopulationSimpleDictFormDTO]
**/
@PostMapping("sys/dict/listPopulationSimple")
Result<List<SysPopulationSimpleDictDTO>> listPopulationSimple(@RequestBody SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO);
@PostMapping(value = "sys/dict/listPopulationSimple", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<SysPopulationSimpleDictDTO>> listPopulationSimple(SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO);
}

117
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationUpdateExcel.java

@ -0,0 +1,117 @@
package com.elink.esua.epdc.vaccine.house.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
/**
* @program: 人口信息导入 -改版
* @description:
* @author: wangtong
* @create: 2021-10-27 17:58
**/
@Data
public class BaseResidentInformationUpdateExcel implements Serializable {
@Excel(name = "姓名")
private String userName;
@Excel(name = "性别", replace = {"女_0", "男_1"})
private String gender;
@Excel(name = "民族")
private String nation;
@Excel(name = "现工作单位")
private String currentEmployer;
@Excel(name = "居民身份证号码")
private String residentsFamilyIdentityNo;
@Excel(name = "现居住地")
private String currentAddress;
@Excel(name = "特殊人群")
private String specialCrowd;
@Excel(name = "联系电话",width = 20)
private String mobile;
@Excel(name = "政治面貌")
private String politicsStatus;
@Excel(name = "人口类型")
private String peopleCategories;
@Excel(name = "身份证号码")
private String selfIdentityNo;
private String birthday;
@Excel(name = "文化程度")
private String standardOfCulture;
@Excel(name = "身体状况")
private String health;
@Excel(name = "婚姻状况")
private String maritalStatus;
@Excel(name = "户口类型")
private String accountType;
@Excel(name = "就业情况")
private String workStatus;
@Excel(name = "失业原因")
private String unemploymentReason;
@Excel(name = "家庭类别")
private String familyCategory;
@Excel(name = "救助情况")
private String helpStatus;
@Excel(name = "机动车类型")
private String motorVehicleCategory;
//无字典
@Excel(name = "入党时间")
private String joinTime;
@Excel(name = "组织关系所在地")
private String organizationalRelationshipLocation;
@Excel(name = "服兵役")
private String military;
// @Excel(name = "户籍地")
// private String motorVehicleCategory;
@Excel(name = "现单位地址")
private String currentEmployerAddress;
@Excel(name = "再就业优惠证")
private String reemploymentPermit;
@Excel(name = "失业登记")
private String unemploymentRegister;
@Excel(name = "失业登记时间")
private String unemploymentRegisterTime;
@Excel(name = "机动车数量")
private String motorVehicleNum;
@Excel(name = "宠物犬状况")
private String dogStatus;
@Excel(name = "年龄")
private Integer age;
}

11
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java

@ -5,14 +5,13 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.constant.OrganizationTypeConstant;
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.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.FileUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.vaccine.common.base.BaseVimCurdServiceImpl;
import com.elink.esua.epdc.vaccine.epidemic.constant.StrConstant;
@ -48,9 +47,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -113,7 +114,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati
params.putAll(authParams);
// 街道和超管有权查看所有数据
if (NumConstant.ZERO == user.getSuperAdmin() && user.getDeptId() != 1258587398679126017L) {
if (NumConstant.ZERO == user.getSuperAdmin() && !user.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_PARTY)) {
params.put("deptIdList", user.getDeptIdList());
}

77
epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml

@ -48,11 +48,15 @@
ui.LIVE_ADDRESS_NAME,
ui.HOUSEHOLD_REGISTER_NAME householdRegisterName,
if(ui.check_state='0','已检测','未检测') as checkStateName,
hi.ALL_DEPT_NAMES
ui.ALL_DEPT_NAMES
from epidemic_user_info ui
LEFT JOIN epdc_house_resident hr on CONVERT(hr.RESIDENT_ID, UNSIGNED INTEGER) = ui.id
left join epdc_housing_information hi on hi.id = hr.HOUSE_ID and hi.DEL_FLAG='0'
where ui.DEL_FLAG='0'
<if test="haveDept != null and haveDept != '' and haveDept== '1'.toString()">
and ( ui.DEPT_ID != '' and ui.DEPT_ID is not null)
</if>
<if test="haveDept != null and haveDept != '' and haveDept== '2'.toString()">
and ( ui.DEPT_ID = '' or ui.DEPT_ID is null)
</if>
<if test="checkState != null and checkState != '' and checkState== '0'.toString()">
and ui.check_state = #{checkState}
</if>
@ -104,19 +108,19 @@
and ui.HOUSEHOLD_REGISTER_NAME like '%${householdRegisterName}%'
</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},hi.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},hi.ALL_DEPT_IDS))
AND (find_in_set(#{streetId},ui.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ui.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},hi.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},hi.ALL_DEPT_IDS))
AND (find_in_set(#{communityId},ui.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ui.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (hi.grid_id = #{gridId}
OR find_in_set(#{gridId},hi.ALL_DEPT_IDS))
and (ui.dept_id = #{gridId}
OR find_in_set(#{gridId},ui.ALL_DEPT_IDS))
</if>
<if test="deptIdList != null and deptIdList.size() > 0">
and hi.grid_id in
and ui.dept_id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
@ -127,6 +131,7 @@
</if>
</select>
<select id="getEpidemicPage" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO">
select ui.ID,
ui.ID as infoId,
ui.USER_NAME,
@ -138,10 +143,8 @@
IFNULL(ui.VACCINATION_NUM, 0) AS VACCINATION_NUM,
IFNULL(ui.VACCINATION_STATE, 0) AS VACCINATION_STATE,
ui.CREATED_TIME,
hi.ALL_DEPT_NAMES
ui.ALL_DEPT_NAMES
from epidemic_user_info ui
LEFT JOIN epdc_house_resident hr on CONVERT(hr.RESIDENT_ID, UNSIGNED INTEGER) = ui.id
left join epdc_housing_information hi on hi.id = hr.HOUSE_ID and hi.DEL_FLAG='0'
where ui.DEL_FLAG='0'
<if test="idCard!=null and idCard!=''">
and ui.ID_CARD like '%${idCard}%'
@ -153,19 +156,19 @@
and ui.USER_NAME like '%${userName}%'
</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},hi.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},hi.ALL_DEPT_IDS))
AND (find_in_set(#{streetId},ui.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ui.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},hi.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},hi.ALL_DEPT_IDS))
AND (find_in_set(#{communityId},ui.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ui.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (hi.grid_id = #{gridId}
OR find_in_set(#{gridId},hi.ALL_DEPT_IDS))
and (ui.dept_id = #{gridId}
OR find_in_set(#{gridId},ui.ALL_DEPT_IDS))
</if>
<if test="deptIdList != null and deptIdList.size() > 0">
and hi.grid_id in
and ui.dept_id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
@ -173,39 +176,7 @@
ORDER BY ui.CREATED_TIME DESC
</select>
<select id="getDetailById" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordDetailDTO">
SELECT ui.USER_NAME,
ui.ID_CARD,
ui.HOUSEHOLD_REGISTER_CODE,
ui.HOUSEHOLD_REGISTER_NAME,
ui.HOUSEHOLD_REGISTER_DETAIL,
ui.ID,
ui.MOBILE,
ui.HOUSE_PROPERTY,
ui.GENDER,
ui.NATION,
ui.FORMER_NAME,
ui.BIRTHDAY,
ui.HEIGHT,
ui.STANDARD_OF_CULTURE,
ui.HEALTH,
ui.MARITAL_STATUS,
ui.RELATION,
ui.NATIONALITY,
ui.POLITICS_STATUS,
ui.FAITH,
ui.GRADUATE_SCHOOL,
ui.PROFESSIONAL,
ui.WORK_STATUS,
ui.INDUSTRY_CATEGORY,
ui.WORK_UNITS,
ui.MILITARY,
ui.PEOPLE_CATEGORIES,
ui.SPECIAL_CROWD,
ui.CAR,
ui.CAR_NO,
ui.HUSHAI_STATUS,
ui.NATIVE_PLACE,
ui.BLOOD_TYPE
SELECT ui.*
FROM epidemic_user_info ui
where ui.DEL_FLAG = '0' AND ui.ID = #{id,jdbcType=BIGINT}
</select>

Loading…
Cancel
Save