44323
2024-05-22 ab7045d70310f4c5b150090b7c9fa18dea7ea1e7
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -183,8 +183,12 @@
                    calendar.setTime(new Date());
                    calendar.add(Calendar.MONTH, time);
                    Date dateAfterOneMonth = calendar.getTime();
                    byId.setTime(dateAfterOneMonth);
                    dateAfterOneMonth.setHours(23);
                    dateAfterOneMonth.setMinutes(59);
                    dateAfterOneMonth.setSeconds(59);
                    byId1.setVipEndTime(dateAfterOneMonth);
                    byId.setTime(dateAfterOneMonth);
                } else {
                    // 不是首次 判断vipEndTime 是否到期 如果没有 加指定月份时间 如果到期了 将会员到期时间从当前增加指定月份
                    if (byId1.getVipEndTime().getTime() < new Date().getTime()) {
@@ -192,6 +196,9 @@
                        calendar.setTime(new Date());
                        calendar.add(Calendar.MONTH, time);
                        Date dateAfterOneMonth = calendar.getTime();
                        dateAfterOneMonth.setHours(23);
                        dateAfterOneMonth.setMinutes(59);
                        dateAfterOneMonth.setSeconds(59);
                        byId.setTime(dateAfterOneMonth);
                        byId1.setVipEndTime(dateAfterOneMonth);
                    } else {
@@ -199,6 +206,9 @@
                        calendar.setTime(byId1.getVipEndTime());
                        calendar.add(Calendar.MONTH, time);
                        Date dateAfterOneMonth = calendar.getTime();
                        dateAfterOneMonth.setHours(23);
                        dateAfterOneMonth.setMinutes(59);
                        dateAfterOneMonth.setSeconds(59);
                        byId.setTime(dateAfterOneMonth);
                        byId1.setVipEndTime(dateAfterOneMonth);
                    }
@@ -257,6 +267,9 @@
                    calendar.setTime(new Date());
                    calendar.add(Calendar.MONTH, time);
                    Date dateAfterOneMonth = calendar.getTime();
                    dateAfterOneMonth.setHours(23);
                    dateAfterOneMonth.setMinutes(59);
                    dateAfterOneMonth.setSeconds(59);
                    byId.setTime(dateAfterOneMonth);
                    byId1.setVipEndTime(dateAfterOneMonth);
                } else {
@@ -266,6 +279,9 @@
                        calendar.setTime(new Date());
                        calendar.add(Calendar.MONTH, time);
                        Date dateAfterOneMonth = calendar.getTime();
                        dateAfterOneMonth.setHours(23);
                        dateAfterOneMonth.setMinutes(59);
                        dateAfterOneMonth.setSeconds(59);
                        byId.setTime(dateAfterOneMonth);
                        byId1.setVipEndTime(dateAfterOneMonth);
                    } else {
@@ -273,6 +289,9 @@
                        calendar.setTime(byId1.getVipEndTime());
                        calendar.add(Calendar.MONTH, time);
                        Date dateAfterOneMonth = calendar.getTime();
                        dateAfterOneMonth.setHours(23);
                        dateAfterOneMonth.setMinutes(59);
                        dateAfterOneMonth.setSeconds(59);
                        byId.setTime(dateAfterOneMonth);
                        byId1.setVipEndTime(dateAfterOneMonth);
                    }
@@ -496,6 +515,17 @@
        return AjaxResult.success();
    }
    /**
     * 获取用户信息
     *
     * @return 用户信息
     */
    @GetMapping("/userInfo")
    @ApiOperation(value = "用户详情", tags = {"用户详情"})
    public R<TUser> userInfo() {
        return R.ok(userService.lambdaQuery().eq(TUser::getId,tokenService.getLoginUserStudy().getUserid()).one());
    }
    @PostMapping("/deleteUser")
    @ApiOperation(value = "注销当前帐号", tags = {"家长端-个人中心"})
    @ApiImplicitParams({