From 2b382a92207dfabf0eb30e743265df5c7c50e7bc Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期四, 07 五月 2026 14:27:45 +0800
Subject: [PATCH] feat(approve): 新增办公用品审批功能

---
 src/main/java/com/ruoyi/framework/security/LoginUser.java |  168 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 147 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/ruoyi/framework/security/LoginUser.java b/src/main/java/com/ruoyi/framework/security/LoginUser.java
index e07dca3..330ae43 100644
--- a/src/main/java/com/ruoyi/framework/security/LoginUser.java
+++ b/src/main/java/com/ruoyi/framework/security/LoginUser.java
@@ -4,7 +4,7 @@
 import java.util.Set;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
-import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.alibaba.fastjson2.annotation.JSONField;
 import com.ruoyi.project.system.domain.SysUser;
 
 /**
@@ -15,6 +15,16 @@
 public class LoginUser implements UserDetails
 {
     private static final long serialVersionUID = 1L;
+
+    /**
+     * 鐢ㄦ埛ID
+     */
+    private Long userId;
+
+    /**
+     * 閮ㄩ棬ID
+     */
+    private Long [] deptIds;
 
     /**
      * 鐢ㄦ埛鍞竴鏍囪瘑
@@ -61,6 +71,84 @@
      */
     private SysUser user;
 
+    /**
+     * 绉熸埛ID
+     */
+    private Long tenantId;
+
+    /**
+     * 褰撳墠閮ㄩ棬id
+     */
+    private Long currentDeptId;
+
+    /**
+     * 鏄惁寮�閫欰I鍔熻兘锛�0鍚� 1鏄級
+     */
+    private Integer aiEnabled;
+
+    private String dataScope;
+
+    public LoginUser()
+    {
+    }
+
+    public LoginUser(SysUser user, Set<String> permissions)
+    {
+        this.user = user;
+        this.permissions = permissions;
+        this.aiEnabled = user == null ? null : user.getAiEnabled();
+    }
+
+    public LoginUser(Long userId, Long [] deptId, SysUser user, Set<String> permissions)
+    {
+        this.userId = userId;
+        this.deptIds = deptId;
+        this.user = user;
+        this.permissions = permissions;
+        this.aiEnabled = user == null ? null : user.getAiEnabled();
+    }
+
+    public LoginUser(Long userId, Long [] deptIds, SysUser user,Long tenantId, Set<String> permissions)
+    {
+        this.userId = userId;
+        this.deptIds = deptIds;
+        this.user = user;
+        this.permissions = permissions;
+        this.tenantId = tenantId;
+        this.aiEnabled = user == null ? null : user.getAiEnabled();
+    }
+
+    public LoginUser(Long userId, Long [] deptIds, SysUser user,Long tenantId,Long currentDeptId, Set<String> permissions)
+    {
+        this.userId = userId;
+        this.deptIds = deptIds;
+        this.user = user;
+        this.permissions = permissions;
+        this.tenantId = tenantId;
+        this.currentDeptId = currentDeptId;
+        this.aiEnabled = user == null ? null : user.getAiEnabled();
+    }
+
+    public Long getUserId()
+    {
+        return userId;
+    }
+
+    public void setUserId(Long userId)
+    {
+        this.userId = userId;
+    }
+
+    public Long [] getDeptIds()
+    {
+        return deptIds;
+    }
+
+    public void setDeptId(Long [] deptIds)
+    {
+        this.deptIds = deptIds;
+    }
+
     public String getToken()
     {
         return token;
@@ -71,17 +159,7 @@
         this.token = token;
     }
 
-    public LoginUser()
-    {
-    }
-
-    public LoginUser(SysUser user, Set<String> permissions)
-    {
-        this.user = user;
-        this.permissions = permissions;
-    }
-
-    @JsonIgnore
+    @JSONField(serialize = false)
     @Override
     public String getPassword()
     {
@@ -94,10 +172,15 @@
         return user.getUserName();
     }
 
+    public String getNickName()
+    {
+        return user.getNickName();
+    }
+
     /**
      * 璐︽埛鏄惁鏈繃鏈�,杩囨湡鏃犳硶楠岃瘉
      */
-    @JsonIgnore
+    @JSONField(serialize = false)
     @Override
     public boolean isAccountNonExpired()
     {
@@ -109,7 +192,7 @@
      * 
      * @return
      */
-    @JsonIgnore
+    @JSONField(serialize = false)
     @Override
     public boolean isAccountNonLocked()
     {
@@ -121,7 +204,7 @@
      * 
      * @return
      */
-    @JsonIgnore
+    @JSONField(serialize = false)
     @Override
     public boolean isCredentialsNonExpired()
     {
@@ -133,7 +216,7 @@
      * 
      * @return
      */
-    @JsonIgnore
+    @JSONField(serialize = false)
     @Override
     public boolean isEnabled()
     {
@@ -215,14 +298,57 @@
         return user;
     }
 
-    public void setUser(SysUser user)
-    {
-        this.user = user;
-    }
+    public void setUser(SysUser user)
+    {
+        this.user = user;
+        this.aiEnabled = user == null ? null : user.getAiEnabled();
+    }
 
     @Override
     public Collection<? extends GrantedAuthority> getAuthorities()
     {
         return null;
     }
-}
+
+    public Long getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Long tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public void setDeptIds(Long[] deptIds) {
+        this.deptIds = deptIds;
+    }
+
+    public Long getCurrentDeptId() {
+        return currentDeptId;
+    }
+
+    public void setCurrentDeptId(Long currentDeptId) {
+        this.currentDeptId = currentDeptId;
+    }
+
+    public Integer getAiEnabled() {
+        if (aiEnabled != null) {
+            return aiEnabled;
+        }
+        if (user != null && user.getAiEnabled() != null) {
+            return user.getAiEnabled();
+        }
+        return 0;
+    }
+
+    public void setAiEnabled(Integer aiEnabled) {
+        this.aiEnabled = aiEnabled;
+    }
+
+    public String getDataScope() {
+        return dataScope;
+    }
+
+    public void setDataScope(String dataScope) {
+        this.dataScope = dataScope;
+    }
+}

--
Gitblit v1.9.3