Пример #1
0
  /**
   * 只查询拓展课的记录<br>
   * 只包括拓展课,<b>不包括</b>班级拓展课
   */
  @SuppressWarnings("unchecked")
  public String scheduleRecords() {
    Date curDate = new Date();
    if (DateUtils.isLessCurDay(date, curDate) || DateUtils.isSameDay(date, curDate)) {
      expiration = "-1";
    } else {
      FzxDto fzx = FzxDto.getFzxDto(cid.trim());
      schedule.setStartDay(DateUtils.getTodayWeeHours(date));
      schedule.setEndDay(DateUtils.getTomorrowWeeHours(date));
      schedule.setSzfzx(fzx);
      schedule.setLessonType(LessonTypeDto.getComplement());

      page = new Page();
      page.setCur(0);
      page.setPageSize(Integer.MAX_VALUE);
      Map<String, Object> result = commonService.getSchedules(page, schedule);
      page = (Page) result.get(Constants.RESULT_MAP_PAGE);
      ss = (List<Schedule>) result.get(Constants.RESULT_MAP_LIST);
      for (Schedule s : ss) {
        int count = commonService.getOrderLessonCountBySchedule(s);
        s.setStudents(count);
        // TODO 根据人数判断是否可以订课,人数可由运营中心设置
        if (count < Constants.MAX_STUDENTS_IN_CLASS) {
          s.setScheduleState(ScheduleStateDto.getCanOrder());
        } else {
          s.setScheduleState(ScheduleStateDto.getIsFull());
        }
      }
      expiration = String.valueOf(page.getTotal());
    }
    return SUCCESS;
  }
 /**
  * 取消订课记录
  *
  * @return
  */
 public String cancelOrder() {
   skjl.setId(id);
   skjl = commonService.getLessonRecord(skjl);
   Calendar now = Calendar.getInstance();
   // 系统当前时间加一天
   // now.add(Calendar.DATE, 1);
   // if (DateUtils.isSameDay(now.getTime(), skjl.getStartTime())
   // || now.getTime().compareTo(skjl.getStartTime()) >= 0) {
   if (DateUtils.isSameDay(now.getTime(), skjl.getStartTime())) {
     // 如果系统当前时间增加一天后,和订课的时间是同一天的话,则不能取消订课
     msg = getText("orderLesson.cancel.not.current.day", "您不能取消当天的订课!");
     return INPUT;
   } else {
     commonService.cancelOrderRecord(skjl, fromType);
     return SUCCESS;
   }
 }
Пример #3
0
 /**
  * 订课,订课后可在订课记录中查看
  *
  * @see LessonRecordAction#orderRecords()
  * @return
  */
 public String orderLesson() {
   xyxx.setId(sid);
   schedule.setId(id);
   Calendar c = Calendar.getInstance();
   int today = c.get(Calendar.DAY_OF_WEEK);
   if (today == Calendar.FRIDAY && c.get(Calendar.HOUR_OF_DAY) >= Constants.TIME_LINE) {
     schedule = commonService.getSchedule(schedule);
     c.add(Calendar.DATE, 1);
     if (org.apache.commons.lang.time.DateUtils.isSameDay(c.getTime(), schedule.getStart())) {
       msg = getText("周五" + Constants.TIME_LINE + "点之后不能预订周六的拓展课!");
       return INPUT;
     }
   }
   if (today == Calendar.SATURDAY && c.get(Calendar.HOUR_OF_DAY) >= Constants.TIME_LINE) {
     schedule = commonService.getSchedule(schedule);
     c.add(Calendar.DATE, 1);
     if (org.apache.commons.lang.time.DateUtils.isSameDay(c.getTime(), schedule.getStart())) {
       msg = getText("周六" + Constants.TIME_LINE + "点之后不能预订当周的拓展课!");
       return INPUT;
     }
   }
   if (commonService.getOrderLessonCountBySchedule(schedule) >= Constants.MAX_STUDENTS_IN_CLASS) {
     msg = getText("orderLesson.schedule.is.full", "本节拓展课已被订满!");
     return INPUT;
   }
   if (!commonService.canOrderLesson(schedule, xyxx)) {
     msg = getText("orderLesson.schedule.has.ordered", "您已经订过本节拓展课了!");
     return INPUT;
   } else {
     try {
       commonService.orderLesson(schedule, xyxx, fromType);
       schedule.setScheduleState(ScheduleStateDto.getCanOrder());
       result = SfDto.TRUE;
     } catch (Exception e) {
       e.printStackTrace();
       return INPUT;
     }
   }
   return SUCCESS;
 }
  /**
   * 取消的订课列表
   *
   * @return
   */
  @SuppressWarnings("unchecked")
  public String canceledRecords() {
    xyxx.setId(sid);

    page = new Page();
    page.setCur(ct);
    page.setPageSize(Constants.PAGE_SIZE);

    skjl.setXyxx(xyxx);
    skjl.setLessonType(LessonTypeDto.getComplement());
    Map<String, Object> result =
        commonService.getLessonRecords(page, skjl, Constants.LESSONRECORD_CANCEL);
    page = (Page) result.get(Constants.RESULT_MAP_PAGE);
    lessonRecords = (List<Skjl>) result.get(Constants.RESULT_MAP_LIST);
    return SUCCESS;
  }
  /**
   * 查看已上课记录列表
   *
   * @return
   */
  @SuppressWarnings("unchecked")
  public String lessonRecords() {
    xyxx.setId(sid);

    page = new Page();
    page.setCur(ct);
    page.setPageSize(Constants.PAGE_SIZE);

    skjl.setXyxx(xyxx);
    if (!StringUtils.isBlank(type)) {
      skjl.setLessonType(LessonTypeDto.getLessonType(type));
    }
    if (!StringUtils.isBlank(kq)) {
      skjl.setKq(KqDto.getKq(kq));
    }
    skjl.setSignDateStart(start);
    skjl.setSignDateEnd(end);
    Map<String, Object> result =
        commonService.getLessonRecords(page, skjl, Constants.LESSONRECORD_RECORD);
    page = (Page) result.get(Constants.RESULT_MAP_PAGE);
    lessonRecords = (List<Skjl>) result.get(Constants.RESULT_MAP_LIST);
    return SUCCESS;
  }
Пример #6
0
 /**
  * 排课详细内容
  *
  * @return
  */
 public String scheduleDetails() {
   schedule.setId(id);
   schedule = commonService.getSchedule(schedule);
   lessonRecords = commonService.getLessonRecordsBySchedule(schedule);
   return SUCCESS;
 }
 public String lessonGuide() {
   lesson = commonService.getLessonGuide(lesson);
   return SUCCESS;
 }
 /**
  * 上课记录明细
  *
  * @return
  */
 public String recordDetails() {
   skjl.setId(id);
   skjl = commonService.getLessonRecord(skjl);
   feedback = commonService.getFeedbackBySkjl(skjl);
   return SUCCESS;
 }