Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式3.2.0
王宁 2 years ago
parent
commit
9da2e6857e

+ 3
- 2
slive/src/main/java/com/xhkjedu/slive/controller/liveplay/CourseSectionController.java View File

260
         N_Utils.validation(new Object[]{classid, "班级id", 1});
260
         N_Utils.validation(new Object[]{classid, "班级id", 1});
261
         Integer page = student.getPage();
261
         Integer page = student.getPage();
262
         String studentname = student.getStudentname();
262
         String studentname = student.getStudentname();
263
+        Integer year = courseSectionService.getYearByClassId(classid);
263
         if (N_Utils.isEmptyInteger(page)) {
264
         if (N_Utils.isEmptyInteger(page)) {
264
-            List<Map> list = courseSectionService.listStudent(classid, studentname);
265
+            List<Map> list = courseSectionService.listStudent(classid, studentname, year);
265
             return new ResultVo(0,"获取课程学生列表成功",list);
266
             return new ResultVo(0,"获取课程学生列表成功",list);
266
         } else {
267
         } else {
267
             Integer pageSize = student.getPageSize();
268
             Integer pageSize = student.getPageSize();
268
             N_Utils.validation(new Object[]{pageSize, "显示条数", 1});
269
             N_Utils.validation(new Object[]{pageSize, "显示条数", 1});
269
             PageHelper.startPage(page, pageSize);
270
             PageHelper.startPage(page, pageSize);
270
-            List<Map> list = courseSectionService.listStudent(classid, studentname);
271
+            List<Map> list = courseSectionService.listStudent(classid, studentname, year);
271
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
272
             PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
272
             return new ResultVo(0, "获取课程学生列表成功", pageResult);
273
             return new ResultVo(0, "获取课程学生列表成功", pageResult);
273
         }
274
         }

+ 14
- 8
slive/src/main/java/com/xhkjedu/slive/service/liveplay/CourseSectionService.java View File

27
 import java.util.ArrayList;
27
 import java.util.ArrayList;
28
 import java.util.List;
28
 import java.util.List;
29
 import java.util.Map;
29
 import java.util.Map;
30
-import java.util.concurrent.Callable;
31
-import java.util.concurrent.ExecutorService;
32
-import java.util.concurrent.Executors;
33
-import java.util.concurrent.Future;
34
-import java.util.concurrent.TimeUnit;
35
-import java.util.concurrent.TimeoutException;
30
+import java.util.concurrent.*;
36
 import java.util.stream.Collectors;
31
 import java.util.stream.Collectors;
37
 
32
 
38
 /**
33
 /**
357
     }
352
     }
358
 
353
 
359
     //获取课程学生列表
354
     //获取课程学生列表
360
-    public List<Map> listStudent(Integer classid, String studentname) {
361
-        Integer year = classMapper.getYearById(classid);
355
+    public List<Map> listStudent(Integer classid, String studentname, Integer year) {
362
         List<Map> list = courseSectionMapper.listStudent(classid, studentname, year);
356
         List<Map> list = courseSectionMapper.listStudent(classid, studentname, year);
363
         for (Map map : list) {
357
         for (Map map : list) {
364
             String classname = (String) map.get("classname");
358
             String classname = (String) map.get("classname");
371
         return list;
365
         return list;
372
     }
366
     }
373
 
367
 
368
+    /**
369
+     * 获取当前班级年份
370
+     *
371
+     * @param [classid]
372
+     * @return java.lang.Integer
373
+     * @author ywx
374
+     * @date 2022/4/8 21:02
375
+     */
376
+    public Integer getYearByClassId(Integer classid) {
377
+        return classMapper.getYearById(classid);
378
+    }
379
+
374
     //学生课节日历
380
     //学生课节日历
375
     public List<Map> listStuSectionDate(CourseParams params) {
381
     public List<Map> listStuSectionDate(CourseParams params) {
376
         return courseSectionMapper.listStuSectionDate(params);
382
         return courseSectionMapper.listStuSectionDate(params);

+ 16
- 0
suser/src/main/java/com/xhkjedu/suser/controller/system/UserController.java View File

515
         N_Utils.validation(new Object[]{userid, "用户id", 1, usid, "密保id", 1, usanswer, "密保答案", 2});
515
         N_Utils.validation(new Object[]{userid, "用户id", 1, usid, "密保id", 1, usanswer, "密保答案", 2});
516
         return userService.checkUsecret(userid, usid, usanswer);
516
         return userService.checkUsecret(userid, usid, usanswer);
517
     }
517
     }
518
+
519
+    /**
520
+     * 校验用户密码
521
+     *
522
+     * @param [user]
523
+     * @return com.xhkjedu.vo.ResultVo
524
+     * @author ywx
525
+     * @date 2022/4/8 15:05
526
+     */
527
+    @PostMapping("/check_pwd")
528
+    public ResultVo checkPwd(@RequestBody TUser user) {
529
+        Integer userid = user.getUserid();
530
+        String loginpwd = user.getLoginpwd();
531
+        N_Utils.validation(new Object[]{userid, "用户id", 1, loginpwd, "密码", 2});
532
+        return userService.checkPwd(user);
533
+    }
518
 }
534
 }

+ 3
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserMapper.java View File

207
 
207
 
208
     //获取手机号绑定的其他用户数量
208
     //获取手机号绑定的其他用户数量
209
     Integer getNumByUserPhone(Integer userid, String userphone);
209
     Integer getNumByUserPhone(Integer userid, String userphone);
210
+
211
+    //根据用户id获取密码
212
+    String getPwdByUserId(Integer userid);
210
 }
213
 }

+ 16
- 0
suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java View File

944
         if (!usanswer.equals(answer)) return new ResultVo(1, "输入答案有误");
944
         if (!usanswer.equals(answer)) return new ResultVo(1, "输入答案有误");
945
         return new ResultVo(0, "校验密保答案成功");
945
         return new ResultVo(0, "校验密保答案成功");
946
     }
946
     }
947
+
948
+    /**
949
+     * 校验用户密码
950
+     *
951
+     * @param [user]
952
+     * @return com.xhkjedu.vo.ResultVo
953
+     * @author ywx
954
+     * @date 2022/4/8 15:05
955
+     */
956
+    public ResultVo checkPwd(TUser user) {
957
+        String pwd = userMapper.getPwdByUserId(user.getUserid());
958
+        setLoginPwd(user);
959
+        String loginpwd = user.getLoginpwd();
960
+        if (!loginpwd.equals(pwd)) return new ResultVo(1, "密码不正确");
961
+        return new ResultVo(0, "密码正确");
962
+    }
947
 }
963
 }

+ 4
- 0
suser/src/main/resources/mapper/system/UserMapper.xml View File

199
     <select id="getNumByUserPhone" resultType="java.lang.Integer">
199
     <select id="getNumByUserPhone" resultType="java.lang.Integer">
200
         select count(*) from t_user where userid!=#{userid} and userphone=#{userphone}
200
         select count(*) from t_user where userid!=#{userid} and userphone=#{userphone}
201
     </select>
201
     </select>
202
+    <!--根据用户id获取密码-->
203
+    <select id="getPwdByUserId" resultType="java.lang.String">
204
+        select loginpwd from t_user where userid=#{userid}
205
+    </select>
202
 
206
 
203
 
207
 
204
 </mapper>
208
 </mapper>

Loading…
Cancel
Save