派生自 projectDept/qhighschool

EricsHu
2022-12-05 068fc7f2e81178e55fa191a13709af64b1a163f6
src/main/java/com/qxueyou/scc/controller/CourseScheduleController.java
@@ -27,16 +27,16 @@
import io.swagger.annotations.ApiOperation;
/**
 * 班级管理控制器
 * 班级管理控制器
 *
 * @author kevin
 */
@Api(tags="课表接口")
@Api(tags="课表接口")
@Controller
@RequestMapping("/admin/schedule")
public class CourseScheduleController {
   
   // 分页查询中,默认记录条数和页数
   // 分页查询中,默认记录条数和页数
   private static final int DEFAULT_PAGE_SIZE = 10;
   private static final int DEFAULT_PAGE_NUM = 1;
@@ -47,16 +47,16 @@
    IClassRoomService classRoomService;
    
    /**
    * 课表列表
    * 课表列表
    */
    @SuppressWarnings("unchecked")
   @ApiOperation(value = "获取课表列表")
   @ApiOperation(value = "获取课表列表")
   @RequestMapping(value = "list", method = RequestMethod.GET)
   public @ResponseBody Result list(String keyword,Short status,Integer pageSize,Integer pageNum) {
      pageSize = pageSize != null && pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE;
      pageNum = pageNum != null && pageNum > 0 ? pageNum : DEFAULT_PAGE_NUM;
      
      //总考试数量
      //总考试数量
      int totalCount = scheduleService.listCount(keyword, status);
      Pager pager = new Pager(pageSize,pageNum);
      pager.setTotalCount(totalCount);
@@ -92,16 +92,16 @@
   }
    
    /**
      * 课表列表
      * 课表列表
     * @throws ParseException 
      */
    @ApiOperation(value = "教师获取当天课表信息")
    @ApiOperation(value = "教师获取当天课表信息")
     @RequestMapping(value = "teacher/list", method = RequestMethod.GET)
     public @ResponseBody Result teacherList(String date,Integer pageSize,Integer pageNum) throws Exception {
        pageSize = pageSize != null && pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE;
        pageNum = pageNum != null && pageNum > 0 ? pageNum : DEFAULT_PAGE_NUM;
        
        //总考试数量
        //总考试数量
        int totalCount = scheduleService.listTeacherOfScheduleCount(date, pageSize, pageNum);
        Pager pager = new Pager(pageSize,pageNum);
        pager.setTotalCount(totalCount);
@@ -144,16 +144,16 @@
    
    
    /**
      * 课表列表
      * 课表列表
     * @throws ParseException 
      */
    @ApiOperation(value = "学生获取当天课表信息")
    @ApiOperation(value = "学生获取当天课表信息")
     @RequestMapping(value = "student/list", method = RequestMethod.GET)
     public @ResponseBody Result studentList(String date,Integer pageSize,Integer pageNum) throws Exception {
        pageSize = pageSize != null && pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE;
        pageNum = pageNum != null && pageNum > 0 ? pageNum : DEFAULT_PAGE_NUM;
        
        //总考试数量
        //总考试数量
        int totalCount = scheduleService.listStudentScheduleCount(date, pageSize, pageNum);
        Pager pager = new Pager(pageSize,pageNum);
        pager.setTotalCount(totalCount);
@@ -193,13 +193,13 @@
     }
     
   /**
    * 保存
    * 保存
    * 
    * @param examInfo
    * @return
    * @throws Exception 
    */
    @ApiOperation(value = "保存课表")
    @ApiOperation(value = "保存课表")
   @RequestMapping(value = "/save", method = RequestMethod.POST)
   public @ResponseBody Result save(@RequestBody CourseSchedule courseSchedule) throws Exception {
       if (StringUtils.isEmpty(courseSchedule.getScheduleId())) {
@@ -212,13 +212,13 @@
   }
   /**
    * 删除
    * 删除
    * 
    * @param examIds
    * @return
    */
   @ApiOperation(value = "删除课表", httpMethod = "GET")
   @ApiImplicitParam(name = "scheduleIds", value = "课表ID字符串", required = true, dataType = "String", paramType = "body")
   @ApiOperation(value = "删除课表", httpMethod = "GET")
   @ApiImplicitParam(name = "scheduleIds", value = "课表ID字符串", required = true, dataType = "String", paramType = "body")
   @RequestMapping(value = "delete", method = RequestMethod.GET)
   public @ResponseBody Result delete(String scheduleIds) {
      Result result = new Result(true);
@@ -229,47 +229,47 @@
   }
   
   /**
    * 发布课表
    * 发布课表
    * 
    * @param scheduleIds
    * @return
    */
   @ApiOperation(value = "发布课表")
   @ApiOperation(value = "发布课表")
   @RequestMapping(value = "/publish", method = RequestMethod.GET)
   public @ResponseBody Result publish(String scheduleIds) {
      if (StringUtils.isEmpty(scheduleIds)) {
         return new Result(false, "参数错误");
         return new Result(false, "参数错误");
      }
      return this.scheduleService.doRelease(scheduleIds.split(","));
   }
   /**
    * 撤回课表
    * 撤回课表
    * 
    * @param scheduleIds
    * @return
    */
   @ApiOperation(value = "撤回课表")
   @ApiOperation(value = "撤回课表")
   @RequestMapping(value = "/cancel", method = RequestMethod.GET)
   public @ResponseBody Result cancel(String scheduleIds) {
      if (StringUtils.isEmpty(scheduleIds)) {
         return new Result(false, "参数错误");
         return new Result(false, "参数错误");
      }
      
      return this.scheduleService.doCancel(scheduleIds.split(","));
   }
   
   /**
    * 课表详情
    * 课表详情
    * 
    * @param scheduleIds
    * @return
    */
   @ApiOperation(value = "课表详情")
   @ApiOperation(value = "课表详情")
   @RequestMapping(value = "/detail", method = RequestMethod.GET)
   public @ResponseBody Result detail(String scheduleId) {
      if (StringUtils.isEmpty(scheduleId)) {
         return new Result(false, "参数错误");
         return new Result(false, "参数错误");
      }
      
      CourseSchedule sche =  this.scheduleService.detail(scheduleId);
@@ -300,16 +300,16 @@
   }
   
   /**
    * 标记有课的日期
    * 标记有课的日期
    * 
    * @param scheduleIds
    * @return
    */
   @ApiOperation(value = "教师课表是否有课标识查询")
   @ApiOperation(value = "教师课表是否有课标识查询")
   @RequestMapping(value = "teacher/flag", method = RequestMethod.GET)
   public @ResponseBody Result listTeacherDateFlag(Integer year,Integer month) {
      if (year==null || month==null) {
         return new Result(false, "参数错误");
         return new Result(false, "参数错误");
      }
      
      List<Integer> listResult =  this.scheduleService.queryDateFlag(year, month);