From 58dd4f9f6f33c7f1a0024a2409d5abdb3baf0f69 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Thu, 7 Jan 2021 11:27:31 +0800 Subject: [PATCH] =?UTF-8?q?20210107=E6=9C=AA=E9=80=89=E6=8B=A9=E7=97=85?= =?UTF-8?q?=E4=BA=BA=E7=82=B9=E8=AF=95=E9=A2=98=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/ht/service/QuestionService.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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