Browse Source

修改课程回顾详情排序,课程表删除单个单元格

tags/正式3.2.0
王宁 2 years ago
parent
commit
087347e19b

+ 7
- 7
sclass/src/main/resources/mapper/classroom/ClassroomMapper.xml View File

36
         ,sum(case when s.radiocorrect!=0 then 1 else 0 end)correctnum
36
         ,sum(case when s.radiocorrect!=0 then 1 else 0 end)correctnum
37
         from t_classroom_askstudent s left join t_classroom_askteacher rt on s.asktid=rt.asktid
37
         from t_classroom_askstudent s left join t_classroom_askteacher rt on s.asktid=rt.asktid
38
         where rt.roomid=#{roomid} and rt.asktype between 32 and 33
38
         where rt.roomid=#{roomid} and rt.asktype between 32 and 33
39
-        group by s.asktid
39
+        group by s.asktid order by rt.createtime
40
     </select>
40
     </select>
41
     <select id="listExam" resultType="com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo">
41
     <select id="listExam" resultType="com.xhkjedu.sclass.vo.classroom.RoomCorrectExamVo">
42
         select s.paperid,p.papername,count(*)commitnum,count(*) stunum
42
         select s.paperid,p.papername,count(*)commitnum,count(*) stunum
44
         from t_classroom_paper_student s left join t_classroom_paper p on s.paperid=p.paperid
44
         from t_classroom_paper_student s left join t_classroom_paper p on s.paperid=p.paperid
45
         left join t_classroom_askteacher rt on s.paperid=rt.paperid
45
         left join t_classroom_askteacher rt on s.paperid=rt.paperid
46
         where rt.roomid=#{roomid} and rt.asktype=40
46
         where rt.roomid=#{roomid} and rt.asktype=40
47
-        group by s.paperid
47
+        group by s.paperid order by p.createtime
48
     </select>
48
     </select>
49
     <select id="listCorrect" resultMap="correctResult">
49
     <select id="listCorrect" resultMap="correctResult">
50
         select r.roomid,r.roomname,r.createtime,r.endtime,r.realstunum
50
         select r.roomid,r.roomname,r.createtime,r.endtime,r.realstunum
77
         left join t_classroom_askteacher rt on rs.asktid=rt.asktid
77
         left join t_classroom_askteacher rt on rs.asktid=rt.asktid
78
         left join t_classroom_askstudent rs2 on rs2.asktid=rs.asktid
78
         left join t_classroom_askstudent rs2 on rs2.asktid=rs.asktid
79
         where rs.asktid=#{asktid}
79
         where rs.asktid=#{asktid}
80
-        group by rs.asksid
80
+        group by rs.asksid order by rs.studentid
81
     </select>
81
     </select>
82
     <!--获取考试批改学生列表-->
82
     <!--获取考试批改学生列表-->
83
     <select id="listStudentsByPaperId" resultMap="checkResult">
83
     <select id="listStudentsByPaperId" resultMap="checkResult">
87
         from t_classroom_paper_student ps left join t_user u on ps.studentid=u.userid
87
         from t_classroom_paper_student ps left join t_user u on ps.studentid=u.userid
88
         left join t_classroom_paper_student ps2 on ps2.paperid=ps.paperid
88
         left join t_classroom_paper_student ps2 on ps2.paperid=ps.paperid
89
         where ps.paperid=#{paperid}
89
         where ps.paperid=#{paperid}
90
-        group by ps.psid
90
+        group by ps.psid order by ps.studentid
91
     </select>
91
     </select>
92
 
92
 
93
     <resultMap id="objectiveResult" type="com.xhkjedu.sclass.vo.classroom.ObjectiveVo">
93
     <resultMap id="objectiveResult" type="com.xhkjedu.sclass.vo.classroom.ObjectiveVo">
218
         from t_classroom_askstudent s1 where s1.asktid=rt.asktid)correctrate
218
         from t_classroom_askstudent s1 where s1.asktid=rt.asktid)correctrate
219
         from t_classroom_askstudent s right join t_classroom_askteacher rt on s.asktid=rt.asktid and s.studentid=#{studentid}
219
         from t_classroom_askstudent s right join t_classroom_askteacher rt on s.asktid=rt.asktid and s.studentid=#{studentid}
220
         where rt.roomid=#{roomid} and rt.asktype between 30 and 33
220
         where rt.roomid=#{roomid} and rt.asktype between 30 and 33
221
-        group by rt.asktid
221
+        group by rt.asktid order by rt.createtime
222
     </select>
222
     </select>
223
     <select id="listStuAsk" resultType="java.util.Map">
223
     <select id="listStuAsk" resultType="java.util.Map">
224
         select a.asktype,a.fqnum,a.cynum,truncate(a.cynum*100/a.fqnum,2)cyrate
224
         select a.asktype,a.fqnum,a.cynum,truncate(a.cynum*100/a.fqnum,2)cyrate
258
         left join t_classroom_paper_student s on s.paperid=p.paperid
258
         left join t_classroom_paper_student s on s.paperid=p.paperid
259
         left join t_classroom_paper_student s1 on s1.paperid=rt.paperid and s1.studentid=#{studentid}
259
         left join t_classroom_paper_student s1 on s1.paperid=rt.paperid and s1.studentid=#{studentid}
260
         where rt.roomid=#{roomid} and rt.asktype=40 and p.paperid is not null
260
         where rt.roomid=#{roomid} and rt.asktype=40 and p.paperid is not null
261
-        group by p.paperid
261
+        group by p.paperid order by p.createtime
262
     </select>
262
     </select>
263
     <select id="listStuEQuestion" resultType="java.util.Map">
263
     <select id="listStuEQuestion" resultType="java.util.Map">
264
         select
264
         select
384
         LEFT JOIN t_classroom_paper_student ps ON p.paperid=ps.paperid
384
         LEFT JOIN t_classroom_paper_student ps ON p.paperid=ps.paperid
385
         LEFT JOIN t_classroom_askteacher rt ON p.paperid=rt.paperid
385
         LEFT JOIN t_classroom_askteacher rt ON p.paperid=rt.paperid
386
         LEFT JOIN t_classroom c ON rt.roomid=c.roomid
386
         LEFT JOIN t_classroom c ON rt.roomid=c.roomid
387
-        WHERE c.roomid=#{roomid} GROUP BY p.paperid
387
+        WHERE c.roomid=#{roomid} GROUP BY p.paperid order by p.createtime
388
     </select>
388
     </select>
389
 
389
 
390
     <!--班级学生列表-->
390
     <!--班级学生列表-->

+ 25
- 9
slive/src/main/java/com/xhkjedu/slive/controller/xz/XzController.java View File

4
 import com.github.pagehelper.PageInfo;
4
 import com.github.pagehelper.PageInfo;
5
 import com.xhkjedu.slive.model.xz.LXz;
5
 import com.xhkjedu.slive.model.xz.LXz;
6
 import com.xhkjedu.slive.service.xz.XzService;
6
 import com.xhkjedu.slive.service.xz.XzService;
7
+import com.xhkjedu.slive.vo.xz.XzDateKjTeaVo;
7
 import com.xhkjedu.slive.vo.xz.XzDateVo;
8
 import com.xhkjedu.slive.vo.xz.XzDateVo;
8
 import com.xhkjedu.utils.N_Utils;
9
 import com.xhkjedu.utils.N_Utils;
9
 import com.xhkjedu.utils.PageUtil;
10
 import com.xhkjedu.utils.PageUtil;
107
         return new ResultVo(0, "删除成功");
108
         return new ResultVo(0, "删除成功");
108
     }
109
     }
109
 
110
 
111
+    /**
112
+     * @Description 获取行政直播课程表
113
+     * @Param [xz]
114
+     * @Return com.xhkjedu.vo.ResultVo
115
+     * @Author wn
116
+     * @Date 2022/4/1 13:57
117
+     **/
118
+    @PostMapping("/xzkb")
119
+    public ResultVo getXzKjDetail(@RequestBody LXz xz){
120
+        N_Utils.validation(new Object[]{xz.getXzid(),"行政直播id",1});
121
+        Map rtnmap = xzService.getXzKjDetail(xz);
122
+        return new ResultVo(0, "成功获取行政直播课程表",rtnmap);
123
+    }
124
+
125
+
110
     /**
126
     /**
111
      * @Description  保存行政直播课程表
127
      * @Description  保存行政直播课程表
112
      * @Param [xz]
128
      * @Param [xz]
114
      * @Author wn
130
      * @Author wn
115
      * @Date 2022/4/1 9:41
131
      * @Date 2022/4/1 9:41
116
      **/
132
      **/
117
-    @PostMapping("/sxzk")
133
+    @PostMapping("/kcbs")
118
     public ResultVo saveXzCourse(@RequestBody LXz xz){
134
     public ResultVo saveXzCourse(@RequestBody LXz xz){
119
         N_Utils.validation(new Object[]{xz.getXzid(),"行政直播id",1});
135
         N_Utils.validation(new Object[]{xz.getXzid(),"行政直播id",1});
120
         return xzService.saveXzCourse(xz);
136
         return xzService.saveXzCourse(xz);
121
     }
137
     }
122
 
138
 
123
     /**
139
     /**
124
-     * @Description 获取行政直播课程表
125
-     * @Param [xz]
140
+     * @Description 删除课程表单个单元格数据
141
+     * @Param [kjTeaVo]
126
      * @Return com.xhkjedu.vo.ResultVo
142
      * @Return com.xhkjedu.vo.ResultVo
127
      * @Author wn
143
      * @Author wn
128
-     * @Date 2022/4/1 13:57
144
+     * @Date 2022/4/1 17:52
129
      **/
145
      **/
130
-    @PostMapping("/xzkb")
131
-    public ResultVo getXzKjDetail(@RequestBody LXz xz){
132
-        N_Utils.validation(new Object[]{xz.getXzid(),"行政直播id",1});
133
-        Map rtnmap = xzService.getXzKjDetail(xz);
134
-        return new ResultVo(0, "成功获取行政直播课程表",rtnmap);
146
+    @PostMapping("/kcbd")
147
+    public ResultVo delXzkjDyg(@RequestBody XzDateKjTeaVo kjTeaVo){
148
+        N_Utils.validation(new Object[]{kjTeaVo.getCourseid(),"课程id",1,kjTeaVo.getClassid(),"班级id",1});
149
+        xzService.delXzkjDyg(kjTeaVo);
150
+        return new ResultVo(0, "成功删除单个课程信息");
135
     }
151
     }
136
 
152
 
137
 }
153
 }

+ 3
- 3
slive/src/main/java/com/xhkjedu/slive/controller/xz/XzKjController.java View File

2
 
2
 
3
 import com.xhkjedu.slive.model.xz.LXzKj;
3
 import com.xhkjedu.slive.model.xz.LXzKj;
4
 import com.xhkjedu.slive.service.xz.XzKjService;
4
 import com.xhkjedu.slive.service.xz.XzKjService;
5
+import com.xhkjedu.slive.vo.xz.XzDateKjVo;
5
 import com.xhkjedu.utils.N_Utils;
6
 import com.xhkjedu.utils.N_Utils;
6
 import com.xhkjedu.vo.ResultVo;
7
 import com.xhkjedu.vo.ResultVo;
7
 import org.springframework.web.bind.annotation.PostMapping;
8
 import org.springframework.web.bind.annotation.PostMapping;
11
 
12
 
12
 import javax.annotation.Resource;
13
 import javax.annotation.Resource;
13
 import java.util.List;
14
 import java.util.List;
14
-import java.util.Map;
15
 
15
 
16
 /**
16
 /**
17
  * @Description 行政直播课节详情
17
  * @Description 行政直播课节详情
27
     @PostMapping("/kjs")
27
     @PostMapping("/kjs")
28
     public ResultVo listKjsByXzid(@RequestBody LXzKj kj){
28
     public ResultVo listKjsByXzid(@RequestBody LXzKj kj){
29
         N_Utils.validation(new Object[]{kj.getXzid(),"行政直播id",1});
29
         N_Utils.validation(new Object[]{kj.getXzid(),"行政直播id",1});
30
-        List<Map> map = xzKjService.listXzKjsByXzid(kj.getXzid());
31
-        return new ResultVo(0,"成功获取行政直播课节详情",map);
30
+        List<XzDateKjVo> rtn = xzKjService.listXzKjsByXzid(kj.getXzid());
31
+        return new ResultVo(0,"成功获取行政直播课节详情",rtn);
32
     }
32
     }
33
 
33
 
34
     /**
34
     /**

+ 3
- 0
slive/src/main/java/com/xhkjedu/slive/mapper/gradeclass/ClassMapper.java View File

28
 
28
 
29
     //获取班级当前年份
29
     //获取班级当前年份
30
     Integer getYearById(Integer classid);
30
     Integer getYearById(Integer classid);
31
+
32
+    //删除班级学生及分组学生
33
+    void deleteClassstu(@Param("zbclassid") Integer zbclassid, @Param("classid")Integer classid);
31
 }
34
 }

+ 6
- 0
slive/src/main/java/com/xhkjedu/slive/mapper/liveplay/CourseClassMapper.java View File

2
 
2
 
3
 import com.xhkjedu.slive.base.TkMapper;
3
 import com.xhkjedu.slive.base.TkMapper;
4
 import com.xhkjedu.slive.model.liveplay.LCourseClass;
4
 import com.xhkjedu.slive.model.liveplay.LCourseClass;
5
+import org.apache.ibatis.annotations.Param;
5
 import org.springframework.stereotype.Repository;
6
 import org.springframework.stereotype.Repository;
6
 
7
 
7
 /**
8
 /**
13
 @Repository
14
 @Repository
14
 public interface CourseClassMapper extends TkMapper<LCourseClass> {
15
 public interface CourseClassMapper extends TkMapper<LCourseClass> {
15
 
16
 
17
+    //获取课程关联指定班级外的其他班级数量
18
+    Integer getOtherClassnumByCourseid(@Param("courseid")Integer courseid,@Param("classid")Integer classid);
19
+
20
+    //根据课程id和班级id删除关联关系
21
+    void deleteByCourseidAndClassid(@Param("courseid")Integer courseid,@Param("classid")Integer classid);
16
 }
22
 }

+ 2
- 0
slive/src/main/java/com/xhkjedu/slive/mapper/liveplay/CourseMapper.java View File

102
     void updateCoursename(@Param("course") LCourse course);
102
     void updateCoursename(@Param("course") LCourse course);
103
     //修改课程课节备注
103
     //修改课程课节备注
104
     void updateCoursecomm(@Param("course") LCourse course);
104
     void updateCoursecomm(@Param("course") LCourse course);
105
+    //根据课程id删除关联课程关联信息
106
+    void deleteCourseClassByCourseid(@Param("courseid") Integer courseid);
105
 }
107
 }

+ 2
- 1
slive/src/main/java/com/xhkjedu/slive/mapper/xz/XzKjMapper.java View File

2
 
2
 
3
 import com.xhkjedu.slive.base.TkMapper;
3
 import com.xhkjedu.slive.base.TkMapper;
4
 import com.xhkjedu.slive.model.xz.LXzKj;
4
 import com.xhkjedu.slive.model.xz.LXzKj;
5
+import com.xhkjedu.slive.vo.xz.XzDateKjVo;
5
 import org.apache.ibatis.annotations.Param;
6
 import org.apache.ibatis.annotations.Param;
6
 import org.springframework.stereotype.Repository;
7
 import org.springframework.stereotype.Repository;
7
 
8
 
17
 public interface XzKjMapper extends TkMapper<LXzKj> {
18
 public interface XzKjMapper extends TkMapper<LXzKj> {
18
 
19
 
19
     //获取行政直播课节详情
20
     //获取行政直播课节详情
20
-    List<Map> listXzKjsByXzid(@Param("xzid") Integer xzid);
21
+    List<XzDateKjVo> listXzKjsByXzid(@Param("xzid") Integer xzid);
21
 
22
 
22
     //批量修改行政直播课节详情
23
     //批量修改行政直播课节详情
23
     void updateBatchXzKj(@Param("list") List<LXzKj> list);
24
     void updateBatchXzKj(@Param("list") List<LXzKj> list);

+ 1
- 1
slive/src/main/java/com/xhkjedu/slive/mapper/xz/XzMapper.java View File

20
     //行政直播列表
20
     //行政直播列表
21
     List<Map> listXzs(@Param("xz") LXz xz);
21
     List<Map> listXzs(@Param("xz") LXz xz);
22
 
22
 
23
-    //行政直播下进行中或已结束的课节数量
23
+    //行政直播课对应的课程已开课数量
24
     Integer getXzSectionKsNum(@Param("xzid") Integer xzid);
24
     Integer getXzSectionKsNum(@Param("xzid") Integer xzid);
25
 
25
 
26
     //删除行政直播下所有的直播课程和直播班级
26
     //删除行政直播下所有的直播课程和直播班级

+ 2
- 3
slive/src/main/java/com/xhkjedu/slive/service/xz/XzKjService.java View File

2
 
2
 
3
 import com.xhkjedu.slive.mapper.xz.XzKjMapper;
3
 import com.xhkjedu.slive.mapper.xz.XzKjMapper;
4
 import com.xhkjedu.slive.model.xz.LXzKj;
4
 import com.xhkjedu.slive.model.xz.LXzKj;
5
+import com.xhkjedu.slive.vo.xz.XzDateKjVo;
5
 import com.xhkjedu.utils.N_Utils;
6
 import com.xhkjedu.utils.N_Utils;
6
 import com.xhkjedu.vo.ResultVo;
7
 import com.xhkjedu.vo.ResultVo;
7
 import org.springframework.stereotype.Service;
8
 import org.springframework.stereotype.Service;
8
 
9
 
9
 import javax.annotation.Resource;
10
 import javax.annotation.Resource;
10
 import java.util.List;
11
 import java.util.List;
11
-import java.util.Map;
12
 
12
 
13
 /**
13
 /**
14
  * @Description 行政直播课节
14
  * @Description 行政直播课节
23
     /**
23
     /**
24
      * @Description  获取行政直播课节基本信息
24
      * @Description  获取行政直播课节基本信息
25
      * @Param [xzid]
25
      * @Param [xzid]
26
-     * @Return com.xhkjedu.vo.ResultVo
27
      * @Author wn
26
      * @Author wn
28
      * @Date 2022/3/31 14:07
27
      * @Date 2022/3/31 14:07
29
      **/
28
      **/
30
-    public List<Map> listXzKjsByXzid(Integer xzid) {
29
+    public List<XzDateKjVo> listXzKjsByXzid(Integer xzid) {
31
         return xzKjMapper.listXzKjsByXzid(xzid);
30
         return xzKjMapper.listXzKjsByXzid(xzid);
32
     }
31
     }
33
 
32
 

+ 75
- 34
slive/src/main/java/com/xhkjedu/slive/service/xz/XzService.java View File

1
 package com.xhkjedu.slive.service.xz;
1
 package com.xhkjedu.slive.service.xz;
2
 
2
 
3
+import com.xhkjedu.slive.mapper.gradeclass.ClassMapper;
3
 import com.xhkjedu.slive.mapper.gradeclass.ClassTeacherMapper;
4
 import com.xhkjedu.slive.mapper.gradeclass.ClassTeacherMapper;
4
 import com.xhkjedu.slive.mapper.gradeclass.SchoolMapper;
5
 import com.xhkjedu.slive.mapper.gradeclass.SchoolMapper;
5
 import com.xhkjedu.slive.mapper.liveplay.CourseClassMapper;
6
 import com.xhkjedu.slive.mapper.liveplay.CourseClassMapper;
18
 import com.xhkjedu.slive.utils.LiveUtil;
19
 import com.xhkjedu.slive.utils.LiveUtil;
19
 import com.xhkjedu.slive.vo.gradeclass.ClassVo;
20
 import com.xhkjedu.slive.vo.gradeclass.ClassVo;
20
 import com.xhkjedu.slive.vo.xz.XzDateVo;
21
 import com.xhkjedu.slive.vo.xz.XzDateVo;
21
-import com.xhkjedu.slive.vo.xz.XzDateXjTeaVo;
22
-import com.xhkjedu.slive.vo.xz.XzDateXjVo;
22
+import com.xhkjedu.slive.vo.xz.XzDateKjTeaVo;
23
+import com.xhkjedu.slive.vo.xz.XzDateKjVo;
23
 import com.xhkjedu.utils.N_Utils;
24
 import com.xhkjedu.utils.N_Utils;
24
 import com.xhkjedu.vo.ResultVo;
25
 import com.xhkjedu.vo.ResultVo;
25
 import lombok.extern.slf4j.Slf4j;
26
 import lombok.extern.slf4j.Slf4j;
58
     private ClassService classService;
59
     private ClassService classService;
59
     @Resource
60
     @Resource
60
     private ClassTeacherMapper classTeacherMapper;
61
     private ClassTeacherMapper classTeacherMapper;
62
+    @Resource
63
+    private ClassMapper classMapper;
61
 
64
 
62
     /**
65
     /**
63
      * @Description 行政直播列表
66
      * @Description 行政直播列表
91
             kj.setXzid(xzid);
94
             kj.setXzid(xzid);
92
             String kjname = LiveUtil.getChineStrByNum(i);
95
             String kjname = LiveUtil.getChineStrByNum(i);
93
             kj.setKjname("第" + kjname + "节");
96
             kj.setKjname("第" + kjname + "节");
94
-            kj.setKjorder(i+1);
97
+            kj.setKjorder(i + 1);
95
             kj.setCreateid(xz.getCreateid());
98
             kj.setCreateid(xz.getCreateid());
96
             kj.setCreatetime(timestamp);
99
             kj.setCreatetime(timestamp);
97
 
100
 
145
                 xzMapper.deleteCourseClassByXzid(xzid);
148
                 xzMapper.deleteCourseClassByXzid(xzid);
146
                 xzMapper.deleteXzAndKjByXzid(xzid);
149
                 xzMapper.deleteXzAndKjByXzid(xzid);
147
             }
150
             }
148
-        }catch (Exception e){
149
-            log.error("删除行政直播出错:"+e.getMessage());
151
+        } catch (Exception e) {
152
+            log.error("删除行政直播出错:" + e.getMessage());
150
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
153
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
151
         }
154
         }
152
 
155
 
153
 
156
 
154
     }
157
     }
158
+
155
     /**
159
     /**
156
      * @Description 保存行政直播课程表
160
      * @Description 保存行政直播课程表
157
      * @Param [xzDatelst]
161
      * @Param [xzDatelst]
168
             //日期下的课节情况
172
             //日期下的课节情况
169
             XzDateVo xzDateVo = xzDatelst.get(i);
173
             XzDateVo xzDateVo = xzDatelst.get(i);
170
             String datazhou = LiveUtil.getDateZhou(xzDateVo.getSelectdate());//要保存日期对应的周
174
             String datazhou = LiveUtil.getDateZhou(xzDateVo.getSelectdate());//要保存日期对应的周
171
-            List<XzDateXjVo> dateKjlst = xzDateVo.getKjs();//指定日期下课节情况
175
+            List<XzDateKjVo> dateKjlst = xzDateVo.getKjs();//指定日期下课节情况
172
 
176
 
173
             for (int j = 0; j < dateKjlst.size(); j++) {
177
             for (int j = 0; j < dateKjlst.size(); j++) {
174
                 //单课节情况
178
                 //单课节情况
175
-                XzDateXjVo dateKjVo = dateKjlst.get(j);
176
-                List<XzDateXjTeaVo> xjTealst = dateKjVo.getKjteas();//单课节下各班级情况
179
+                XzDateKjVo dateKjVo = dateKjlst.get(j);
180
+                List<XzDateKjTeaVo> xjTealst = dateKjVo.getKjteas();//单课节下各班级情况
177
                 //处理成教师下班级形式,生成课程
181
                 //处理成教师下班级形式,生成课程
178
-                Map<Integer, List<XzDateXjTeaVo>> map = listChangeTeacherClass(xjTealst);
182
+                Map<Integer, List<XzDateKjTeaVo>> map = listChangeTeacherClass(xjTealst);
179
                 LCourse course = new LCourse();
183
                 LCourse course = new LCourse();
180
                 course.setGradeid(x.getGradeid());
184
                 course.setGradeid(x.getGradeid());
181
                 course.setBegindate(xzDateVo.getSelectdate());
185
                 course.setBegindate(xzDateVo.getSelectdate());
189
                 course.setCreatetime(N_Utils.getSecondTimestamp());
193
                 course.setCreatetime(N_Utils.getSecondTimestamp());
190
                 course.setSchoolid(x.getSchoolid());
194
                 course.setSchoolid(x.getSchoolid());
191
 
195
 
192
-                for(Map.Entry<Integer, List<XzDateXjTeaVo>> entry : map.entrySet()){
193
-                    List<XzDateXjTeaVo> xjTeas = entry.getValue();
196
+                for (Map.Entry<Integer, List<XzDateKjTeaVo>> entry : map.entrySet()) {
197
+                    List<XzDateKjTeaVo> xjTeas = entry.getValue();
194
                     String teachername = xjTeas.get(0).getTeachername();
198
                     String teachername = xjTeas.get(0).getTeachername();
195
                     //单个教师课程信息
199
                     //单个教师课程信息
196
-                    String coursename = datazhou + dateKjVo.getKjname() +xjTeas.get(0).getSubjectname()+ "("+ teachername +")";
200
+                    String coursename =
201
+                            datazhou + dateKjVo.getKjname() + xjTeas.get(0).getSubjectname() + "(" + teachername + ")";
197
 
202
 
198
                     course.setCoursename(coursename);
203
                     course.setCoursename(coursename);
199
                     course.setSubjectid(xjTeas.get(0).getSubjectid());
204
                     course.setSubjectid(xjTeas.get(0).getSubjectid());
202
                     course.setEndtime(dateKjVo.getEndtime());
207
                     course.setEndtime(dateKjVo.getEndtime());
203
                     course.setKjid(dateKjVo.getKjid());
208
                     course.setKjid(dateKjVo.getKjid());
204
                     //保存行政直播课程表
209
                     //保存行政直播课程表
205
-                    saveCourseAll(xjTeas,course);
210
+                    saveCourseAll(xjTeas, course);
206
                 }
211
                 }
207
             }
212
             }
208
         }
213
         }
210
     }
215
     }
211
 
216
 
212
     //指定天某天某节课下的教师班级层级关系
217
     //指定天某天某节课下的教师班级层级关系
213
-    private Map<Integer, List<XzDateXjTeaVo>> listChangeTeacherClass(List<XzDateXjTeaVo> xjTealst) {
214
-        Map<Integer, List<XzDateXjTeaVo>> map = new HashMap<>();
218
+    private Map<Integer, List<XzDateKjTeaVo>> listChangeTeacherClass(List<XzDateKjTeaVo> xjTealst) {
219
+        Map<Integer, List<XzDateKjTeaVo>> map = new HashMap<>();
215
 
220
 
216
         for (int i = 0; i < xjTealst.size(); i++) {
221
         for (int i = 0; i < xjTealst.size(); i++) {
217
-            XzDateXjTeaVo xzDateXjTeaVo = xjTealst.get(i);
218
-            if (map.containsKey(xzDateXjTeaVo.getTeacherid())) {
219
-                map.get(xzDateXjTeaVo.getTeacherid()).add(xzDateXjTeaVo);
220
-            } else {
221
-                List<XzDateXjTeaVo> classlst = new ArrayList<>();
222
-                classlst.add(xzDateXjTeaVo);
223
-                map.put(xzDateXjTeaVo.getTeacherid(), classlst);
222
+            XzDateKjTeaVo xzDateXjTeaVo = xjTealst.get(i);
223
+            if (!N_Utils.isEmptyInteger(xzDateXjTeaVo.getTeacherid())) {
224
+                if (map.containsKey(xzDateXjTeaVo.getTeacherid())) {
225
+                    map.get(xzDateXjTeaVo.getTeacherid()).add(xzDateXjTeaVo);
226
+                } else {
227
+                    List<XzDateKjTeaVo> classlst = new ArrayList<>();
228
+                    classlst.add(xzDateXjTeaVo);
229
+                    map.put(xzDateXjTeaVo.getTeacherid(), classlst);
230
+                }
224
             }
231
             }
225
         }
232
         }
226
         return map;
233
         return map;
228
 
235
 
229
     //保存行政直播课程表
236
     //保存行政直播课程表
230
     @Transactional(rollbackFor = Exception.class)
237
     @Transactional(rollbackFor = Exception.class)
231
-    public void saveCourseAll(List<XzDateXjTeaVo> xjTeas,LCourse course){
238
+    public void saveCourseAll(List<XzDateKjTeaVo> xjTeas, LCourse course) {
232
         try {
239
         try {
233
             //获取集合中所有的班级id
240
             //获取集合中所有的班级id
234
-            List classidlst = xjTeas.stream().map(XzDateXjTeaVo::getClassid).collect(Collectors.toList());
241
+            List classidlst = xjTeas.stream().map(XzDateKjTeaVo::getClassid).collect(Collectors.toList());
235
             List<Map> users = courseMapper.listUid(classidlst);//获取课班级下学生
242
             List<Map> users = courseMapper.listUid(classidlst);//获取课班级下学生
236
 
243
 
237
             //新生成直播班班级信息
244
             //新生成直播班班级信息
273
 
280
 
274
             //保存直播关联班级
281
             //保存直播关联班级
275
             List<LCourseClass> cclist = new ArrayList<>();
282
             List<LCourseClass> cclist = new ArrayList<>();
276
-            for(int i=0;i<classidlst.size();i++){
283
+            for (int i = 0; i < classidlst.size(); i++) {
277
                 Integer cid = Integer.parseInt(classidlst.get(i).toString());
284
                 Integer cid = Integer.parseInt(classidlst.get(i).toString());
278
                 LCourseClass cc = new LCourseClass();
285
                 LCourseClass cc = new LCourseClass();
279
                 cc.setCourseid(courseid);
286
                 cc.setCourseid(courseid);
287
             }
294
             }
288
             courseClassMapper.insertList(cclist);//保存原班级和直播的关联关系
295
             courseClassMapper.insertList(cclist);//保存原班级和直播的关联关系
289
 
296
 
290
-            //获取班级人数
291
-            ClassVo classVo = classService.getById(classid);
292
-
293
             //保存课程课节关联关系
297
             //保存课程课节关联关系
294
             LCourseSection cs = new LCourseSection();
298
             LCourseSection cs = new LCourseSection();
295
             cs.setCourseid(courseid);
299
             cs.setCourseid(courseid);
299
             cs.setSectiondate(course.getBegindate());
303
             cs.setSectiondate(course.getBegindate());
300
             cs.setPlanbegintime(course.getBegintime());
304
             cs.setPlanbegintime(course.getBegintime());
301
             cs.setPlanendtime(course.getEndtime());
305
             cs.setPlanendtime(course.getEndtime());
302
-            cs.setStunum(classVo.getClassnum());
306
+            cs.setStunum(0);
303
             cs.setSectionstate(0);
307
             cs.setSectionstate(0);
304
             cs.setCreateid(course.getCreateid());
308
             cs.setCreateid(course.getCreateid());
305
             cs.setCreatetime(course.getCreatetime());
309
             cs.setCreatetime(course.getCreatetime());
306
             courseSectionMapper.insertUseGeneratedKeys(cs);//保存课程课节信息
310
             courseSectionMapper.insertUseGeneratedKeys(cs);//保存课程课节信息
307
 
311
 
308
-        }catch (Exception e){
309
-            log.info("保存行政直播课程表出错:"+e.getMessage());
312
+        } catch (Exception e) {
313
+            log.info("保存行政直播课程表出错:" + e.getMessage());
310
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
314
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
311
         }
315
         }
312
     }
316
     }
319
      * @Date 2022/4/1 13:59
323
      * @Date 2022/4/1 13:59
320
      **/
324
      **/
321
     public Map getXzKjDetail(LXz xz) {
325
     public Map getXzKjDetail(LXz xz) {
322
-        if(N_Utils.isNotEmpty(xz.getBegindate())){
323
-            xz.setEnddate(LiveUtil.getSelectDateAfter(xz.getBegindate(),6));
326
+        if (N_Utils.isNotEmpty(xz.getBegindate())) {
327
+            xz.setEnddate(LiveUtil.getSelectDateAfter(xz.getBegindate(), 6));
324
         }
328
         }
325
         //先获取课程基本信息
329
         //先获取课程基本信息
326
         Map map = xzMapper.getXzForRtn(xz.getXzid());
330
         Map map = xzMapper.getXzForRtn(xz.getXzid());
327
-        map.put("xzdates",xzMapper.listXzKjDetail(xz));
331
+        map.put("xzdates", xzMapper.listXzKjDetail(xz));
328
         return map;
332
         return map;
329
     }
333
     }
334
+
335
+    /**
336
+     * @Description 删除单个单元格
337
+     * @Param [kjTeaVo]
338
+     * @Return com.xhkjedu.vo.ResultVo
339
+     * @Author wn
340
+     * @Date 2022/4/1 17:42
341
+     **/
342
+    @Transactional
343
+    public ResultVo delXzkjDyg(XzDateKjTeaVo kjTeaVo) {
344
+        try {
345
+            //判断课程的状态,如果已经开始上课则不能删除
346
+            LCourse course = courseMapper.selectByPrimaryKey(kjTeaVo.getCourseid());
347
+            if (course.getCoursestate() > 0) {
348
+                return new ResultVo(1,"选择的课程已经开始上课,不允许删除");
349
+            } else {
350
+                //删除单个单元格中设置的教师信息,先判断该单元格对应的课程是否有其他班级
351
+                Integer coursenum = courseClassMapper.getOtherClassnumByCourseid(kjTeaVo.getCourseid(), kjTeaVo.getClassid());
352
+                if (coursenum == 0) {
353
+                    //说明该课程仅关联一个班级,直接删除该课程以及该课程对应的直播班
354
+                    courseMapper.deleteCourseClassByCourseid(kjTeaVo.getCourseid());
355
+                } else {
356
+                    //说明关联的还有其他班级,删除该班级在直播班级中的学生,
357
+                    courseClassMapper.deleteByCourseidAndClassid(kjTeaVo.getCourseid(),kjTeaVo.getClassid());
358
+                    //处理对应直播班级中学生
359
+                    classMapper.deleteClassstu(course.getClassid(),kjTeaVo.getClassid());
360
+                    classMapper.updateNum2(course.getClassid());//更改班级以及班级分组人数
361
+                    courseMapper.updateStuNum(kjTeaVo.getCourseid());//更新直播课学生数量
362
+                }
363
+            }
364
+            return new ResultVo(0,"成功删除课程表单个课程");
365
+        }catch (Exception e){
366
+            log.error("删除课程表单个课程出错:"+e.getMessage());
367
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
368
+            return new ResultVo(1,"删除课程表单个课程失败");
369
+        }
370
+    }
330
 }
371
 }

slive/src/main/java/com/xhkjedu/slive/vo/xz/XzDateXjTeaVo.java → slive/src/main/java/com/xhkjedu/slive/vo/xz/XzDateKjTeaVo.java View File

10
  * Date 2022/3/31 10:04
10
  * Date 2022/3/31 10:04
11
  **/
11
  **/
12
 @Data
12
 @Data
13
-public class XzDateXjTeaVo {
13
+public class XzDateKjTeaVo {
14
 
14
 
15
     private Integer classid;//班级id
15
     private Integer classid;//班级id
16
     private String classname;//班级名称
16
     private String classname;//班级名称
21
     private String subjectid;//科目id
21
     private String subjectid;//科目id
22
     private String subjectname;//科目名称
22
     private String subjectname;//科目名称
23
 
23
 
24
-    private List<XzDateXjTeaVo> xjclass;//存放层级用于保存时使用
24
+    private List<XzDateKjTeaVo> xjclass;//存放层级用于保存时使用
25
 }
25
 }

slive/src/main/java/com/xhkjedu/slive/vo/xz/XzDateXjVo.java → slive/src/main/java/com/xhkjedu/slive/vo/xz/XzDateKjVo.java View File

10
  * Date 2022/3/31 10:04
10
  * Date 2022/3/31 10:04
11
  **/
11
  **/
12
 @Data
12
 @Data
13
-public class XzDateXjVo {
13
+public class XzDateKjVo {
14
     private Integer kjid;//行政课节id
14
     private Integer kjid;//行政课节id
15
     private String kjname;//课节名称
15
     private String kjname;//课节名称
16
     private Integer kjorder;//课节排序
16
     private Integer kjorder;//课节排序
17
     private String begintime;//开始时间
17
     private String begintime;//开始时间
18
     private String endtime;//结束时间
18
     private String endtime;//结束时间
19
-    private List<XzDateXjTeaVo> kjteas;//指定日期下课节下所有的直播课
19
+    private List<XzDateKjTeaVo> kjteas;//指定日期下课节下所有的直播课
20
 
20
 
21
 }
21
 }

+ 1
- 2
slive/src/main/java/com/xhkjedu/slive/vo/xz/XzDateVo.java View File

2
 
2
 
3
 import lombok.Data;
3
 import lombok.Data;
4
 
4
 
5
-import java.util.ArrayList;
6
 import java.util.List;
5
 import java.util.List;
7
 
6
 
8
 /**
7
 /**
13
 @Data
12
 @Data
14
 public class XzDateVo {
13
 public class XzDateVo {
15
     private String selectdate;//当前选择日期
14
     private String selectdate;//当前选择日期
16
-    private List<XzDateXjVo> kjs;//行政直播课节集合
15
+    private List<XzDateKjVo> kjs;//行政直播课节集合
17
 
16
 
18
 
17
 
19
 }
18
 }

+ 8
- 0
slive/src/main/resources/mapper/gradeclass/ClassMapper.xml View File

40
     <select id="getYearById" resultType="java.lang.Integer">
40
     <select id="getYearById" resultType="java.lang.Integer">
41
         select year from t_class where classid=#{classid}
41
         select year from t_class where classid=#{classid}
42
     </select>
42
     </select>
43
+
44
+    <!--删除班级学生及分组学生-->
45
+    <delete id="deleteClassstu">
46
+        delete cs.*,gs.* from t_class_student cs
47
+        left join t_class_student cs2 on cs.studentid=cs2.studentid
48
+        left join t_group_student gs on cs.classid=gs.classid and cs.studentid=gs.studentid
49
+        where cs.classid=#{zbclassid} and cs2.classid=#{classid} and cs.xzed=0
50
+    </delete>
43
 </mapper>
51
 </mapper>

+ 14
- 0
slive/src/main/resources/mapper/liveplay/CourseClassMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.slive.mapper.liveplay.CourseClassMapper">
4
+
5
+    <!--获取课程关联指定班级外的其他班级数量-->
6
+    <select id="getOtherClassnumByCourseid" resultType="java.lang.Integer">
7
+        select count(*) from l_course_class where courseid=#{courseid} and classid!=#{classid}
8
+    </select>
9
+
10
+    <!--根据课程id和班级id删除关联关系-->
11
+    <delete id="deleteByCourseidAndClassid">
12
+        delete from l_course_class where courseid=#{courseid} and classid=#{classid}
13
+    </delete>
14
+</mapper>

+ 6
- 1
slive/src/main/resources/mapper/liveplay/CourseMapper.xml View File

18
         <if test="course.classid!=null and course.classid!=0">
18
         <if test="course.classid!=null and course.classid!=0">
19
             left join l_course_class cc on cc.courseid=c.courseid
19
             left join l_course_class cc on cc.courseid=c.courseid
20
         </if>
20
         </if>
21
-        where c.schoolid=#{course.schoolid} and c.deleted=1
21
+        where c.schoolid=#{course.schoolid} and c.deleted=1 and c.courseclass=0
22
         <if test="course.gradeid!=null and course.gradeid!=0">
22
         <if test="course.gradeid!=null and course.gradeid!=0">
23
             and c.gradeid=#{course.gradeid}
23
             and c.gradeid=#{course.gradeid}
24
         </if>
24
         </if>
501
         update l_course c ,l_course_section s set c.comm=#{course.comm},s.comm=#{course.comm}
501
         update l_course c ,l_course_section s set c.comm=#{course.comm},s.comm=#{course.comm}
502
         where c.courseid=s.courseid and c.courseid=#{course.courseid}
502
         where c.courseid=s.courseid and c.courseid=#{course.courseid}
503
     </update>
503
     </update>
504
+
505
+    <!--根据课程id删除关联课程关联信息-->
506
+    <delete id="deleteCourseClassByCourseid">
507
+        delete c,tc from l_course c,t_class tc where c.classid=tc.classid and c.courseid=#{courseid}
508
+    </delete>
504
 </mapper>
509
 </mapper>

+ 1
- 1
slive/src/main/resources/mapper/xz/XzKjMapper.xml View File

3
 <mapper namespace="com.xhkjedu.slive.mapper.xz.XzKjMapper">
3
 <mapper namespace="com.xhkjedu.slive.mapper.xz.XzKjMapper">
4
 
4
 
5
     <!--获取行政直播课节详情-->
5
     <!--获取行政直播课节详情-->
6
-    <select id="listXzKjsByXzid" resultType="java.util.Map">
6
+    <select id="listXzKjsByXzid" resultType="com.xhkjedu.slive.vo.xz.XzDateKjVo">
7
         select * from l_xz_kj where xzid=#{xzid} order by kjorder asc
7
         select * from l_xz_kj where xzid=#{xzid} order by kjorder asc
8
     </select>
8
     </select>
9
 
9
 

+ 8
- 11
slive/src/main/resources/mapper/xz/XzMapper.xml View File

13
         order by x.begindate desc
13
         order by x.begindate desc
14
     </select>
14
     </select>
15
 
15
 
16
-    <!--行政直播课对应的课节进行中或已结束数量-->
16
+    <!--行政直播课对应的课程已开课数量-->
17
     <select id="getXzSectionKsNum" resultType="java.lang.Integer">
17
     <select id="getXzSectionKsNum" resultType="java.lang.Integer">
18
-        select count(*) from l_course_section s left join l_course c on c.courseid = s.courseid
19
-        left join l_xz_kj k on c.kjid = k.kjid
20
-        where k.xzid = #{xzid} and s.sectionstate BETWEEN 2 and 3
18
+        select count(*) from l_course c left join l_xz_kj k on c.kjid = k.kjid
19
+        where k.xzid = #{xzid} and c.coursestate>0
21
     </select>
20
     </select>
22
 
21
 
23
     <!--删除行政直播下所有的直播课程和直播班级-->
22
     <!--删除行政直播下所有的直播课程和直播班级-->
28
     </delete>
27
     </delete>
29
     <!--删除行政直播和课节详情-->
28
     <!--删除行政直播和课节详情-->
30
     <delete id="deleteXzAndKjByXzid">
29
     <delete id="deleteXzAndKjByXzid">
31
-        delete
32
-        x,k from l_xz as x left join l_xz_kj as k on x.xzid=k.xzid where x.xzid=
30
+        delete x,k from l_xz as x left join l_xz_kj as k on x.xzid=k.xzid where x.xzid=
33
         #{xzid}
31
         #{xzid}
34
     </delete>
32
     </delete>
35
     <!--删除行政直播下未开始的直播课、班级、课节详情-->
33
     <!--删除行政直播下未开始的直播课、班级、课节详情-->
36
     <delete id="deleteCourseClassKjByXzid">
34
     <delete id="deleteCourseClassKjByXzid">
37
-        delete
38
-        c,lc,k from t_class as c left join l_course as lc on c.classid=lc.classid
35
+        delete c,lc,k from t_class as c left join l_course as lc on c.classid=lc.classid
39
         left join l_course_section ls on ls.courseid=lc.courseid
36
         left join l_course_section ls on ls.courseid=lc.courseid
40
         left join l_xz_kj k on k.kjid=lc.kjid where k.xzid=#{xzid}
37
         left join l_xz_kj k on k.kjid=lc.kjid where k.xzid=#{xzid}
41
         and ls.sectionstate = 0
38
         and ls.sectionstate = 0
75
 
72
 
76
     <resultMap id="xzkjDate" type="java.util.Map">
73
     <resultMap id="xzkjDate" type="java.util.Map">
77
         <result property="selectdate" column="selectdate"></result>
74
         <result property="selectdate" column="selectdate"></result>
78
-        <collection property="kjs" ofType="com.xhkjedu.slive.vo.xz.XzDateXjVo" javaType="java.util.List">
75
+        <collection property="kjs" ofType="com.xhkjedu.slive.vo.xz.XzDateKjVo" javaType="java.util.List">
79
             <result property="kjid" column="kjid"></result>
76
             <result property="kjid" column="kjid"></result>
80
             <result property="kjname" column="kjname"></result>
77
             <result property="kjname" column="kjname"></result>
81
             <result property="kjorder" column="kjorder"></result>
78
             <result property="kjorder" column="kjorder"></result>
82
             <result property="begintime" column="begintime"></result>
79
             <result property="begintime" column="begintime"></result>
83
             <result property="endtime" column="endtime"></result>
80
             <result property="endtime" column="endtime"></result>
84
-            <collection property="kjteas" ofType="com.xhkjedu.slive.vo.xz.XzDateXjTeaVo"
81
+            <collection property="kjteas" ofType="com.xhkjedu.slive.vo.xz.XzDateKjTeaVo"
85
                         javaType="java.util.List" select="listKjClassTea" column="{kjid=kjid,selectdate=selectdate}">
82
                         javaType="java.util.List" select="listKjClassTea" column="{kjid=kjid,selectdate=selectdate}">
86
                 <result property="classid" column="classid"></result>
83
                 <result property="classid" column="classid"></result>
87
                 <result property="classname" column="classname"></result>
84
                 <result property="classname" column="classname"></result>
105
         group by c.begindate,k.kjid
102
         group by c.begindate,k.kjid
106
     </select>
103
     </select>
107
     <!--获取指定课节指定日期所有班级的课程和教师-->
104
     <!--获取指定课节指定日期所有班级的课程和教师-->
108
-    <select id="listKjClassTea" resultType="com.xhkjedu.slive.vo.xz.XzDateXjTeaVo">
105
+    <select id="listKjClassTea" resultType="com.xhkjedu.slive.vo.xz.XzDateKjTeaVo">
109
         select c.classid,lc.classname,c.teacherid,u.username as teachername,
106
         select c.classid,lc.classname,c.teacherid,u.username as teachername,
110
                c.subjectid,s.subjectname,c.kjid,c.courseid,c.coursestate
107
                c.subjectid,s.subjectname,c.kjid,c.courseid,c.coursestate
111
         from l_course c left join l_course_class cc on c.courseid=cc.courseid
108
         from l_course c left join l_course_class cc on c.courseid=cc.courseid

Loading…
Cancel
Save