From 9c9e7c60e31e448bf5e823577964aad50dff5c28 Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Tue, 10 Sep 2024 17:55:50 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E5=9C=BA=E6=99=AF=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E7=BB=93=E6=9D=9F=E5=90=8E=E7=9A=84=E8=AF=84=E5=88=86?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=B8=AD=E5=A2=9E=E5=8A=A0=E9=9D=9E=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A7=92=E8=89=B2=E7=9A=84=E6=AD=A5=E9=AA=A4=EF=BC=88?= =?UTF-8?q?=E5=B9=B6=E5=A2=9E=E5=8A=A0=E6=AF=8F=E4=B8=AA=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84=E8=A7=92=E8=89=B2id=EF=BC=8C?= =?UTF-8?q?=E9=9D=9E=E7=94=A8=E6=88=B7=E8=A7=92=E8=89=B2=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=86=E6=95=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/training2/Training2Service.java | 28 +++++---- .../rtss/vo/paper/PaperTrainAnswerDetail.java | 62 ++++++++++--------- 2 files changed, 48 insertions(+), 42 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 94c0574f9..30b755c7e 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2Service.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2Service.java @@ -16,8 +16,6 @@ import club.joylink.rtss.simulation.cbtc.GroupSimulationService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService; import club.joylink.rtss.simulation.cbtc.SimulationService; -import club.joylink.rtss.simulation.cbtc.conversation.ConversationGroup; -import club.joylink.rtss.simulation.cbtc.conversation.ConversationMember; import club.joylink.rtss.simulation.cbtc.data.map.Switch; import club.joylink.rtss.simulation.cbtc.data.vo.ConversationMessageVO; import club.joylink.rtss.simulation.cbtc.data.vo.Training2MessageVO; @@ -317,7 +315,7 @@ public class Training2Service { Map scoreMap = new HashMap<>(); if (!CollectionUtils.isEmpty(training2.getScoringRules())) { training2.getScoringRules().stream() - .filter(score -> Objects.equals(score.getMember().getId(), member.getId())) +// .filter(score -> Objects.equals(score.getMember().getId(), member.getId())) .findFirst().ifPresent(scoringRule2 -> scoringRule2.getDetails() .forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore()))); } @@ -327,20 +325,24 @@ public class Training2Service { scoreDetailList.forEach(d -> answerDetailMap.put(d.getStepId(), d)); } return training2.getSteps().stream() - .filter(s -> Objects.equals(s.getSimulationMember().getId(), member.getId())) +// .filter(s -> Objects.equals(s.getSimulationMember().getId(), member.getId())) .map(step -> { PaperTrainAnswerDetail detail = new PaperTrainAnswerDetail(); + detail.setMemberId(step.getSimulationMember().getId()); detail.setStepId(step.getId()); detail.setHaveRule(scoreMap.containsKey(step.getId())); - 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); - } - if (detail.isHaveRule()) { - detail.setRuleScore(scoreMap.get(step.getId())); + detail.setRuleScore(scoreMap.get(step.getId())); + if (!Objects.equals(step.getSimulationMember().getId(), member.getId())) { + detail.setSuccess(true); + detail.setScore(detail.getRuleScore()); + } 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); + } } return detail; }).collect(Collectors.toList()); diff --git a/src/main/java/club/joylink/rtss/vo/paper/PaperTrainAnswerDetail.java b/src/main/java/club/joylink/rtss/vo/paper/PaperTrainAnswerDetail.java index c83204181..f36001cb7 100644 --- a/src/main/java/club/joylink/rtss/vo/paper/PaperTrainAnswerDetail.java +++ b/src/main/java/club/joylink/rtss/vo/paper/PaperTrainAnswerDetail.java @@ -1,48 +1,52 @@ package club.joylink.rtss.vo.paper; import club.joylink.rtss.vo.client.training2.Operation2VO; +import java.util.List; import lombok.Data; import lombok.NoArgsConstructor; -import java.util.List; - @Data @NoArgsConstructor public class PaperTrainAnswerDetail { - /** - * 实训步骤id - */ - private Long stepId; + /** + * 实训步骤id + */ + private Long stepId; - /** - * 实训是否成功 - */ - private boolean success; + /** + * 实训是否成功 + */ + private boolean success; - /** - * 获得的分数 - */ - private Float score; + /** + * 获得的分数 + */ + private Float score; - /** - * 规则设置的分数 - */ - private Float ruleScore; + /** + * 规则设置的分数 + */ + private Float ruleScore; - /** - * 是否有打分规则 - */ - private boolean haveRule; + /** + * 是否有打分规则 + */ + private boolean haveRule; - private boolean notExistAppend; - /** - * 客户端操作的实训,对应的id必须要传 - */ - private List clientOperations; + private boolean notExistAppend; + /** + * 客户端操作的实训,对应的id必须要传 + */ + private List clientOperations; + + /** + * 步骤对应的成员的id + */ + private String memberId; - public static class TrainOperations extends Operation2VO.ClientOperation2VO{ + public static class TrainOperations extends Operation2VO.ClientOperation2VO { - } + } }