From 43965116f560e839e9c3a898cd696f961331b423 Mon Sep 17 00:00:00 2001 From: cjw Date: Thu, 1 Aug 2024 14:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=AD=94=E6=A1=88=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/scale/service/impl/EvaluationServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/service/impl/EvaluationServiceImpl.java b/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/service/impl/EvaluationServiceImpl.java index 6982061..ace944c 100644 --- a/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/service/impl/EvaluationServiceImpl.java +++ b/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/service/impl/EvaluationServiceImpl.java @@ -158,6 +158,9 @@ public class EvaluationServiceImpl implements IEvaluationService { } List answerAdd = MapstructUtils.convert(answerList, SysEvaluationAnswer.class); + if (answerAdd.stream().anyMatch(entity -> entity.getAnswerId() == null)) { + throw new ServiceException("有题目未作选择,请检查后提交"); + } evaluationAnswerMapper.insertBatch(answerAdd); // List list;