Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master' into ywx

tags/正式3.2.0
雍文秀 2 anni fa
parent
commit
99b81876bd

+ 18
- 0
suser/src/main/java/com/xhkjedu/suser/controller/gradeclass/ClassStudentController.java Vedi File

@@ -100,6 +100,24 @@ public class ClassStudentController {
100 100
         }
101 101
     }
102 102
 
103
+    @PostMapping("/list_live")
104
+    public ResultVo listStudentForliveclass(@RequestBody TClassStudent tClassStudent) {
105
+        Integer classid = tClassStudent.getClassid();
106
+        N_Utils.validation(new Object[]{classid, "班级id", 1,tClassStudent.getSchoolid(),"学校id",1});
107
+        Integer page = tClassStudent.getPage();
108
+        if (N_Utils.isEmptyInteger(page)) {
109
+            List<ClassStudentVo> list = classStudentService.listStudentForliveclass(tClassStudent);
110
+            return new ResultVo(0,"获取列表成功",list);
111
+        } else {
112
+            Integer pageSize = tClassStudent.getPageSize();
113
+            N_Utils.validation(new Object[]{pageSize, "显示条数", 1});
114
+            PageHelper.startPage(page, pageSize);
115
+            List<ClassStudentVo> list = classStudentService.listStudentForliveclass(tClassStudent);
116
+            PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
117
+            return new ResultVo(0, "获取列表成功", pageResult);
118
+        }
119
+    }
120
+
103 121
     @PostMapping("/import_user")
104 122
     public ResultVo importUser(MultipartFile file,TClassStudent tClassStudent) {
105 123
         return classStudentService.importUser(file, tClassStudent);

+ 3
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassStudentMapper.java Vedi File

@@ -49,4 +49,7 @@ public interface ClassStudentMapper extends TkMapper<TClassStudent> {
49 49
 
50 50
     //获取学生所有提高班
51 51
     List<Integer> listTgClassid(Integer studentid);
52
+
53
+    //直播班中班级学生集合
54
+    List<ClassStudentVo> listStudentForliveclass(@Param("student") TClassStudent student);
52 55
 }

+ 18
- 0
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassStudentService.java Vedi File

@@ -236,6 +236,24 @@ public class ClassStudentService {
236 236
         return classStudentMapper.findAll(student);
237 237
     }
238 238
 
239
+    //直播班中班级集合
240
+    public List<ClassStudentVo> listStudentForliveclass(TClassStudent student) {
241
+        setOrderField(student);
242
+        Integer year = schoolMapper.getYearById(student.getSchoolid());
243
+        student.setYear(year);
244
+        List<ClassStudentVo> rtnlst = classStudentMapper.listStudentForliveclass(student);
245
+        for (int i=0;i<rtnlst.size();i++){
246
+            ClassStudentVo cs = rtnlst.get(i);
247
+            String classname = cs.getClassname();
248
+            if (N_Utils.isNotEmpty(classname)) {
249
+                String[] gid_cname = classname.split("_");
250
+                cs.setGradeid(N_Utils.str2Int(gid_cname[0]));
251
+                cs.setClassname(gid_cname[1]);
252
+            }
253
+        }
254
+        return rtnlst;
255
+    }
256
+
239 257
     //班级学生导入
240 258
     @Transactional(rollbackFor = Exception.class)
241 259
     public ResultVo importUser(MultipartFile file, TClassStudent tClassStudent) {

+ 19
- 1
suser/src/main/resources/mapper/gradeclass/ClassStudentMapper.xml Vedi File

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.suser.mapper.gradeclass.ClassStudentMapper">
4 4
     <!--班级学生列表-->
5 5
     <select id="findAll" resultType="com.xhkjedu.suser.vo.gradeclass.ClassStudentVo">
6
-        select cs.csid,cs.classid,u.username studentname,u.studentno,u.usersex,u.userid studentid,u.loginname,cs.createtime
6
+        select cs.csid,cs.classid,c.classname,c.gradeid,u.username studentname,u.studentno,u.usersex,u.userid studentid,u.loginname,cs.createtime
7 7
         ,u.bindmac,u.mac,u.headpic,u.userphone,u.usertime
8 8
         from t_class_student cs left join t_user u on cs.studentid = u.userid
9 9
         left join t_class c on cs.classid=c.classid
@@ -117,4 +117,22 @@
117 117
         LEFT JOIN t_school s ON c.schoolid=s.schoolid
118 118
         WHERE cs.studentid=#{studentid} AND c.year=s.year AND c.classtype=2
119 119
     </select>
120
+
121
+    <!--直播班中学生信息-->
122
+    <select id="listStudentForliveclass" resultType="com.xhkjedu.suser.vo.gradeclass.ClassStudentVo">
123
+        select cs.csid,cs.classid,u.username studentname,u.studentno,u.usersex,u.userid studentid,u.loginname,cs.createtime
124
+        ,u.bindmac,u.mac,u.headpic,u.userphone,u.usertime,
125
+        (select concat(c2.gradeid,'_',c2.classname) from t_class_student cs2 left join t_class c2 on cs2.classid=c2.classid
126
+        where cs2.studentid=cs.studentid and c2.classtype=1 and c2.classstate=1 and c2.year=#{student.year} order by c2.classid desc limit 1)classname
127
+        from t_class_student cs left join t_user u on cs.studentid = u.userid
128
+        left join t_class c on cs.classid=c.classid
129
+        where cs.classid=#{student.classid}
130
+        <if test="student.studentname!=null and student.studentname!=''">
131
+            and (u.username like '%${student.studentname}%' or u.studentno like '%${student.studentname}%'
132
+            or u.loginname like '%${student.studentname}%' or u.userphone like '%${student.studentname}%')
133
+        </if>
134
+        <if test="student.fieldname!=null and student.fieldname!=''">
135
+            order by ${student.fieldname} ${student.fieldorder},cs.csid desc
136
+        </if>
137
+    </select>
120 138
 </mapper>

Loading…
Annulla
Salva