|
|
@ -24,10 +24,10 @@ 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.dto.personroom.EpidemicUnitOwnerDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.result.EpidemicPlotBuildingResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.result.EpidemicUnitInfoResultDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.constant.ImageConstant; |
|
|
|
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; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.*; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultV2DTO; |
|
|
@ -40,8 +40,12 @@ import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserErrorService; |
|
|
|
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.personroom.entity.EpidemicBuildingUnitEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.entity.EpidemicUnitOwnerEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.service.EpidemicBuildingUnitService; |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.service.EpidemicPlotBuildingService; |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.service.EpidemicUnitOwnerService; |
|
|
|
import com.elink.esua.epdc.vaccine.vim.dao.VaccinationInfoDao; |
|
|
|
import com.elink.esua.epdc.vaccine.vim.dao.VimImgDao; |
|
|
|
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; |
|
|
@ -71,8 +75,6 @@ import java.util.stream.Collectors; |
|
|
|
@Service |
|
|
|
public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInfoDao, EpidemicUserInfoEntity, EpidemicUserInfoDTO> implements EpidemicUserInfoService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EpidemicUserInoutRecordService inoutRecordService; |
|
|
|
@Autowired |
|
|
|
private VaccinationInfoService vaccinationInfoService; |
|
|
|
@Autowired |
|
|
@ -84,10 +86,6 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
@Autowired |
|
|
|
public VaccinationUserRoleService vaccinationUserRoleService; |
|
|
|
@Resource |
|
|
|
public SelectAreaDao selectAreaDao; |
|
|
|
@Resource |
|
|
|
private EpidemicUserInoutRecordDao inoutRecordDao; |
|
|
|
@Resource |
|
|
|
public EpidemicUserInfoDao epidemicUserInfoDao; |
|
|
|
@Resource |
|
|
|
public VaccinationInfoDao vaccinationInfoDao; |
|
|
@ -99,6 +97,12 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
private VimImgDao vimImgDao; |
|
|
|
@Autowired |
|
|
|
private EpidemicUserErrorService epidemicUserErrorService; |
|
|
|
@Autowired |
|
|
|
private EpidemicPlotBuildingService epidemicPlotBuildingService; |
|
|
|
@Autowired |
|
|
|
private EpidemicBuildingUnitService epidemicBuildingUnitService; |
|
|
|
@Autowired |
|
|
|
private EpidemicUnitOwnerService epidemicUnitOwnerService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public QueryWrapper<EpidemicUserInfoEntity> getWrapper(Map<String, Object> params) { |
|
|
@ -447,16 +451,6 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<EpidemicRecordListDTO> getList(Map<String, Object> params) { |
|
|
|
// params.put("deptIdList", SecurityUser.getUser().getDeptIdList());
|
|
|
|
// params.put("age", new ArrayList<>());
|
|
|
|
// params.put("company", new ArrayList<>());
|
|
|
|
// for (EpidemicRecordListDTO eru : list) {
|
|
|
|
// eru.setIdCard(idEncrypt(eru.getIdCard()));
|
|
|
|
// eru.setMobile(mobileEncrypt(eru.getMobile()));
|
|
|
|
// eru.setUserName(nameDesensitization(eru.getUserName()));
|
|
|
|
// eru.setRelationPeople(nameDesensitization(eru.getRelationPeople()));
|
|
|
|
// eru.setRelationPeopleMobile(mobileEncrypt(eru.getRelationPeopleMobile()));
|
|
|
|
// }
|
|
|
|
return baseDao.getEpidemicUserRecordList(params); |
|
|
|
} |
|
|
|
|
|
|
@ -472,24 +466,23 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
public Result deleteUserById(Long[] ids) { |
|
|
|
|
|
|
|
//物理删除
|
|
|
|
|
|
|
|
baseDao.deleteByIds(ids); |
|
|
|
// //1、获取详情id
|
|
|
|
// Long inoutRecord = ids[0];
|
|
|
|
// if (null != inoutRecord) {
|
|
|
|
// baseDao.deleteById(inoutRecord);
|
|
|
|
//// //查询信息
|
|
|
|
//// EpidemicUserInfoEntity entity = baseDao.selectByIdCard(inoutRecord);
|
|
|
|
//// if (null == entity) {
|
|
|
|
//// return new Result().error("数据错误,刷新后重试!!");
|
|
|
|
//// }
|
|
|
|
//// // 2、判断人员信息表中数据如果只有一条就全删
|
|
|
|
//// Integer integer = inoutRecordDao.selectByState(entity.getIdCard());
|
|
|
|
//// if (integer == 1) {
|
|
|
|
//// // 若同时存在,则保留基础信息,删除额外信息。
|
|
|
|
//// baseDao.deleteById(entity.getId());
|
|
|
|
//// }
|
|
|
|
//// inoutRecordDao.deleteById(inoutRecord);
|
|
|
|
// //查询信息
|
|
|
|
// EpidemicUserInfoEntity entity = baseDao.selectByIdCard(inoutRecord);
|
|
|
|
// if (null == entity) {
|
|
|
|
// return new Result().error("数据错误,刷新后重试!!");
|
|
|
|
// }
|
|
|
|
// // 2、判断人员信息表中数据如果只有一条就全删
|
|
|
|
// Integer integer = inoutRecordDao.selectByState(entity.getIdCard());
|
|
|
|
// if (integer == 1) {
|
|
|
|
// // 若同时存在,则保留基础信息,删除额外信息。
|
|
|
|
// baseDao.deleteById(entity.getId());
|
|
|
|
// }
|
|
|
|
// inoutRecordDao.deleteById(inoutRecord);
|
|
|
|
// } else {
|
|
|
|
// return new Result().error("删除参数不正确,请联系管理员查看");
|
|
|
|
// }
|
|
|
@ -602,8 +595,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
|
|
|
|
@Override |
|
|
|
public VaccinationInfoResultV2DTO getInfoV2(String id) { |
|
|
|
VaccinationInfoResultV2DTO dto = baseDao.selectInfoV2(id); |
|
|
|
return dto; |
|
|
|
return baseDao.selectInfoV2(id); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -1054,16 +1046,13 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
sysPopulationSimpleDictDTO.setSysSimpleDicts(dictList); |
|
|
|
sysPopulationSimpleDictDTO.setDicType(dictType); |
|
|
|
listResult.add(sysPopulationSimpleDictDTO); |
|
|
|
continue; |
|
|
|
} else { |
|
|
|
sysPopulationSimpleDictDTO = null; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcPopulationErrorResultDTO> |
|
|
|
* @Description 校验居住人数据 |
|
|
@ -1370,6 +1359,10 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
* @Param [baseResidentInformationExcels] |
|
|
|
**/ |
|
|
|
private void saveResidentList(List<BaseResidentInformationUpdateExcel> baseResidentInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO, Map<String, String> populationIdNoAndIdMap) { |
|
|
|
|
|
|
|
List<EpidemicUserInfoEntity> addList = new ArrayList<>(); |
|
|
|
List<EpidemicUserInfoEntity> updateList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (BaseResidentInformationUpdateExcel baseResidentInformationExcel : baseResidentInformationExcels) { |
|
|
|
//插入居民信息
|
|
|
|
EpidemicUserInfoEntity epidemicUserInfoEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, EpidemicUserInfoEntity.class); |
|
|
@ -1405,8 +1398,6 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
// 已存在的居民信息进行更新,否则进行插入操作
|
|
|
|
EpidemicUserInfoEntity check = epidemicUserInfoService.selectInfoByIdCard(baseResidentInformationExcel.getSelfIdentityNo()); |
|
|
|
|
|
|
|
List<EpidemicUserInfoEntity> addList = new ArrayList<>(); |
|
|
|
List<EpidemicUserInfoEntity> updateList = new ArrayList<>(); |
|
|
|
if (null == check) { |
|
|
|
addList.add(epidemicUserInfoEntity); |
|
|
|
// epidemicUserInfoService.insert(epidemicUserInfoEntity);
|
|
|
@ -1473,13 +1464,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
// epidemicUserInfoService.updateById(check);
|
|
|
|
updateList.add(check); |
|
|
|
} |
|
|
|
// 改为批量插入和批量按ID更新
|
|
|
|
if (!addList.isEmpty()) { |
|
|
|
epidemicUserInfoService.insertBatch(addList); |
|
|
|
} |
|
|
|
if (!updateList.isEmpty()) { |
|
|
|
epidemicUserInfoService.updateBatchById(updateList); |
|
|
|
} |
|
|
|
|
|
|
|
//插入房屋人员关联关系表
|
|
|
|
// HouseResidentEntity houseResidentEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, HouseResidentEntity.class);
|
|
|
|
// if (null == check) {
|
|
|
@ -1513,61 +1498,91 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 转换新旧人员信息实体类 |
|
|
|
* |
|
|
|
* @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())); |
|
|
|
// 改为批量插入和批量按ID更新
|
|
|
|
if (!addList.isEmpty()) { |
|
|
|
epidemicUserInfoService.insertBatch(addList); |
|
|
|
} |
|
|
|
entity.setUserName(informationEntity.getResidentsName()); |
|
|
|
entity.setGender(informationEntity.getResidentsSex()); |
|
|
|
entity.setNation(informationEntity.getResidentsNation()); |
|
|
|
if (informationEntity.getResidentsBirthday() != null) { |
|
|
|
entity.setBirthday(DateUtils.format(informationEntity.getResidentsBirthday())); |
|
|
|
if (!updateList.isEmpty()) { |
|
|
|
epidemicUserInfoService.updateBatchById(updateList); |
|
|
|
} |
|
|
|
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; |
|
|
|
|
|
|
|
// 补充人房关系
|
|
|
|
List<EpidemicPlotBuildingResultDTO> buildingList = epidemicPlotBuildingService.listAllBuildingInfo(); |
|
|
|
List<EpidemicUnitInfoResultDTO> unitList = epidemicBuildingUnitService.listAllUnitInfo(); |
|
|
|
List<EpidemicUnitOwnerEntity> addOwner = new ArrayList<>(); |
|
|
|
List<EpidemicBuildingUnitEntity> addUnit = new ArrayList<>(); |
|
|
|
addList.forEach(item -> { |
|
|
|
// 只有信息完整的才进行匹配
|
|
|
|
if (StringUtils.isNotBlank(item.getPlot()) && StringUtils.isNotBlank(item.getBuildingNo()) && StringUtils.isNotBlank(item.getUnit())) { |
|
|
|
Optional<EpidemicUnitInfoResultDTO> unitOptional = unitList.stream().filter(unit -> unit.getPlotName().equals(item.getPlot()) && unit.getBuildingName().equals(item.getBuildingNo()) && unit.getUnit().equals(item.getUnit())).findFirst(); |
|
|
|
if (unitOptional.isPresent()) { |
|
|
|
EpidemicUnitOwnerEntity entity = new EpidemicUnitOwnerEntity(); |
|
|
|
entity.setIdCard(item.getIdCard()); |
|
|
|
entity.setUnitId(unitOptional.get().getUnitId()); |
|
|
|
entity.setOwnerName(item.getUserName()); |
|
|
|
entity.setMobile(item.getMobile()); |
|
|
|
addOwner.add(entity); |
|
|
|
} else { |
|
|
|
Optional<EpidemicPlotBuildingResultDTO> buildingOptional = buildingList.stream().filter(build -> build.getPlotName().equals(item.getPlot()) && build.getBuildingName().equals(item.getBuildingNo())).findFirst(); |
|
|
|
if (buildingOptional.isPresent()) { |
|
|
|
EpidemicBuildingUnitEntity unitEntity = new EpidemicBuildingUnitEntity(); |
|
|
|
unitEntity.setBuildingId(buildingOptional.get().getId()); |
|
|
|
unitEntity.setUnit(item.getUnit()); |
|
|
|
unitEntity.setRoomNo(item.getRoomNo()); |
|
|
|
unitEntity.setIdCard(item.getIdCard()); |
|
|
|
unitEntity.setOwnerName(item.getUserName()); |
|
|
|
unitEntity.setMobile(item.getMobile()); |
|
|
|
unitEntity.setRoomType(NumConstant.ONE_STR); |
|
|
|
addUnit.add(unitEntity); |
|
|
|
EpidemicUnitOwnerEntity entity = new EpidemicUnitOwnerEntity(); |
|
|
|
entity.setIdCard(item.getIdCard()); |
|
|
|
entity.setUnitId(unitEntity.getId()); |
|
|
|
entity.setOwnerName(item.getUserName()); |
|
|
|
entity.setMobile(item.getMobile()); |
|
|
|
addOwner.add(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
updateList.forEach(item -> { |
|
|
|
// 只有信息完整的才进行匹配
|
|
|
|
if (StringUtils.isNotBlank(item.getPlot()) && StringUtils.isNotBlank(item.getBuildingNo()) && StringUtils.isNotBlank(item.getUnit())) { |
|
|
|
Optional<EpidemicUnitInfoResultDTO> unitOptional = unitList.stream().filter(unit -> unit.getPlotName().equals(item.getPlot()) && unit.getBuildingName().equals(item.getBuildingNo()) && unit.getUnit().equals(item.getUnit())).findFirst(); |
|
|
|
if (unitOptional.isPresent()) { |
|
|
|
EpidemicUnitOwnerEntity entity = new EpidemicUnitOwnerEntity(); |
|
|
|
entity.setIdCard(item.getIdCard()); |
|
|
|
entity.setUnitId(unitOptional.get().getUnitId()); |
|
|
|
entity.setOwnerName(item.getUserName()); |
|
|
|
entity.setMobile(item.getMobile()); |
|
|
|
// todo del?
|
|
|
|
addOwner.add(entity); |
|
|
|
} else { |
|
|
|
Optional<EpidemicPlotBuildingResultDTO> buildingOptional = buildingList.stream().filter(build -> build.getPlotName().equals(item.getPlot()) && build.getBuildingName().equals(item.getBuildingNo())).findFirst(); |
|
|
|
if (buildingOptional.isPresent()) { |
|
|
|
EpidemicBuildingUnitEntity unitEntity = new EpidemicBuildingUnitEntity(); |
|
|
|
unitEntity.setBuildingId(buildingOptional.get().getId()); |
|
|
|
unitEntity.setUnit(item.getUnit()); |
|
|
|
unitEntity.setRoomNo(item.getRoomNo()); |
|
|
|
unitEntity.setIdCard(item.getIdCard()); |
|
|
|
unitEntity.setOwnerName(item.getUserName()); |
|
|
|
unitEntity.setMobile(item.getMobile()); |
|
|
|
unitEntity.setRoomType(NumConstant.ONE_STR); |
|
|
|
addUnit.add(unitEntity); |
|
|
|
EpidemicUnitOwnerEntity entity = new EpidemicUnitOwnerEntity(); |
|
|
|
entity.setIdCard(item.getIdCard()); |
|
|
|
entity.setUnitId(unitEntity.getId()); |
|
|
|
entity.setOwnerName(item.getUserName()); |
|
|
|
entity.setMobile(item.getMobile()); |
|
|
|
// todo del?
|
|
|
|
addOwner.add(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
epidemicBuildingUnitService.insertBatch(addUnit); |
|
|
|
epidemicUnitOwnerService.insertBatch(addOwner); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|