hgw 3 年 前
コミット
f856fc4823

+ 6 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -81,7 +81,12 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         String classDate = WrapperUtil.toStr(param, "classDate", "查询时间不能为空!");
         String[] classDateSp = classDate.split("-");
         //本月的第一天
-        LocalDate firstDay = LocalDate.of(Integer.parseInt(classDateSp[0]), Integer.parseInt(classDateSp[1]), 1);
+        LocalDate firstDay;
+        try {
+            firstDay = LocalDate.of(Integer.parseInt(classDateSp[0]), Integer.parseInt(classDateSp[1]), 1);
+        } catch (Exception e) {
+            throw new BizException("查询时间格式不正确 ["+classDate+"]");
+        }
         //本月的最后一天
         LocalDate lastDay = firstDay.with(TemporalAdjusters.lastDayOfMonth());
         //查询该月的所有课程