|
@@ -7,6 +7,7 @@ import com.diagbot.dto.ExportConceptAllDTO;
|
|
|
import com.diagbot.dto.ExportConceptModeDTO;
|
|
|
import com.diagbot.entity.KlConcept;
|
|
|
import com.diagbot.entity.KlConceptCommon;
|
|
|
+import com.diagbot.entity.KlDisease;
|
|
|
import com.diagbot.entity.KlLexicon;
|
|
|
import com.diagbot.entity.KlLibraryInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
@@ -298,6 +299,7 @@ public class TermImportFacade {
|
|
|
}
|
|
|
}
|
|
|
res = klLibraryInfoService.saveBatch(libraryInfosSub);
|
|
|
+ List<Long> conceptIds = new ArrayList<>();
|
|
|
//年龄
|
|
|
List<KlConceptCommon> conceptCommonList = new ArrayList<>();
|
|
|
for (Map.Entry<String, ImportConceptAllVO> entry : conceptListMap.entrySet()) {
|
|
@@ -315,14 +317,41 @@ public class TermImportFacade {
|
|
|
conceptCommon.setGmtCreate(now);
|
|
|
conceptCommon.setGmtModified(now);
|
|
|
conceptCommonList.add(conceptCommon);
|
|
|
+ conceptIds.add(klConcept.getId());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
res = klConceptCommonService.saveBatch(conceptCommonList);
|
|
|
+ //疾病表
|
|
|
+ if (ListUtil.isNotEmpty(conceptIds)) {
|
|
|
+ QueryWrapper<KlDisease> klDisease = new QueryWrapper<>();
|
|
|
+ klDisease.lambda().eq(KlDisease::getIsDeleted, IsDeleteEnum.N.getKey())
|
|
|
+ .in(KlDisease::getConceptId, conceptIds);
|
|
|
+ List<KlDisease> list = klDiseaseFacade.list(klDisease);
|
|
|
+ List<Long> diseaseConceptId = list.stream().map(ac -> ac.getConceptId()).collect(Collectors.toList());
|
|
|
+ if (ListUtil.isNotEmpty(diseaseConceptId)) {
|
|
|
+ conceptIds.retainAll(diseaseConceptId);
|
|
|
+ }
|
|
|
+ List<KlDisease> klDiseaseData = new ArrayList<>();
|
|
|
+ for (Long id : conceptIds) {
|
|
|
+ KlDisease data = new KlDisease();
|
|
|
+ data.setConceptId(id);
|
|
|
+ data.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
+ data.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
+ data.setGmtCreate(now);
|
|
|
+ data.setGmtModified(now);
|
|
|
+ klDiseaseData.add(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ res = klDiseaseService.saveBatch(klDiseaseData);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public void exportTemplateAll(HttpServletResponse response) {
|
|
|
//类型数据
|
|
|
QueryWrapper<KlLexicon> klLexiconQuer = new QueryWrapper<>();
|