From 54e47bd6caeb816bc35d6b915875c4029605069b Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Fri, 6 Dec 2024 10:54:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=90=86=E8=AE=BA=E8=80=83?= =?UTF-8?q?=E8=AF=95=E8=AE=A1=E7=AE=97=E5=B9=B3=E5=9D=87=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TheoryTestServiceImpl.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/sztzjy/money_management/service/impl/TheoryTestServiceImpl.java b/src/main/java/com/sztzjy/money_management/service/impl/TheoryTestServiceImpl.java index f0fd0d0..8a4f8fe 100644 --- a/src/main/java/com/sztzjy/money_management/service/impl/TheoryTestServiceImpl.java +++ b/src/main/java/com/sztzjy/money_management/service/impl/TheoryTestServiceImpl.java @@ -175,16 +175,14 @@ public class TheoryTestServiceImpl implements TheoryTestService { List stuTheoryExamWithBLOBs = theoryExamMapper.selectByExampleWithBLOBs(example); BigDecimal totalScore = stuTheoryExamWithBLOBs.stream() .map(StuTheoryExamWithBLOBs::getScore) - .reduce(BigDecimal.ZERO, BigDecimal::add) - .add(score); - BigDecimal avgScore = totalScore.divide(BigDecimal.valueOf(stuTheoryExamWithBLOBs.size()+1), 2, RoundingMode.HALF_UP); + .reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal avgScore = totalScore.divide(BigDecimal.valueOf(stuTheoryExamWithBLOBs.size()), 2, RoundingMode.HALF_UP); record.setAverageScore(avgScore); } } theoryRecordMapper.updateByPrimaryKey(record); } - @Override public Date getStartTime(String userId, String source) { StuTheoryExamExample example = new StuTheoryExamExample(); @@ -528,15 +526,6 @@ public class TheoryTestServiceImpl implements TheoryTestService { } } - public static void main(String[] args) { - String singleStuAnswer = ", , , ," + " ,"; - System.out.println(singleStuAnswer); - String[] split = singleStuAnswer.split(", "); - for (String s : split) { - System.out.println(s); - } - } - @Override public List getTheoryTestDetail(String theoryExamId, Integer index, Integer size) throws IOException { ArrayList idsList = new ArrayList<>();