Browse Source

基础技能班,增加星期判断

周箭河 5 năm trước cách đây
mục cha
commit
64edd5fc1f

+ 5 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -303,6 +303,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         Integer schoolId = musicGroup.getSchoolId();
         for (HighClassGroupDto highClassGroup : highClassGroupList) {
+            if (highClassGroup.getDayOfWeek() < 1 || highClassGroup.getDayOfWeek() > 7) {
+                throw new BizException("上课星期错误,请核查");
+            }
             //1、插入班级信息
             Date date;
             date = new Date();
@@ -1681,8 +1684,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
             Calendar calendar = Calendar.getInstance();
             calendar.setTime(courseSchedule.getClassDate());
-            Integer dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK)-1;
-            dayOfWeek =dayOfWeek.equals(0) ? 7 :dayOfWeek;
+            Integer dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK) - 1;
+            dayOfWeek = dayOfWeek.equals(0) ? 7 : dayOfWeek;
             highClassGroup.setDayOfWeek(dayOfWeek);
         }
         return highClassGroupList;