患者导入修改

This commit is contained in:
zhangheng 2024-12-25 18:11:43 +08:00
parent ce5e3b68df
commit b44359051c
2 changed files with 11 additions and 6 deletions

View File

@ -603,15 +603,16 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
List<Department> 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<String> 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());

View File

@ -20,6 +20,8 @@
<result property="sn" column="sn"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="hospitalAgencyId" column="hospital_agency_id"/>
<result property="hospitalAgencyName" column="hospital_agency_name"/>
</resultMap>
<sql id="selectPatientInfoImportVo">
@ -37,7 +39,9 @@
department_name,
sn,
create_time,
create_by
create_by,
hospital_agency_id,
hospital_agency_name
from patient_info_import
</sql>