hjl
2024-06-19 aa34f5b4a80eec408185cc36500149679e1a71c9
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/service/impl/TStudyServiceImpl.java
@@ -400,15 +400,13 @@
    @Override
    public int computeTotalIntegral(List<String> studyIds, Integer type, Integer accuracy) {
        int sum;
        int sum = 0;
        if (Constants.ONE.equals(type)) {
            List<TStudyListen> list = studyListenService.lambdaQuery().in(TStudyListen::getId, studyIds)
                    .eq(TStudyListen::getDisabled, 0).list();
            Optional<TStudyListen> any = list.stream().findAny();
            if (any.isPresent()) {
                sum = any.get().getIntegral();
            } else {
                sum = 0;
            }
        } else if (Constants.TWO.equals(type)) {
            List<TStudyLook> list = studyLookService.lambdaQuery().in(TStudyLook::getId, studyIds)
@@ -416,8 +414,6 @@
            Optional<TStudyLook> any = list.stream().findAny();
            if (any.isPresent()) {
                sum = any.get().getIntegral();
            } else {
                sum = 0;
            }
        } else if (Constants.THREE.equals(type)) {
            List<TStudyInduction> list = studyInductionService.lambdaQuery().in(TStudyInduction::getId, studyIds)
@@ -425,8 +421,6 @@
            Optional<TStudyInduction> any = list.stream().findAny();
            if (any.isPresent()) {
                sum = any.get().getIntegral();
            } else {
                sum = 0;
            }
        } else if (Constants.FOUR.equals(type)) {
            List<TStudyAnswer> list = studyAnswerService.lambdaQuery().in(TStudyAnswer::getId, studyIds)
@@ -434,8 +428,6 @@
            Optional<TStudyAnswer> any = list.stream().findAny();
            if (any.isPresent()) {
                sum = any.get().getIntegral();
            } else {
                sum = 0;
            }
        } else if (Constants.FIVE.equals(type)) {
            List<TStudyPair> list = studyPairService.lambdaQuery().in(TStudyPair::getId, studyIds)
@@ -443,8 +435,6 @@
            Optional<TStudyPair> any = list.stream().findAny();
            if (any.isPresent()) {
                sum = any.get().getIntegral();
            } else {
                sum = 0;
            }
        } else {
            throw new GlobalException("题目信息异常!");