From ac87b0dbe98a67d14ed4ad98260b305923f3a3bf Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Wed, 18 Sep 2024 10:37:33 +0800 Subject: [PATCH] =?UTF-8?q?[bug]=E5=AE=9E=E8=AE=AD=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E6=9C=89=E5=A4=9A=E4=B8=AA=E8=AF=84=E5=88=86=E8=A7=84=E5=88=99?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=BB=85=E6=9C=89=E4=B8=80=E4=B8=AA=E8=AF=84?= =?UTF-8?q?=E5=88=86=E8=A7=84=E5=88=99=E8=A2=AB=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/services/training2/Training2Service.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java index 49a635a06..be89ff47b 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java @@ -315,9 +315,12 @@ public class Training2Service { Map scoreMap = new HashMap<>(); if (!CollectionUtils.isEmpty(training2.getScoringRules())) { training2.getScoringRules().stream() -// .filter(score -> Objects.equals(score.getMember().getId(), member.getId())) - .findFirst().ifPresent(scoringRule2 -> scoringRule2.getDetails() - .forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore()))); + .flatMap(sr -> sr.getDetails().stream()) + .forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore())); +// training2.getScoringRules().stream() +//// .filter(score -> Objects.equals(score.getMember().getId(), member.getId())) +// .findFirst().ifPresent(scoringRule2 -> scoringRule2.getDetails() +// .forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore()))); } // 前端传回的步骤信息 Map answerDetailMap = new HashMap<>(); @@ -337,11 +340,11 @@ public class Training2Service { } else { if (answerDetailMap.containsKey(step.getId())) { detail.setSuccess(answerDetailMap.get(step.getId()).isSuccess()); - detail.setScore( - detail.isHaveRule() && detail.isSuccess() ? scoreMap.get(step.getId()) : 0F); detail.setClientOperations(answerDetailMap.get(step.getId()).getClientOperations()); detail.setNotExistAppend(true); } + detail.setScore( + detail.isHaveRule() && detail.isSuccess() ? scoreMap.get(step.getId()) : 0F); } return detail; }).collect(Collectors.toList());