| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | *作业完成情况 |
| | | *作业完成情况 |
| | | * |
| | | * @author kevin |
| | | * @history 2018-03-11 create kevin |
| | | * |
| | | */ |
| | | @Api(tags="作业完成情况管理接口") |
| | | @Api(tags="作业完成情况管理接口") |
| | | @Controller |
| | | @RequestMapping(value = "/exercise/complete") |
| | | public class ExerciseCompleteController { |
| | | //分页查询中,默认记录条数和页数 |
| | | //分页查询中,默认记录条数和页数 |
| | | private static final int DEFAULT_PAGE_SIZE=10; |
| | | private static final int DEFAULT_PAGE_NUM=1; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 作业完成情况列表 |
| | | * 作业完成情况列表 |
| | | * */ |
| | | @ApiOperation(value = "作业完成情况列表", notes = "") |
| | | @ApiOperation(value = "作业完成情况列表", notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "keyword", value = "学生名称", required = false, paramType="query", dataType = "String"), |
| | | @ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = true, paramType="query", dataType = "String"), |
| | | @ApiImplicitParam(name = "status", value = "状态(0未提交,1待批阅,2已批阅,3需重写)", required = false, paramType="query", dataType = "Short"), |
| | | @ApiImplicitParam(name = "keyword", value = "学生名称", required = false, paramType="query", dataType = "String"), |
| | | @ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = true, paramType="query", dataType = "String"), |
| | | @ApiImplicitParam(name = "status", value = "状态(0未提交,1待批阅,2已批阅,3需重写)", required = false, paramType="query", dataType = "Short"), |
| | | }) |
| | | @RequestMapping(value = "/list", method = RequestMethod.GET) |
| | | public @ResponseBody Result list(String keyword,String exerciseInfoId,Short status,Integer pageSize,Integer pageNum){ |
| | | pageSize = pageSize != null && pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE; |
| | | pageNum = pageNum != null && pageNum > 0 ? pageNum : DEFAULT_PAGE_NUM; |
| | | |
| | | //读取作业信息 |
| | | //读取作业信息 |
| | | ExerciseInfo exerciseInfo = commonService.read(ExerciseInfo.class, exerciseInfoId); |
| | | |
| | | //总考试数量 |
| | | //总考试数量 |
| | | int totalCount = exerciseCompleteService.listCount(keyword == null ? "" : keyword.trim(),exerciseInfoId,status); |
| | | Pager pager = new Pager(pageSize,pageNum); |
| | | pager.setTotalCount(totalCount); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据不同的作业类型,返回作业完成情况及审批详情 |
| | | * 根据不同的作业类型,返回作业完成情况及审批详情 |
| | | * @param exerciseCompleteId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "详情页面数据", notes = "") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "exerciseCompleteId", value = "作业完成情况id", required = true, paramType="query", dataType = "String")}) |
| | | @ApiOperation(value = "详情页面数据", notes = "") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "exerciseCompleteId", value = "作业完成情况id", required = true, paramType="query", dataType = "String")}) |
| | | @RequestMapping(value = "/detail", method = RequestMethod.GET) |
| | | public @ResponseBody Result detail(String exerciseCompleteId) { |
| | | return new Result(true,"",CollectionUtils.newObjectMap("detail",exerciseCompleteService.queryExerciseCompleteDetail(exerciseCompleteId))); |
| | | } |
| | | |
| | | /** |
| | | * 批阅 |
| | | * 批阅 |
| | | * @param exerciseCompleteInfo |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 批阅 |
| | | * 批阅 |
| | | * @param examInfo |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "批阅", notes = "") |
| | | @ApiOperation(value = "批阅", notes = "") |
| | | @RequestMapping(value = "/check", method = RequestMethod.POST) |
| | | public @ResponseBody Result checkExerciseComplateInfo(@RequestBody ExerciseCompleteInfo exerciseCompleteInfo) { |
| | | return exerciseCompleteService.updateExerciseComplete(exerciseCompleteInfo); |
| | | } |
| | | |
| | | /** |
| | | * 批阅下一个 |
| | | * 批阅下一个 |
| | | * @param examInfo |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "批阅下一个", notes = "") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = true, paramType="query", dataType = "String")}) |
| | | @ApiOperation(value = "批阅下一个", notes = "") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = true, paramType="query", dataType = "String")}) |
| | | @RequestMapping(value = "/checknext", method = RequestMethod.GET) |
| | | public @ResponseBody Result checkExerciseComplateInfo(String exerciseInfoId) { |
| | | String hql = "from ExerciseCompleteInfo where exerciseInfoId=? and completeStatus=? and deleteFlag is false order by studentNo asc"; |
| | |
| | | if(lastCompleteInfo!=null){ |
| | | return new Result(true,"",CollectionUtils.newObjectMap("detail",exerciseCompleteService.queryExerciseCompleteDetail(lastCompleteInfo.getExerciseCompleteId()))); |
| | | }else{ |
| | | return new Result(false,"已经没有待批阅的作业!"); |
| | | return new Result(false,"已经没有待批阅的作业!"); |
| | | } |
| | | } |
| | | |