|
@@ -1,5 +1,6 @@
|
|
|
package com.fs.his.service.impl;
|
|
package com.fs.his.service.impl;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
|
|
|
import com.fs.his.mapper.FsQuestionAndAnswerMapper;
|
|
import com.fs.his.mapper.FsQuestionAndAnswerMapper;
|
|
|
import com.fs.his.domain.FsQuestionAndAnswer;
|
|
import com.fs.his.domain.FsQuestionAndAnswer;
|
|
|
import com.fs.his.service.IFsQuestionAndAnswerService;
|
|
import com.fs.his.service.IFsQuestionAndAnswerService;
|
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 问答Service业务层处理
|
|
* 问答Service业务层处理
|
|
@@ -114,4 +116,21 @@ public class FsQuestionAndAnswerServiceImpl extends ServiceImpl<FsQuestionAndAns
|
|
|
public List<OptionsVO> selectAllQuestionOptions() {
|
|
public List<OptionsVO> selectAllQuestionOptions() {
|
|
|
return fsQuestionAndAnswerMapper.selectAllQuestionOptions();
|
|
return fsQuestionAndAnswerMapper.selectAllQuestionOptions();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<FsQuestionAndAnswerVO> selectFsQuestionAndAnswerVOList() {
|
|
|
|
|
+ List<FsQuestionAndAnswer> answers = fsQuestionAndAnswerMapper.selectFsQuestionAndAnswerList(new FsQuestionAndAnswer());
|
|
|
|
|
+ List<FsQuestionAndAnswerVO> vos = new ArrayList<>();
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(answers)) {
|
|
|
|
|
+ answers.forEach(answer -> {
|
|
|
|
|
+ FsQuestionAndAnswerVO vo = new FsQuestionAndAnswerVO();
|
|
|
|
|
+ vo.setQuestionName(answer.getQuestionName());
|
|
|
|
|
+ List<AnswerVO> answerVOS = JSON.parseArray(answer.getJsonInfo(), AnswerVO.class);
|
|
|
|
|
+ vo.setAnswers(answerVOS);
|
|
|
|
|
+ vo.setId(answer.getId());
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return vos;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|