From 1496a2640408f000f31e01ebe90b5ef97237f5a1 Mon Sep 17 00:00:00 2001 From: zqy <2522236926@qq.com> Date: 星期二, 19 八月 2025 19:42:46 +0800 Subject: [PATCH] 修改婚姻bug && 管理员修改用户信息时 同步修改用户姓名、性别、婚姻状态 --- ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index 58be3dd..fd40fa4 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -33,6 +33,14 @@ import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysUserService; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.temporal.ChronoUnit; +import java.time.temporal.Temporal; +import java.util.Date; +import java.util.Objects; + /** * 鐧诲綍鏍¢獙鏂规硶 * @@ -109,7 +117,25 @@ + public boolean endOfLife(String username) { + SysUser sysUser = userService.selectUserByNickName(username); + System.out.println("[[[[[[["+sysUser); + if (sysUser.getPaid() != null && sysUser.getPaid().equals(0) && !"4".equals(sysUser.getStatus())) { + Date startTime = sysUser.getCreateTime(); + // 瀹夊叏杞崲 + Instant instant = startTime.toInstant(); + LocalDateTime startDateTime = instant.atZone(ZoneId.systemDefault()).toLocalDateTime(); + long daysPassed = ChronoUnit.DAYS.between(startDateTime, LocalDateTime.now()); + + if (daysPassed > 7) { + sysUser.setStatus("4"); + userService.updateUserStatus(sysUser); + + } + } + return true; + } @@ -124,6 +150,7 @@ */ public String login(String nickName, String password, String code, String uuid) { + endOfLife(nickName); // 楠岃瘉鐮佹牎楠� validateCaptcha(nickName, code, uuid); // 鐧诲綍鍓嶇疆鏍¢獙 -- Gitblit v1.9.1