|
|
|
@ -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<DiseasePhysicalResVo> queryListByDiseaseId(String diseaseId) {
|
|
|
|
@ -98,6 +101,27 @@ public class DiseasePhysicalManageServiceImpl implements DiseasePhysicalManageSe
|
|
|
|
|
.map(DiseasePhysical::getLocationId).distinct().collect(Collectors.toList());
|
|
|
|
|
populateDiseasePhysicalLocationNodeFlag(bean,locationIds);
|
|
|
|
|
|
|
|
|
|
// 4. 检查工具没有配置检查位,设置禁用标识
|
|
|
|
|
List<DefaultPhysicalIndicator> defaultPhysicalIndicatorList = defaultPhysicalIndicatorService.lambdaQuery().eq(DefaultPhysicalIndicator::getItemId, toolId).list();
|
|
|
|
|
if (CollectionUtil.isEmpty(defaultPhysicalIndicatorList)){
|
|
|
|
|
return bean.getChild();
|
|
|
|
|
}
|
|
|
|
|
// node: 现在认为一个检查项目和一个位置组成一条唯一数据
|
|
|
|
|
Map<String, DefaultPhysicalIndicator> indicatorMap = defaultPhysicalIndicatorList.stream()
|
|
|
|
|
.collect(Collectors.toMap(DefaultPhysicalIndicator::getLocationId, p -> p, (v1, v2) -> v1));
|
|
|
|
|
for (DiseasePhysicalLocationNodeVo diseasePhysicalLocationNodeVo : bean.getChild()) {
|
|
|
|
|
List<DiseasePhysicalLocationNodeVo> 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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|