|
@@ -142,10 +142,13 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Concept> getListByIds(List<Long> ids) {
|
|
|
- QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
|
- conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("id", ids);
|
|
|
- List<Concept> list = this.list(conceptQueryWrapper);
|
|
|
+ List<Concept> list = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(ids)) {
|
|
|
+ QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
|
+ conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("id", ids);
|
|
|
+ list = this.list(conceptQueryWrapper);
|
|
|
+ }
|
|
|
return list;
|
|
|
}
|
|
|
|
|
@@ -157,13 +160,16 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Concept> getListByNamesAndType(List<String> nameList, Integer libType) {
|
|
|
- QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
|
- conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("lib_name", nameList);
|
|
|
- if (libType != null) {
|
|
|
- conceptQueryWrapper.eq("lib_type", libType);
|
|
|
+ List<Concept> list = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(nameList)) {
|
|
|
+ QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
|
+ conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("lib_name", nameList);
|
|
|
+ if (libType != null) {
|
|
|
+ conceptQueryWrapper.eq("lib_type", libType);
|
|
|
+ }
|
|
|
+ list = this.list(conceptQueryWrapper);
|
|
|
}
|
|
|
- List<Concept> list = this.list(conceptQueryWrapper);
|
|
|
return list;
|
|
|
}
|
|
|
|
|
@@ -174,10 +180,13 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Concept> getListByNames(List<String> nameList) {
|
|
|
- QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
|
- conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("lib_name", nameList);
|
|
|
- List<Concept> list = this.list(conceptQueryWrapper);
|
|
|
+ List<Concept> list = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(nameList)) {
|
|
|
+ QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
|
+ conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("lib_name", nameList);
|
|
|
+ list = this.list(conceptQueryWrapper);
|
|
|
+ }
|
|
|
return list;
|
|
|
}
|
|
|
|
|
@@ -316,18 +325,18 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
// 有本体,过滤同义词和子项;无本体,有子项,过滤同义词
|
|
|
for (ConceptRetrievalDTO bean : conceptRetrievalDTOS) {
|
|
|
if (bean.getShowType().intValue() == 1) {
|
|
|
- if(retrievalVO.getIsSonShow().intValue() == 0){//isSonShow为0执行检索去重逻辑
|
|
|
+ if (retrievalVO.getIsSonShow().intValue() == 0) {//isSonShow为0执行检索去重逻辑
|
|
|
res.add(bean);
|
|
|
}
|
|
|
} else if (bean.getShowType().intValue() == 2) {
|
|
|
- if(retrievalVO.getIsSonShow().intValue() == 0){//isSonShow为0执行检索去重逻辑
|
|
|
- if (!selfList.contains(bean.getParentId()) && !conceptNameList.contains(bean.getParentName()) ) {
|
|
|
+ if (retrievalVO.getIsSonShow().intValue() == 0) {//isSonShow为0执行检索去重逻辑
|
|
|
+ if (!selfList.contains(bean.getParentId()) && !conceptNameList.contains(bean.getParentName())) {
|
|
|
conceptNameList.add(bean.getParentName());
|
|
|
res.add(bean);
|
|
|
}
|
|
|
}
|
|
|
} else if (bean.getShowType().intValue() == 0) {
|
|
|
- if(retrievalVO.getIsSonShow().intValue() == 0){//isSonShow为0执行检索去重逻辑
|
|
|
+ if (retrievalVO.getIsSonShow().intValue() == 0) {//isSonShow为0执行检索去重逻辑
|
|
|
if (!selfList.contains(bean.getSelfId()) && !subList.contains(bean.getSelfId()) && !conceptNameList.contains(bean.getSelfName())) {
|
|
|
conceptNameList.add(bean.getSelfName());
|
|
|
res.add(bean);
|
|
@@ -354,12 +363,12 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
*/
|
|
|
public List<RetrievalDTO> getStaticKnowledge(GetStaticKnowledgeVO getStaticKnowledgeVO) {
|
|
|
RetrievalVO retrievalVO = new RetrievalVO();
|
|
|
- BeanUtil.copyProperties(getStaticKnowledgeVO,retrievalVO);
|
|
|
+ BeanUtil.copyProperties(getStaticKnowledgeVO, retrievalVO);
|
|
|
List<RetrievalDTO> staticRetrievalList = this.staticKnowledge(retrievalVO);
|
|
|
for (RetrievalDTO retrievalDTO : staticRetrievalList) {
|
|
|
retrievalDTO.setType(ParamConvertUtil.libConvert2Concept(retrievalDTO.getLibTypeId().intValue()));
|
|
|
- if((retrievalDTO.getShowType().intValue() == 1)
|
|
|
- || (retrievalDTO.getShowType().intValue() == 21)){//去除本体retrivalName和(父项--子项)组合的retrivalName
|
|
|
+ if ((retrievalDTO.getShowType().intValue() == 1)
|
|
|
+ || (retrievalDTO.getShowType().intValue() == 21)) {//去除本体retrivalName和(父项--子项)组合的retrivalName
|
|
|
retrievalDTO.setRetrievalName(null);
|
|
|
}
|
|
|
}
|