hjl
2024-06-19 ee0ef084a9750338a118ac577af679e8549444da
fix: 家长端学习进度bug
2个文件已修改
27 ■■■■■ 已修改文件
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java
@@ -1493,6 +1493,10 @@
            TUserStudy tUserStudy = new TUserStudy();
            tUserStudy.setSurplus(studyService.list(new QueryWrapper<TStudy>()
                    .eq("type", 1)).size());
            tUserStudy.setTodayStudy(Constants.ZERO);
            tUserStudy.setTotalStudy(Constants.ZERO);
            tUserStudy.setWeekStudy(Constants.ZERO);
            tUserStudy.setMonthStudy(Constants.ZERO);
            studyRecord = tUserStudy;
        }
        // 学习时长格式转换
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -493,10 +493,29 @@
        loginUserParent.setName(tUser1.getName());
        loginUserParent.setUserid(tUser1.getId());
        loginUserParent.setPhone(tUser1.getPhone());
        loginUserParent.setLoginTime(new Date().getTime());
        loginUserParent.setLoginTime(System.currentTimeMillis());
        HashMap<String, Object> map = new HashMap<>();
        map.put("token", tokenService.createToken1(loginUserParent));
        // 获取登录token
        map.put("token", tokenService.createToken1(loginUserParent));
        // 学习进度检查
        TUserStudy userStudy = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, tUser1.getId())
                .eq(TUserStudy::getDisabled, 0).one();
        if (null == userStudy) {
            TUserStudy study = new TUserStudy();
            study.setUserId(tUser1.getId());
            study.setWeek(Constants.ONE);
            study.setDay(Constants.ONE);
            study.setTotalStudy(Constants.ZERO);
            study.setTodayStudy(Constants.ZERO);
            study.setWeekStudy(Constants.ZERO);
            study.setMonthStudy(Constants.ZERO);
            study.setListen(Constants.BURDEN_ONE);
            study.setLook(Constants.BURDEN_ONE);
            study.setInduction(Constants.BURDEN_ONE);
            study.setAnswer(Constants.BURDEN_ONE);
            study.setPair(Constants.BURDEN_ONE);
            userStudyService.save(study);
        }
        return R.ok(map);
    }