From 233ab439e38d3040d556f3f6d04492be2a3a6c8d Mon Sep 17 00:00:00 2001 From: hjl <1657978663@qq.com> Date: 星期三, 19 六月 2024 18:17:14 +0800 Subject: [PATCH] fix: 学习端bug --- ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java | 35 +++++++++++++++-------------------- 1 files changed, 15 insertions(+), 20 deletions(-) diff --git a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java index c32cf5e..127e6a8 100644 --- a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java +++ b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java @@ -503,7 +503,10 @@ if (null == userStudy) { TUserStudy study = new TUserStudy(); study.setUserId(tUser1.getId()); - study.setWeek(Constants.ONE); + // 学习周目 + TStudy tStudy = studyService.lambdaQuery().eq(TStudy::getQuarter, Constants.ONE) + .orderByAsc(TStudy::getWeek).last("limit 1").one(); + study.setWeek(tStudy.getWeek()); study.setDay(Constants.ONE); study.setTotalStudy(Constants.ZERO); study.setTodayStudy(Constants.ZERO); @@ -564,25 +567,6 @@ HashMap<String, Object> map = new HashMap<>(); // 获取登录token map.put("token", tokenService.createTokenStudy(loginUserParent)); - // 学习进度检查 - TUserStudy userStudy = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, user.getId()) - .eq(TUserStudy::getDisabled, 0).one(); - if (null == userStudy) { - TUserStudy study = new TUserStudy(); - study.setUserId(user.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); } @@ -724,6 +708,17 @@ return R.ok(new UserPersonalCenterVO(user, userStudy)); } + @GetMapping("/userInfoParent") + @ApiOperation(value = "用户详情", tags = {"家长端-用户详情"}) + public R<TUser> userInfoParent() { + LoginUserParent loginUserStudy = tokenService.getLoginUser1(); + if (null == loginUserStudy) { + return R.tokenError("登录失效!"); + } + TUser byId = userService.getById(loginUserStudy.getUserid()); + return R.ok(byId); + } + @PostMapping("/deleteUser") @ApiOperation(value = "注销当前帐号", tags = {"家长端-个人中心"}) @ApiImplicitParams({ -- Gitblit v1.7.1