派生自 projectDept/qhighschool

yn147
2023-05-10 96286178ee1c257c130cb2ad964a781f36c4eee5
src/main/java/com/qxueyou/scc/controller/CourseScheduleController.java
@@ -7,10 +7,7 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.qxueyou.scc.admin.classes.model.ClsClass;
import com.qxueyou.scc.admin.classroom.service.IClassRoomService;
@@ -27,16 +24,17 @@
import io.swagger.annotations.ApiOperation;
/**
 * 班级管理控制器
 * 班级管理控制器
 *
 * @author kevin
 */
@Api(tags="课表接口")
@Api(tags="课表接口")
@Controller
@CrossOrigin(origins="*",maxAge=3600)
@RequestMapping("/admin/schedule")
public class CourseScheduleController {
   
   // 分页查询中,默认记录条数和页数
   // 分页查询中,默认记录条数和页数
   private static final int DEFAULT_PAGE_SIZE = 10;
   private static final int DEFAULT_PAGE_NUM = 1;
@@ -47,16 +45,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 +90,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 +142,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 +191,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 +210,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 +227,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 +298,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);