|
@@ -35,6 +35,7 @@ import com.diagbot.vo.HasStaticKnowledgeVO;
|
|
|
import com.diagbot.vo.IdVO;
|
|
|
import com.diagbot.vo.StaticKnowledgeHISVO;
|
|
|
import com.diagbot.vo.StaticKnowledgeIndexVO;
|
|
|
+import com.diagbot.vo.StaticKnowledgeNameVO;
|
|
|
import com.diagbot.vo.StaticKnowledgeVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -255,7 +256,39 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
ConceptInfo conceptInfo = this.getOne(conceptInfoQueryWrapper, false);
|
|
|
|
|
|
if (conceptInfo == null) {
|
|
|
- throw new CommonException(CommonErrorCode.IS_EXISTS, "缺少静态信息");
|
|
|
+ StaticKnowledgeNameVO superName = new StaticKnowledgeNameVO();
|
|
|
+ if (typeName.equals("实验室检查名称")) {
|
|
|
+ StaticKnowledgeNameVO staticKnowledgeNameVO = new StaticKnowledgeNameVO();
|
|
|
+ staticKnowledgeNameVO.setName(staticKnowledgeVO.getName());
|
|
|
+ staticKnowledgeNameVO.setType(staticKnowledgeVO.getType());
|
|
|
+ RespDTO<StaticKnowledgeNameVO> respDTO = cdssCoreClient.getSuperName(staticKnowledgeNameVO);
|
|
|
+ if (RespDTOUtil.respIsOK(respDTO)) {
|
|
|
+ superName = respDTO.data;
|
|
|
+ }
|
|
|
+ } else if (typeName.equals("辅助检查名称")) {
|
|
|
+ StaticKnowledgeNameVO staticKnowledgeNameVO = new StaticKnowledgeNameVO();
|
|
|
+ staticKnowledgeNameVO.setName(staticKnowledgeVO.getName());
|
|
|
+ staticKnowledgeNameVO.setType(6);
|
|
|
+ RespDTO<StaticKnowledgeNameVO> respDTO = cdssCoreClient.getSuperName(staticKnowledgeNameVO);
|
|
|
+ if (RespDTOUtil.respIsOK(respDTO)) {
|
|
|
+ superName = respDTO.data;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new CommonException(CommonErrorCode.IS_EXISTS, "缺少静态信息");
|
|
|
+ }
|
|
|
+ typeName = dicStaticTypeValNameMap.get(superName.getType().toString());
|
|
|
+ typeName = convertTypeName(typeName, 1, dicList);
|
|
|
+
|
|
|
+ conceptInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("name", superName.getName())
|
|
|
+ .eq("status", StatusEnum.Enable.getKey())
|
|
|
+ .eq("type", typeName);
|
|
|
+ conceptInfo = this.getOne(conceptInfoQueryWrapper, false);
|
|
|
+
|
|
|
+ if (conceptInfo == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.IS_EXISTS, "缺少静态信息");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
BeanUtil.copyProperties(conceptInfo, staticKnowledgeDTO);
|
|
@@ -373,6 +406,63 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
.in("type", typeNames);
|
|
|
List<ConceptInfo> conceptInfoList = this.list(conceptInfoQueryWrapper);
|
|
|
|
|
|
+ List<String> existUniqueNameList = Lists.newLinkedList();
|
|
|
+
|
|
|
+ if (ListUtil.isNotEmpty(conceptInfoList)) {
|
|
|
+ existUniqueNameList.addAll(conceptInfoList
|
|
|
+ .stream()
|
|
|
+ .map(i -> i.getName())
|
|
|
+ .collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取上级静态知识
|
|
|
+ List<String> notExistUniqueNameList = Lists.newLinkedList();
|
|
|
+ uniqueNameList.forEach(name -> {
|
|
|
+ if (!existUniqueNameList.contains(name)) {
|
|
|
+ notExistUniqueNameList.add(name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (ListUtil.isNotEmpty(notExistUniqueNameList)) {
|
|
|
+ List<StaticKnowledgeNameVO> paramNames = Lists.newLinkedList();
|
|
|
+ List<StaticKnowledgeNameVO> superNames = Lists.newLinkedList();
|
|
|
+ for (String name : notExistUniqueNameList) {
|
|
|
+ StaticKnowledgeNameVO paramName = new StaticKnowledgeNameVO();
|
|
|
+ paramName.setName(name);
|
|
|
+ if (staticKnowledgeHISVO.getType().equals(5)) {
|
|
|
+ paramName.setType(6);
|
|
|
+ } else {
|
|
|
+ paramName.setType(staticKnowledgeHISVO.getType());
|
|
|
+ }
|
|
|
+ paramNames.add(paramName);
|
|
|
+ }
|
|
|
+ RespDTO<List<StaticKnowledgeNameVO>> respDTO = cdssCoreClient.getSuperNameBatch(paramNames);
|
|
|
+ if (RespDTOUtil.respIsOK(respDTO)) {
|
|
|
+ superNames = respDTO.data;
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(superNames)) {
|
|
|
+ List<String> superNameList = superNames.stream().map(i -> i.getName()).distinct().collect(Collectors.toList());
|
|
|
+ List<Integer> superTypes = superNames.stream().map(i -> i.getType()).distinct().collect(Collectors.toList());
|
|
|
+ List<String> superTypeNames = Lists.newLinkedList();
|
|
|
+ for (Integer type : superTypes) {
|
|
|
+ String typeName = dicStaticTypeValNameMap.get(type.toString());
|
|
|
+ typeName = convertTypeName(typeName, 1, dicList);
|
|
|
+ superTypeNames.add(typeName);
|
|
|
+ }
|
|
|
+ conceptInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("name", superNameList)
|
|
|
+ .eq("status", StatusEnum.Enable.getKey())
|
|
|
+ .in("type", superTypeNames);
|
|
|
+ List<ConceptInfo> superConceptInfoList = this.list(conceptInfoQueryWrapper);
|
|
|
+ if (ListUtil.isNotEmpty(superConceptInfoList)) {
|
|
|
+ conceptInfoList.addAll(superConceptInfoList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ conceptInfoList = conceptInfoList.stream().distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
if (ListUtil.isEmpty(conceptInfoList)) {
|
|
|
return retList;
|
|
|
}
|