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 1180ada..5543954 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 @@ -389,13 +389,18 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl idCards = new ArrayList<>(maxDoseMap.keySet()); - List userDeptInfoList = epidemicUserInfoDao.selectDeptInfoByIdCards(idCards); - Map deptMaps = userDeptInfoList.stream().collect(Collectors.toMap(EpidemicUserDeptInfoDTO::getIdCard, Function.identity())); + List userDeptInfoList = new ArrayList<>(); + Map deptMaps = new HashMap<>(); + if (!idCards.isEmpty()) { + userDeptInfoList = epidemicUserInfoDao.selectDeptInfoByIdCards(idCards); + deptMaps = userDeptInfoList.stream().collect(Collectors.toMap(EpidemicUserDeptInfoDTO::getIdCard, Function.identity())); + } // 插入接种数据 if (!addList.isEmpty()) { List insertUserList = ConvertUtils.sourceToTarget(addList, VaccinationInfoEntity.class); List finalAddressList = addressList; + Map finalDeptMaps = deptMaps; insertUserList.forEach(entity -> { entity.setIdentityNo(entity.getIdentityNo().toUpperCase()); Optional addressOptional = finalAddressList.stream().filter(address -> address.getIdCard().equals(entity.getIdentityNo())).findFirst(); @@ -406,7 +411,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl #{idCard}