From dc3336685e80c593a3654a6e53e3e1d1d13b2b50 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 06 五月 2026 15:30:13 +0800
Subject: [PATCH] fix(approve): 修复流程配置节点审批人为空时的异常处理

---
 src/main/java/com/ruoyi/framework/security/LoginUser.java |  146 +++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 117 insertions(+), 29 deletions(-)

diff --git a/src/main/java/com/ruoyi/framework/security/LoginUser.java b/src/main/java/com/ruoyi/framework/security/LoginUser.java
index 46661c5..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.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson2.annotation.JSONField;
 import com.ruoyi.project.system.domain.SysUser;
 
 /**
@@ -24,7 +24,7 @@
     /**
      * 閮ㄩ棬ID
      */
-    private Long deptId;
+    private Long [] deptIds;
 
     /**
      * 鐢ㄦ埛鍞竴鏍囪瘑
@@ -71,6 +71,64 @@
      */
     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;
@@ -81,14 +139,14 @@
         this.userId = userId;
     }
 
-    public Long getDeptId()
+    public Long [] getDeptIds()
     {
-        return deptId;
+        return deptIds;
     }
 
-    public void setDeptId(Long deptId)
+    public void setDeptId(Long [] deptIds)
     {
-        this.deptId = deptId;
+        this.deptIds = deptIds;
     }
 
     public String getToken()
@@ -99,24 +157,6 @@
     public void setToken(String token)
     {
         this.token = token;
-    }
-
-    public LoginUser()
-    {
-    }
-
-    public LoginUser(SysUser user, Set<String> permissions)
-    {
-        this.user = user;
-        this.permissions = permissions;
-    }
-
-    public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
-    {
-        this.userId = userId;
-        this.deptId = deptId;
-        this.user = user;
-        this.permissions = permissions;
     }
 
     @JSONField(serialize = false)
@@ -130,6 +170,11 @@
     public String getUsername()
     {
         return user.getUserName();
+    }
+
+    public String getNickName()
+    {
+        return user.getNickName();
     }
 
     /**
@@ -253,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