From 2bf92184d4584cac58b76b8d1ea0b3b0ff34b4fb Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 24 五月 2024 13:46:30 +0800
Subject: [PATCH] fix:统计修改
---
src/main/java/com/mindskip/xzs/controller/admin/QuestionController.java | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/mindskip/xzs/controller/admin/QuestionController.java b/src/main/java/com/mindskip/xzs/controller/admin/QuestionController.java
index aca34d0..1dbbad1 100644
--- a/src/main/java/com/mindskip/xzs/controller/admin/QuestionController.java
+++ b/src/main/java/com/mindskip/xzs/controller/admin/QuestionController.java
@@ -18,8 +18,10 @@
import com.mindskip.xzs.domain.enums.QuestionTypeEnum;
import com.mindskip.xzs.domain.question.QuestionItemObject;
import com.mindskip.xzs.domain.question.QuestionObject;
+import com.mindskip.xzs.domain.vo.DeptQuestionVO;
import com.mindskip.xzs.excel.*;
import com.mindskip.xzs.repository.DepartmentMapper;
+import com.mindskip.xzs.repository.DeptQuestionMapper;
import com.mindskip.xzs.repository.SubjectMapper;
import com.mindskip.xzs.service.*;
import com.mindskip.xzs.utility.*;
@@ -55,22 +57,20 @@
private final QuestionService questionService;
private final TextContentService textContentService;
-
private final SubjectMapper subjectMapper;
-
private final DepartmentMapper departmentMapper;
-
private final QuestionSubjectService questionSubjectService;
+ private final DeptQuestionMapper deptQuestionMapper;
private static final String SPLIT = "銆�";
- @Autowired
- public QuestionController(QuestionService questionService, TextContentService textContentService, SubjectMapper subjectMapper, DepartmentMapper departmentMapper, QuestionSubjectService questionSubjectService) {
+ public QuestionController(QuestionService questionService, TextContentService textContentService, SubjectMapper subjectMapper, DepartmentMapper departmentMapper, QuestionSubjectService questionSubjectService, DeptQuestionMapper deptQuestionMapper) {
this.questionService = questionService;
this.textContentService = textContentService;
this.subjectMapper = subjectMapper;
this.departmentMapper = departmentMapper;
this.questionSubjectService = questionSubjectService;
+ this.deptQuestionMapper = deptQuestionMapper;
}
@RequestMapping(value = "/page", method = RequestMethod.POST)
@@ -90,6 +90,9 @@
e.setSubName(subjectMapper.page(subjectPageRequestVM).get(0).getName());
return e;
}).collect(Collectors.toList()));
+ // 鏌ヨ棰樼洰鎵�灞為儴闂�
+ String deptNames = deptQuestionMapper.deptByQuestionId(q.getId()).stream().map(DeptQuestionVO::getDeptName).collect(Collectors.joining("銆�"));
+ vm.setDeptNames(deptNames);
return vm;
});
return RestResponse.ok(page);
@@ -194,9 +197,8 @@
.doWrite(data);
}
- @GetMapping("/question/export")
- public void importQuestion(QuestionExportVO query, HttpServletResponse response) throws IOException {
- query.formartTime();
+ @PostMapping("/question/export")
+ public void exportQuestion(@RequestBody QuestionExportVO query, HttpServletResponse response) throws IOException {
// 鏌ヨ瀵煎嚭鏁版嵁
List<QuestionImportVO> exportData = questionService.export(query);
// 鏋勫缓鏁版嵁
--
Gitblit v1.8.0