From 3aedb19ae88fea7d5cff4a1fafb894e6ce277bba Mon Sep 17 00:00:00 2001 From: xueqingkun Date: Mon, 8 Jan 2024 11:57:24 +0800 Subject: [PATCH] =?UTF-8?q?manage:=20=E4=BF=AE=E6=94=B9=20queryTree=20?= =?UTF-8?q?=E7=96=BE=E7=97=85=E8=BA=AB=E4=BD=93=E9=83=A8=E4=BD=8D=E6=A0=91?= =?UTF-8?q?=E3=80=82=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=80=BC=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E3=80=81=E4=BF=AE=E6=94=B9flag=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PhysicalLocationManageService.java | 5 +++ .../DiseasePhysicalManageServiceImpl.java | 32 ++++++++++++++++--- .../manage/DiseasePhysicalLocationNodeVo.java | 4 +++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/virtual-patient-manage/src/main/java/com/supervision/manage/service/PhysicalLocationManageService.java b/virtual-patient-manage/src/main/java/com/supervision/manage/service/PhysicalLocationManageService.java index 7f654981..b48578eb 100644 --- a/virtual-patient-manage/src/main/java/com/supervision/manage/service/PhysicalLocationManageService.java +++ b/virtual-patient-manage/src/main/java/com/supervision/manage/service/PhysicalLocationManageService.java @@ -9,6 +9,11 @@ public interface PhysicalLocationManageService { List queryTree(); + /** + * 查询体格检查身体部位配置树(支持已配置部位) + * @param physicalId 检查项id + * @return + */ List queryLocationTreeForPhysicalConfig(String physicalId); } diff --git a/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/DiseasePhysicalManageServiceImpl.java b/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/DiseasePhysicalManageServiceImpl.java index e8cc4804..1bf2fde9 100644 --- a/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/DiseasePhysicalManageServiceImpl.java +++ b/virtual-patient-manage/src/main/java/com/supervision/manage/service/impl/DiseasePhysicalManageServiceImpl.java @@ -1,16 +1,15 @@ package com.supervision.manage.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; import com.supervision.manage.service.DiseasePhysicalManageService; import com.supervision.manage.service.PhysicalLocationManageService; -import com.supervision.manage.service.PhysicalToolManageService; -import com.supervision.model.ConfigPhysicalLocation; -import com.supervision.model.DiseaseAncillary; +import com.supervision.model.DefaultPhysicalIndicator; import com.supervision.model.DiseasePhysical; -import com.supervision.service.ConfigPhysicalLocationService; +import com.supervision.service.DefaultPhysicalIndicatorService; import com.supervision.service.DiseasePhysicalService; import com.supervision.vo.manage.DiseasePhysicalLocationNodeVo; import com.supervision.vo.manage.DiseasePhysicalResVo; @@ -19,6 +18,8 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; @Service @@ -29,6 +30,8 @@ public class DiseasePhysicalManageServiceImpl implements DiseasePhysicalManageSe private final PhysicalLocationManageService physicalToolManageService; + private final DefaultPhysicalIndicatorService defaultPhysicalIndicatorService; + @Override public List queryListByDiseaseId(String diseaseId) { @@ -98,6 +101,27 @@ public class DiseasePhysicalManageServiceImpl implements DiseasePhysicalManageSe .map(DiseasePhysical::getLocationId).distinct().collect(Collectors.toList()); populateDiseasePhysicalLocationNodeFlag(bean,locationIds); + // 4. 检查工具没有配置检查位,设置禁用标识 + List defaultPhysicalIndicatorList = defaultPhysicalIndicatorService.lambdaQuery().eq(DefaultPhysicalIndicator::getItemId, toolId).list(); + if (CollectionUtil.isEmpty(defaultPhysicalIndicatorList)){ + return bean.getChild(); + } + // node: 现在认为一个检查项目和一个位置组成一条唯一数据 + Map indicatorMap = defaultPhysicalIndicatorList.stream() + .collect(Collectors.toMap(DefaultPhysicalIndicator::getLocationId, p -> p, (v1, v2) -> v1)); + for (DiseasePhysicalLocationNodeVo diseasePhysicalLocationNodeVo : bean.getChild()) { + List child = diseasePhysicalLocationNodeVo.getChild(); + if (CollectionUtil.isEmpty(child)) { + continue; + } + for (DiseasePhysicalLocationNodeVo physicalLocationNodeVo : child) { + physicalLocationNodeVo.setFlag(indicatorMap.containsKey(physicalLocationNodeVo.getId())); + if (Objects.nonNull(indicatorMap.get(physicalLocationNodeVo.getId()))) { + physicalLocationNodeVo.setIndicatorValue(indicatorMap.get(physicalLocationNodeVo.getId()).getIndicatorValue()); + } + + } + } return bean.getChild(); } diff --git a/virtual-patient-model/src/main/java/com/supervision/vo/manage/DiseasePhysicalLocationNodeVo.java b/virtual-patient-model/src/main/java/com/supervision/vo/manage/DiseasePhysicalLocationNodeVo.java index 09a3d4d3..67b3fa9a 100644 --- a/virtual-patient-model/src/main/java/com/supervision/vo/manage/DiseasePhysicalLocationNodeVo.java +++ b/virtual-patient-model/src/main/java/com/supervision/vo/manage/DiseasePhysicalLocationNodeVo.java @@ -42,5 +42,9 @@ public class DiseasePhysicalLocationNodeVo { @ApiModelProperty("标识 true:已选择 false:未选择") private boolean flag; + @ApiModelProperty("检查结果默认值") + private String indicatorValue; + + private List child; }