Browse Source

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

tags/正式3.2.0
雍文秀 2 years ago
parent
commit
f11f6c192e

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

137
 
137
 
138
 
138
 
139
     /**
139
     /**
140
-     * @Description  保存行政直播课程表
140
+     * @Description  保存行政直播课程表(整个)
141
      * @Param [xz]
141
      * @Param [xz]
142
      * @Return com.xhkjedu.vo.ResultVo
142
      * @Return com.xhkjedu.vo.ResultVo
143
      * @Author wn
143
      * @Author wn
159
     @PostMapping("/kcbd")
159
     @PostMapping("/kcbd")
160
     public ResultVo delXzkjDyg(@RequestBody XzDateKjTeaVo kjTeaVo){
160
     public ResultVo delXzkjDyg(@RequestBody XzDateKjTeaVo kjTeaVo){
161
         N_Utils.validation(new Object[]{kjTeaVo.getCourseid(),"课程id",1,kjTeaVo.getClassid(),"班级id",1});
161
         N_Utils.validation(new Object[]{kjTeaVo.getCourseid(),"课程id",1,kjTeaVo.getClassid(),"班级id",1});
162
-        xzService.delXzkjDyg(kjTeaVo);
163
-        return new ResultVo(0, "成功删除单个课程信息");
162
+        return xzService.delXzkjDyg(kjTeaVo);
164
     }
163
     }
165
 
164
 
166
     /**
165
     /**
167
-     * @Description 修改课程表单个单元格数据
166
+     * @Description 保存课程表单个单元格数据(单元格)
168
      * @Param [kjTeaVo]
167
      * @Param [kjTeaVo]
169
      * @Return com.xhkjedu.vo.ResultVo
168
      * @Return com.xhkjedu.vo.ResultVo
170
      * @Author wn
169
      * @Author wn
171
      * @Date 2022/4/2 17:11
170
      * @Date 2022/4/2 17:11
172
      **/
171
      **/
173
-    @PostMapping("/kcbup")
174
-    public ResultVo updateXzkjDyg(@RequestBody XzDateKjTeaVo kjTeaVo){
175
-        N_Utils.validation(new Object[]{kjTeaVo.getCourseid(),"课程id",1,kjTeaVo.getClassid(),"班级id",1,kjTeaVo.getCreateid(),"操作人id",1});
176
-        xzService.updateXzKjDyg(kjTeaVo);
177
-        return new ResultVo(0, "成功修改单个课程信息");
172
+    @PostMapping("/kcbsone")
173
+    public ResultVo saveOneXzkjDyg(@RequestBody XzDateKjTeaVo kjTeaVo){
174
+        N_Utils.validation(new Object[]{kjTeaVo.getKjid(),"课节id",1,kjTeaVo.getClassid(),"班级id",1,kjTeaVo.getCreateid(),"操作人id",1,
175
+        kjTeaVo.getTeacherid(),"教师id",1,kjTeaVo.getSeldate(),"时间",2});
176
+        return xzService.saveOneXzKjDyg(kjTeaVo);
178
     }
177
     }
179
 
178
 
180
 }
179
 }

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

3
 import com.xhkjedu.slive.base.TkMapper;
3
 import com.xhkjedu.slive.base.TkMapper;
4
 import com.xhkjedu.slive.model.gradeclass.TClass;
4
 import com.xhkjedu.slive.model.gradeclass.TClass;
5
 import com.xhkjedu.slive.vo.gradeclass.ClassVo;
5
 import com.xhkjedu.slive.vo.gradeclass.ClassVo;
6
+import com.xhkjedu.slive.vo.xz.XzClassVo;
6
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;
7
 
8
 
8
 import java.util.List;
9
 import java.util.List;
31
 
32
 
32
     //删除班级学生及分组学生
33
     //删除班级学生及分组学生
33
     void deleteClassstu(@Param("zbclassid") Integer zbclassid, @Param("classid")Integer classid);
34
     void deleteClassstu(@Param("zbclassid") Integer zbclassid, @Param("classid")Integer classid);
35
+
36
+    //根据行政直播id获取该学校当前年份指定年级下的行政班和提高班
37
+    List<XzClassVo> listClassByXzid(@Param("xzid")Integer xzid);
34
 }
38
 }

+ 5
- 3
slive/src/main/java/com/xhkjedu/slive/mapper/liveplay/CourseMapper.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.LCourse;
4
 import com.xhkjedu.slive.model.liveplay.LCourse;
5
+import com.xhkjedu.slive.model.xz.LXzKj;
5
 import com.xhkjedu.slive.vo.liveplay.CTypeVo;
6
 import com.xhkjedu.slive.vo.liveplay.CTypeVo;
6
 import com.xhkjedu.slive.vo.liveplay.CourseParams;
7
 import com.xhkjedu.slive.vo.liveplay.CourseParams;
7
 import com.xhkjedu.slive.vo.liveplay.CourseSectionVo;
8
 import com.xhkjedu.slive.vo.liveplay.CourseSectionVo;
8
 import com.xhkjedu.slive.vo.liveplay.CourseStudentVo;
9
 import com.xhkjedu.slive.vo.liveplay.CourseStudentVo;
9
 import com.xhkjedu.slive.vo.liveplay.CourseVo;
10
 import com.xhkjedu.slive.vo.liveplay.CourseVo;
10
 import com.xhkjedu.slive.vo.liveplay.SectionDateVo;
11
 import com.xhkjedu.slive.vo.liveplay.SectionDateVo;
12
+import com.xhkjedu.slive.vo.xz.XzDateKjTeaVo;
11
 import org.apache.ibatis.annotations.Param;
13
 import org.apache.ibatis.annotations.Param;
12
 
14
 
13
 import java.util.List;
15
 import java.util.List;
107
     //获取指定课节班级日期下的课程信息
109
     //获取指定课节班级日期下的课程信息
108
     CourseVo getCourseByKjidAndClassid(@Param("kjid") Integer kjid,@Param("classid") Integer classid,@Param("seldate") String seldate);
110
     CourseVo getCourseByKjidAndClassid(@Param("kjid") Integer kjid,@Param("classid") Integer classid,@Param("seldate") String seldate);
109
     //获取指定指定日期教师课节下教师的直播课
111
     //获取指定指定日期教师课节下教师的直播课
110
-    CourseVo getCourseByDateKjTeacher(@Param("kjid") Integer kjid,@Param("teacherid") Integer teacherid,@Param("seldate") String seldate);
111
-    //更改课程相关任课教师
112
-    void updateCourseSectionClassTeacher(@Param("courseid") Integer courseid,@Param("teacherid") Integer teacherid,@Param("subjectid") String subjectid);
112
+    CourseVo getCourseByDateKjTeacher(@Param("kjTeaVo") XzDateKjTeaVo kjTeaVo);
113
+    //修改未开课课程课节时间-
114
+    void updateCourseSectionTime(@Param("kj") LXzKj kj);
113
 }
115
 }

+ 3
- 0
slive/src/main/java/com/xhkjedu/slive/mapper/xz/XzKjMapper.java View File

20
     //获取行政直播课节详情
20
     //获取行政直播课节详情
21
     List<XzDateKjVo> listXzKjsByXzid(@Param("xzid") Integer xzid);
21
     List<XzDateKjVo> listXzKjsByXzid(@Param("xzid") Integer xzid);
22
 
22
 
23
+    //修改行政直播课节详情
24
+    void updateXzkj(@Param("kj") LXzKj kj);
25
+
23
     //批量修改行政直播课节详情
26
     //批量修改行政直播课节详情
24
     void updateBatchXzKj(@Param("list") List<LXzKj> list);
27
     void updateBatchXzKj(@Param("list") List<LXzKj> list);
25
 }
28
 }

+ 4
- 3
slive/src/main/java/com/xhkjedu/slive/mapper/xz/XzMapper.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.LXz;
4
 import com.xhkjedu.slive.model.xz.LXz;
5
-import com.xhkjedu.slive.vo.xz.XzDateKjVo;
6
-import com.xhkjedu.slive.vo.xz.XzDateVo;
7
 import org.apache.ibatis.annotations.Param;
5
 import org.apache.ibatis.annotations.Param;
8
 import org.springframework.stereotype.Repository;
6
 import org.springframework.stereotype.Repository;
9
 
7
 
43
     List<Map> listXzKjsAfterSaveXz(@Param("xzid") Integer xzid);
41
     List<Map> listXzKjsAfterSaveXz(@Param("xzid") Integer xzid);
44
 
42
 
45
     //取指定课节指定日期所有班级的课程和教师
43
     //取指定课节指定日期所有班级的课程和教师
46
-    List<XzDateKjVo> listXzDateKjDetail(@Param("selectdate") String selectdate,@Param("xzid") Integer xzid);
44
+    List<Map> listXzDateKjDetail(@Param("selectdate") String selectdate,@Param("xzid") Integer xzid,@Param("classid")Integer classid);
47
 
45
 
48
     //获取指定课节班级对应的课程的日期
46
     //获取指定课节班级对应的课程的日期
49
     List<String> getAllDatesForKj(@Param("kjid") Integer kjid,@Param("classid") Integer classid,@Param("seldate") String seldate);
47
     List<String> getAllDatesForKj(@Param("kjid") Integer kjid,@Param("classid") Integer classid,@Param("seldate") String seldate);
48
+
49
+    //根据课节id获取行政直播详情
50
+    LXz getXzByXzkjid(@Param("kjid") Integer kjid);
50
 }
51
 }

+ 1
- 0
slive/src/main/java/com/xhkjedu/slive/service/liveplay/CourseService.java View File

110
             //课程信息
110
             //课程信息
111
             model.setClassid(classid);
111
             model.setClassid(classid);
112
             model.setDeleted(1);
112
             model.setDeleted(1);
113
+            model.setCourseclass(0);
113
             courseMapper.insertUseGeneratedKeys(model);
114
             courseMapper.insertUseGeneratedKeys(model);
114
             List<ClassVo> classes = new ArrayList<>();
115
             List<ClassVo> classes = new ArrayList<>();
115
             if (model.getCoursetype() == 1) {
116
             if (model.getCoursetype() == 1) {

+ 31
- 13
slive/src/main/java/com/xhkjedu/slive/service/xz/XzKjService.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.liveplay.CourseMapper;
3
 import com.xhkjedu.slive.mapper.xz.XzKjMapper;
4
 import com.xhkjedu.slive.mapper.xz.XzKjMapper;
4
 import com.xhkjedu.slive.model.xz.LXzKj;
5
 import com.xhkjedu.slive.model.xz.LXzKj;
5
 import com.xhkjedu.slive.vo.xz.XzDateKjVo;
6
 import com.xhkjedu.slive.vo.xz.XzDateKjVo;
6
 import com.xhkjedu.utils.N_Utils;
7
 import com.xhkjedu.utils.N_Utils;
7
 import com.xhkjedu.vo.ResultVo;
8
 import com.xhkjedu.vo.ResultVo;
9
+import lombok.extern.slf4j.Slf4j;
8
 import org.springframework.stereotype.Service;
10
 import org.springframework.stereotype.Service;
11
+import org.springframework.transaction.annotation.Transactional;
12
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
9
 
13
 
10
 import javax.annotation.Resource;
14
 import javax.annotation.Resource;
11
 import java.util.List;
15
 import java.util.List;
16
  * Date 2022/3/30 15:26
20
  * Date 2022/3/30 15:26
17
  **/
21
  **/
18
 @Service
22
 @Service
23
+@Slf4j
19
 public class XzKjService {
24
 public class XzKjService {
20
     @Resource
25
     @Resource
21
     private XzKjMapper xzKjMapper;
26
     private XzKjMapper xzKjMapper;
27
+    @Resource
28
+    private CourseMapper courseMapper;
22
 
29
 
23
     /**
30
     /**
24
      * @Description  获取行政直播课节基本信息
31
      * @Description  获取行政直播课节基本信息
37
      * @Author wn
44
      * @Author wn
38
      * @Date 2022/3/30 21:51
45
      * @Date 2022/3/30 21:51
39
      **/
46
      **/
47
+    @Transactional(rollbackFor = Exception.class)
40
     public ResultVo updateBatch(List<LXzKj> xzKjs) {
48
     public ResultVo updateBatch(List<LXzKj> xzKjs) {
41
-        for (int i = 0; i < xzKjs.size(); i++) {
42
-            boolean rtn = false;
43
-            LXzKj kj = xzKjs.get(i);
44
-            if (kj.getKjid() == null || kj.getKjid() == 0) {
45
-                rtn = true;
46
-            }
47
-            if (N_Utils.isEmpty(kj.getKjname()) || N_Utils.isEmpty(kj.getBegintime()) || N_Utils.isEmpty(kj.getEndtime())) {
48
-                rtn = true;
49
-            }
50
-            if(rtn){
51
-                return new ResultVo(1,"课节信息不完善");
49
+        try {
50
+            for (int i = 0; i < xzKjs.size(); i++) {
51
+                boolean rtn = false;
52
+                LXzKj kj = xzKjs.get(i);
53
+                if (kj.getKjid() == null || kj.getKjid() == 0) {
54
+                    rtn = true;
55
+                }
56
+                if (N_Utils.isEmpty(kj.getKjname()) || N_Utils.isEmpty(kj.getBegintime()) || N_Utils.isEmpty(kj.getEndtime())) {
57
+                    rtn = true;
58
+                }
59
+                if(rtn){
60
+                    return new ResultVo(1,"课节信息不完善");
61
+                }
62
+                //修改课节信息
63
+                xzKjMapper.updateXzkj(kj);
64
+                //修改所有未开始课程关联课节的时间
65
+                courseMapper.updateCourseSectionTime(kj);
52
             }
66
             }
67
+            return new ResultVo(0,"修改课节信息成功");
68
+        }catch (Exception e){
69
+            log.error("修改课节信息出错:"+e.getMessage());
70
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
71
+            return new ResultVo(1,"修改课节信息失败");
72
+
53
         }
73
         }
54
 
74
 
55
-        xzKjMapper.updateBatchXzKj(xzKjs);
56
-        return new ResultVo(0,"修改课节信息成功");
57
     }
75
     }
58
 
76
 
59
 }
77
 }

+ 128
- 101
slive/src/main/java/com/xhkjedu/slive/service/xz/XzService.java View File

18
 import com.xhkjedu.slive.utils.LiveUtil;
18
 import com.xhkjedu.slive.utils.LiveUtil;
19
 import com.xhkjedu.slive.vo.gradeclass.ClassVo;
19
 import com.xhkjedu.slive.vo.gradeclass.ClassVo;
20
 import com.xhkjedu.slive.vo.liveplay.CourseVo;
20
 import com.xhkjedu.slive.vo.liveplay.CourseVo;
21
+import com.xhkjedu.slive.vo.xz.XzClassVo;
21
 import com.xhkjedu.slive.vo.xz.XzDateVo;
22
 import com.xhkjedu.slive.vo.xz.XzDateVo;
22
 import com.xhkjedu.slive.vo.xz.XzDateKjTeaVo;
23
 import com.xhkjedu.slive.vo.xz.XzDateKjTeaVo;
23
 import com.xhkjedu.slive.vo.xz.XzDateKjVo;
24
 import com.xhkjedu.slive.vo.xz.XzDateKjVo;
32
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
33
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
33
 
34
 
34
 import javax.annotation.Resource;
35
 import javax.annotation.Resource;
36
+import javax.annotation.security.DenyAll;
35
 import java.util.ArrayList;
37
 import java.util.ArrayList;
36
 import java.util.HashMap;
38
 import java.util.HashMap;
37
 import java.util.List;
39
 import java.util.List;
68
     private ClassStudentMapper classStudentMapper;
70
     private ClassStudentMapper classStudentMapper;
69
     @Resource
71
     @Resource
70
     private GroupMapper groupMapper;
72
     private GroupMapper groupMapper;
73
+
74
+    @Autowired
75
+    ApplicationContext applicationContext;
76
+
71
     /**
77
     /**
72
      * @Description 行政直播列表
78
      * @Description 行政直播列表
73
      * @Param [schoolid]
79
      * @Param [schoolid]
109
             }
115
             }
110
             //批量保存行政直播对应的课节
116
             //批量保存行政直播对应的课节
111
             xzKjMapper.insertList(kjlst);
117
             xzKjMapper.insertList(kjlst);
112
-            return new ResultVo(0, "保存行政直播成功",xzid);
113
-        }catch (Exception e){
114
-            log.error("保存行政直播出错:"+e.getMessage());
118
+            return new ResultVo(0, "保存行政直播成功", xzid);
119
+        } catch (Exception e) {
120
+            log.error("保存行政直播出错:" + e.getMessage());
115
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
121
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
116
             return new ResultVo(1, "保存行政直播成功失败");
122
             return new ResultVo(1, "保存行政直播成功失败");
117
         }
123
         }
231
                         course.setEndtime(dateKjVo.getEndtime());
237
                         course.setEndtime(dateKjVo.getEndtime());
232
                         course.setKjid(dateKjVo.getKjid());
238
                         course.setKjid(dateKjVo.getKjid());
233
                         //保存行政直播课程表,该方式解决事务不生效问题
239
                         //保存行政直播课程表,该方式解决事务不生效问题
234
-                        ((XzService) AopContext.currentProxy()).saveCourseAll(xjTeas, course);
240
+                        ((XzService)applicationContext.getBean("xzService")).saveCourseAll(xjTeas, course);
235
                     }
241
                     }
236
                 }
242
                 }
237
             }
243
             }
238
-        }catch (Exception e){
239
-            log.error("保存行政直播课程表出错:"+e.getMessage());
244
+        } catch (Exception e) {
245
+            log.error("保存行政直播课程表出错:" + e.getMessage());
240
         }
246
         }
241
 
247
 
242
         return new ResultVo(0, "保存行政直播课程表成功");
248
         return new ResultVo(0, "保存行政直播课程表成功");
316
                 cc.setCreateid(course.getCreateid());
322
                 cc.setCreateid(course.getCreateid());
317
                 cc.setCreatetime(course.getCreatetime());
323
                 cc.setCreatetime(course.getCreatetime());
318
                 cclist.add(cc);
324
                 cclist.add(cc);
319
-                //通知班级
320
-                ClassVo classVo = new ClassVo();
321
-                classVo.setClassid(cid);
322
             }
325
             }
323
             courseClassMapper.insertList(cclist);//保存原班级和直播的关联关系
326
             courseClassMapper.insertList(cclist);//保存原班级和直播的关联关系
324
 
327
 
336
             cs.setCreateid(course.getCreateid());
339
             cs.setCreateid(course.getCreateid());
337
             cs.setCreatetime(course.getCreatetime());
340
             cs.setCreatetime(course.getCreatetime());
338
             courseSectionMapper.insertUseGeneratedKeys(cs);//保存课程课节信息
341
             courseSectionMapper.insertUseGeneratedKeys(cs);//保存课程课节信息
339
-
340
         } catch (Exception e) {
342
         } catch (Exception e) {
341
             log.info("保存行政直播课程表出错:" + e.getMessage());
343
             log.info("保存行政直播课程表出错:" + e.getMessage());
342
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
344
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
357
 
359
 
358
         Map map = new HashMap();
360
         Map map = new HashMap();
359
         List<XzDateKjVo> kjs = xzKjMapper.listXzKjsByXzid(xz.getXzid());
361
         List<XzDateKjVo> kjs = xzKjMapper.listXzKjsByXzid(xz.getXzid());
360
-        map.put("kjs",kjs);//保存所有课节信息
362
+        map.put("kjs", kjs);//保存所有课节信息
363
+
364
+        List<XzDateVo> classdatelst = new ArrayList<>();//班级日期课节
361
 
365
 
362
-        List<XzDateVo> datelst = new ArrayList<>();//保存指定日期
366
+        //根据行政直播id获取该学校当前年份指定年级下的行政班和提高班
367
+        List<XzClassVo> classlst = classMapper.listClassByXzid(xz.getXzid());
363
         //先获取选择要看的有效日期,不能超出行政直播结束的日期
368
         //先获取选择要看的有效日期,不能超出行政直播结束的日期
364
-        List<String> seldates = LiveUtil.listDateAfterDates(xz.getBegindate(),xz.getEnddate(),7);
365
-        for(int i=0;i<seldates.size();i++){
366
-            List<XzDateKjVo> kjlst = xzMapper.listXzDateKjDetail(seldates.get(i),xz.getXzid());//获取课节详情
367
-            XzDateVo dateVo = new XzDateVo();
368
-            dateVo.setSelectdate(seldates.get(i));
369
-            dateVo.setKjs(kjlst);
370
-            datelst.add(dateVo);
369
+        List<String> seldates = LiveUtil.listDateAfterDates(xz.getBegindate(), xz.getEnddate(), 7);
370
+
371
+        for (int i = 0; i < classlst.size(); i++) {
372
+            XzClassVo classVo = classlst.get(i);
373
+            List<XzDateVo> datelst = new ArrayList<>();//保存指定日期
374
+            for (int j = 0; j < seldates.size(); j++) {
375
+                List<Map> kjlst = xzMapper.listXzDateKjDetail(seldates.get(j), xz.getXzid(),classVo.getClassid());//获取课节详情
376
+                XzDateVo dateVo = new XzDateVo();
377
+                dateVo.setSelectdate(seldates.get(j));
378
+                dateVo.setKjsmap(kjlst);
379
+                datelst.add(dateVo);
380
+            }
381
+            classVo.setDates(datelst);
371
         }
382
         }
372
-        map.put("xzdates", datelst);
383
+
384
+        map.put("xzdates", classlst);
373
         return map;
385
         return map;
374
     }
386
     }
375
 
387
 
385
             //判断课程的状态,如果已经开始上课则不能删除
397
             //判断课程的状态,如果已经开始上课则不能删除
386
             LCourse course = courseMapper.selectByPrimaryKey(kjTeaVo.getCourseid());
398
             LCourse course = courseMapper.selectByPrimaryKey(kjTeaVo.getCourseid());
387
             Integer kjid = course.getKjid();
399
             Integer kjid = course.getKjid();
388
-            Integer classid= kjTeaVo.getClassid();//行政班id
389
-            if(course.getCoursestate() > 0){
390
-                throw new Exception("选择的课程已经开始上课,不允许删除");
391
-            }else{
400
+            Integer classid = kjTeaVo.getClassid();//行政班id
401
+            if (course.getCoursestate() > 0) {
402
+                return new ResultVo(1,"选择的课程已经开始上课,不允许删除");
403
+            } else {
392
                 //先判断是删除当前课程还是后续日期的课
404
                 //先判断是删除当前课程还是后续日期的课
393
-                if(N_Utils.isEmptyInteger(kjTeaVo.getKfollow())){
405
+                if (N_Utils.isEmptyInteger(kjTeaVo.getKfollow())) {
394
                     //kfollow为0或者空,则只需要删除当前选中的课程
406
                     //kfollow为0或者空,则只需要删除当前选中的课程
395
-                    ((XzService) AopContext.currentProxy()).delXzkjDygForDetail(kjTeaVo,course.getClassid());
396
-                }else{
407
+                    ((XzService)applicationContext.getBean("xzService")).delXzkjDygForDetail(kjTeaVo, course.getClassid());
408
+                } else {
397
                     //需要删除后续和当前日期相同的星期相同课节的课程
409
                     //需要删除后续和当前日期相同的星期相同课节的课程
398
-                    //获取已生成课程的最后日期
399
-                    List<String> alldates = xzMapper.getAllDatesForKj(kjid,classid,course.getBegindate());
400
-                    if(alldates!=null && alldates.size()>0){
410
+                    //获取已生成课程从所选删除课程开始日期到结束日期内所有日期
411
+                    List<String> alldates = xzMapper.getAllDatesForKj(kjid, classid, course.getBegindate());
412
+                    if (alldates != null && alldates.size() > 0) {
401
                         //已经成课程中符合周的需要删除的日期
413
                         //已经成课程中符合周的需要删除的日期
402
-                        List<String> deldates = LiveUtil.getMeetDayOfDates(alldates,course.getBegindate());
403
-                        if(deldates!=null && deldates.size()>0){
404
-                            for(int i=0;i<deldates.size();i++){
414
+                        List<String> deldates = LiveUtil.getMeetDayOfDates(alldates, course.getBegindate());
415
+                        if (deldates != null && deldates.size() > 0) {
416
+                            for (int i = 0; i < deldates.size(); i++) {
405
                                 //先获取指定日期对应的课程
417
                                 //先获取指定日期对应的课程
406
-                                CourseVo courseVo = courseMapper.getCourseByKjidAndClassid(kjid,classid,deldates.get(i));
407
-                                ((XzService) AopContext.currentProxy()).delXzkjDygForDetail(kjTeaVo,courseVo.getClassid());
418
+                                CourseVo courseVo = courseMapper.getCourseByKjidAndClassid(kjid, classid, deldates.get(i));
419
+                                kjTeaVo.setCourseid(courseVo.getCourseid());
420
+                                ((XzService)applicationContext.getBean("xzService")).delXzkjDygForDetail(kjTeaVo,courseVo.getClassid());
408
                             }
421
                             }
409
                         }
422
                         }
410
                     }
423
                     }
411
                 }
424
                 }
412
-                return new ResultVo(0,"成功删除课程表单个课程");
425
+                return new ResultVo(0, "成功删除课程表单个课程");
413
             }
426
             }
414
-        }catch (Exception e){
415
-            log.error("删除课程表单个课程出错:"+e.getMessage());
416
-            return new ResultVo(1,"删除课程表单个课程失败");
427
+        } catch (Exception e) {
428
+            log.error("删除课程表单个课程出错:" + e.getMessage());
429
+            return new ResultVo(1, "删除课程表单个课程失败");
417
         }
430
         }
418
     }
431
     }
419
 
432
 
420
     //删除单个课程表
433
     //删除单个课程表
421
     @Transactional(rollbackFor = Exception.class)
434
     @Transactional(rollbackFor = Exception.class)
422
-    public void delXzkjDygForDetail(XzDateKjTeaVo kjTeaVo,Integer zbclassid) {
435
+    public void delXzkjDygForDetail(XzDateKjTeaVo kjTeaVo, Integer zbclassid) {
423
         try {
436
         try {
424
             //删除单个单元格中设置的教师信息,先判断该单元格对应的课程是否有其他班级
437
             //删除单个单元格中设置的教师信息,先判断该单元格对应的课程是否有其他班级
425
-            Integer coursenum = courseClassMapper.getOtherClassnumByCourseid(kjTeaVo.getCourseid(), kjTeaVo.getClassid());
438
+            Integer coursenum = courseClassMapper.getOtherClassnumByCourseid(kjTeaVo.getCourseid(),kjTeaVo.getClassid());
426
             if (coursenum == 0) {
439
             if (coursenum == 0) {
427
                 //说明该课程仅关联一个班级,直接删除该课程以及该课程对应的直播班
440
                 //说明该课程仅关联一个班级,直接删除该课程以及该课程对应的直播班
428
                 courseMapper.deleteCourseClassByCourseid(kjTeaVo.getCourseid());
441
                 courseMapper.deleteCourseClassByCourseid(kjTeaVo.getCourseid());
434
                 classMapper.updateNum2(zbclassid);//更改班级以及班级分组人数
447
                 classMapper.updateNum2(zbclassid);//更改班级以及班级分组人数
435
                 courseMapper.updateStuNum(kjTeaVo.getCourseid());//更新直播课学生数量
448
                 courseMapper.updateStuNum(kjTeaVo.getCourseid());//更新直播课学生数量
436
             }
449
             }
437
-        }catch (Exception e){
438
-           log.error("删除单个课程出错:"+e.getMessage());
439
-           TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
450
+        } catch (Exception e) {
451
+            log.error("删除单个课程出错:" + e.getMessage());
452
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
440
         }
453
         }
441
     }
454
     }
442
 
455
 
443
     /**
456
     /**
444
-     * @Description 修改单个单元格
457
+     * @Description 保存单个单元格(单元格)
445
      * @Param [kjTeaVo]
458
      * @Param [kjTeaVo]
446
      * @Return com.xhkjedu.vo.ResultVo
459
      * @Return com.xhkjedu.vo.ResultVo
447
      * @Author wn
460
      * @Author wn
448
      * @Date 2022/4/2 15:19
461
      * @Date 2022/4/2 15:19
449
      **/
462
      **/
450
-    public ResultVo updateXzKjDyg(XzDateKjTeaVo kjTeaVo){
463
+    public ResultVo saveOneXzKjDyg(XzDateKjTeaVo kjTeaVo) {
451
         try {
464
         try {
452
-            //判断课程的状态,如果已经开始上课则不能修改
453
-            LCourse course = courseMapper.selectByPrimaryKey(kjTeaVo.getCourseid());
454
-            Integer kjid = course.getKjid();
455
-            Integer classid= kjTeaVo.getClassid();//行政班id
456
-            if(course.getCoursestate() > 0){
457
-                throw new Exception("选择的课程已经开始上课,不允许修改");
458
-            }else{
459
-                //先判断是修改当前课程还是后续日期的课
460
-                if(N_Utils.isEmptyInteger(kjTeaVo.getKfollow())){
461
-                    //kfollow为0或者空,则只需要修改当前选中的课程
462
-                    ((XzService) AopContext.currentProxy()).updateXzkjDygForDetail(kjTeaVo,course);
463
-                }else{
464
-                    //需要修改后续和当前日期相同的星期相同课节的课程
465
-                    //获取已生成课程的最后日期
466
-                    List<String> alldates = xzMapper.getAllDatesForKj(kjid,classid,course.getBegindate());
467
-                    if(alldates!=null && alldates.size()>0){
468
-                        //已经成课程中符合周的需要修改的日期
469
-                        List<String> deldates = LiveUtil.getMeetDayOfDates(alldates,course.getBegindate());
470
-                        if(deldates!=null && deldates.size()>0){
471
-                            for(int i=0;i<deldates.size();i++){
472
-                                //先获取指定日期对应的课程
473
-                                course.setBegintime(deldates.get(i));
474
-                                ((XzService) AopContext.currentProxy()).updateXzkjDygForDetail(kjTeaVo,course);
475
-                            }
465
+            LXz xz = xzMapper.getXzByXzkjid(kjTeaVo.getKjid());
466
+            kjTeaVo.setGradeid(xz.getGradeid());
467
+            kjTeaVo.setSchoolid(xz.getSchoolid());
468
+
469
+            //先判断是保存当前课程还是后续日期的课
470
+            if (N_Utils.isEmptyInteger(kjTeaVo.getKfollow())) {
471
+                //kfollow为0或者空,则只需要保存当前选中的课程
472
+                ((XzService)applicationContext.getBean("xzService")).saveOneXzkjDygForDetail(kjTeaVo);
473
+            } else {
474
+                //需要保存后续和当前日期相同的星期相同课节的课程,判断后续日期是否有课程,如果有则提示先删除后再添加
475
+                //获取已生成课程的往后日期
476
+                List<String> alldates = xzMapper.getAllDatesForKj(kjTeaVo.getKjid(), kjTeaVo.getClassid(), kjTeaVo.getSeldate());
477
+                if(alldates != null && alldates.size() > 0){
478
+                    //去匹配是否包含在当前选中日期后续周对应的日期
479
+                    List<String> afterlst = LiveUtil.getMeetDayOfDates(alldates,kjTeaVo.getSeldate());
480
+                    if(afterlst != null && afterlst.size() > 0){
481
+                        return new ResultVo(1,"同日期同班级同课节有数据,不能保存");
482
+                    }else{
483
+
484
+                        //获取seldate至结束日期时端内符合条件的日期
485
+                        List<String> savedates = LiveUtil.getDaysForMeetDates(kjTeaVo.getSeldate(),xz.getEnddate());
486
+                        for (int i = 0; i < savedates.size(); i++) {
487
+                            kjTeaVo.setSeldate(savedates.get(i));
488
+//                            ((XzService)applicationContext.getBean("xzService")).saveOneXzkjDygForDetail(kjTeaVo);
476
                         }
489
                         }
477
                     }
490
                     }
478
                 }
491
                 }
479
-                return new ResultVo(0,"成功修改课程表单个课程");
480
             }
492
             }
481
-        }catch (Exception e){
482
-            log.error("修改课程表单个课程出错:"+e.getMessage());
483
-            return new ResultVo(1,"修改课程表单个课程失败");
493
+            return new ResultVo(0, "成功保存课程表单个课程");
494
+        } catch (Exception e) {
495
+            log.error("保存课程表单个课程出错:" + e.getMessage());
496
+            return new ResultVo(1, "保存课程表单个课程失败");
484
         }
497
         }
485
     }
498
     }
486
 
499
 
487
-    //修改单个课程
500
+    //保存单个课程
488
     @Transactional(rollbackFor = Exception.class)
501
     @Transactional(rollbackFor = Exception.class)
489
-    public void updateXzkjDygForDetail(XzDateKjTeaVo kjTeaVo,LCourse course) {
502
+    public void saveOneXzkjDygForDetail(XzDateKjTeaVo kjTeaVo) {
490
         try {
503
         try {
491
             //先看新选择的教师情况,先判断选中的同一日期课节教师是否还有其他直播课
504
             //先看新选择的教师情况,先判断选中的同一日期课节教师是否还有其他直播课
492
-            CourseVo courseVo = courseMapper.getCourseByDateKjTeacher(course.getKjid(),kjTeaVo.getTeacherid(),course.getBegindate());
493
-            if(courseVo==null){
494
-                //说明该老师之前没有直播课,则直接修改课程任课教师,直播班关联教师以及科目
495
-                courseMapper.updateCourseSectionClassTeacher(course.getCourseid(),kjTeaVo.getTeacherid(),kjTeaVo.getSubjectid());
496
-            }else{
505
+            CourseVo courseVo = courseMapper.getCourseByDateKjTeacher(kjTeaVo);
506
+            if (courseVo == null) {
507
+                //说明该老师之前没有直播课,则直接保存为新的课程
508
+                LCourse course = new LCourse();
509
+                course.setGradeid(kjTeaVo.getGradeid());
510
+                course.setBegindate(kjTeaVo.getSeldate());
511
+                course.setEnddate(kjTeaVo.getSeldate());
512
+                course.setCoursenum(1);
513
+                course.setCoursetype(1);
514
+                course.setCourseclass(1);
515
+                course.setCoursestate(0);
516
+                course.setDeleted(1);
517
+                course.setCourseselected(0);
518
+                course.setCreateid(kjTeaVo.getCreateid());
519
+                course.setCreatetime(N_Utils.getSecondTimestamp());
520
+                course.setSchoolid(kjTeaVo.getSchoolid());
521
+
522
+                String datezhou = LiveUtil.getDateZhou(kjTeaVo.getSeldate());
523
+                LXzKj kj = xzKjMapper.selectByPrimaryKey(kjTeaVo.getKjid());//课节详情
524
+
525
+                //单个教师课程信息
526
+                String coursename = datezhou + kj.getKjname() + kjTeaVo.getSubjectname() + "(" + kjTeaVo.getTeachername() + ")";
527
+
528
+                course.setCoursename(coursename);
529
+                course.setSubjectid(kjTeaVo.getSubjectid());
530
+                course.setTeacherid(kjTeaVo.getTeacherid());
531
+                course.setBegintime(kj.getBegintime());
532
+                course.setEndtime(kj.getEndtime());
533
+                course.setKjid(kjTeaVo.getKjid());
534
+                //保存行政直播课程表,调用保存整个课表时的方法
535
+                List<XzDateKjTeaVo> lst = new ArrayList<>();
536
+                lst.add(kjTeaVo);
537
+                ((XzService)applicationContext.getBean("xzService")).saveCourseAll(lst, course);
538
+            } else {
497
                 //说明该教师当前有其他直播课,则把班级加入课程,完成直播课学生数量
539
                 //说明该教师当前有其他直播课,则把班级加入课程,完成直播课学生数量
498
                 TClassStudent cs = new TClassStudent();
540
                 TClassStudent cs = new TClassStudent();
499
-                cs.setSchoolid(course.getSchoolid());
541
+                cs.setSchoolid(kjTeaVo.getSchoolid());
500
                 cs.setClassid(kjTeaVo.getClassid());
542
                 cs.setClassid(kjTeaVo.getClassid());
501
                 cs.setCreateid(kjTeaVo.getCreateid());
543
                 cs.setCreateid(kjTeaVo.getCreateid());
502
-                classStudentMapper.saveAllClassStu(cs,courseVo.getClassid());
544
+                classStudentMapper.saveAllClassStu(cs, courseVo.getClassid());
503
                 //获取直播班对应全班学生分组id
545
                 //获取直播班对应全班学生分组id
504
                 Integer groupid = groupMapper.getGroupIdByClassid(courseVo.getClassid());
546
                 Integer groupid = groupMapper.getGroupIdByClassid(courseVo.getClassid());
505
-                groupMapper.saveAllClassGroupStu(cs,courseVo.getClassid(),groupid);
547
+                groupMapper.saveAllClassGroupStu(cs, courseVo.getClassid(), groupid);
506
                 classMapper.updateNum2(courseVo.getClassid());//更改直播班级以及班级分组人数
548
                 classMapper.updateNum2(courseVo.getClassid());//更改直播班级以及班级分组人数
507
                 courseMapper.updateStuNum(courseVo.getCourseid());//更新直播课学生数量
549
                 courseMapper.updateStuNum(courseVo.getCourseid());//更新直播课学生数量
508
-
509
-                //把指定的班级从原直播班中移除
510
-                //修改原单元格中设置的教师信息,先判断该单元格对应的课程是否有其他班级
511
-                Integer coursenum = courseClassMapper.getOtherClassnumByCourseid(kjTeaVo.getCourseid(), kjTeaVo.getClassid());
512
-                if (coursenum == 0) {
513
-                    //说明该课程仅关联一个班级,直接修改该课程以及该课程对应的直播班
514
-                    courseMapper.deleteCourseClassByCourseid(kjTeaVo.getCourseid());
515
-                } else {
516
-                    //说明关联的还有其他班级,修改该班级在直播班级中的学生,
517
-                    courseClassMapper.deleteByCourseidAndClassid(kjTeaVo.getCourseid(), kjTeaVo.getClassid());
518
-                    //处理对应直播班级中学生
519
-                    classMapper.deleteClassstu(course.getClassid(), kjTeaVo.getClassid());
520
-                    classMapper.updateNum2(course.getClassid());//更改班级以及班级分组人数
521
-                    courseMapper.updateStuNum(kjTeaVo.getCourseid());//更新直播课学生数量
522
-                }
523
             }
550
             }
524
-        }catch (Exception e){
525
-            log.error("修改单个课程出错:"+e.getMessage());
551
+        } catch (Exception e) {
552
+            log.error("保存单个课程出错:" + e.getMessage());
526
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
553
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
527
         }
554
         }
528
     }
555
     }

+ 25
- 1
slive/src/main/java/com/xhkjedu/slive/utils/LiveUtil.java View File

75
         DateTimeFormatter fomatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
75
         DateTimeFormatter fomatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
76
         LocalDate datas = LocalDate.parse(beginstr, fomatter);
76
         LocalDate datas = LocalDate.parse(beginstr, fomatter);
77
         LocalDate enddate = LocalDate.parse(endstr,fomatter);
77
         LocalDate enddate = LocalDate.parse(endstr,fomatter);
78
-
78
+        //days是的往后一周
79
         int i=0;
79
         int i=0;
80
         while (i<days){
80
         while (i<days){
81
             int td = i ;
81
             int td = i ;
102
         LocalDate startDate = LocalDate.parse(startDateStr, fomatter);
102
         LocalDate startDate = LocalDate.parse(startDateStr, fomatter);
103
         LocalDate endDate = LocalDate.parse(endDateStr, fomatter);
103
         LocalDate endDate = LocalDate.parse(endDateStr, fomatter);
104
 
104
 
105
+        //指定的周几
105
         DayOfWeek dayOfWeek = DayOfWeek.of(weekDate);
106
         DayOfWeek dayOfWeek = DayOfWeek.of(weekDate);
106
         long distance = ChronoUnit.DAYS.between(startDate, endDate);
107
         long distance = ChronoUnit.DAYS.between(startDate, endDate);
107
 
108
 
136
         return rtn;
137
         return rtn;
137
     }
138
     }
138
 
139
 
140
+    /**
141
+     * @Description 指定时间段内符合开始时间的周几的所有日期集合
142
+     * @Param [startDateStr, endDateStr]
143
+     * @Return java.util.List<java.lang.String>
144
+     * @Author wn
145
+     * @Date 2022/4/6 16:16
146
+     **/
147
+    public static List<String> getDaysForMeetDates(String startDateStr, String endDateStr) {
148
+        DateTimeFormatter fomatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
149
+        LocalDate startDate = LocalDate.parse(startDateStr, fomatter);
150
+        LocalDate endDate = LocalDate.parse(endDateStr, fomatter);
151
+
152
+        DayOfWeek dayOfWeek = startDate.getDayOfWeek();
153
+        long distance = ChronoUnit.DAYS.between(startDate, endDate);
154
+
155
+        List<String> rtnlst = new ArrayList<>();
156
+        Stream.iterate(startDate, d -> d.plusDays(1))
157
+              .limit(distance + 1)
158
+              .filter(localDate -> dayOfWeek.toString().equals(localDate.getDayOfWeek().toString()))
159
+              .forEach(f -> rtnlst.add(f.toString()));
160
+        return rtnlst;
161
+    }
162
+
139
 }
163
 }

+ 23
- 0
slive/src/main/java/com/xhkjedu/slive/vo/xz/XzClassVo.java View File

1
+package com.xhkjedu.slive.vo.xz;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * @Description 班级信息
9
+ * @Author WN
10
+ * Date 2022/4/6 10:53
11
+ **/
12
+@Data
13
+public class XzClassVo {
14
+    private Integer classid;//班级id
15
+
16
+    private String classname; //班级名称
17
+
18
+    private Integer gradeid;//年级
19
+
20
+    private Integer classtype;//班级类型
21
+
22
+    private List<XzDateVo> dates;//行政课日期
23
+}

+ 5
- 0
slive/src/main/java/com/xhkjedu/slive/vo/xz/XzDateKjTeaVo.java View File

21
     private String subjectid;//科目id
21
     private String subjectid;//科目id
22
     private String subjectname;//科目名称
22
     private String subjectname;//科目名称
23
 
23
 
24
+    private Integer kjid;//行政直播课节id
25
+    private String seldate;//选择设置的日期
26
+
24
     private Integer kfollow;//区分是否处理指定日期后的课0不处理1处理
27
     private Integer kfollow;//区分是否处理指定日期后的课0不处理1处理
28
+    private Integer gradeid;//年级id
25
     private Integer createid;//操作人id
29
     private Integer createid;//操作人id
30
+    private Integer schoolid;//学校id
26
 
31
 
27
     private List<XzDateKjTeaVo> xjclass;//存放层级用于保存时使用
32
     private List<XzDateKjTeaVo> xjclass;//存放层级用于保存时使用
28
 }
33
 }

+ 4
- 0
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;
5
 import java.util.List;
6
 import java.util.List;
7
+import java.util.Map;
6
 
8
 
7
 /**
9
 /**
8
  * @Description 行政直播日期
10
  * @Description 行政直播日期
14
     private String selectdate;//当前选择日期
16
     private String selectdate;//当前选择日期
15
     private List<XzDateKjVo> kjs;//行政直播课节集合
17
     private List<XzDateKjVo> kjs;//行政直播课节集合
16
 
18
 
19
+    private List<Map> kjsmap = new ArrayList<>();
20
+
17
 
21
 
18
 }
22
 }

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

48
         left join t_group_student gs on cs.classid=gs.classid and cs.studentid=gs.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
49
         where cs.classid=#{zbclassid} and cs2.classid=#{classid} and cs.xzed=0
50
     </delete>
50
     </delete>
51
+
52
+    <!--获取年级下所有行政班和提高班-->
53
+    <select id="listClassByXzid" resultType="com.xhkjedu.slive.vo.xz.XzClassVo">
54
+        select DISTINCT c.classid,c.classname,c.classtype,c.gradeid from t_class c
55
+        left join t_school s on c.schoolid=s.schoolid and c.year=s.year
56
+        left join l_xz x on s.schoolid=x.schoolid and c.gradeid=x.gradeid
57
+        where x.xzid=#{xzid} and c.classstate=1 and c.classtype in (1,2)
58
+    </select>
51
 </mapper>
59
 </mapper>

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

517
     <!--获取指定指定日期教师课节下教师的直播课-->
517
     <!--获取指定指定日期教师课节下教师的直播课-->
518
     <select id="getCourseByDateKjTeacher" resultType="com.xhkjedu.slive.vo.liveplay.CourseVo">
518
     <select id="getCourseByDateKjTeacher" resultType="com.xhkjedu.slive.vo.liveplay.CourseVo">
519
         select courseid,subjectid,classid,teacherid,kjid from l_course
519
         select courseid,subjectid,classid,teacherid,kjid from l_course
520
-        where kjid=#{xkjid} and teacherid=#{teacherid} and begindate=#{seldate}
520
+        where kjid=#{kjTeaVo.kjid} and teacherid=#{kjTeaVo.teacherid} and begindate=#{kjTeaVo.seldate}
521
     </select>
521
     </select>
522
-    <!--更改课程相关任课教师-->
523
-    <update id="updateCourseSectionClassTeacher">
524
-        update l_course c ,l_course_section s,t_class_teacher ct
525
-        set c.teacherid=#{teacherid},s.teacherid=#{teacherid},ct.teacherid=#{teacherid},c.subjectid=#{subjectid}
526
-        where c.courseid=s.courseid and ct.classid=c.classid and c.courseid=#{courseid}
522
+
523
+    <!--修改未开课课程课节时间-->
524
+    <update id="updateCourseSectionTime">
525
+        update l_course c,l_course_section s set c.begintime=#{kj.begintime},c.endtime=#{kj.endtime},
526
+        s.planbegintime=#{kj.begintime},s.planendtime=#{kj.endtime} where c.courseid=s.courseid
527
+        and c.kjid=#{kj.kjid} and c.coursestate=0 and s.sectionstate=0
527
     </update>
528
     </update>
528
 </mapper>
529
 </mapper>

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

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
 
10
+    <!--修改课节信息-->
11
+    <update id="updateXzkj">
12
+        update l_xz_kj set kjname=#{kj.kjname},begintime=#{kj.begintime},endtime=#{kj.endtime}
13
+        where kjid=#{kj.kjid}
14
+    </update>
15
+
10
     <!--批量修改行政直播课节详情-->
16
     <!--批量修改行政直播课节详情-->
11
     <update id="updateBatchXzKj" parameterType="java.util.List">
17
     <update id="updateBatchXzKj" parameterType="java.util.List">
12
         <foreach collection="list" item="kj" index="index" separator=";">
18
         <foreach collection="list" item="kj" index="index" separator=";">

+ 9
- 22
slive/src/main/resources/mapper/xz/XzMapper.xml View File

70
         left join l_xz_kj k on x.xzid=k.xzid where x.xzid=#{xzid} order by k.kjorder
70
         left join l_xz_kj k on x.xzid=k.xzid where x.xzid=#{xzid} order by k.kjorder
71
     </select>
71
     </select>
72
 
72
 
73
-    <resultMap id="xzkjsForDate" type="com.xhkjedu.slive.vo.xz.XzDateKjVo">
74
-        <result property="kjid" column="kjid"></result>
75
-        <result property="kjname" column="kjname"></result>
76
-        <result property="kjorder" column="kjorder"></result>
77
-        <result property="begintime" column="begintime"></result>
78
-        <result property="endtime" column="endtime"></result>
79
-        <collection property="kjteas" ofType="com.xhkjedu.slive.vo.xz.XzDateKjTeaVo"
80
-                    javaType="java.util.List">
81
-            <result property="classid" column="classid"></result>
82
-            <result property="classname" column="classname"></result>
83
-            <result property="teacherid" column="teacherid"></result>
84
-            <result property="teachername" column="teachername"></result>
85
-            <result property="courseid" column="courseid"></result>
86
-            <result property="subjectid" column="subjectid"></result>
87
-            <result property="subjectname" column="subjectname"></result>
88
-        </collection>
89
-    </resultMap>
90
-
91
     <!--获取指定课节指定日期所有班级的课程和教师-->
73
     <!--获取指定课节指定日期所有班级的课程和教师-->
92
-    <select id="listXzDateKjDetail" resultMap="xzkjsForDate">
93
-        select k.kjid,k.kjname,k.kjorder,k.begintime,k.endtime,
74
+    <select id="listXzDateKjDetail" resultType="java.util.Map">
75
+        select k.kjid,k.kjname,
94
         c.classid,lc.classname,c.teacherid,u.username as teachername,
76
         c.classid,lc.classname,c.teacherid,u.username as teachername,
95
         c.subjectid,s.subjectname,c.kjid,c.courseid,c.coursestate
77
         c.subjectid,s.subjectname,c.kjid,c.courseid,c.coursestate
96
         from l_course c left join l_course_class cc on c.courseid=cc.courseid
78
         from l_course c left join l_course_class cc on c.courseid=cc.courseid
97
         left join t_class lc on cc.classid=lc.classid
79
         left join t_class lc on cc.classid=lc.classid
98
         left join t_user u on c.teacherid=u.userid
80
         left join t_user u on c.teacherid=u.userid
99
         left join t_subject s on c.subjectid=s.subjectid left join l_xz_kj k on c.kjid=k.kjid
81
         left join t_subject s on c.subjectid=s.subjectid left join l_xz_kj k on c.kjid=k.kjid
100
-        where c.begindate=#{selectdate} and c.courseclass=1 and k.xzid=#{xzid}
82
+        where c.begindate=#{selectdate} and c.courseclass=1 and k.xzid=#{xzid} and cc.classid=#{classid}
101
         order by k.kjorder, lc.classtype, lc.classorder
83
         order by k.kjorder, lc.classtype, lc.classorder
102
     </select>
84
     </select>
103
 
85
 
104
     <!--获取指定课节班级对应的课程的日期-->
86
     <!--获取指定课节班级对应的课程的日期-->
105
     <select id="getAllDatesForKj" resultType="java.lang.String">
87
     <select id="getAllDatesForKj" resultType="java.lang.String">
106
         select c.enddate from l_course c left join l_course_class cc on c.courseid=cc.courseid
88
         select c.enddate from l_course c left join l_course_class cc on c.courseid=cc.courseid
107
-        WHERE c.kjid=#{kjid} and cc.classid=#{classid} and c.begindate<![CDATA[ <= ]]>#{seldate}
89
+        WHERE c.kjid=#{kjid} and cc.classid=#{classid} and c.begindate<![CDATA[ >= ]]>#{seldate}
90
+    </select>
91
+
92
+    <!--根据课节id获取行政直播详情-->
93
+    <select id="getXzByXzkjid" resultType="com.xhkjedu.slive.model.xz.LXz">
94
+        select x.* from l_xz x left join l_xz_kj k on x.xzid=k.xzid where kjid=#{kjid} group by xzid
108
     </select>
95
     </select>
109
 </mapper>
96
 </mapper>

Loading…
Cancel
Save