瀏覽代碼

解决lambda排序问题

yucheng 3 年之前
父節點
當前提交
7e08eb0d06
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/main/java/com/persagy/proxy/adm/service/impl/AdmDictServiceImpl.java

+ 6 - 2
src/main/java/com/persagy/proxy/adm/service/impl/AdmDictServiceImpl.java

@@ -360,11 +360,15 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         admObjectInfos = sortFuncidForEdit(admObjectInfos);
         //查询平台级信息点采集信息
         List<ObjectInfoCollect> commonObjectInfoCollect = queryObjectInfoCollect(context, "common", request.getType(), clazz);
-        Map<String, Boolean> commonObjectInfoCollectMap = commonObjectInfoCollect.stream().filter(item -> StrUtil.isNotEmpty(item.getDefineInfoId())).collect(Collectors.toMap(ObjectInfoCollect::getDefineInfoId,ObjectInfoCollect::getVisiable));
+        Map<String, Boolean> commonObjectInfoCollectMap = commonObjectInfoCollect.stream().filter(item ->
+                StrUtil.isNotEmpty(item.getDefineInfoId())).collect(
+                        Collectors.toMap(ObjectInfoCollect::getDefineInfoId,ObjectInfoCollect::getVisiable,(k1,k2)->k1));
 
         //查询项目级信息点采集信息
         List<ObjectInfoCollect> projectObjectInfoCollect = queryObjectInfoCollect(context, "project", request.getType(), clazz);
-        Map<String, Boolean> projectObjectInfoCollectMap = projectObjectInfoCollect.stream().filter(item -> StrUtil.isNotEmpty(item.getDefineInfoId())).collect(Collectors.toMap(ObjectInfoCollect::getDefineInfoId,ObjectInfoCollect::getVisiable));
+        Map<String, Boolean> projectObjectInfoCollectMap = projectObjectInfoCollect.stream().filter(item ->
+                StrUtil.isNotEmpty(item.getDefineInfoId())).collect(
+                        Collectors.toMap(ObjectInfoCollect::getDefineInfoId,ObjectInfoCollect::getVisiable,(k1,k2)->k1));
 
         String dictType = request.getDictType();