|
@@ -22,7 +22,6 @@ import com.diagbot.entity.Lexicon;
|
|
import com.diagbot.entity.LibraryInfo;
|
|
import com.diagbot.entity.LibraryInfo;
|
|
import com.diagbot.entity.QuestionInfo;
|
|
import com.diagbot.entity.QuestionInfo;
|
|
import com.diagbot.entity.Relation;
|
|
import com.diagbot.entity.Relation;
|
|
-import com.diagbot.entity.ScaleContent;
|
|
|
|
import com.diagbot.entity.wrapper.ConceptWrapper;
|
|
import com.diagbot.entity.wrapper.ConceptWrapper;
|
|
import com.diagbot.enums.DiseaseClassifyEnum;
|
|
import com.diagbot.enums.DiseaseClassifyEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
@@ -63,6 +62,7 @@ import com.diagbot.vo.IndexVO;
|
|
import com.diagbot.vo.KLQuestionVO;
|
|
import com.diagbot.vo.KLQuestionVO;
|
|
import com.diagbot.vo.RemoveConceptInfoVO;
|
|
import com.diagbot.vo.RemoveConceptInfoVO;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
+import com.google.common.collect.Maps;
|
|
import org.apache.commons.lang.time.DateFormatUtils;
|
|
import org.apache.commons.lang.time.DateFormatUtils;
|
|
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
@@ -240,7 +240,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
List<Concept> conceptList = list(conceptQe);
|
|
List<Concept> conceptList = list(conceptQe);
|
|
|
|
|
|
if (ListUtil.isNotEmpty(conceptList)) {
|
|
if (ListUtil.isNotEmpty(conceptList)) {
|
|
- Map<Long, Long> reCouMap = new HashMap<>();
|
|
|
|
|
|
+ Map<Long, Long> reCouMap = Maps.newHashMap();
|
|
if (getAllForRelationVO.getRelationPosition() != 3) {
|
|
if (getAllForRelationVO.getRelationPosition() != 3) {
|
|
if (getAllForRelationVO.getRelationId() == null) {
|
|
if (getAllForRelationVO.getRelationId() == null) {
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "关系类型id必传!");
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "关系类型id必传!");
|
|
@@ -264,18 +264,40 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
if (ListUtil.isNotEmpty(relationConceptIdList)) {
|
|
if (ListUtil.isNotEmpty(relationConceptIdList)) {
|
|
if (getAllForRelationVO.getRelationPosition() == 1) {
|
|
if (getAllForRelationVO.getRelationPosition() == 1) {
|
|
relationQe.in("start_id", conceptIdList);
|
|
relationQe.in("start_id", conceptIdList);
|
|
- relationQe.in(ListUtil.isNotEmpty(relationConceptIdList), "end_id", relationConceptIdList);
|
|
|
|
|
|
+ relationQe.in("end_id", relationConceptIdList);
|
|
reCouMap = relationFacade.list(relationQe)
|
|
reCouMap = relationFacade.list(relationQe)
|
|
.stream()
|
|
.stream()
|
|
.collect(Collectors.groupingBy(Relation::getStartId, Collectors.counting()));
|
|
.collect(Collectors.groupingBy(Relation::getStartId, Collectors.counting()));
|
|
- } else {
|
|
|
|
|
|
+ } else if (getAllForRelationVO.getRelationPosition() == 2) {
|
|
relationQe.in("end_id", conceptIdList);
|
|
relationQe.in("end_id", conceptIdList);
|
|
- relationQe.in(ListUtil.isNotEmpty(relationConceptIdList), "start_id", relationConceptIdList);
|
|
|
|
|
|
+ relationQe.in("start_id", relationConceptIdList);
|
|
reCouMap = relationFacade.list(relationQe)
|
|
reCouMap = relationFacade.list(relationQe)
|
|
.stream()
|
|
.stream()
|
|
.collect(Collectors.groupingBy(Relation::getEndId, Collectors.counting()));
|
|
.collect(Collectors.groupingBy(Relation::getEndId, Collectors.counting()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (getAllForRelationVO.getRelationPosition() == 0) {
|
|
|
|
+ List<Long> relationConceptIdList_ = relationConceptIdList;
|
|
|
|
+ relationQe.and(
|
|
|
|
+ qwall -> qwall
|
|
|
|
+ .and(qw1 -> qw1
|
|
|
|
+ .in("start_id", conceptIdList)
|
|
|
|
+ .in(ListUtil.isNotEmpty(relationConceptIdList_), "end_id", relationConceptIdList_))
|
|
|
|
+ .or(qw2 -> qw2
|
|
|
|
+ .in("end_id", conceptIdList)
|
|
|
|
+ .in(ListUtil.isNotEmpty(relationConceptIdList_), "start_id", relationConceptIdList_))
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ List<Relation> relationList = relationFacade.list(relationQe);
|
|
|
|
+ reCouMap.putAll(relationList
|
|
|
|
+ .stream()
|
|
|
|
+ .collect(Collectors.groupingBy(Relation::getStartId, Collectors.counting())));
|
|
|
|
+
|
|
|
|
+ reCouMap.putAll(relationList
|
|
|
|
+ .stream()
|
|
|
|
+ .collect(Collectors.groupingBy(Relation::getEndId, Collectors.counting())));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
for (Concept i : conceptList) {
|
|
for (Concept i : conceptList) {
|
|
@@ -382,7 +404,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
public Boolean removeConceptInfo(RemoveConceptInfoVO removeConceptInfoVO) {
|
|
public Boolean removeConceptInfo(RemoveConceptInfoVO removeConceptInfoVO) {
|
|
|
|
|
|
//清理缓存
|
|
//清理缓存
|
|
- if(removeConceptInfoVO.getConceptId()!=null) {
|
|
|
|
|
|
+ if (removeConceptInfoVO.getConceptId() != null) {
|
|
this.cacheClearByConceptId(removeConceptInfoVO.getConceptId());
|
|
this.cacheClearByConceptId(removeConceptInfoVO.getConceptId());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -520,7 +542,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
*/
|
|
*/
|
|
public Boolean addConceptInfo(AddConceptInfoVO addConceptInfoVO) {
|
|
public Boolean addConceptInfo(AddConceptInfoVO addConceptInfoVO) {
|
|
//清理原名称对应标签缓存
|
|
//清理原名称对应标签缓存
|
|
- if(addConceptInfoVO.getConceptId()!=null) {
|
|
|
|
|
|
+ if (addConceptInfoVO.getConceptId() != null) {
|
|
this.cacheClearByConceptId(addConceptInfoVO.getConceptId());
|
|
this.cacheClearByConceptId(addConceptInfoVO.getConceptId());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1119,7 +1141,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
//删除标签缓存
|
|
//删除标签缓存
|
|
List<Long> saveConceptIds = saveOrUpdateConceptList.stream()
|
|
List<Long> saveConceptIds = saveOrUpdateConceptList.stream()
|
|
.map(i -> i.getId()).filter(j -> j != null).distinct().collect(Collectors.toList());
|
|
.map(i -> i.getId()).filter(j -> j != null).distinct().collect(Collectors.toList());
|
|
- if(ListUtil.isNotEmpty(saveConceptIds)) {
|
|
|
|
|
|
+ if (ListUtil.isNotEmpty(saveConceptIds)) {
|
|
this.cacheClearByConceptIds(saveConceptIds);
|
|
this.cacheClearByConceptIds(saveConceptIds);
|
|
}
|
|
}
|
|
conceptService.saveOrUpdateBatch(saveOrUpdateConceptList);
|
|
conceptService.saveOrUpdateBatch(saveOrUpdateConceptList);
|
|
@@ -1224,9 +1246,10 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 知识库标准化-获取医学数据统计
|
|
* 知识库标准化-获取医学数据统计
|
|
|
|
+ *
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<BIItemDTO> queryLibTypeCou(){
|
|
|
|
|
|
+ public List<BIItemDTO> queryLibTypeCou() {
|
|
return this.baseMapper.queryLibTypeCou();
|
|
return this.baseMapper.queryLibTypeCou();
|
|
}
|
|
}
|
|
|
|
|