Browse Source

学校样式设置登录页面

tags/正式3.13.0
王宁 1 year ago
parent
commit
bf48b94ebd

+ 15
- 0
sapi/src/main/java/com/xhkjedu/sapi/controller/system/SchoolStypeController.java View File

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
12 12
 
13 13
 import javax.annotation.Resource;
14 14
 import java.util.List;
15
+import java.util.Map;
15 16
 
16 17
 /**
17 18
 * @author ywx
@@ -52,4 +53,18 @@ public class SchoolStypeController {
52 53
         List<TSchoolStype> list = schoolStypeService.listAll2(stype);
53 54
         return new ResultVo(0,"获取学校样式列表成功",list);
54 55
     }
56
+
57
+    /*
58
+     * @Description 获取学校样式(设置登录页面获取数据)
59
+     * @Date 2023/11/21 10:19:12
60
+     * @Author WN
61
+     * @Param [stype]
62
+     * @Return com.xhkjedu.vo.ResultVo
63
+     **/
64
+    @PostMapping("/sstyles")
65
+    public ResultVo allList(@RequestBody TSchoolStype stype) {
66
+        N_Utils.validation(new Object[]{stype.getSchoolid(),"学校id",1});
67
+        Map<String,List<TSchoolStype>> rtnMap = schoolStypeService.listSchoolStypeAndDefault(stype);
68
+        return new ResultVo(0,"获取学校样式列表成功",rtnMap);
69
+    }
55 70
 }

+ 28
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolStypeService.java View File

@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
12 12
 
13 13
 import javax.annotation.Resource;
14 14
 import java.util.ArrayList;
15
+import java.util.HashMap;
15 16
 import java.util.List;
16 17
 import java.util.Map;
17 18
 import java.util.stream.Collectors;
@@ -146,4 +147,31 @@ public class SchoolStypeService {
146 147
         }
147 148
         return rtnlst;
148 149
     }
150
+
151
+    /*
152
+     * @Description 获取学校样式(设置登录页面获取数据)
153
+     * @Date 2023/11/21 10:39:18
154
+     * @Author WN
155
+     * @Param [stype]
156
+     * @Return java.util.Map<java.lang.String,java.util.List<com.xhkjedu.sapi.model.system.TSchoolStype>>
157
+     **/
158
+    public Map<String,List<TSchoolStype>> listSchoolStypeAndDefault(TSchoolStype stype) {
159
+        List<TSchoolStype> lst = schoolStypeMapper.findAll2(stype);
160
+
161
+        Map<String,List<TSchoolStype>> rtnMap = new HashMap<>();
162
+        if(N_Utils.isListNotEmpty(lst)){
163
+            //获取学校设置的
164
+            List<TSchoolStype> schoolStypes = lst.stream().filter(s -> stype.getSchoolid().equals(s.getSchoolid())).collect(Collectors.toList());
165
+            //默认地址
166
+            List<TSchoolStype> defaultStypes = lst.stream().filter(s -> "default".equals(s.getSchooldomain())).collect(Collectors.toList());
167
+
168
+            rtnMap.put("school",schoolStypes);
169
+            rtnMap.put("default",defaultStypes);
170
+        }else{
171
+            rtnMap.put("school",new ArrayList<>());
172
+            rtnMap.put("default",new ArrayList<>());
173
+        }
174
+
175
+        return rtnMap;
176
+    }
149 177
 }

Loading…
Cancel
Save