Sfoglia il codice sorgente

获取学校样式过滤

wn0920
王宁 2 anni fa
parent
commit
bd68ae5648

+ 20
- 11
sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolStypeService.java Vedi File

@@ -113,17 +113,26 @@ public class SchoolStypeService {
113 113
     public List <TSchoolStype> listAll2(TSchoolStype stype) {
114 114
         List<TSchoolStype> lst = schoolStypeMapper.findAll2(stype);
115 115
         List<TSchoolStype> rtnlst = new ArrayList<>();
116
-        //获取学校样式,如果学校未设置使用default设置的内容
117
-        Map<String,List<TSchoolStype>> map = lst.stream().collect(Collectors.groupingBy(TSchoolStype :: getSchooltype,Collectors.toList()));
118
-        for(Map.Entry<String, List<TSchoolStype>> entry : map.entrySet()){
119
-            List<TSchoolStype> maplist = entry.getValue();
120
-            if(maplist.size() == 1){
121
-                rtnlst.add(maplist.get(0));
122
-            }else if(maplist.size()>1){
123
-                for(TSchoolStype s : maplist){
124
-                    if(!s.getSchooldomain().equals("default")){
125
-                        rtnlst.add(s);
126
-                        break;
116
+        if(N_Utils.isListNotEmpty(lst)){
117
+            List<TSchoolStype> filterlst = new ArrayList<>();
118
+            for(TSchoolStype s : lst){
119
+                if(s.getStid()!=null && s.getStid()>0){
120
+                    filterlst.add(s);
121
+                }
122
+            }
123
+
124
+            //获取学校样式,如果学校未设置使用default设置的内容
125
+            Map<String,List<TSchoolStype>> map = filterlst.stream().collect(Collectors.groupingBy(TSchoolStype :: getSchooltype,Collectors.toList()));
126
+            for(Map.Entry<String, List<TSchoolStype>> entry : map.entrySet()){
127
+                List<TSchoolStype> maplist = entry.getValue();
128
+                if(maplist.size() == 1){
129
+                    rtnlst.add(maplist.get(0));
130
+                }else if(maplist.size()>1){
131
+                    for(TSchoolStype s : maplist){
132
+                        if(!s.getSchooldomain().equals("default")){
133
+                            rtnlst.add(s);
134
+                            break;
135
+                        }
127 136
                     }
128 137
                 }
129 138
             }

Loading…
Annulla
Salva