| | |
| | | * @author kevin |
| | | * @history 2018-03-11 create kevin |
| | | */ |
| | | @Api(tags = "试卷部分管理接口") |
| | | @Api(tags = "试卷部分管理接口") |
| | | @Controller |
| | | @RequestMapping(value = "/exam/papersection") |
| | | public class ExamPaperSectionController { |
| | | //分页查询中,默认记录条数和页数 |
| | | //分页查询中,默认记录条数和页数 |
| | | private static final int DEFAULT_PAGE_SIZE = Integer.MAX_VALUE; |
| | | private static final int DEFAULT_PAGE_NUM = 1; |
| | | |
| | |
| | | IExerciseGroupService exerciseGroupService; |
| | | |
| | | /** |
| | | * 试卷部分列表 |
| | | * 试卷部分列表 |
| | | */ |
| | | @RequestMapping(value = "/list", method = RequestMethod.GET) |
| | | public @ResponseBody |
| | | Result pageList(String examPaperId, Integer pageSize, Integer pageNum) { |
| | | Result result = new Result(Boolean.TRUE); |
| | | Pager pager = new Pager(); |
| | | // 查询记录数 |
| | | // 查询记录数 |
| | | String hqlCount = "from ExamPaperSectionInfo where examPaperId=? and deleteFlag is false"; |
| | | int totalCount = commonDAO.findCount(hqlCount, CollectionUtils.newList(examPaperId)); |
| | | |
| | | // 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 examPaperSectionId |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 保存 |
| | | * 保存 |
| | | * |
| | | * @param examPaperSectionInfo |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * 删除 |
| | | * |
| | | * @param examPaperSectionIds |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 设置题库 |
| | | * 设置题库 |
| | | * |
| | | * @param examPaperSectionInfo |
| | | * @return |
| | |
| | | public @ResponseBody |
| | | Result saveSectionGroup(String sectionId, String selectedGroupIds, String selectedItemTypes) throws Exception { |
| | | if (StringUtils.isEmpty(sectionId) || StringUtils.isEmpty(selectedGroupIds) || StringUtils.isEmpty(selectedItemTypes)) { |
| | | return new Result(false, "请求参数错误!"); |
| | | return new Result(false, "请求参数错误!"); |
| | | } |
| | | |
| | | String[] arrGroupIds = selectedGroupIds.split(","); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自主选题 |
| | | * 自主选题 |
| | | * |
| | | * @param examPaperSectionInfo |
| | | * @return |
| | |
| | | public @ResponseBody |
| | | Result saveSectionSeletedItems(String sectionId, String sourceGroupId, String selectedItemIds) throws Exception { |
| | | if (StringUtils.isEmpty(sectionId) || StringUtils.isEmpty(sourceGroupId) || StringUtils.isEmpty(selectedItemIds)) { |
| | | return new Result(false, "请求参数错误!"); |
| | | return new Result(false, "请求参数错误!"); |
| | | } |
| | | |
| | | String[] arrItemIds = selectedItemIds.split(","); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 交换题目顺序 |
| | | * 交换题目顺序 |
| | | * |
| | | * @param examPaperSectionInfo |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除题目 |
| | | * 删除题目 |
| | | * |
| | | * @param examPaperSectionInfo |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 考试保存题目 |
| | | * 考试保存题目 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * 查询当前题组中被选中的题目ID |
| | | * 查询当前题组中被选中的题目ID |
| | | */ |
| | | @RequestMapping(value = "/group/itemIds", method = RequestMethod.GET) |
| | | public @ResponseBody |