deason 1 rok pred
rodič
commit
cd67c8dcf6

+ 15 - 21
src/main/java/com/qmth/exam/reserve/controller/student/StudentApplyController.java

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

+ 30 - 0
src/main/java/com/qmth/exam/reserve/service/ExamReserveService.java

@@ -0,0 +1,30 @@
+package com.qmth.exam.reserve.service;
+
+import com.qmth.exam.reserve.bean.RichTextBean;
+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 java.util.List;
+
+public interface ExamReserveService {
+
+    void saveStudentApply(Long studentId, Long examSiteId, Long timePeriodId);
+
+    void cancelStudentApply(Long studentId, Long applyId);
+
+    List<ApplyVO> getStudentApplyList(Long studentId, String includeStatus);
+
+    List<ApplyVO> getStudentApplyListForCurrent(Long studentId);
+
+    TicketInfo getApplyTicket(Long studentId, Long applyId);
+
+    List<String> getApplyDateList(Long studentId);
+
+    ApplyTimePeriodResult getApplyTimePeriodList(Long studentId, Long examSiteId, String date);
+
+    RichTextBean getExamNotice(Long studentId, Long applyId);
+
+    RichTextBean getExamRoomGuide(Long studentId, Long applyId);
+
+}

+ 69 - 0
src/main/java/com/qmth/exam/reserve/service/impl/ExamReserveServiceImpl.java

@@ -0,0 +1,69 @@
+package com.qmth.exam.reserve.service.impl;
+
+import com.qmth.exam.reserve.bean.RichTextBean;
+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.service.ExamReserveService;
+import com.qmth.exam.reserve.service.StudentApplyService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class ExamReserveServiceImpl implements ExamReserveService {
+
+    private static final Logger log = LoggerFactory.getLogger(ExamReserveServiceImpl.class);
+
+    @Autowired
+    private StudentApplyService studentApplyService;
+
+    @Override
+    public void saveStudentApply(Long studentId, Long examSiteId, Long timePeriodId) {
+
+    }
+
+    @Override
+    public void cancelStudentApply(Long studentId, Long applyId) {
+
+    }
+
+    @Override
+    public List<ApplyVO> getStudentApplyList(Long studentId, String includeStatus) {
+        return null;
+    }
+
+    @Override
+    public List<ApplyVO> getStudentApplyListForCurrent(Long studentId) {
+        return null;
+    }
+
+    @Override
+    public TicketInfo getApplyTicket(Long studentId, Long applyId) {
+        return null;
+    }
+
+    @Override
+    public List<String> getApplyDateList(Long studentId) {
+        return null;
+    }
+
+    @Override
+    public ApplyTimePeriodResult getApplyTimePeriodList(Long studentId, Long examSiteId, String date) {
+        return null;
+    }
+
+    @Override
+    public RichTextBean getExamNotice(Long studentId, Long applyId) {
+        return null;
+    }
+
+    @Override
+    public RichTextBean getExamRoomGuide(Long studentId, Long applyId) {
+        return null;
+    }
+
+}