Przeglądaj źródła

20240929 添加查新对比记录

lwhhszx 11 miesięcy temu
rodzic
commit
e976855a5f

+ 8 - 5
src/main/java/cn/cslg/pas/service/business/SystemDictService.java

@@ -9,10 +9,7 @@ import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -30,8 +27,14 @@ public class SystemDictService extends ServiceImpl<SystemDictMapper, SystemDict>
     public Map<String, List<SystemDict>> getOsSystemDict(List<String> types) {
         Map<String, List<SystemDict>> systemDictMap = new HashMap<>();
         LambdaQueryWrapper<SystemDict> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.in(SystemDict::getType, types);
+        if (types != null && types.size() > 0) {
+            queryWrapper.in(SystemDict::getType, types);
+        }
         List<SystemDict> systemDictList = this.list(queryWrapper);
+        types =systemDictList.stream().map(SystemDict::getType).collect(Collectors.toList());
+        types =types.stream().distinct().collect(Collectors.toList());
+        Set set = new HashSet();
+        set.addAll(systemDictList);
         types.forEach(item -> {
             List<SystemDict> systemDictList1 = systemDictList.stream().filter(t -> t.getType().equals(item)).collect(Collectors.toList());
             systemDictMap.put(item, systemDictList1);