龚焕茏
2024-05-17 03a9cd21c1589e98978dc7296bb7fb48f1dcd7fe
src/main/java/com/mindskip/xzs/controller/admin/ExamPaperAnswerController.java
@@ -8,6 +8,7 @@
import com.mindskip.xzs.domain.ExamPaperSubject;
import com.mindskip.xzs.domain.Subject;
import com.mindskip.xzs.domain.exam.ExamPaperAnswerObject;
import com.mindskip.xzs.domain.vo.ExamPaperStatisticVO;
import com.mindskip.xzs.service.ExamPaperAnswerService;
import com.mindskip.xzs.service.ExamPaperSubjectService;
import com.mindskip.xzs.service.SubjectService;
@@ -18,7 +19,10 @@
import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM;
import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.math.BigDecimal;
@@ -116,8 +120,9 @@
        return RestResponse.ok(object);
    }
    @RequestMapping(value = "/statistic", method = RequestMethod.GET)
    public RestResponse<Map<String, Object>> statistic(String examPaperId, String departmentId) {
        return RestResponse.ok(examPaperAnswerService.statistic(examPaperId, departmentId));
    @RequestMapping(value = "/statistic", method = RequestMethod.POST)
    public RestResponse<Map<String, Object>> statistic(@RequestBody ExamPaperStatisticVO examPaperStatisticVO) {
        examPaperStatisticVO.setDepartmentId(isDeptAdmin() ? getAdminDeptIds() : null);
        return RestResponse.ok(examPaperAnswerService.statistic(examPaperStatisticVO));
    }
}