diff --git a/ht/src/main/java/com/ccsens/ht/service/QuestionService.java b/ht/src/main/java/com/ccsens/ht/service/QuestionService.java index 4d7f1bf5..6f1f125e 100644 --- a/ht/src/main/java/com/ccsens/ht/service/QuestionService.java +++ b/ht/src/main/java/com/ccsens/ht/service/QuestionService.java @@ -86,12 +86,14 @@ public class QuestionService implements IQuestionService { QuestionVo.Question questionVo = QuestionVo.Question.toQuestionVo(question); //检查当前试题是否有答案,共享答案的试题是否有答案 boolean f = false; - HtPatientScoreExample scoreExample = new HtPatientScoreExample(); - scoreExample.createCriteria().andPatientReportIdEqualTo(query.getPatientReportId()).andQuestionIdEqualTo(question.getId()) - .andTypeBetween((byte)0,(byte)1); - if(htPatientScoreDao.countByExample(scoreExample) > 0){ - f = true; - questionVo.setShowShareAnswer((byte) 0); + if(ObjectUtil.isNotNull(query.getPatientReportId())){ + HtPatientScoreExample scoreExample = new HtPatientScoreExample(); + scoreExample.createCriteria().andPatientReportIdEqualTo(query.getPatientReportId()).andQuestionIdEqualTo(question.getId()) + .andTypeBetween((byte)0,(byte)1); + if(htPatientScoreDao.countByExample(scoreExample) > 0){ + f = true; + questionVo.setShowShareAnswer((byte) 0); + } } //查询可以共享答案的试题的id