|
|
@ -222,7 +222,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
String vaccineName = epidemicReportUserInfoAllExcel.getVaccineName(); |
|
|
|
if (StringUtils.isNotBlank(vaccineName)) { |
|
|
|
List<VaccineDto> vaccine = vaccineList.stream().filter(item -> vaccineName.equals(item.getLabel())).collect(Collectors.toList()); |
|
|
|
if (vaccine.size() > 0) { |
|
|
|
if (!vaccine.isEmpty()) { |
|
|
|
epidemicReportUserInfoAllExcel.setVaccineId(vaccine.get(0).getValue()); |
|
|
|
} else { |
|
|
|
checkInfo += "第" + (i + 1) + "条、"; |
|
|
@ -241,7 +241,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
String companyName = epidemicReportUserInfoAllExcel.getCompanyName(); |
|
|
|
if (StringUtils.isNotBlank(vaccineName)) { |
|
|
|
List<VaccineDto> company = companyList.stream().filter(item -> companyName.equals(item.getLabel())).collect(Collectors.toList()); |
|
|
|
if (company.size() > 0) { |
|
|
|
if (!company.isEmpty()) { |
|
|
|
epidemicReportUserInfoAllExcel.setCompanyId(company.get(0).getValue()); |
|
|
|
maxDose = company.get(0).getMaxDose(); |
|
|
|
} else { |
|
|
@ -261,7 +261,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
String siteName = epidemicReportUserInfoAllExcel.getSiteName(); |
|
|
|
if (StringUtils.isNotBlank(vaccineName)) { |
|
|
|
List<VaccineDto> site = siteList.stream().filter(item -> siteName.equals(item.getLabel())).collect(Collectors.toList()); |
|
|
|
if (site.size() > 0) { |
|
|
|
if (!site.isEmpty()) { |
|
|
|
epidemicReportUserInfoAllExcel.setSiteId(site.get(0).getValue()); |
|
|
|
} else { |
|
|
|
checkInfo += "第" + (i + 1) + "条、"; |
|
|
@ -293,24 +293,22 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
|
|
|
|
addList.add(epidemicReportUserInfoAllExcel); |
|
|
|
|
|
|
|
// 检查重复数据,对旧数据进行覆盖
|
|
|
|
List<VaccinationInfoEntity> checkList = checkVaccination(vaccinationInfoDTO); |
|
|
|
if (!checkList.isEmpty()) { |
|
|
|
deleteIdCardArr.addAll(checkList.stream().map(VaccinationInfoEntity::getId).collect(Collectors.toList())); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
log.info("循环结束,进入人员数据处理"); |
|
|
|
// 对规范数据,根据身份证号进行逻辑删除
|
|
|
|
if (deleteIdCardArr.size() > 0) { |
|
|
|
baseDao.deleteDistinctDose(deleteIdCardArr); |
|
|
|
} |
|
|
|
|
|
|
|
List<String> idCards = new ArrayList<>(maxDoseMap.keySet()); |
|
|
|
log.info("循环结束,判断人员信息是否需要更新"); |
|
|
|
|
|
|
|
List<String> idCards = new ArrayList<>(maxDoseMap.keySet()); |
|
|
|
List<EpidemicUserInfoDTO> updateList = new ArrayList<>(); |
|
|
|
if (!idCards.isEmpty()) { |
|
|
|
|
|
|
|
if (!idCards.isEmpty()) { |
|
|
|
List<EpidemicUserInfoDTO> existUserList = epidemicUserInfoDao.selectByIdCards(idCards); |
|
|
|
|
|
|
|
existUserList.forEach(item -> { |
|
|
|
EpidemicUserInfoDTO updateDto = new EpidemicUserInfoDTO(); |
|
|
|
if (item.getVaccinationState() == 2) { |
|
|
@ -330,11 +328,16 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
updateList.add(updateDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log.info("需要更新的人员信息数量为:" + updateList.size()); |
|
|
|
|
|
|
|
// 对规范数据,根据身份证号进行逻辑删除
|
|
|
|
if (!deleteIdCardArr.isEmpty()) { |
|
|
|
baseDao.deleteDistinctDose(deleteIdCardArr); |
|
|
|
} |
|
|
|
|
|
|
|
// 插入数据----需改为批量插入
|
|
|
|
List<VaccinationInfoEntity> insertUserList = new ArrayList<>(); |
|
|
|
|
|
|
@ -343,12 +346,13 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
userEntity = ConvertUtils.sourceToTarget(vaccinationInfoAllExcel, VaccinationInfoEntity.class); |
|
|
|
insertUserList.add(userEntity); |
|
|
|
} |
|
|
|
insertBatch(insertUserList); |
|
|
|
|
|
|
|
// 更新人员的接种信息
|
|
|
|
for (EpidemicUserInfoDTO dto : updateList) { |
|
|
|
epidemicUserInfoDao.updateVaccinationInfo(dto); |
|
|
|
} |
|
|
|
|
|
|
|
insertBatch(insertUserList); |
|
|
|
// 批量插入错误数据
|
|
|
|
List<VaccinationErrorEntity> insertErrorList = ConvertUtils.sourceToTarget(addErrorList, VaccinationErrorEntity.class); |
|
|
|
Integer insertNo = vaccinationErrorDao.getMaxInsertNo(); |
|
|
@ -377,7 +381,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
* @param infoAllExcel |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private Boolean checkNullCell(VaccinationInfoAllExcel infoAllExcel) { |
|
|
|
private boolean checkNullCell(VaccinationInfoAllExcel infoAllExcel) { |
|
|
|
// 校验必填项 (用户名、身份证号)
|
|
|
|
return StringUtils.isBlank(infoAllExcel.getRealName()) || StringUtils.isBlank(infoAllExcel.getIdentityNo()) || infoAllExcel.getDose() == null; |
|
|
|
} |
|
|
|