Browse Source

完善接口

tags/正式3.2.0
王宁 2 years ago
parent
commit
697acaef3a

+ 13
- 12
slive/src/main/java/com/xhkjedu/slive/service/xz/XzService.java View File

@@ -571,23 +571,24 @@ public class XzService {
571 571
                 //获取已生成课程的往后日期
572 572
                 List<String> alldates = xzMapper.getAllDatesForKj(kjTeaVo.getKjid(), kjTeaVo.getClassid(), kjTeaVo.getSeldate());
573 573
                 if (alldates != null && alldates.size() > 0) {
574
-                    //去匹配是否包含在当前选中日期后续周对应的日期
574
+                    //去匹配是否包含在当前选中日期后续周对应的日期,主要是为了判断是否有已生成的课
575 575
                     List<String> afterlst = LiveUtil.getMeetDayOfDates(alldates, kjTeaVo.getSeldate());
576 576
                     if (afterlst != null && afterlst.size() > 0) {
577 577
                         return new ResultVo(1, "同日期同班级同课节有数据,不能保存");
578
-                    } else {
579
-                        //获取seldate至结束日期时端内符合条件的日期
580
-                        List<String> savedates = LiveUtil.getDaysForMeetDates(kjTeaVo.getSeldate(), xz.getEnddate());
581
-                        for (int i = 0; i < savedates.size(); i++) {
582
-                            kjTeaVo.setSeldate(savedates.get(i));
583
-
584
-                            Integer rtnid = ((XzService)applicationContext.getBean("xzService")).saveOneXzkjDygForDetail(kjTeaVo);
585
-                            if(i==0){
586
-                                courseid = rtnid;
587
-                            }
578
+                    }
579
+                }
588 580
 
589
-                        }
581
+                //说明当前日期(包含当前日期)往后都没有课,则直接处理
582
+                //获取seldate至结束日期时端内符合条件的日期
583
+                List<String> savedates = LiveUtil.getDaysForMeetDates(kjTeaVo.getSeldate(), xz.getEnddate());
584
+                for (int i = 0; i < savedates.size(); i++) {
585
+                    kjTeaVo.setSeldate(savedates.get(i));
586
+
587
+                    Integer rtnid = ((XzService)applicationContext.getBean("xzService")).saveOneXzkjDygForDetail(kjTeaVo);
588
+                    if(i==0){
589
+                        courseid = rtnid;
590 590
                     }
591
+
591 592
                 }
592 593
             }
593 594
             return new ResultVo(0, "成功保存课程表单个课程",courseid);

+ 1
- 1
slive/src/main/resources/mapper/gradeclass/ClassStudentMapper.xml View File

@@ -20,6 +20,6 @@
20 20
     <!--保存班级学生到指定班级-->
21 21
     <insert id="saveAllClassStu">
22 22
         insert ignore into t_class_student (classid,studentid,createid,createtime,schoolid)
23
-        SELECT #{zbclassid},studentid,#{student.createid}, UNIX_TIMESTAMP(),#{student.schoolid} FROM t_class_student WHERE classid=#{student.classid});
23
+        SELECT #{zbclassid},studentid,#{student.createid}, UNIX_TIMESTAMP(),#{student.schoolid} FROM t_class_student WHERE classid=#{student.classid};
24 24
     </insert>
25 25
 </mapper>

+ 1
- 1
slive/src/main/resources/mapper/gradeclass/GroupMapper.xml View File

@@ -15,6 +15,6 @@
15 15
     <!--保存全部分组学生-->
16 16
     <insert id="saveAllClassGroupStu">
17 17
         insert ignore into t_group_student (classid,groupid,studentid,createid,createtime,schoolid)
18
-        SELECT #{zbclassid},#{zbgroupid},studentid,#{student.createid}, UNIX_TIMESTAMP(),#{student.schoolid} FROM t_class_student WHERE classid=#{student.classid});
18
+        SELECT #{zbclassid},#{zbgroupid},studentid,#{student.createid}, UNIX_TIMESTAMP(),#{student.schoolid} FROM t_class_student WHERE classid=#{student.classid};
19 19
     </insert>
20 20
 </mapper>

Loading…
Cancel
Save