|
@@ -7,17 +7,18 @@ import com.qmth.exam.reserve.bean.apply.ApplyTimePeriodResult;
|
|
|
import com.qmth.exam.reserve.bean.apply.ApplyVO;
|
|
|
import com.qmth.exam.reserve.bean.apply.TicketInfo;
|
|
|
import com.qmth.exam.reserve.controller.BaseController;
|
|
|
+import com.qmth.exam.reserve.service.ExamReserveService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController("stuApplyController")
|
|
@@ -28,70 +29,63 @@ public class StudentApplyController extends BaseController {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(StudentApplyController.class);
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ExamReserveService examReserveService;
|
|
|
+
|
|
|
@ApiOperation(value = "保存考生预约结果")
|
|
|
@PostMapping(value = "/apply/save")
|
|
|
public void save(@ApiParam("考点ID") @RequestParam Long examSiteId,
|
|
|
@ApiParam("预约时段ID") @RequestParam Long timePeriodId) {
|
|
|
- //todo
|
|
|
+ examReserveService.saveStudentApply(curLoginStudent().getId(), examSiteId, timePeriodId);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "取消考生预约结果")
|
|
|
@PostMapping(value = "/apply/cancel")
|
|
|
public void cancel(@ApiParam("预约ID") @RequestParam Long applyId) {
|
|
|
- //todo
|
|
|
+ examReserveService.cancelStudentApply(curLoginStudent().getId(), applyId);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取考生预约结果列表(个人中心)")
|
|
|
@PostMapping(value = "/apply/list")
|
|
|
- public List<ApplyVO> list(@ApiParam("包含状态:多个值逗号分隔;不填时代表全部状态") @RequestParam String includeStatus) {
|
|
|
- //todo
|
|
|
- return new ArrayList<>();
|
|
|
+ public List<ApplyVO> list(@ApiParam("包含状态:多个值逗号分隔;不填时代表全部状态") @RequestParam(required = false) String includeStatus) {
|
|
|
+ return examReserveService.getStudentApplyList(curLoginStudent().getId(), includeStatus);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取考生当前进行中的预约列表(首页)")
|
|
|
@PostMapping(value = "/apply/list/for/current")
|
|
|
public List<ApplyVO> listForCurrent() {
|
|
|
- //todo
|
|
|
- return new ArrayList<>();
|
|
|
+ return examReserveService.getStudentApplyListForCurrent(curLoginStudent().getId());
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取考生预约-电子准考证")
|
|
|
@PostMapping(value = "/apply/ticket")
|
|
|
public TicketInfo ticket(@ApiParam("预约ID") @RequestParam Long applyId) {
|
|
|
- //todo
|
|
|
- return new TicketInfo();
|
|
|
+ return examReserveService.getApplyTicket(curLoginStudent().getId(), applyId);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取考试须知")
|
|
|
@PostMapping(value = "/exam/notice")
|
|
|
public RichTextBean examNotice(@ApiParam("预约ID") @RequestParam Long applyId) {
|
|
|
- //todo
|
|
|
- return new RichTextBean();
|
|
|
+ return examReserveService.getExamNotice(curLoginStudent().getId(), applyId);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取考场引导")
|
|
|
@PostMapping(value = "/exam/room/guide")
|
|
|
public RichTextBean examRoomGuide(@ApiParam("预约ID") @RequestParam Long applyId) {
|
|
|
- //todo
|
|
|
- return new RichTextBean();
|
|
|
+ return examReserveService.getExamRoomGuide(curLoginStudent().getId(), applyId);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取可预约的“日期”列表")
|
|
|
@PostMapping(value = "/apply/date/list")
|
|
|
public List<String> dateList() {
|
|
|
- List<String> dateList = new ArrayList<>();
|
|
|
- dateList.add("20240401");
|
|
|
- //todo
|
|
|
- return dateList;
|
|
|
+ return examReserveService.getApplyDateList(curLoginStudent().getId());
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取可预约的“时段”列表")
|
|
|
@PostMapping(value = "/apply/time/period/list")
|
|
|
public ApplyTimePeriodResult timePeriodList(@ApiParam("考点ID") @RequestParam Long examSiteId,
|
|
|
@ApiParam("预约日期:yyyyMMdd") @RequestParam String date) {
|
|
|
- ApplyTimePeriodResult result = new ApplyTimePeriodResult();
|
|
|
- //todo
|
|
|
- return result;
|
|
|
+ return examReserveService.getApplyTimePeriodList(curLoginStudent().getId(), examSiteId, date);
|
|
|
}
|
|
|
|
|
|
}
|