From d9e671636d5dbf8e78cdd4d8923beb333af7d42a Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Sun, 9 May 2021 10:14:57 +0800 Subject: [PATCH] format --- .../impl/VaccinationInfoServiceImpl.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java index 0c4f712..a8d7fb6 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java @@ -222,7 +222,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl 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 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 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 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 idCards = new ArrayList<>(maxDoseMap.keySet()); + log.info("循环结束,判断人员信息是否需要更新"); + List idCards = new ArrayList<>(maxDoseMap.keySet()); List updateList = new ArrayList<>(); - if (!idCards.isEmpty()) { + if (!idCards.isEmpty()) { List existUserList = epidemicUserInfoDao.selectByIdCards(idCards); + existUserList.forEach(item -> { EpidemicUserInfoDTO updateDto = new EpidemicUserInfoDTO(); if (item.getVaccinationState() == 2) { @@ -330,11 +328,16 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl insertUserList = new ArrayList<>(); @@ -343,12 +346,13 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl insertErrorList = ConvertUtils.sourceToTarget(addErrorList, VaccinationErrorEntity.class); Integer insertNo = vaccinationErrorDao.getMaxInsertNo(); @@ -377,7 +381,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl