diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java index 703ff087..eded23e0 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java @@ -603,15 +603,16 @@ public class PatientInfoServiceImpl implements IPatientInfoService { List departments = new ArrayList<>(); for (Department department1 : departmentList) { Department deptAliasdepartment = new Department(); - DeptAliasVO deptAliasVO = patientInfoImportVO.getDeptAliasVOS().stream().filter(Objects::nonNull).filter(item -> department1.getDepartmentName().equals(item.getDepartmentName())).findFirst().orElse(new DeptAliasVO()); - if (Objects.nonNull(deptAliasVO.getDeptAlias()) && StringUtils.isNotEmpty(department1.getDepartmentAbbreviation())) { - deptAliasdepartment.setDepartmentAbbreviation(department1.getDepartmentAbbreviation() + "|" + deptAliasVO.getDeptAlias()); + List collect = patientInfoImportVO.getDeptAliasVOS().stream().filter(Objects::nonNull).filter(item -> department1.getDepartmentName().equals(item.getDepartmentName())).map(DeptAliasVO::getDeptAlias).collect(Collectors.toList()); + String join = StringUtils.join(collect, "|"); + if (CollectionUtils.isNotEmpty(collect) && StringUtils.isNotEmpty(department1.getDepartmentAbbreviation())) { + deptAliasdepartment.setDepartmentAbbreviation(department1.getDepartmentAbbreviation() + "|" + join); deptAliasdepartment.setId(department1.getId()); deptAliasdepartment.setUpdateBy(SecurityUtils.getUsername()); deptAliasdepartment.setUpdateTime(LocalDateTime.now()); departments.add(deptAliasdepartment); - } else if (Objects.nonNull(deptAliasVO.getDeptAlias()) && StringUtils.isEmpty(department1.getDepartmentAbbreviation())) { - deptAliasdepartment.setDepartmentAbbreviation(deptAliasVO.getDeptAlias()); + } else if (CollectionUtils.isNotEmpty(collect) && StringUtils.isEmpty(department1.getDepartmentAbbreviation())) { + deptAliasdepartment.setDepartmentAbbreviation(join); deptAliasdepartment.setId(department1.getId()); deptAliasdepartment.setUpdateBy(SecurityUtils.getUsername()); deptAliasdepartment.setUpdateTime(LocalDateTime.now()); diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimport/PatientInfoImportMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimport/PatientInfoImportMapper.xml index 4f991c3d..5dc0878d 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimport/PatientInfoImportMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimport/PatientInfoImportMapper.xml @@ -20,6 +20,8 @@ + + @@ -37,7 +39,9 @@ department_name, sn, create_time, - create_by + create_by, + hospital_agency_id, + hospital_agency_name from patient_info_import