From b32ffa3b6a95ebd243f140b663413f2fa7aaaf31 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Fri, 26 Apr 2024 16:14:29 +0800 Subject: [PATCH] update --- .../modules/sys/web/OfficeController.java | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/OfficeController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/OfficeController.java index aef958a9..758d05ac 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/OfficeController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/OfficeController.java @@ -4,24 +4,6 @@ */ package com.jeesite.modules.sys.web; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import io.swagger.annotations.Api; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - import com.jeesite.common.collect.ListUtils; import com.jeesite.common.collect.MapUtils; import com.jeesite.common.config.Global; @@ -35,6 +17,22 @@ import com.jeesite.modules.sys.entity.Office; import com.jeesite.modules.sys.service.OfficeService; import com.jeesite.modules.sys.utils.UserUtils; import com.jeesite.modules.sys.web.user.EmpUserController; +import io.swagger.annotations.Api; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; /** * 机构Controller @@ -335,9 +333,9 @@ public class OfficeController extends BaseController { mapList.add(map); } // 一次性后台加载用户,若数据量比较大,建议使用懒加载 - if (StringUtils.equals(isLoadUser, "true") && idList.size() > 0) { + if (StringUtils.equals(isLoadUser, "true") && !idList.isEmpty()) { List> userList = - empUserController.treeData(userIdPrefix, idList.toArray(new String[idList.size()]), + empUserController.treeData(userIdPrefix, idList.toArray(new String[0]), companyCode, postCode, roleCode, isAll, isShowCode, ctrlPermi); mapList.addAll(userList); }