|
|
@@ -450,6 +450,7 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
|
|
|
.eq(AssessmentPlanQuestion::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
.eq(AssessmentPlanQuestion::getAssessmentTemplatePlanId, id)
|
|
|
);
|
|
|
+ Map<Long, String> questionTypeMap = questionList.stream().collect(Collectors.toMap(AssessmentPlanQuestion::getAssessmentTemplatePlanId, AssessmentPlanQuestion::getType));
|
|
|
|
|
|
//循环大题
|
|
|
List<OneQuestionVo> oneList = new ArrayList<>();
|
|
|
@@ -482,7 +483,7 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
|
|
|
for (OneQuestionVo oneQuestion : oneList) {
|
|
|
for (TwoQuestionVo twoQuestion : oneQuestion.getChildren()) {
|
|
|
List<AssessmentQuestionOptionResultVo> optionList = new ArrayList<>();
|
|
|
- if("radio_question".equals(twoQuestion.getType()) || "multi_question".equals(twoQuestion.getType())){
|
|
|
+ if(AssessQuestionTypeEnum.RADIO.getCode().equals(twoQuestion.getType()) || AssessQuestionTypeEnum.MULTI.getCode().equals(twoQuestion.getType())){
|
|
|
for (AssessmentPlanQuestion assessmentQuestion : questionList) {
|
|
|
if(assessmentQuestion.getCategory() == 3 && assessmentQuestion.getParentId().equals(twoQuestion.getId())){
|
|
|
AssessmentQuestionOptionResultVo questionVo = BeanUtil.toBean(assessmentQuestion, AssessmentQuestionOptionResultVo.class);
|
|
|
@@ -493,7 +494,7 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
|
|
|
optionList.add(questionVo);
|
|
|
}
|
|
|
}
|
|
|
- }else if("judge_question".equals(twoQuestion.getType())){
|
|
|
+ }else if(AssessQuestionTypeEnum.JUDGE.getCode().equals(twoQuestion.getType())){
|
|
|
optionList.add(new AssessmentQuestionOptionResultVo(){{
|
|
|
setName("是");
|
|
|
Integer count = answerCountMap.get(twoQuestion.getId().toString() + "1");
|
|
|
@@ -506,28 +507,24 @@ public class AssessmentTemplatePlanServiceImpl extends MPJBaseServiceImpl<Assess
|
|
|
setPercentage(vo.getStudentCount());
|
|
|
setCount(count == null?0:count);
|
|
|
}});
|
|
|
- }else if("scale_question".equals(twoQuestion.getType())) {
|
|
|
+ }else if(AssessQuestionTypeEnum.SCALE.getCode().equals(twoQuestion.getType())) {
|
|
|
for (AssessmentPlanAnswerDetailVo detailVo : scaleQuestionResult) {
|
|
|
if(detailVo.getQuestionId().equals(twoQuestion.getId())){
|
|
|
optionList.add(new AssessmentQuestionOptionResultVo(){{
|
|
|
- setName(detailVo.getAnswerId());
|
|
|
+ setName(detailVo.getAnswerId() + "星");
|
|
|
Integer count = detailVo.getChooseCount();
|
|
|
setPercentage(vo.getStudentCount());
|
|
|
setCount(count == null?0:count);
|
|
|
}});
|
|
|
}
|
|
|
}
|
|
|
- }else if("text_question".equals(twoQuestion.getType())) {
|
|
|
- for (AssessmentPlanQuestion assessmentQuestion : questionList) {
|
|
|
- if(assessmentQuestion.getCategory() == 3 && assessmentQuestion.getParentId().equals(twoQuestion.getId())){
|
|
|
- AssessmentQuestionOptionResultVo questionVo = BeanUtil.toBean(assessmentQuestion, AssessmentQuestionOptionResultVo.class);
|
|
|
- Integer count = answerCountMap.get(assessmentQuestion.getParentId().toString() + assessmentQuestion.getId().toString());
|
|
|
- questionVo.setCount(count == null?0:count);
|
|
|
-
|
|
|
- questionVo.setPercentage(vo.getStudentCount());
|
|
|
- optionList.add(questionVo);
|
|
|
- }
|
|
|
- }
|
|
|
+ }else if(AssessQuestionTypeEnum.TEXT.getCode().equals(twoQuestion.getType())) {
|
|
|
+ AssessmentQuestionOptionResultVo questionVo = new AssessmentQuestionOptionResultVo();
|
|
|
+ Integer count = answerCountMap.get(twoQuestion.getId().toString() + "null");
|
|
|
+ questionVo.setCount(count == null?0:count);
|
|
|
+ questionVo.setName("已答题");
|
|
|
+ questionVo.setPercentage(vo.getStudentCount());
|
|
|
+ optionList.add(questionVo);
|
|
|
}
|
|
|
twoQuestion.setResultList(optionList);
|
|
|
}
|