|
@ -153,14 +153,16 @@ public class QuestionnaireManageService extends BaseJpaService {
|
|
String sql = "SELECT soa.*, sqo.content FROM wlyy_survey_option_answers soa LEFT JOIN wlyy_survey_questions_options sqo ON soa.options_code= sqo.code WHERE soa.screen_result_code = ? AND soa.patient=? AND soa.survey_code=?";
|
|
String sql = "SELECT soa.*, sqo.content FROM wlyy_survey_option_answers soa LEFT JOIN wlyy_survey_questions_options sqo ON soa.options_code= sqo.code WHERE soa.screen_result_code = ? AND soa.patient=? AND soa.survey_code=?";
|
|
List<Map<String, Object>> optionAnswersList = jdbcTemplate.queryForList(sql, new Object[]{code, patient, templateCode});
|
|
List<Map<String, Object>> optionAnswersList = jdbcTemplate.queryForList(sql, new Object[]{code, patient, templateCode});
|
|
for (SurveyQuestionnaire question : questionList) {
|
|
for (SurveyQuestionnaire question : questionList) {
|
|
|
|
List<Map<String, Object>> optionList = new ArrayList<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("question", question);
|
|
map.put("question", question);
|
|
String qusCode = question.getCode();
|
|
String qusCode = question.getCode();
|
|
for (Map<String, Object> option : optionAnswersList) {
|
|
for (Map<String, Object> option : optionAnswersList) {
|
|
if (option.get("question_code").equals(qusCode)) {
|
|
if (option.get("question_code").equals(qusCode)) {
|
|
map.put("option", option);
|
|
|
|
|
|
optionList.add(option);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
map.put("option", optionList);
|
|
answerMap.put(question.getSort() + "", map);
|
|
answerMap.put(question.getSort() + "", map);
|
|
}
|
|
}
|
|
json.put("answer", answerMap);
|
|
json.put("answer", answerMap);
|