manage: 修改 queryTree 疾病身体部位树。添加默认值字段、修改flag逻辑

dev_2.1.0
xueqingkun 1 year ago
parent ecc5187c15
commit 92776b1703

@ -97,11 +97,10 @@ public class DiseasePhysicalManageServiceImpl implements DiseasePhysicalManageSe
} }
// 3. 填充疾病体格检查树中的flag属性 // 3. 填充疾病体格检查树中的flag属性
// 3.1 检查该位置是否已经配置
// 3.2检查工具没有配置检查位,设置禁用标识
List<String> locationIds = diseasePhysicalResVos.stream().filter(vo->toolId.equals(vo.getToolId())) List<String> locationIds = diseasePhysicalResVos.stream().filter(vo->toolId.equals(vo.getToolId()))
.map(DiseasePhysical::getLocationId).distinct().collect(Collectors.toList()); .map(DiseasePhysical::getLocationId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
populateDiseasePhysicalLocationNodeFlag(bean,locationIds);
// 4. 检查工具没有配置检查位,设置禁用标识
List<DefaultPhysicalIndicator> defaultPhysicalIndicatorList = defaultPhysicalIndicatorService.lambdaQuery().eq(DefaultPhysicalIndicator::getItemId, toolId).list(); List<DefaultPhysicalIndicator> defaultPhysicalIndicatorList = defaultPhysicalIndicatorService.lambdaQuery().eq(DefaultPhysicalIndicator::getItemId, toolId).list();
if (CollectionUtil.isEmpty(defaultPhysicalIndicatorList)){ if (CollectionUtil.isEmpty(defaultPhysicalIndicatorList)){
return bean.getChild(); return bean.getChild();
@ -110,16 +109,18 @@ public class DiseasePhysicalManageServiceImpl implements DiseasePhysicalManageSe
Map<String, DefaultPhysicalIndicator> indicatorMap = defaultPhysicalIndicatorList.stream() Map<String, DefaultPhysicalIndicator> indicatorMap = defaultPhysicalIndicatorList.stream()
.collect(Collectors.toMap(DefaultPhysicalIndicator::getLocationId, p -> p, (v1, v2) -> v1)); .collect(Collectors.toMap(DefaultPhysicalIndicator::getLocationId, p -> p, (v1, v2) -> v1));
for (DiseasePhysicalLocationNodeVo diseasePhysicalLocationNodeVo : bean.getChild()) { for (DiseasePhysicalLocationNodeVo diseasePhysicalLocationNodeVo : bean.getChild()) {
// 一级不做处理,只处理二级数据
List<DiseasePhysicalLocationNodeVo> child = diseasePhysicalLocationNodeVo.getChild(); List<DiseasePhysicalLocationNodeVo> child = diseasePhysicalLocationNodeVo.getChild();
if (CollectionUtil.isEmpty(child)) { if (CollectionUtil.isEmpty(child)) {
continue; continue;
} }
for (DiseasePhysicalLocationNodeVo physicalLocationNodeVo : child) { for (DiseasePhysicalLocationNodeVo physicalLocationNodeVo : child) {
physicalLocationNodeVo.setFlag(indicatorMap.containsKey(physicalLocationNodeVo.getId())); String nodeId = physicalLocationNodeVo.getId();
if (Objects.nonNull(indicatorMap.get(physicalLocationNodeVo.getId()))) { physicalLocationNodeVo.setFlag(
physicalLocationNodeVo.setIndicatorValue(indicatorMap.get(physicalLocationNodeVo.getId()).getIndicatorValue()); locationIds.contains(nodeId) || indicatorMap.containsKey(nodeId));
if (Objects.nonNull(indicatorMap.get(nodeId))) {
physicalLocationNodeVo.setIndicatorValue(indicatorMap.get(nodeId).getIndicatorValue());
} }
} }
} }
return bean.getChild(); return bean.getChild();

Loading…
Cancel
Save