From 3e0fde40498608a2cb002e5f6bcb94386ca17d19 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 03 七月 2024 17:16:44 +0800
Subject: [PATCH] bug修改

---
 ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java
index ce72700..3685521 100644
--- a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java
+++ b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java
@@ -26,6 +26,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -967,7 +968,7 @@
      */
     @GetMapping("/exitGameOrStory")
     @ApiOperation(value = "退出游戏/故事学习", tags = {"学习端-题目"})
-    public R<Boolean> exitGameOrStory(@RequestParam Integer studyTime) {
+    public R<Boolean> exitGameOrStory(@RequestParam("studyTime") Integer studyTime) {
         LoginUserParent loginStudy = tokenService.getLoginUserStudy();
         if (null == loginStudy) {
             return R.tokenError("登录失效!");
@@ -1672,7 +1673,7 @@
             // 游戏总时长
             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));
             // 剩余周目
             List<TStudy> studyList = studyService.lambdaQuery().eq(TStudy::getDisabled, 0)
                     .eq(TStudy::getType, Constants.ONE)
@@ -1702,6 +1703,7 @@
                 .eq(TGameRecord::getDisabled, 0)
                 .orderByDesc(TGameRecord::getCreateTime)
                 .list();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm");
         if (null != studyRecord) {
             // 学习时长格式转换
             Integer todayStudy = studyRecord.getTodayStudy();
@@ -1712,6 +1714,9 @@
             studyRecord.setMonthStudy(Math.round((float) monthStudy / 3600));
             // 游戏总时长
             int sum = gameRecordList.stream().map(TGameRecord::getUseTime).mapToInt(Integer::intValue).sum();
+            for (TGameRecord tGameRecord : gameRecordList) {
+                tGameRecord.setTime(simpleDateFormat.format(tGameRecord.getCreateTime()));
+            }
             Integer totalStudy = studyRecord.getTotalStudy();
             studyRecord.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600));
             // 剩余周目

--
Gitblit v1.7.1