Explorar o código

Merge branch 'dev' of https://git.yingcaibx.com/tl/api into dev

brealinxx hai 1 ano
pai
achega
8e5836b0d7

+ 3 - 2
src/main/java/com/xjrsoft/module/assessment/controller/AssessmentPlanAnswerController.java

@@ -18,6 +18,7 @@ import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerStudentVo;
 import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerTeacherPageVo;
 import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanPageVo;
 import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanQuestionVo;
+import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanResultVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -140,8 +141,8 @@ public class AssessmentPlanAnswerController {
     @GetMapping(value="question-result")
     @ApiOperation(value = "每道题的答题情况")
     @SaCheckPermission("assessmenttemplateplan:question-result")
-    public RT<AssessmentTemplatePlanQuestionVo> questionResult(@RequestParam Long id){
-        AssessmentTemplatePlanQuestionVo resultList = planService.getQuestionResult(id);
+    public RT<AssessmentTemplatePlanResultVo> questionResult(@RequestParam Long id){
+        AssessmentTemplatePlanResultVo resultList = planService.getQuestionResult(id);
         return RT.ok(resultList);
     }
 

+ 6 - 0
src/main/java/com/xjrsoft/module/assessment/controller/AssessmentTemplatePlanController.java

@@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -117,6 +118,11 @@ public class AssessmentTemplatePlanController {
         if(templatePlan == null){
             throw new MyException("未能找到场所信息");
         }
+        if(dto.getStatus() == 1){
+            templatePlan.setStartTime(new Date());
+        }else if(dto.getStatus() == 2){
+            templatePlan.setEndTime(new Date());
+        }
         templatePlan.setStatus(dto.getStatus());
         planService.updateById(templatePlan);
         return RT.ok(true);

+ 2 - 0
src/main/java/com/xjrsoft/module/assessment/mapper/AssessmentPlanAnswerResultMapper.java

@@ -25,4 +25,6 @@ public interface AssessmentPlanAnswerResultMapper extends MPJBaseMapper<Assessme
     List<AssessmentPlanAnswerClassResultVo> getClassResult(Long id);
 
     List<AssessmentPlanAnswerDetailVo> getQuestionResult(Long id);
+
+    List<AssessmentPlanAnswerDetailVo> getScaleQuestionResult(Long id);
 }

+ 2 - 1
src/main/java/com/xjrsoft/module/assessment/service/IAssessmentTemplatePlanService.java

@@ -17,6 +17,7 @@ import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerStudentVo;
 import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerTeacherPageVo;
 import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanPageVo;
 import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanQuestionVo;
+import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanResultVo;
 
 import java.util.List;
 
@@ -84,7 +85,7 @@ public interface IAssessmentTemplatePlanService extends MPJBaseService<Assessmen
 
     List<AssessmentPlanAnswerClassResultVo> getClassResult(Long id);
 
-    AssessmentTemplatePlanQuestionVo getQuestionResult(Long id);
+    AssessmentTemplatePlanResultVo getQuestionResult(Long id);
 
 
     Boolean sendMsg(AssessmentTemplatePlanSureDto dto);

+ 151 - 81
src/main/java/com/xjrsoft/module/assessment/service/impl/AssessmentTemplatePlanServiceImpl.java

@@ -43,10 +43,16 @@ import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerDetailVo;
 import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerStudentPageVo;
 import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerStudentVo;
 import com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerTeacherPageVo;
+import com.xjrsoft.module.assessment.vo.AssessmentQuestionOptionResultVo;
 import com.xjrsoft.module.assessment.vo.AssessmentQuestionResultVo;
 import com.xjrsoft.module.assessment.vo.AssessmentQuestionVo;
 import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanPageVo;
 import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanQuestionVo;
+import com.xjrsoft.module.assessment.vo.AssessmentTemplatePlanResultVo;
+import com.xjrsoft.module.assessment.vo.OneQuestionVo;
+import com.xjrsoft.module.assessment.vo.TwoQuestionVo;
+import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
 import com.xjrsoft.module.organization.service.IWeChatService;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
@@ -56,6 +62,8 @@ import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
@@ -72,7 +80,8 @@ import java.util.Random;
 */
 @Service
 @AllArgsConstructor
-public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<AssessmentTemplatePlanMapper, AssessmentTemplatePlan> implements IAssessmentTemplatePlanService {
+public
+class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<AssessmentTemplatePlanMapper, AssessmentTemplatePlan> implements IAssessmentTemplatePlanService {
     private final AssessmentTemplatePlanMapper templatePlanMapper;
 
     private final AssessmentPlanQuestionMapper planQuestionMapper;
@@ -84,6 +93,7 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
     private final XjrUserMapper xjrUserMapper;
     private final IWeChatService weChatService;
     private final CommonPropertiesConfig commonPropertiesConfig;
+    private final BaseClassMapper baseClassMapper;
 
 
     @Override
@@ -111,6 +121,30 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
             planQuestion.setAssessmentTemplatePlanId(assessmentTemplatePlan.getId());
             planQuestionMapper.insert(planQuestion);
         }
+        List<BaseClass> classList = baseClassMapper.selectList(
+            new QueryWrapper<BaseClass>().lambda()
+            .eq(BaseClass::getDeleteMark, DeleteMark.NODELETE.getCode())
+            .eq(BaseClass::getIsGraduate, 1)
+        );
+        List<Long> classIds = new ArrayList<>();
+        if("all".equals(dto.getType())){
+            for (BaseClass baseClass : classList) {
+                classIds.add(baseClass.getId());
+            }
+        }else if("random".equals(dto.getType())){
+            List<Integer> randomList = new ArrayList<>();
+            Random random = new Random();
+            while(randomList.size() < dto.getRandomNumber()){
+                int nextInt = random.nextInt(classList.size());
+                if(!randomList.contains(nextInt) && nextInt >= 0){
+                    randomList.add(nextInt);
+
+                }
+            }
+            for (Integer i : randomList) {
+                classIds.add(classList.get(i).getId());
+            }
+        }
 
         //存入班级,并根据选人方式存入答题学生
         for (Long classId : dto.getClassIds()) {
@@ -123,29 +157,7 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
             query.leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, XjrUser::getId)
             .eq(BaseStudentSchoolRoll::getClassId, classId);
             List<XjrUser> studentList = xjrUserMapper.selectJoinList(XjrUser.class, query);
-            List<XjrUser> needStudentList = new ArrayList<>();
-            if("all".equals(dto.getType())){
-                needStudentList.addAll(studentList);
-            }else if("random".equals(dto.getType())){
-                int maxCount = studentList.size();//班级最大人数
-                if(dto.getRandomNumber() > maxCount){
-                    needStudentList.addAll(studentList);
-                }else{
-                    List<Integer> randomList = new ArrayList<>();
-                    Random random = new Random();
-                    while(randomList.size() < dto.getRandomNumber()){
-                        int nextInt = random.nextInt(studentList.size());
-                        if(!randomList.contains(nextInt) && nextInt >= 0){
-                            randomList.add(nextInt);
-
-                        }
-                    }
-                    for (Integer i : randomList) {
-                        needStudentList.add(studentList.get(i));
-                    }
-                }
-            }
-            for (XjrUser xjrUser : needStudentList) {
+            for (XjrUser xjrUser : studentList) {
                 AssessmentPlanAnswerStudent answer = new AssessmentPlanAnswerStudent();
                 answer.setAssessmentTemplatePlanId(assessmentTemplatePlan.getId());
                 answer.setStudentUserId(xjrUser.getId());
@@ -187,6 +199,30 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
         //删除班级和学生
         answerClassMapper.deleteByPlanId(assessmentTemplatePlan.getId(), StpUtil.getLoginIdAsLong());
         studentMapper.deleteByPlanId(assessmentTemplatePlan.getId(), StpUtil.getLoginIdAsLong());
+        List<BaseClass> classList = baseClassMapper.selectList(
+            new QueryWrapper<BaseClass>().lambda()
+            .eq(BaseClass::getDeleteMark, DeleteMark.NODELETE.getCode())
+            .eq(BaseClass::getIsGraduate, 1)
+        );
+        List<Long> classIds = new ArrayList<>();
+        if("all".equals(dto.getType())){
+            for (BaseClass baseClass : classList) {
+                classIds.add(baseClass.getId());
+            }
+        }else if("random".equals(dto.getType())){
+            List<Integer> randomList = new ArrayList<>();
+            Random random = new Random();
+            while(randomList.size() < dto.getRandomNumber()){
+                int nextInt = random.nextInt(classList.size());
+                if(!randomList.contains(nextInt) && nextInt >= 0){
+                    randomList.add(nextInt);
+                }
+            }
+            for (Integer i : randomList) {
+                classIds.add(classList.get(i).getId());
+            }
+        }
+
         //存入班级,并根据选人方式存入答题学生
         for (Long classId : dto.getClassIds()) {
             AssessmentPlanAnswerClass answerClass = new AssessmentPlanAnswerClass();
@@ -198,29 +234,7 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
             query.leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, XjrUser::getId)
                     .eq(BaseStudentSchoolRoll::getClassId, classId);
             List<XjrUser> studentList = xjrUserMapper.selectJoinList(XjrUser.class, query);
-            List<XjrUser> needStudentList = new ArrayList<>();
-            if("all".equals(dto.getType())){
-                needStudentList.addAll(studentList);
-            }else if("random".equals(dto.getType())){
-                int maxCount = studentList.size();//班级最大人数
-                if(dto.getRandomNumber() > maxCount){
-                    needStudentList.addAll(studentList);
-                }else{
-                    List<Integer> randomList = new ArrayList<>();
-                    Random random = new Random();
-                    while(randomList.size() < dto.getRandomNumber()){
-                        int nextInt = random.nextInt(studentList.size());
-                        if(!randomList.contains(nextInt) && nextInt >= 0){
-                            randomList.add(nextInt);
-
-                        }
-                    }
-                    for (Integer i : randomList) {
-                        needStudentList.add(studentList.get(i));
-                    }
-                }
-            }
-            for (XjrUser xjrUser : needStudentList) {
+            for (XjrUser xjrUser : studentList) {
                 AssessmentPlanAnswerStudent answer = new AssessmentPlanAnswerStudent();
                 answer.setAssessmentTemplatePlanId(assessmentTemplatePlan.getId());
                 answer.setStudentUserId(xjrUser.getId());
@@ -335,17 +349,42 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
     public Boolean saveAnswer(AssessmentPlanSubmitDto dto) {
         long studentUserId = StpUtil.getLoginIdAsLong();
         Date date = new Date();
+
+        List<Long> questionIds = new ArrayList<>();
+        for (AssessmentPlanAnswerSubmitDto answerSubmitDto : dto.getAnswerList()) {
+            questionIds.add(answerSubmitDto.getQuestionId());
+        }
+        Map<Long, String> questionTypeMaps = new HashMap<>();
+        planQuestionMapper.selectList(
+            new QueryWrapper<AssessmentPlanQuestion>().lambda()
+            .in(AssessmentPlanQuestion::getId, questionIds)
+        ).forEach(question ->{
+            questionTypeMaps.put(question.getId(), question.getType());
+        });
+
         // 学生提交
         studentMapper.submitAnswer(dto.getAssessmentTemplatePlanId(), studentUserId);
         for (AssessmentPlanAnswerSubmitDto answerSubmitDto : dto.getAnswerList()) {
-            AssessmentPlanAnswerResult answerStudent = new AssessmentPlanAnswerResult();
-            answerStudent.setAssessmentTemplatePlanId(dto.getAssessmentTemplatePlanId());
-            answerStudent.setStudentUserId(studentUserId);
-            answerStudent.setCreateDate(date);
-            answerStudent.setQuestionId(answerSubmitDto.getQuestionId());
-            answerStudent.setAnswerId(answerSubmitDto.getAnswerId());
-            resultMapper.insert(answerStudent);
-
+            if("multi_question".equals(questionTypeMaps.get(answerSubmitDto.getQuestionId()))){
+                String[] split = answerSubmitDto.getAnswerId().split(",");
+                for (String answerId : split) {
+                    AssessmentPlanAnswerResult answerStudent = new AssessmentPlanAnswerResult();
+                    answerStudent.setAssessmentTemplatePlanId(dto.getAssessmentTemplatePlanId());
+                    answerStudent.setStudentUserId(studentUserId);
+                    answerStudent.setCreateDate(date);
+                    answerStudent.setQuestionId(answerSubmitDto.getQuestionId());
+                    answerStudent.setAnswerId(answerId);
+                    resultMapper.insert(answerStudent);
+                }
+            }else{
+                AssessmentPlanAnswerResult answerStudent = new AssessmentPlanAnswerResult();
+                answerStudent.setAssessmentTemplatePlanId(dto.getAssessmentTemplatePlanId());
+                answerStudent.setStudentUserId(studentUserId);
+                answerStudent.setCreateDate(date);
+                answerStudent.setQuestionId(answerSubmitDto.getQuestionId());
+                answerStudent.setAnswerId(answerSubmitDto.getAnswerId());
+                resultMapper.insert(answerStudent);
+            }
         }
 
         return true;
@@ -376,65 +415,96 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
     }
 
     @Override
-    public AssessmentTemplatePlanQuestionVo getQuestionResult(Long id) {
+    public AssessmentTemplatePlanResultVo getQuestionResult(Long id) {
         AssessmentTemplatePlan templatePlan = templatePlanMapper.selectById(id);
-        AssessmentTemplatePlanQuestionVo vo = BeanUtil.toBean(templatePlan, AssessmentTemplatePlanQuestionVo.class);
+        AssessmentTemplatePlanResultVo vo = BeanUtil.toBean(templatePlan, AssessmentTemplatePlanResultVo.class);
         vo.setStudentCount(studentMapper.getStudentCount(id));
         List<AssessmentPlanQuestion> questionList = planQuestionMapper.selectList(
             new QueryWrapper<AssessmentPlanQuestion>().lambda()
             .eq(AssessmentPlanQuestion::getDeleteMark, DeleteMark.NODELETE.getCode())
             .eq(AssessmentPlanQuestion::getAssessmentTemplatePlanId, id)
         );
-        List<AssessmentPlanAnswerDetailVo> questionResult = resultMapper.getQuestionResult(id);
-        Map<String, Integer> answerCountMap = new HashMap<>();
-        for (AssessmentPlanAnswerDetailVo countVo : questionResult) {
-            answerCountMap.put(countVo.getQuestionId().toString() + countVo.getAnswerId(), countVo.getChooseCount());
-        }
+
         //循环大题
-        List<AssessmentQuestionVo> oneList = new ArrayList<>();
+        List<OneQuestionVo> oneList = new ArrayList<>();
         for (AssessmentPlanQuestion assessmentQuestion : questionList) {
             if(assessmentQuestion.getCategory() == 1){
-                oneList.add(BeanUtil.toBean(assessmentQuestion, AssessmentQuestionVo.class));
+                oneList.add(BeanUtil.toBean(assessmentQuestion, OneQuestionVo.class));
             }
         }
-
         //循环小题
-        for (AssessmentQuestionVo oneQuestion : oneList) {
-            List<AssessmentQuestionVo> twoList = new ArrayList<>();
+        for (OneQuestionVo oneQuestion : oneList) {
+            List<TwoQuestionVo> twoList = new ArrayList<>();
             for (AssessmentPlanQuestion assessmentQuestion : questionList) {
                 if(assessmentQuestion.getCategory() == 2 && assessmentQuestion.getParentId().equals(oneQuestion.getId())){
-                    AssessmentQuestionVo questionVo = BeanUtil.toBean(assessmentQuestion, AssessmentQuestionVo.class);
+                    TwoQuestionVo questionVo = BeanUtil.toBean(assessmentQuestion, TwoQuestionVo.class);
                     twoList.add(questionVo);
                 }
             }
             oneQuestion.setChildren(twoList);
         }
+        List<AssessmentPlanAnswerDetailVo> questionResult = resultMapper.getQuestionResult(id);
+        Map<String, Integer> answerCountMap = new HashMap<>();
+        for (AssessmentPlanAnswerDetailVo countVo : questionResult) {
+            answerCountMap.put(countVo.getQuestionId().toString() + countVo.getAnswerId(), countVo.getChooseCount());
+        }
+
+        //量表
+        List<AssessmentPlanAnswerDetailVo> scaleQuestionResult = resultMapper.getScaleQuestionResult(id);
 
         //循环选项
-        for (AssessmentQuestionVo oneQuestion : oneList) {
-            for (AssessmentQuestionVo twoQuestion : oneQuestion.getChildren()) {
-                List<AssessmentQuestionVo> optionList = new ArrayList<>();
+        for (OneQuestionVo oneQuestion : oneList) {
+            for (TwoQuestionVo twoQuestion : oneQuestion.getChildren()) {
+                List<AssessmentQuestionOptionResultVo> optionList = new ArrayList<>();
                 for (AssessmentPlanQuestion assessmentQuestion : questionList) {
                     if(assessmentQuestion.getCategory() == 3 && assessmentQuestion.getParentId().equals(twoQuestion.getId())){
-                        AssessmentQuestionVo questionVo = BeanUtil.toBean(assessmentQuestion, AssessmentQuestionVo.class);
-                        questionVo.setChooseCount(answerCountMap.get(assessmentQuestion.getParentId().toString() + assessmentQuestion.getId().toString()));
+                        AssessmentQuestionOptionResultVo questionVo = BeanUtil.toBean(assessmentQuestion, AssessmentQuestionOptionResultVo.class);
+                        questionVo.setCount(answerCountMap.get(assessmentQuestion.getParentId().toString() + assessmentQuestion.getId().toString()));
+                        BigDecimal bigDecimal = BigDecimal.valueOf(questionVo.getCount())
+                                .divide(BigDecimal.valueOf(vo.getStudentCount()))
+                                .multiply(BigDecimal.valueOf(100))
+                                .setScale(2, RoundingMode.HALF_UP);
+                        questionVo.setPercentage(bigDecimal.floatValue());
                         optionList.add(questionVo);
                     }
                     if(assessmentQuestion.getCategory() == 2 && "judge_question".equals(assessmentQuestion.getType())){
-                        optionList.add(new AssessmentQuestionVo(){{
-                            setId(1L);
-                            setChooseCount(answerCountMap.get(assessmentQuestion.getId().toString() + "1"));
+                        optionList.add(new AssessmentQuestionOptionResultVo(){{
+                            setName("是");
+                            BigDecimal bigDecimal = BigDecimal.valueOf(answerCountMap.get(assessmentQuestion.getId().toString() + "1"))
+                                    .divide(BigDecimal.valueOf(vo.getStudentCount()))
+                                    .multiply(BigDecimal.valueOf(100))
+                                    .setScale(2, RoundingMode.HALF_UP);
+                            setPercentage(bigDecimal.floatValue());
+                            setCount(answerCountMap.get(assessmentQuestion.getId().toString() + "1"));
                         }});
-                        optionList.add(new AssessmentQuestionVo(){{
-                            setId(2L);
-                            setChooseCount(answerCountMap.get(assessmentQuestion.getId().toString() + "2"));
+                        optionList.add(new AssessmentQuestionOptionResultVo(){{
+                            setName("否");
+                            BigDecimal bigDecimal = BigDecimal.valueOf(answerCountMap.get(assessmentQuestion.getId().toString() + "2"))
+                                    .divide(BigDecimal.valueOf(vo.getStudentCount()))
+                                    .multiply(BigDecimal.valueOf(100))
+                                    .setScale(2, RoundingMode.HALF_UP);
+                            setPercentage(bigDecimal.floatValue());
+                            setCount(answerCountMap.get(assessmentQuestion.getId().toString() + "2"));
                         }});
                     }
                 }
-                twoQuestion.setOptions(optionList);
+                if("scale_question".equals(twoQuestion.getType())) {
+                    for (AssessmentPlanAnswerDetailVo detailVo : scaleQuestionResult) {
+                        if(detailVo.getQuestionId().equals(twoQuestion.getId())){
+                            optionList.add(new AssessmentQuestionOptionResultVo(){{
+                                setName(detailVo.getAnswerId());
+                                BigDecimal bigDecimal = BigDecimal.valueOf(detailVo.getChooseCount())
+                                        .divide(BigDecimal.valueOf(vo.getStudentCount())).multiply(BigDecimal.valueOf(100))
+                                        .setScale(2, RoundingMode.HALF_UP);
+                                setPercentage(bigDecimal.floatValue());
+                                setCount(detailVo.getChooseCount());
+                            }});
+                        }
+                    }
+                }
+                twoQuestion.setResultList(optionList);
             }
         }
-
         vo.setChildren(oneList);
         return vo;
     }

+ 27 - 0
src/main/java/com/xjrsoft/module/assessment/vo/AssessmentQuestionOptionResultVo.java

@@ -0,0 +1,27 @@
+package com.xjrsoft.module.assessment.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+* @title: 考核题目答案出参
+* @Author dzx
+* @Date: 2024-03-29
+* @Version 1.0
+*/
+@Data
+public class AssessmentQuestionOptionResultVo implements Serializable {
+
+    @ApiModelProperty("选项名称")
+    private String name;
+
+    @ApiModelProperty("选择数量")
+    private Integer count;
+
+    @ApiModelProperty("占比")
+    private Float percentage;
+
+}

+ 45 - 0
src/main/java/com/xjrsoft/module/assessment/vo/AssessmentQuestionResultDetailVo.java

@@ -0,0 +1,45 @@
+package com.xjrsoft.module.assessment.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+* @title: 考核题目答案出参
+* @Author dzx
+* @Date: 2024-03-29
+* @Version 1.0
+*/
+@Data
+public class AssessmentQuestionResultDetailVo implements Serializable {
+
+    @ApiModelProperty("")
+    private Long id;
+
+    @ApiModelProperty("题目题干")
+    private String name;
+
+    @ApiModelProperty("分数")
+    private Long score;
+
+    @ApiModelProperty("题目类型")
+    private String type;
+
+    @ApiModelProperty("类别(1:大题 2:小题 3:选项)")
+    private Integer category;
+
+    @ApiModelProperty("父级id")
+    private Long parentId;
+
+    @ApiModelProperty("小题是否必填(1:是 0:否)")
+    private Short required;
+
+    @ApiModelProperty("数量")
+    private Integer count;
+
+    @ApiModelProperty("子集")
+    private List<AssessmentQuestionOptionResultVo> resultList;
+
+}

+ 39 - 0
src/main/java/com/xjrsoft/module/assessment/vo/AssessmentTemplatePlanResultVo.java

@@ -0,0 +1,39 @@
+package com.xjrsoft.module.assessment.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+* @title: 考核模板表单出参
+* @Author dzx
+* @Date: 2024-03-29
+* @Version 1.0
+*/
+@Data
+public class AssessmentTemplatePlanResultVo {
+
+    @ApiModelProperty("")
+    private Long id;
+
+    @ApiModelProperty("名称")
+    private String name;
+
+    @ApiModelProperty("分数")
+    private Long score;
+
+    @ApiModelProperty("开始时间")
+    private Date startTime;
+
+    @ApiModelProperty("结束时间")
+    private Date endTime;
+
+    @ApiModelProperty("题目内容")
+    private List<OneQuestionVo> children;
+
+    @ApiModelProperty("学生人数")
+    private Integer studentCount;
+
+}

+ 39 - 0
src/main/java/com/xjrsoft/module/assessment/vo/OneQuestionVo.java

@@ -0,0 +1,39 @@
+package com.xjrsoft.module.assessment.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+* @title: 一级题目
+* @Author dzx
+* @Date: 2024年4月9日
+* @Version 1.0
+*/
+@Data
+public class OneQuestionVo implements Serializable {
+
+    @ApiModelProperty("")
+    private Long id;
+
+    @ApiModelProperty("题目题干")
+    private String name;
+
+    @ApiModelProperty("分数")
+    private Long score;
+
+    @ApiModelProperty("题目类型")
+    private String type;
+
+    @ApiModelProperty("小题是否必填(1:是 0:否)")
+    private Short required;
+
+    @ApiModelProperty("数量")
+    private Integer count;
+
+    @ApiModelProperty("二级题目")
+    private List<TwoQuestionVo> children;
+
+}

+ 39 - 0
src/main/java/com/xjrsoft/module/assessment/vo/TwoQuestionVo.java

@@ -0,0 +1,39 @@
+package com.xjrsoft.module.assessment.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+* @title: 二级题目
+* @Author dzx
+* @Date: 2024年4月9日
+* @Version 1.0
+*/
+@Data
+public class TwoQuestionVo implements Serializable {
+
+    @ApiModelProperty("")
+    private Long id;
+
+    @ApiModelProperty("题目题干")
+    private String name;
+
+    @ApiModelProperty("分数")
+    private Long score;
+
+    @ApiModelProperty("题目类型")
+    private String type;
+
+    @ApiModelProperty("小题是否必填(1:是 0:否)")
+    private Short required;
+
+    @ApiModelProperty("数量")
+    private Integer count;
+
+    @ApiModelProperty("选项")
+    private List<AssessmentQuestionOptionResultVo> resultList;
+
+}

+ 7 - 0
src/main/resources/mapper/assessment/AssessmentPlanAnswerResultMapper.xml

@@ -29,4 +29,11 @@
         SELECT question_id,answer_id,COUNT(*) AS choose_count FROM assessment_plan_answer_result WHERE delete_mark = 0 AND assessment_template_plan_id = #{id}
         GROUP BY question_id,answer_id
     </select>
+    <select id="getScaleQuestionResult" resultType="com.xjrsoft.module.assessment.vo.AssessmentPlanAnswerDetailVo">
+        SELECT t1.question_id,t1.answer_id,COUNT(t1.*) AS choose_count FROM assessment_plan_answer_result t1
+        INNER JOIN assessment_plan_question t2 ON t1.question_id = t2.id
+        WHERE t1.delete_mark = 0 AND t1.assessment_template_plan_id = #{id}
+        AND t2.type = 'scale_question'
+        GROUP BY t1.question_id,t1.answer_id
+    </select>
 </mapper>