|
@@ -0,0 +1,45 @@
|
|
|
+package com.diagbot.facade;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.diagbot.entity.GraphConceptInfo;
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.service.impl.GraphConceptInfoServiceImpl;
|
|
|
+import com.diagbot.util.EntityUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import org.apache.commons.collections.MapUtils;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author kwz
|
|
|
+ * @date 2020/12/29
|
|
|
+ * @time 19:53
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class GraphConceptInfoFacade extends GraphConceptInfoServiceImpl {
|
|
|
+
|
|
|
+ public Map<String,List<String>> getGraphConceptMap(){
|
|
|
+ Map<String,List<String>> retMap = new HashMap<>();
|
|
|
+ QueryWrapper<GraphConceptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("status", 1);
|
|
|
+ List<GraphConceptInfo> graphConceptInfos = this.list(queryWrapper);
|
|
|
+ if(ListUtil.isEmpty(graphConceptInfos)){
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+ Map<String, List<GraphConceptInfo>> typeMap = EntityUtil.makeEntityListMap(graphConceptInfos, "type");
|
|
|
+ if(MapUtils.isNotEmpty(typeMap)){
|
|
|
+ typeMap.forEach((key,value) ->{
|
|
|
+ retMap.put(key,value.stream().map(x ->x.getName()).collect(Collectors.toList()));
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ return retMap;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|