zjh
2025-06-18 b115eea2b161adddeb92c5e885019aba8763bb0e
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java
@@ -20,6 +20,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.util.StringUtil;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -135,10 +136,13 @@
    }
    @GetMapping("/userListByDeptId")
    public AjaxResult userListByDeptId(@RequestParam("deptId") String deptId){
        List<Long> deptIds = deptService.getDeptTreeById(deptId);
    public AjaxResult userListByDeptId(@RequestParam(required = false) String deptId){
        LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.in(SysUser::getDeptId,deptIds);
        if(StringUtil.isNotBlank(deptId)){
            List<Long> deptIds = deptService.getDeptTreeById(deptId);
            wrapper.in(SysUser::getDeptId,deptIds);
        }
        return AjaxResult.success(userService.list(wrapper));
    }