Browse Source

补充修改功能

origin/epidemic_user
zhangyuan 4 years ago
parent
commit
61c66ef881
  1. 4
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java
  2. 2
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoDao.java
  3. 2
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicRecordDetailDTO.java
  4. 2
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicRecordListDTO.java
  5. 1
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java
  6. 109
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java
  7. 2
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/fallback/VimAdminFeignClientFallback.java
  8. 8
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseResidentDao.java
  9. 2
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BasePopulationInformationExcel.java
  10. 2
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationExcel.java
  11. 108
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java
  12. 175
      epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml
  13. 6
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml
  14. 6
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/HousingInformationDao.xml

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

@ -2,7 +2,6 @@ package com.elink.esua.epdc.vaccine.epidemic.controller;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter;
import com.elink.esua.epdc.commons.tools.annotation.LogOperation;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
@ -46,11 +45,8 @@ public class EpidemicUserInfoController {
private EpidemicUserInfoExportServer exportServer;
@GetMapping("page")
@DataFilter(tableAlias = "hi", deptId = "grid_id", prefix = "and", isPendingCreator = false)
public Result<PageData<EpidemicRecordListDTO>> page(@RequestParam Map<String, Object> params) {
// 按人员往返时间倒序排列
PageData<EpidemicRecordListDTO> page = epidemicUserInfoService.getPageList(params);
return new Result<PageData<EpidemicRecordListDTO>>().ok(page);
}

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

@ -61,7 +61,7 @@ public interface EpidemicUserInfoDao extends BaseDao<EpidemicUserInfoEntity> {
* @date 2021/1/26 21:02
* @params [id]
*/
EpidemicRecordDetailDTO getDetailById(@Param("detailId") Long detailId);
EpidemicRecordDetailDTO getDetailById(@Param("id") Long id);
/**
* 根据信息表id查询基础信息表信息

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

@ -1,7 +1,5 @@
package com.elink.esua.epdc.vaccine.epidemic.dto;
// import io.swagger.annotations.ApiModel;
// import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;

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

@ -218,4 +218,6 @@ public class EpidemicRecordListDTO implements Serializable {
// @ApiModelProperty(value = "核酸检测状态")
private String checkStateName;
private String allDeptNames;
}

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

@ -14,7 +14,6 @@ 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.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;

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

@ -98,11 +98,13 @@ 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) {
params.put("deptIdList", user.getDeptIdList());
}
List<EpidemicRecordListDTO> list = baseDao.getEpidemicUserRecordList(params);
for (EpidemicRecordListDTO eru : list) {
eru.setUserName(nameDesensitization(eru.getUserName()));
eru.setRelationPeople(nameDesensitization(eru.getRelationPeople()));
}
return new PageData<>(list, page.getTotal());
}
@ -179,11 +181,11 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
//基础信息dto
EpidemicUserInfoEntity userInfoDTO = new EpidemicUserInfoEntity();
//录入信息dto
EpidemicUserInoutRecordEntity userInoutRecordDTO = new EpidemicUserInoutRecordEntity();
// EpidemicUserInoutRecordEntity userInoutRecordDTO = new EpidemicUserInoutRecordEntity();
//拷贝出入数据
BeanUtils.copyProperties(dto, userInfoDTO);
BeanUtils.copyProperties(dto, userInoutRecordDTO);
// BeanUtils.copyProperties(dto, userInoutRecordDTO);
//1.校验 身份证号
String idCard = dto.getIdCard();
if (StringUtils.isEmpty(idCard)) {
@ -198,19 +200,19 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
if (null == userInfoDTO.getId() || StringUtils.isEmpty(userInfoDTO.getId().toString())) {
return new Result().error("无此数据,请联系管理员!!!");
}
if (null == dto.getUserInoutId() || StringUtils.isEmpty(dto.getUserInoutId().toString())) {
userInoutRecordDTO.setId(dto.getId());
}
// if (null == dto.getUserInoutId() || StringUtils.isEmpty(dto.getUserInoutId().toString())) {
// userInoutRecordDTO.setId(dto.getId());
// }
//查询信息
EpidemicUserInfoEntity entity = baseDao.selectByIdCard(dto.getId());
userInfoDTO.setId(entity.getId());
Long userInroutid = dto.getId();
EpidemicUserInoutRecordEntity inoutRecordEntity = inoutRecordDao.selectById(userInroutid);
// Long userInroutid = dto.getId();
// EpidemicUserInoutRecordEntity inoutRecordEntity = inoutRecordDao.selectById(userInroutid);
//进行身份证号校验
if (idCard.contains("*")) {
//身份证号带* 说明没有改
userInfoDTO.setIdCard(entity.getIdCard());
userInoutRecordDTO.setIdCard(entity.getIdCard());
// userInoutRecordDTO.setIdCard(entity.getIdCard());
} else { //身份证号不带* 说明改了要校验
String s = fixAndCheckIdentityNo(idCard);
//校验之后要进行唯一性查询
@ -223,45 +225,45 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
return new Result().error("身份证号已存在!!!");
}
//身份证号已经验证完事需要更新人员出行信息表所有的数据
inoutRecordDao.updateListByIdCard(s, inoutRecordEntity.getIdCard());
// inoutRecordDao.updateListByIdCard(s, inoutRecordEntity.getIdCard());
}
//判断名字是否需要修改
if (userInfoDTO.getUserName().contains("*")) {
userInfoDTO.setUserName(entity.getUserName());
}
//判断手机号是否需要修稿
if (userInoutRecordDTO.getMobile().contains("*")) {
userInoutRecordDTO.setMobile(inoutRecordEntity.getMobile());
} else {
String mobile = userInoutRecordDTO.getMobile();
Boolean isMobile = ValidateUtils.validateMobilePhone(mobile);
if (!isMobile) {
return new Result().error("电话号格式不正确");
}
}
//判断关联人
if (!StringUtils.isEmpty(userInoutRecordDTO.getRelationPeople())) {
if (userInoutRecordDTO.getRelationPeople().contains("*")) {
userInoutRecordDTO.setRelationPeople(inoutRecordEntity.getRelationPeople());
}
}
//判断关联人联系电话
if (!StringUtils.isEmpty(userInoutRecordDTO.getRelationPeopleMobile())) {
if (userInoutRecordDTO.getRelationPeopleMobile().contains("*")) {
userInoutRecordDTO.setRelationPeopleMobile(inoutRecordEntity.getRelationPeopleMobile());
} else {
String peopleMobile = userInoutRecordDTO.getRelationPeopleMobile();
boolean isMobile = ValidateUtils.validateMobilePhone(peopleMobile);
if (!isMobile) {
return new Result().error("关联人联系电话格式不正确");
}
}
}
// //判断手机号是否需要修稿
// if (userInoutRecordDTO.getMobile().contains("*")) {
// userInoutRecordDTO.setMobile(inoutRecordEntity.getMobile());
// } else {
// String mobile = userInoutRecordDTO.getMobile();
// Boolean isMobile = ValidateUtils.validateMobilePhone(mobile);
// if (!isMobile) {
// return new Result().error("电话号格式不正确");
// }
// }
// //判断关联人
// if (!StringUtils.isEmpty(userInoutRecordDTO.getRelationPeople())) {
// if (userInoutRecordDTO.getRelationPeople().contains("*")) {
// userInoutRecordDTO.setRelationPeople(inoutRecordEntity.getRelationPeople());
// }
// }
// //判断关联人联系电话
// if (!StringUtils.isEmpty(userInoutRecordDTO.getRelationPeopleMobile())) {
// if (userInoutRecordDTO.getRelationPeopleMobile().contains("*")) {
// userInoutRecordDTO.setRelationPeopleMobile(inoutRecordEntity.getRelationPeopleMobile());
// } else {
// String peopleMobile = userInoutRecordDTO.getRelationPeopleMobile();
// boolean isMobile = ValidateUtils.validateMobilePhone(peopleMobile);
// if (!isMobile) {
// return new Result().error("关联人联系电话格式不正确");
// }
// }
// }
} catch (RenException e) {
return new Result().error(e.getMsg());
}
this.updateById(userInfoDTO);
inoutRecordService.updateById(userInoutRecordDTO);
// inoutRecordService.updateById(userInoutRecordDTO);
return new Result();
}
@ -271,11 +273,11 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
//基础信息dto
EpidemicUserInfoEntity userInfoDTO = new EpidemicUserInfoEntity();
//录入信息dto
EpidemicUserInoutRecordEntity userInoutRecordDTO = new EpidemicUserInoutRecordEntity();
// EpidemicUserInoutRecordEntity userInoutRecordDTO = new EpidemicUserInoutRecordEntity();
try {
//拷贝出入数据
BeanUtils.copyProperties(dto, userInfoDTO);
BeanUtils.copyProperties(dto, userInoutRecordDTO);
// BeanUtils.copyProperties(dto, userInoutRecordDTO);
//1.校验 身份证号
String idCard = dto.getIdCard();
if (StringUtils.isEmpty(idCard)) {
@ -289,18 +291,18 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
deleteIdCardArr.add(dto.getIdCard());
EpidemicUserInfoEntity userEntity = ConvertUtils.sourceToTarget(dto, EpidemicUserInfoEntity.class);
EpidemicUserInoutRecordEntity userRecordEntity = ConvertUtils.sourceToTarget(dto, EpidemicUserInoutRecordEntity.class);
// EpidemicUserInoutRecordEntity userRecordEntity = ConvertUtils.sourceToTarget(dto, EpidemicUserInoutRecordEntity.class);
if (StringUtils.isNotBlank(dto.getDestinationAddressCode()) && StringUtils.isNotBlank(dto.getDestinationAddressName())) {
userRecordEntity.setOutLiveAddressName("在境外");
userRecordEntity.setOutLiveAddressCode("1");
}
if (StringUtils.isNotBlank(dto.getLiveAddressCode())) {
userRecordEntity.setLiveAddressName(selectAreaDao.getLiveArea(dto.getLiveAddressCode()).getLabel());
}
// if (StringUtils.isNotBlank(dto.getDestinationAddressCode()) && StringUtils.isNotBlank(dto.getDestinationAddressName())) {
// userRecordEntity.setOutLiveAddressName("在境外");
// userRecordEntity.setOutLiveAddressCode("1");
// }
// if (StringUtils.isNotBlank(dto.getLiveAddressCode())) {
// userRecordEntity.setLiveAddressName(selectAreaDao.getLiveArea(dto.getLiveAddressCode()).getLabel());
// }
epidemicUserInfoService.insert(userEntity);
epidemicUserInoutRecordService.insert(userRecordEntity);
// epidemicUserInoutRecordService.insert(userRecordEntity);
} catch (RenException e) {
return new Result().error(e.getMsg());
}
@ -493,7 +495,10 @@ 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) {
params.put("deptIdList", user.getDeptIdList());
}
List<EpidemicPageResultDTO> list = baseDao.getEpidemicPage(params);
return new PageData<>(list, page.getTotal());
}

2
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/fallback/VimAdminFeignClientFallback.java

@ -30,7 +30,7 @@ public class VimAdminFeignClientFallback implements VimAdminFeignClient {
}
@Override
public Result<List<SysPopulationSimpleDictDTO>> listPopulationSimple(SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO) {
public Result<List<SysPopulationSimpleDictDTO>> listPopulationSimple(SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO){
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listPopulationSimple", sysPopulationSimpleDictFormDTO);
}
}

8
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/dao/HouseResidentDao.java

@ -66,4 +66,12 @@ public interface HouseResidentDao extends BaseDao<HouseResidentEntity> {
* @return com.elink.esua.epdc.entity.HouseResidentEntity
**/
HouseResidentEntity getHouseResidentInfoByResidentId(@Param("residentId") String residentId);
/**
* @Description 根据户主ID获取关联关系表ID
* @Author zhangyuan
* @Date 2020/8/21
* @Param [dto]
* @return com.elink.esua.epdc.entity.HouseResidentEntity
**/
HouseResidentEntity getHouseResidentInfoByHeadId(@Param("houseHeadId") String houseHeadId);
}

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

@ -156,7 +156,7 @@ public class BasePopulationInformationExcel {
@Excel(name = "特殊人群")
private String specialCrowd;
@Excel(name = "人口类型", replace = {"常驻_0", "流动_1", "境外_2"})
@Excel(name = "人口类型")
private String peopleCategories;
}

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

@ -64,7 +64,7 @@ public class BaseResidentInformationExcel {
@Excel(name = "政治面貌")
private String politicsStatus;
@Excel(name = "人口类型", replace = {"常驻_0", "流动_1", "境外_2"})
@Excel(name = "人口类型")
private String peopleCategories;
@Excel(name = "本人身份证号码")

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

@ -27,6 +27,8 @@ 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.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.*;
import com.elink.esua.epdc.constant.HouseUseConstant;
import com.elink.esua.epdc.constant.PopulationDictConstant;
@ -100,7 +102,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
@Resource
private EpidemicUserInfoDao epidemicUserInfoDao;
@Override
public PageData<HousingInformationDTO> page(Map<String, Object> params) {
IPage<HousingInformationEntity> page = baseDao.selectPage(
@ -308,6 +309,10 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
@Override
public PageData<HousingInformationDTO> listOfPage(Map<String, Object> params) {
IPage<HousingInformationDTO> page = getPage(params);
UserDetail user = SecurityUser.getUser();
if (NumConstant.ZERO == user.getSuperAdmin() && user.getDeptId() != 1258587398679126017L) {
params.put("deptIdList", user.getDeptIdList());
}
List<HousingInformationDTO> list = baseDao.selectListOfHousingInformationDTO(params);
return new PageData<>(list, page.getTotal());
}
@ -469,21 +474,34 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, PopulationInformationEntity.class);
populationInformationEntity.setResidentsIdentityNo(baseResidentInformationExcel.getResidentsFamilyIdentityNo());
EpidemicUserInfoEntity epidemicUserInfoEntity = convertInformationToUserInfo(populationInformationEntity);
epidemicUserInfoService.insert(epidemicUserInfoEntity);
epidemicUserInfoEntity.setIdCard(baseResidentInformationExcel.getSelfIdentityNo());
EpidemicUserInfoEntity check = epidemicUserInfoService.selectInfoByIdCard(baseResidentInformationExcel.getSelfIdentityNo());
if (null == check) {
epidemicUserInfoService.insert(epidemicUserInfoEntity);
}
//插入房屋人员关联关系表
HouseResidentEntity houseResidentEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, HouseResidentEntity.class);
houseResidentEntity.setResidentId(epidemicUserInfoEntity.getId().toString());
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);
@ -542,6 +560,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
houseResidentEntity.setIsHouseHead(NumConstant.ONE_STR);
houseResidentDao.insert(houseResidentEntity);
populationIdNoAndIdMap.put(basePopulationInformationExcel.getResidentsIdentityNo(), epidemicUserInfoEntity.getId().toString());
populationIdNoAndIdMap.put(epidemicUserInfoEntity.getId().toString(), housingInformationEntity.getId());
}
return populationIdNoAndIdMap;
}
@ -632,12 +651,17 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
for (int i = 0; i < basePopulationInformationExcels.size(); i++) {
BaseResidentInformationExcel baseResidentInformationExcel = basePopulationInformationExcels.get(i);
String residentsIdentityNo = baseResidentInformationExcel.getResidentsIdentityNo() == null ? null : baseResidentInformationExcel.getResidentsIdentityNo().trim();
String selfIdentityNo = baseResidentInformationExcel.getSelfIdentityNo() == null ? null : baseResidentInformationExcel.getSelfIdentityNo().trim();
String houseHeadRelation = baseResidentInformationExcel.getHouseHeadRelation() == null ? null : baseResidentInformationExcel.getHouseHeadRelation().trim();
String residentsName = baseResidentInformationExcel.getResidentsName() == null ? null : baseResidentInformationExcel.getResidentsName().trim();
String residentsSex = baseResidentInformationExcel.getResidentsSex() == null ? null : baseResidentInformationExcel.getResidentsSex().trim();
String residentsNation = baseResidentInformationExcel.getResidentsNation() == null ? null : baseResidentInformationExcel.getResidentsNation().trim();
String currentEmployer = baseResidentInformationExcel.getCurrentEmployer() == null ? null : baseResidentInformationExcel.getCurrentEmployer().trim();
String currentAddress = baseResidentInformationExcel.getCurrentAddress() == null ? null : baseResidentInformationExcel.getCurrentAddress().trim();
String specialCrowd = baseResidentInformationExcel.getSpecialCrowd() == null ? null : baseResidentInformationExcel.getSpecialCrowd().trim();
String peopleCategories = baseResidentInformationExcel.getPeopleCategories() == null ? null : baseResidentInformationExcel.getPeopleCategories().trim();
String politicsStatus = baseResidentInformationExcel.getPoliticsStatus() == null ? null : baseResidentInformationExcel.getPoliticsStatus().trim();
if (StringUtils.isBlank(residentsIdentityNo)) {
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
@ -657,6 +681,20 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
}
baseResidentInformationExcel.setResidentsIdentityNo(residentsIdentityNo);
}
if (StringUtils.isNotBlank(selfIdentityNo)) {
String result = IdentityNoUtils.IdentityNoVerification(selfIdentityNo);
if (result != null) {
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("本人身份证号码有误");
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
} else {
baseResidentInformationExcel.setResidentsSex(IdentityNoUtils.getSex(residentsIdentityNo));
baseResidentInformationExcel.setResidentsBirthday(DateUtil.parse(IdentityNoUtils.getBirthday(residentsIdentityNo)));
}
baseResidentInformationExcel.setResidentsIdentityNo(residentsIdentityNo);
}
if (StringUtils.isBlank(houseHeadRelation)) {
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
@ -725,7 +763,69 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
} else if (StringUtils.isNotBlank((currentAddress))) {
baseResidentInformationExcel.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;
baseResidentInformationExcel.setPoliticsStatus(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("政治面貌数据不匹配");
errorLineInfoDto.setSheetName("居住人信息");
errorLineInfoList.add(errorLineInfoDto);
}
}
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;
baseResidentInformationExcel.setSpecialCrowd(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("特殊人群数据不匹配");
errorLineInfoDto.setSheetName("居住人信息");
errorLineInfoList.add(errorLineInfoDto);
}
}
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;
baseResidentInformationExcel.setPeopleCategories(sysSimpleDict.getDictValue());
}
}
}
}
if (!isMatch) {
errorLineInfoDto = new EpdcPopulationErrorResultDTO();
errorLineInfoDto.setErrorLine((i + 2) + "");
errorLineInfoDto.setErrorInfo("人口类型数据不匹配");
errorLineInfoDto.setSheetName("居住人信息");
errorLineInfoList.add(errorLineInfoDto);
}
}
}
return errorLineInfoList;
}

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

@ -33,8 +33,7 @@
</update>
<select id="getEpidemicUserRecordList" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordListDTO">
select
-- uir.LIVE_ADDRESS_NAME as street,
-- uir.LIVE_ADDRESS_NAME,
ui.ID,
ui.USER_NAME,
ui.ID_CARD,
ui.age,
@ -44,19 +43,10 @@
ui.PEOPLE_CATEGORIES,
ui.SPECIAL_CROWD,
ui.HUSHAI_STATUS,
-- uir.ID,
-- uir.MOBILE,
-- uir.COMMUNITY,
-- uir.GRID_NAME,
-- uir.PLOT,
-- uir.BUILDING_NO,
-- uir.UNIT,
-- IFNULL(uir.RETURN_STATE,'') AS RETURN_STATE ,
-- IFNULL(uir.RISK_GRADE,'') AS RISK_GRADE,
-- uir.ROOM_NO,
-- uir.OUT_LIVE_ADDRESS_NAME outLiveAddressName,
ui.MOBILE,
ui.HOUSEHOLD_REGISTER_NAME householdRegisterName,
if(ui.check_state='0','已检测','未检测') as checkStateName
if(ui.check_state='0','已检测','未检测') as checkStateName,
hi.ALL_DEPT_NAMES
from epidemic_user_info ui
LEFT JOIN epdc_house_resident hr on hr.RESIDENT_ID = ui.id
left join epdc_housing_information hi on hi.id = hr.HOUSE_ID and hi.DEL_FLAG='0'
@ -74,16 +64,7 @@
and ui.USER_NAME like '%${username}%'
</if>
<if test="mobile != null and mobile != ''">
and uir.MOBILE = #{mobile}
</if>
<if test="street != null and street != ''">
and uir.LIVE_ADDRESS_NAME like '%${street}%'
</if>
<if test="community != null and community != ''">
and uir.COMMUNITY like '%${community}%'
</if>
<if test="gridName != null and gridName != ''">
and uir.GRID_NAME like '%${gridName}%'
and ui.MOBILE = #{mobile}
</if>
<if test="specialCrowd != null and specialCrowd != ''">
and ui.SPECIAL_CROWD = #{specialCrowd}
@ -117,30 +98,9 @@
<if test="isInoculate != null and isInoculate != '' and isInoculate == 12">
and ui.VACCINATION_STATE IN ('1', '2')
</if>
<if test="streetKeywords != null">
AND uir.LIVE_ADDRESS_NAME IN
<foreach collection="streetKeywords" index="index" item="street" open="(" separator="," close=")">
#{street}
</foreach>
</if>
<if test="communityKeywords != null">
AND uir.COMMUNITY IN
<foreach collection="communityKeywords" index="index" item="community" open="(" separator="," close=")">
#{community}
</foreach>
</if>
<if test="gridKeywords != null">
AND uir.GRID_NAME IN
<foreach collection="gridKeywords" index="index" item="grid" open="(" separator="," close=")">
#{grid}
</foreach>
</if>
<if test="householdRegisterName != null and householdRegisterName.trim() != ''">
and ui.HOUSEHOLD_REGISTER_NAME like '%${householdRegisterName}%'
</if>
<if test="outLiveAddressName != null and outLiveAddressName.trim() != ''">
and uir.OUT_LIVE_ADDRESS_NAME like '%${outLiveAddressName}%'
</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))
@ -153,6 +113,12 @@
and (hi.grid_id = #{gridId}
OR find_in_set(#{gridId},hi.ALL_DEPT_IDS))
</if>
<if test="deptIdList != null">
and hi.grid_id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY ui.UPDATED_TIME DESC
<if test="excelBigDataPageSize != null and excelBigDataPageIndex != null">
limit #{excelBigDataPageIndex},#{excelBigDataPageSize}
@ -164,36 +130,8 @@
ui.HOUSEHOLD_REGISTER_CODE,
ui.HOUSEHOLD_REGISTER_NAME,
ui.HOUSEHOLD_REGISTER_DETAIL,
uir.ID,
uir.MOBILE,
CASE uir.RETURN_STATE
WHEN '1' THEN '1'
WHEN '2' THEN '2'
ELSE ''
END AS RETURN_STATE,
uir.LIVE_ADDRESS_CODE,
uir.LIVE_ADDRESS_NAME,
uir.LIVE_ADDRESS_DETAIL,
uir.RELATION_PEOPLE,
uir.RELATION_PEOPLE_MOBILE,
uir.OUT_LIVE_ADDRESS_CODE,
uir.OUT_LIVE_ADDRESS_NAME,
uir.OUT_LIVE_ADDRESS_DETAIL,
CASE uir.RISK_GRADE
WHEN '1' THEN '1'
WHEN '2' THEN '2'
WHEN '3' THEN '3'
ELSE ''
end as RISK_GRADE,
DATE_FORMAT(GO_BARK_TIME, '%Y-%m-%d %H:%i:%s') as GO_BARK_TIME,
DATE_FORMAT(LEAVE_TIME, '%Y-%m-%d %H:%i:%s') as LEAVE_TIME,
uir.DESTINATION_ADDRESS_CODE,
uir.DESTINATION_ADDRESS_NAME,
uir.DESTINATION_ADDRESS_DETAIL,
ui.ID,
ui.MOBILE,
ui.GENDER,
ui.NATION,
ui.FORMER_NAME,
@ -218,27 +156,15 @@
ui.CAR_NO,
ui.HUSHAI_STATUS,
ui.NATIVE_PLACE,
ui.BLOOD_TYPE,
uir.COMMUNITY,
uir.GRID_NAME,
uir.PLOT,
uir.BUILDING_NO,
uir.UNIT,
uir.ROOM_NO,
uir.HOUSE_PROPERTY,
uir.FAMILY_SECURITY,
uir.LIVING_SITUATION
FROM `epidemic_user_inout_record` uir
left join epidemic_user_info ui on ui.ID_CARD = uir.ID_CARD and ui.DEL_FLAG = '0'
where uir.ID = #{detailId,jdbcType=BIGINT}
ui.BLOOD_TYPE
FROM epidemic_user_info ui
where ui.DEL_FLAG = '0' AND ui.ID = #{id,jdbcType=BIGINT}
</select>
<select id="selectByIdCard" resultMap="epidemicUserInfoMap">
SELECT *
FROM epidemic_user_info
WHERE DEL_FLAG = 0
AND ID_CARD = (SELECT ID_CARD FROM epidemic_user_inout_record WHERE DEL_FLAG = 0 AND ID = #{id})
AND ID = #{id}
</select>
<select id="selectByIdCards" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTO">
SELECT
@ -447,58 +373,37 @@
</select>
<select id="getEpidemicPage" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO">
select i.id as infoId,
r.id as inoutId,
'平阴县' as city,
r.LIVE_ADDRESS_NAME as street,
r.LIVE_ADDRESS_CODE as streetId,
r.COMMUNITY,
r.GRID_NAME,
r.PLOT,
r.BUILDING_NO,
r.UNIT,
r.ROOM_NO,
i.USER_NAME,
i.ID_CARD,
r.MOBILE,
i.GENDER,
i.BIRTHDAY,
IFNULL(i.VACCINATION_NUM, 0) AS VACCINATION_NUM,
IFNULL(i.VACCINATION_STATE, 0) AS VACCINATION_STATE,
r.CREATED_TIME
from epidemic_user_info i
LEFT JOIN epidemic_user_inout_record r ON i.ID_CARD = r.ID_CARD
where i.DEL_FLAG='0'
and r.DEL_FLAG='0'
select ui.ID,
ui.ID as infoId,
ui.USER_NAME,
ui.ID_CARD,
ui.MOBILE,
ui.GENDER,
ui.BIRTHDAY,
IFNULL(ui.VACCINATION_NUM, 0) AS VACCINATION_NUM,
IFNULL(ui.VACCINATION_STATE, 0) AS VACCINATION_STATE,
ui.CREATED_TIME,
hi.ALL_DEPT_NAMES
from epidemic_user_info ui
LEFT JOIN epdc_house_resident hr on hr.RESIDENT_ID = 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 i.ID_CARD like '%${idCard}%'
and ui.ID_CARD like '%${idCard}%'
</if>
<if test="mobile!=null and mobile!=''">
and r.MOBILE like '%${mobile}%'
and ui.MOBILE like '%${mobile}%'
</if>
<if test="userName!=null and userName!=''">
and i.USER_NAME like '%${userName}%'
</if>
<if test="streetKeywords != null">
AND r.LIVE_ADDRESS_NAME IN
<foreach collection="streetKeywords" index="index" item="street" open="(" separator="," close=")">
#{street}
</foreach>
</if>
<if test="communityKeywords != null">
AND r.COMMUNITY IN
<foreach collection="communityKeywords" index="index" item="community" open="(" separator="," close=")">
#{community}
</foreach>
and ui.USER_NAME like '%${userName}%'
</if>
<if test="gridKeywords != null">
AND r.GRID_NAME IN
<foreach collection="gridKeywords" index="index" item="grid" open="(" separator="," close=")">
#{grid}
<if test="deptIdList != null">
and hi.grid_id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
GROUP BY i.ID
ORDER BY i.CREATED_TIME DESC
ORDER BY ui.CREATED_TIME DESC
</select>
<select id="selectInfoV2"
resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO">

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

@ -84,6 +84,10 @@
select * from epdc_house_resident where RESIDENT_ID = #{residentId} and DEL_FLAG ='0'
and IS_HOUSE_HEAD = '0' limit 1
</select>
<select id="getHouseResidentInfoByHeadId"
resultType="com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity">
select * from epdc_house_resident where HOUSE_HEAD_ID = #{houseHeadId} and DEL_FLAG ='0'
and IS_HOUSE_HEAD = '0' limit 1
</select>
</mapper>

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

@ -64,6 +64,12 @@
and (t.grid_id = #{gridId}
OR find_in_set(#{gridId},t.ALL_DEPT_IDS))
</if>
<if test="deptIdList != null">
and t.grid_id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
order by CREATED_TIME desc
</select>
<select id="selectByIdAndUsed" resultType="com.elink.esua.epdc.dto.house.HousingInformationDTO">

Loading…
Cancel
Save