From 8245a52ca30b397e5ec6fcefe391e3b57475fb64 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 17 五月 2024 20:27:18 +0800
Subject: [PATCH] fix:部门管理员权限

---
 src/main/java/com/mindskip/xzs/controller/admin/ExamPaperAnswerController.java |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/mindskip/xzs/controller/admin/ExamPaperAnswerController.java b/src/main/java/com/mindskip/xzs/controller/admin/ExamPaperAnswerController.java
index e903f59..6d2281e 100644
--- a/src/main/java/com/mindskip/xzs/controller/admin/ExamPaperAnswerController.java
+++ b/src/main/java/com/mindskip/xzs/controller/admin/ExamPaperAnswerController.java
@@ -18,6 +18,7 @@
 import com.mindskip.xzs.utility.PageInfoHelper;
 import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM;
 import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -122,7 +123,7 @@
 
     @RequestMapping(value = "/statistic", method = RequestMethod.POST)
     public RestResponse<Map<String, Object>> statistic(@RequestBody ExamPaperStatisticVO examPaperStatisticVO) {
-        examPaperStatisticVO.setDepartmentId(isDeptAdmin() ? getAdminDeptIds() : null);
+        examPaperStatisticVO.setDepartmentId(ObjectUtils.isNotEmpty(examPaperStatisticVO.getDepartmentId()) ? examPaperStatisticVO.getDepartmentId() : getAdminDeptIds());
         return RestResponse.ok(examPaperAnswerService.statistic(examPaperStatisticVO));
     }
 }

--
Gitblit v1.8.0