czh 2 жил өмнө
parent
commit
b6ff0f3510

+ 4 - 4
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -227,12 +227,12 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
     }
 
     @Override
-    public Map<Long, List<EntCacheResDto>> queryEntCacheMapByIds(List<Long> entIds) {
+    public Map<Long, EntCacheResDto> queryEntCacheMapByIds(List<Long> entIds) {
         List<EntCacheResDto> entCacheResDtos = queryEntCacheByIds(entIds);
         if (CollectionUtils.isEmpty(entCacheResDtos)) {
             return null;
         }
-        return entCacheResDtos.stream().collect(Collectors.groupingBy(EntCacheResDto::getId));
+        return entCacheResDtos.stream().collect(Collectors.toMap(EntCacheResDto::getId, x -> x, (oldValue, newValue) -> newValue));
     }
 
     @Override
@@ -295,12 +295,12 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
     }
 
     @Override
-    public Map<Long, List<UserCacheResDto>> queryUserCacheMapByIds(List<Long> userIds) {
+    public Map<Long, UserCacheResDto> queryUserCacheMapByIds(List<Long> userIds) {
         List<UserCacheResDto> userCacheResDtos = queryUserCacheByIds(userIds);
         if (CollectionUtils.isEmpty(userCacheResDtos)) {
             return null;
         }
-        return userCacheResDtos.stream().collect(Collectors.groupingBy(UserCacheResDto::getId));
+        return userCacheResDtos.stream().collect(Collectors.toMap(UserCacheResDto::getId, x -> x, (oldValue, newValue) -> newValue));
     }
 
     @Override