|
@@ -4,12 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.dto.GetAllForRelationDTO;
|
|
|
import com.diagbot.dto.IndexBatchDTO;
|
|
|
import com.diagbot.dto.KllisDetailDTO;
|
|
|
-import com.diagbot.entity.KlConcept;
|
|
|
-import com.diagbot.entity.KlDisease;
|
|
|
-import com.diagbot.entity.KlLibraryInfo;
|
|
|
-import com.diagbot.entity.KlOperation;
|
|
|
-import com.diagbot.entity.TcmDisease;
|
|
|
-import com.diagbot.entity.TcmSyndrome;
|
|
|
+import com.diagbot.entity.*;
|
|
|
import com.diagbot.enums.ConceptTypeEnum;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.LexiconEnum;
|
|
@@ -55,6 +50,8 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
private TcmSyndromeFacade tcmSyndromeFacade;
|
|
|
@Autowired
|
|
|
private KlLibraryInfoFacade klLibraryInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private KlDrugFacade klDrugFacade;
|
|
|
|
|
|
/**
|
|
|
* 批量校验标准术语
|
|
@@ -500,13 +497,32 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
.eq("status", StatusEnum.Enable.getKey())
|
|
|
.notIn(ListUtil.isNotEmpty(excludedConceptIds), "id", excludedConceptIds)
|
|
|
.last("limit 100"));
|
|
|
+
|
|
|
+ // 取出 is_deleted = N 且 concept_id 在 conceptList 中的所有药品
|
|
|
+ List<KlDrug> klDrugs = klDrugFacade.getKlDrugsByConceptIds(conceptList.stream().map(KlConcept::getId).collect(Collectors.toList()));
|
|
|
+
|
|
|
if (ListUtil.isNotEmpty(conceptList)) {
|
|
|
+
|
|
|
+ // 构建 conceptId -> KlDrug 的映射
|
|
|
+ Map<Long, KlDrug> klDrugMap = new HashMap<>();
|
|
|
+ for (KlDrug klDrug : klDrugs) {
|
|
|
+ klDrugMap.put(klDrug.getConceptId(), klDrug);
|
|
|
+ }
|
|
|
+
|
|
|
getAllForRelationDTOS = conceptList.stream().map(x -> {
|
|
|
GetAllForRelationDTO getAllForRelationDTO = new GetAllForRelationDTO();
|
|
|
getAllForRelationDTO.setConceptNameType(x.getLibName());
|
|
|
getAllForRelationDTO.setConceptName(x.getLibName());
|
|
|
getAllForRelationDTO.setConceptId(x.getId());
|
|
|
getAllForRelationDTO.setLibType(x.getLibType());
|
|
|
+
|
|
|
+ KlDrug klDrug = klDrugMap.get(x.getId());
|
|
|
+ if (klDrug != null && StringUtil.isNotBlank(klDrug.getDrugC())) {
|
|
|
+ getAllForRelationDTO.setDrugC(klDrug.getDrugC());
|
|
|
+ } else {
|
|
|
+ getAllForRelationDTO.setDrugC("其他");
|
|
|
+ }
|
|
|
+
|
|
|
return getAllForRelationDTO;
|
|
|
}).collect(Collectors.toList());
|
|
|
}
|