| | |
| | | * @history 2018-03-11 create kevin |
| | | * |
| | | */ |
| | | @Api(tags="试卷管理接口") |
| | | @Api(tags="试卷管理接口") |
| | | @Controller |
| | | @RequestMapping(value = "/exam/paper") |
| | | public class ExamPaperController { |
| | | //分页查询中,默认记录条数和页数 |
| | | //分页查询中,默认记录条数和页数 |
| | | private static final int DEFAULT_PAGE_SIZE=Integer.MAX_VALUE; |
| | | private static final int DEFAULT_PAGE_NUM=1; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 试卷列表 |
| | | * 试卷列表 |
| | | * */ |
| | | @RequestMapping(value = "/list", method = RequestMethod.GET) |
| | | public @ResponseBody Result pageList(String keyword,Short status, Integer pageSize,Integer pageNum){ |
| | | Result result = new Result(Boolean.TRUE); |
| | | Pager pager = new Pager(); |
| | | List<Object> queryParamLst = null; |
| | | // 查询记录数 |
| | | // 查询记录数 |
| | | String hqlCount="from ExamPaperInfo where createId=? and examPaperName like ? and deleteFlag is false"; |
| | | if(status!=null){ |
| | | hqlCount = hqlCount.concat(" and paperStatus = ?"); |
| | |
| | | } |
| | | int totalCount = commonDAO.findCount(hqlCount,queryParamLst); |
| | | |
| | | // page赋值 |
| | | // page赋值 |
| | | pager.setTotalCount(totalCount); |
| | | pager.setPageSize(pageSize!=null&&pageSize>0?pageSize:DEFAULT_PAGE_SIZE); |
| | | pager.setPageNum (pageNum!=null&&pageNum>0?pageNum:DEFAULT_PAGE_NUM); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 详情页面数据 |
| | | * 详情页面数据 |
| | | * @param examPaperId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 保存 |
| | | * 保存 |
| | | * |
| | | * @param examInfo |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * 删除 |
| | | * @param examPaperIds |
| | | * @return |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * 发布试卷 |
| | | * 发布试卷 |
| | | * |
| | | * @param exerciseIds |
| | | * @return |
| | |
| | | @RequestMapping(value = "/publish", method = RequestMethod.GET) |
| | | public @ResponseBody Result publishExamPaper(String examPaperIds) { |
| | | if (StringUtils.isEmpty(examPaperIds)) { |
| | | return new Result(false, "参数错误"); |
| | | return new Result(false, "参数错误"); |
| | | } |
| | | return this.examPaperService.doPublishExamPaper(examPaperIds.split(",")); |
| | | } |
| | | |
| | | /** |
| | | * 撤回试卷 |
| | | * 撤回试卷 |
| | | * |
| | | * @param exerciseIds |
| | | * @return |
| | |
| | | @RequestMapping(value = "/revoke", method = RequestMethod.GET) |
| | | public @ResponseBody Result revokeExamPaper(String examPaperIds) { |
| | | if (StringUtils.isEmpty(examPaperIds)) { |
| | | return new Result(false, "参数错误"); |
| | | return new Result(false, "参数错误"); |
| | | } |
| | | return this.examPaperService.doRevokeExamPaper(examPaperIds.split(",")); |
| | | } |