Kaynağa Gözat

组卷区分班级统计及增加试卷名称显示

mingfu 2 hafta önce
ebeveyn
işleme
bd87d62d2e

+ 16 - 2
ie-admin/src/main/java/com/ruoyi/web/controller/learn/LearnTeacherController.java

@@ -18,9 +18,10 @@ import com.ruoyi.dz.service.IDzSubjectService;
 import com.ruoyi.enums.PaperBuildStatus;
 import com.ruoyi.enums.QuestionType;
 import com.ruoyi.learn.domain.*;
-import com.ruoyi.learn.service.ILearnPaperQuestionService;
 import com.ruoyi.learn.service.ILearnPaperService;
 import com.ruoyi.learn.service.ILearnTestPaperService;
+import com.ruoyi.syzy.domain.BBusiWishUniversities;
+import com.ruoyi.syzy.mapper.BBusiWishUniversitiesMapper;
 import com.ruoyi.web.service.LearnTeacherService;
 import com.ruoyi.web.service.PaperService;
 import io.swagger.annotations.Api;
@@ -32,6 +33,7 @@ import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 @RestController
@@ -44,14 +46,16 @@ public class LearnTeacherController extends BaseController {
     private final PaperService paperService;
     private final ILearnPaperService learnPaperService;
     private final ILearnTestPaperService testPaperService;
+    private final BBusiWishUniversitiesMapper busiWishUniversitiesMapper;
 
-    public LearnTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, LearnTeacherService learnTeacherService, PaperService paperService, ILearnPaperService learnPaperService, ILearnTestPaperService testPaperService) {
+    public LearnTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, LearnTeacherService learnTeacherService, PaperService paperService, ILearnPaperService learnPaperService, ILearnTestPaperService testPaperService, BBusiWishUniversitiesMapper busiWishUniversitiesMapper) {
         this.dzControlService = dzControlService;
         this.dzSubjectService = dzSubjectService;
         this.learnTeacherService = learnTeacherService;
         this.paperService = paperService;
         this.learnPaperService = learnPaperService;
         this.testPaperService = testPaperService;
+        this.busiWishUniversitiesMapper = busiWishUniversitiesMapper;
     }
 
 
@@ -116,10 +120,20 @@ public class LearnTeacherController extends BaseController {
             return AjaxResult.success(Collections.emptyList());
         }
         List<JSONObject> resultList = new ArrayList<>();
+
+        Map uCond = new HashMap();
+        uCond.put("ids", testPaperList.stream().map(LearnTestPaper::getUniversityId).collect(Collectors.toSet()));
+        Map<Long, BBusiWishUniversities> universityMap = busiWishUniversitiesMapper.selectBBusiWishUniversitiesListSimpleByIds(uCond).stream().collect(Collectors.toMap(BBusiWishUniversities::getId, Function.identity()));
         for(LearnTestPaper learnTestPaper : testPaperList) {
             PaperVO paperVO = paperService.loadPaper(learnTestPaper.getPaperId());
             JSONObject root = JSONObject.from(paperVO);
             root.remove("id");
+            BBusiWishUniversities u = universityMap.get(learnTestPaper.getUniversityId());
+            if(null != u) {
+                String paperName = paperVO.getPaperName().replaceAll(paperVO.getDirectKey(), "");
+                paperName += u.getName() + "_" + ExamType.valueOf(learnTestPaper.getExamType()).title();
+                root.put("paperName", paperName);
+            }
             root.put("paperId", learnTestPaper.getPaperId());
             resultList.add(root);
         }

+ 1 - 0
ie-admin/src/main/java/com/ruoyi/web/service/LearnTeacherService.java

@@ -235,6 +235,7 @@ public class LearnTeacherService {
                     saveHandPaper(paper, req.getQuestions());
                 } else {
                     LearnDirectedKnowledge directedKnowledge = directedKnowledgeMap.get(directedKey);
+                    examType = directedKnowledge.getExamineeTypes();
                     TestPaperVO.PaperDef2 paperDef = new TestPaperVO.PaperDef2(directedKnowledge.getKnowledges(), directedKnowledge.getConditions());
                     paperDef.setFillExclude(false);
                     AnswerSheet.PaperCond info = new AnswerSheet.PaperCond();

+ 2 - 2
ie-system/src/main/resources/mapper/dz/DzClassesMapper.xml

@@ -39,7 +39,7 @@
         join `dz_classes` c on ls.`class_id` = c.`class_id`
         JOIN `sys_user` u ON ls.`student_id` = u.`user_id`
         join `learn_test` lt on lt.`year` = #{year} <if test="batchId != null"> and lt.`batch_id` =  #{batchId} </if>
-        LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` AND ts.`batch_id` = lt.`batch_id`
+        LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` AND ts.`batch_id` = lt.`batch_id` AND ts.`class_id` = tc.`class_id`
             <if test="buildType != null"> AND ts.`build_type` = #{buildType} </if>
             <if test="subjectId != null"> and ts.`subject_id` = #{subjectId} </if>
         <where>tc.`teacher_id` = #{teacherId}
@@ -64,7 +64,7 @@
          JOIN sys_user u ON ls.`student_id` = u.`user_id`
          join `dz_classes` c on ls.`class_id` = c.`class_id`
          join `learn_test` lt on lt.`year` = #{year} <if test="batchId != null"> and lt.`batch_id` =  #{batchId} </if>
-         LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id`
+         LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` AND ts.`class_id` = tc.`class_id`
             <if test="batchId != null"> and ts.`batch_id` =  #{batchId} </if>
             <if test="buildType != null"> AND ts.`build_type` = #{buildType} </if>
             <if test="subjectId != null"> and ts.`subject_id` = #{subjectId} </if>