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());