|
|
@ -92,8 +92,8 @@ public class QuestionService implements IQuestionService { |
|
|
|
f = true; |
|
|
|
questionVo.setShowShareAnswer((byte) 0); |
|
|
|
} |
|
|
|
//试题选项
|
|
|
|
List<QuestionVo.Option> optionList = htQuestionOptionDao.queryOption(question.getId(), query.getPatientReportId()); |
|
|
|
// //试题选项
|
|
|
|
// List<QuestionVo.Option> optionList = htQuestionOptionDao.queryOption(question.getId(), query.getPatientReportId());
|
|
|
|
|
|
|
|
//查询可以共享答案的试题的id
|
|
|
|
List<Long> shareAnswerIds = new ArrayList<>(); |
|
|
@ -105,7 +105,7 @@ public class QuestionService implements IQuestionService { |
|
|
|
if(!f){ |
|
|
|
if(shareAnswer.getShowShareAnswer() == 1){ |
|
|
|
questionVo.setShowShareAnswer(shareAnswer.getShowShareAnswer()); |
|
|
|
optionList = htQuestionOptionDao.queryOption(shareAnswer.getShareAnswerId(), query.getPatientReportId()); |
|
|
|
// optionList = htQuestionOptionDao.queryOption(shareAnswer.getShareAnswerId(), query.getPatientReportId());
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -155,8 +155,8 @@ public class QuestionService implements IQuestionService { |
|
|
|
introduceExample.setOrderByClause("sort"); |
|
|
|
List<HtQuestionIntroducer> introduces = htQuestionIntroducerDao.selectByExample(introduceExample); |
|
|
|
List<QuestionVo.Introduce> introduceVos = QuestionVo.Introduce.toIntroduces(introduces); |
|
|
|
// //试题选项
|
|
|
|
// List<QuestionVo.Option> options = htQuestionOptionDao.queryOption(question.getId(), query.getPatientReportId());
|
|
|
|
//试题选项
|
|
|
|
List<QuestionVo.Option> optionList = htQuestionOptionDao.queryOption(question.getId(), query.getPatientReportId()); |
|
|
|
|
|
|
|
//答题记录
|
|
|
|
List<QuestionVo.Record> recordVos; |
|
|
@ -177,6 +177,27 @@ public class QuestionService implements IQuestionService { |
|
|
|
return data; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<QuestionVo.OptionJson> queryOptionJson(QuestionDto.QueryPatientCanvas param, Long userId) { |
|
|
|
List<QuestionVo.OptionJson> optionJsons = new ArrayList<>(); |
|
|
|
List<QuestionVo.Option> options = htQuestionOptionDao.queryOption(param.getQuestionId(), param.getPatientReportId()); |
|
|
|
if (CollectionUtil.isNotEmpty(options)) { |
|
|
|
//方便后续把相同属性的选项放到一个对象的List中
|
|
|
|
Map<String, QuestionVo.OptionJson> map = new HashMap<>(); |
|
|
|
options.forEach(option -> { |
|
|
|
if (map.get(option.getName()) == null) { |
|
|
|
QuestionVo.OptionJson json = new QuestionVo.OptionJson(); |
|
|
|
json.setName(option.getName()); |
|
|
|
map.put(json.getName(), json); |
|
|
|
//相同属性的选项放在同一个optionJson里
|
|
|
|
optionJsons.add(json); |
|
|
|
} |
|
|
|
QuestionVo.OptionJson json = map.get(option.getName()); |
|
|
|
json.addOption(option); |
|
|
|
}); |
|
|
|
} |
|
|
|
return optionJsons; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public CodeEnum saveScore(QuestionDto.Score score, Long userId) throws IOException, NotSupportedFileTypeException { |
|
|
|