无关风月
2025-04-11 75942ecc2e438012c5ea876715966ace593565a0
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/service/impl/TGameServiceImpl.java
@@ -1,6 +1,7 @@
package com.ruoyi.study.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.study.domain.TGame;
import com.ruoyi.study.domain.TIntegralRecord;
import com.ruoyi.study.dto.CompleteGameDTO;
@@ -30,13 +31,14 @@
            return gameAvailableIntegral;
        } else {
            // 积分明细不为空,根据正确率及已获取积分数量计算本次答题可获取的积分数量
            List<Integer> integralList = integralRecordList.stream().map(TIntegralRecord::getIntegral).collect(Collectors.toList())
            List<Integer> integralList = integralRecordList.stream()
                    .map(TIntegralRecord::getIntegral).collect(Collectors.toList())
                    .stream().map(Integer::parseInt).collect(Collectors.toList());
            int sumIntegral = integralList.stream().mapToInt(Integer::intValue).sum();
            if (gameAvailableIntegral > sumIntegral) {
                return gameAvailableIntegral - sumIntegral;
            } else {
                return null;
                return Constants.ZERO;
            }
        }
    }
@@ -45,4 +47,5 @@
    public TGame gameHearing(Integer quarter, Integer week) {
        return baseMapper.gameHearing(quarter, week);
    }
}