|
|
|
@ -389,13 +389,18 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
|
|
|
|
// 网格信息
|
|
|
|
List<String> idCards = new ArrayList<>(maxDoseMap.keySet()); |
|
|
|
List<EpidemicUserDeptInfoDTO> userDeptInfoList = epidemicUserInfoDao.selectDeptInfoByIdCards(idCards); |
|
|
|
Map<String, EpidemicUserDeptInfoDTO> deptMaps = userDeptInfoList.stream().collect(Collectors.toMap(EpidemicUserDeptInfoDTO::getIdCard, Function.identity())); |
|
|
|
List<EpidemicUserDeptInfoDTO> userDeptInfoList = new ArrayList<>(); |
|
|
|
Map<String, EpidemicUserDeptInfoDTO> deptMaps = new HashMap<>(); |
|
|
|
if (!idCards.isEmpty()) { |
|
|
|
userDeptInfoList = epidemicUserInfoDao.selectDeptInfoByIdCards(idCards); |
|
|
|
deptMaps = userDeptInfoList.stream().collect(Collectors.toMap(EpidemicUserDeptInfoDTO::getIdCard, Function.identity())); |
|
|
|
} |
|
|
|
|
|
|
|
// 插入接种数据
|
|
|
|
if (!addList.isEmpty()) { |
|
|
|
List<VaccinationInfoEntity> insertUserList = ConvertUtils.sourceToTarget(addList, VaccinationInfoEntity.class); |
|
|
|
List<EpidemicUserInoutRecordEntity> finalAddressList = addressList; |
|
|
|
Map<String, EpidemicUserDeptInfoDTO> finalDeptMaps = deptMaps; |
|
|
|
insertUserList.forEach(entity -> { |
|
|
|
entity.setIdentityNo(entity.getIdentityNo().toUpperCase()); |
|
|
|
Optional<EpidemicUserInoutRecordEntity> addressOptional = finalAddressList.stream().filter(address -> address.getIdCard().equals(entity.getIdentityNo())).findFirst(); |
|
|
|
@ -406,7 +411,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati |
|
|
|
entity.setGrid(addressOptional.get().getGridName()); |
|
|
|
entity.setVillageName(addressOptional.get().getPlot()); |
|
|
|
} |
|
|
|
EpidemicUserDeptInfoDTO dept = deptMaps.get(entity.getIdentityNo().toUpperCase()); |
|
|
|
EpidemicUserDeptInfoDTO dept = finalDeptMaps.get(entity.getIdentityNo().toUpperCase()); |
|
|
|
if (dept != null) { |
|
|
|
entity.setGridId(dept.getGridId()); |
|
|
|
entity.setParentDeptIds(dept.getParentDeptIds()); |
|
|
|
|