This commit is contained in:
thinkgem
2024-04-26 16:14:29 +08:00
parent 95ec1770df
commit b32ffa3b6a

View File

@@ -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<Map<String, Object>> 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);
}