| | |
| | | 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); |
| | |
| | | if (null == userStudy) { |
| | | TUserStudy study = new TUserStudy(); |
| | | study.setUserId(user.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); |
| | |
| | | Integer totalStudy = userStudy.getTotalStudy(); |
| | | userStudy.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600)); |
| | | return R.ok(new UserPersonalCenterVO(user, userStudy)); |
| | | }@GetMapping("/userInfoParent") |
| | | } |
| | | |
| | | @GetMapping("/userInfoParent") |
| | | @ApiOperation(value = "用户详情", tags = {"家长端-用户详情"}) |
| | | public R<TUser> userInfoParent() { |
| | | LoginUserParent loginUserStudy = tokenService.getLoginUser1(); |