From 8a9cfd703481a5b8752b6f942926ea321d4c5630 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 10 May 2021 15:08:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=EF=BC=8C=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EpidemicReportUserInfoServiceImpl.java | 4 +- .../impl/EpidemicUserInfoServiceImpl.java | 8 +- .../vim/excel/VaccinationInfoAllExcel.java | 1 - .../impl/VaccinationInfoServiceImpl.java | 81 +++++++------------ .../mapper/vim/VaccinationErrorDao.xml | 2 +- 5 files changed, 34 insertions(+), 62 deletions(-) diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicReportUserInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicReportUserInfoServiceImpl.java index b0b3bfc..e6264be 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicReportUserInfoServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicReportUserInfoServiceImpl.java @@ -70,7 +70,7 @@ public class EpidemicReportUserInfoServiceImpl extends CrudServiceImpl page(Map params) { - params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); +// params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); IPage page = getPage(params); List list = baseDao.getEpidemicUserInfoList(params); for (EpidemicReportUserInfoDTO eru : list) { @@ -184,7 +184,7 @@ public class EpidemicReportUserInfoServiceImpl extends CrudServiceImpl list(Map params) { - params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); +// params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); List list = baseDao.getEpidemicUserInfoList(params); for (EpidemicReportUserInfoDTO eru : list) { eru.setIdCard(idEncrypt(eru.getIdCard())); diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java index 71892a1..3c2d31c 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java @@ -101,9 +101,9 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl page = getPage(params); List list = baseDao.getEpidemicUserRecordList(params); for (EpidemicRecordListDTO eru : list) { @@ -453,7 +453,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl getList(Map params) { - params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); +// params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); params.put("age",new ArrayList<>()); params.put("company",new ArrayList<>()); // for (EpidemicRecordListDTO eru : list) { diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationInfoAllExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationInfoAllExcel.java index 17dd2c9..42961de 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationInfoAllExcel.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/excel/VaccinationInfoAllExcel.java @@ -24,7 +24,6 @@ public class VaccinationInfoAllExcel { private String county; @Excel(name = "接种人街道/乡镇") private String street; - @Excel(name = "接种人街道/乡镇ID") private String streetId; @Excel(name = "接种人社区/村") private String community; 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 9d27969..41795f5 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 @@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; 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; @@ -159,11 +160,11 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl maxDoseMap = new HashMap<>(); log.info("准备进入Excel数据导入循环"); -// List vaccineList = vaccineTypeService.vaccineList(); List companyList = vaccineCompanyService.compantyList(); List siteList = vaccinationSiteService.getSiteList(); List allUserList = epidemicUserInfoDao.selectAllUserInfo(); @@ -197,7 +197,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl vaccine = vaccineList.stream().filter(item -> vaccineName.equals(item.getLabel())).collect(Collectors.toList()); -// if (!vaccine.isEmpty()) { -// epidemicReportUserInfoAllExcel.setVaccineId(vaccine.get(0).getValue()); -// } else { -// checkInfo += "第" + (i + 1) + "条、"; -// epidemicReportUserInfoAllExcel.setErrorInfo("不存在的疫苗类型"); -// addErrorList.add(epidemicReportUserInfoAllExcel); -// continue; -// } -// } else { -// checkInfo += "第" + (i + 1) + "条、"; -// epidemicReportUserInfoAllExcel.setErrorInfo("未填写疫苗类型"); -// addErrorList.add(epidemicReportUserInfoAllExcel); -// continue; -// } - // 校验疫苗生产商 String companyName = epidemicReportUserInfoAllExcel.getCompanyName(); if (StringUtils.isNotBlank(companyName)) { @@ -248,13 +229,13 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl { EpidemicUserInfoDTO updateDto = new EpidemicUserInfoDTO(); - if (item.getVaccinationState() == 2) { - // 已经接种完的不需要处理 - } else { - if (item.getVaccinationNum() > maxDoseMap.get(item.getIdCard()).getVaccinationNum()) { - // excel的剂次数据小于数据库时不需要处理 + + // 已经接种完的不需要处理,excel的剂次数据小于数据库时不需要处理,已经接种完的不需要处理 + if (item.getVaccinationState() != NumConstant.TWO && item.getVaccinationNum() <= maxDoseMap.get(item.getIdCard()).getVaccinationNum()) { + updateDto.setIdCard(item.getIdCard()); + updateDto.setVaccinationNum(maxDoseMap.get(item.getIdCard()).getVaccinationNum()); + if (maxDoseMap.get(item.getIdCard()).getVaccinationNum().equals(maxDoseMap.get(item.getIdCard()).getMaxDose())) { + // 如果最大剂次同于excel的剂次就是接种完成,否则是接种中 + updateDto.setVaccinationState(2); } else { - updateDto.setIdCard(item.getIdCard()); - updateDto.setVaccinationNum(maxDoseMap.get(item.getIdCard()).getVaccinationNum()); - if (maxDoseMap.get(item.getIdCard()).getVaccinationNum().equals(maxDoseMap.get(item.getIdCard()).getMaxDose())) { - // 如果最大剂次同于excel的剂次就是接种完成,否则是接种中 - updateDto.setVaccinationState(2); - } else { - updateDto.setVaccinationState(1); - } - updateList.add(updateDto); + updateDto.setVaccinationState(1); } + updateList.add(updateDto); } }); } log.info("需要更新的人员信息数量为:" + updateList.size()); - // 对规范数据,根据身份证号进行逻辑删除 + // 对历史数据根据身份证号进行逻辑删除 if (!deleteIdCardArr.isEmpty()) { baseDao.deleteDistinctDose(deleteIdCardArr); } - // 插入数据----需改为批量插入 - List insertUserList = new ArrayList<>(); - - VaccinationInfoEntity userEntity; - for (VaccinationInfoAllExcel vaccinationInfoAllExcel : addList) { - userEntity = ConvertUtils.sourceToTarget(vaccinationInfoAllExcel, VaccinationInfoEntity.class); - insertUserList.add(userEntity); - } + // 插入接种数据 + List insertUserList = ConvertUtils.sourceToTarget(addList, VaccinationInfoEntity.class); insertBatch(insertUserList); // 更新人员的接种信息 @@ -380,12 +351,14 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl