无关风月
2024-07-03 53b1659091b7f4ae4a519ea5bf5522493d5be484
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -1041,14 +1041,16 @@
        studyRecord.setMonthStudy(Math.round((float) monthStudy / 3600));
        // 总时长还需计算上游戏测试成绩时长
        List<TGameRecord> gameRecordList = gameRecordService.lambdaQuery().eq(TGameRecord::getUserId, dto.getId())
                .eq(TGameRecord::getDisabled, 0).list();
                .eq(TGameRecord::getDisabled, 0)
                .orderByDesc(TGameRecord::getCreateTime)
                .list();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        for (TGameRecord tGameRecord : gameRecordList) {
            tGameRecord.setTime(simpleDateFormat.format(tGameRecord.getCreateTime()));
        }
        int sum = gameRecordList.stream().map(TGameRecord::getUseTime).mapToInt(Integer::intValue).sum();
        Integer totalStudy = studyRecord.getTotalStudy();
        studyRecord.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600));
        studyRecord.setTotalStudy(Math.round((float) (totalStudy) / 3600));
        res.setCurrent(studyRecord.getWeek()+"");
        // 剩余周目
        List<TStudy> studyList = studyService.lambdaQuery().eq(TStudy::getDisabled, 0)