|
@@ -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);
|