Zhangtf преди 2 седмици
родител
ревизия
bb5df36ab3

+ 105 - 0
xzl-admin/src/main/java/com/xzl/web/controller/KnowledgeFileController.java

@@ -0,0 +1,105 @@
+package com.xzl.web.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xzl.common.core.domain.entity.KnowledgeFile;
+import com.xzl.web.service.KnowledgeFileService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.xzl.common.annotation.Log;
+import com.xzl.common.core.controller.BaseController;
+import com.xzl.common.core.domain.AjaxResult;
+import com.xzl.common.enums.BusinessType;
+import com.xzl.common.utils.poi.ExcelUtil;
+import com.xzl.common.core.page.TableDataInfo;
+
+/**
+ * 文件Controller
+ *
+ * @author xzl
+ * @date 2025-06-17
+ */
+@RestController
+@RequestMapping("/system/file")
+public class KnowledgeFileController extends BaseController
+{
+    @Autowired
+    private KnowledgeFileService knowledgeFileService;
+
+    /**
+     * 查询文件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(KnowledgeFile Knowledge)
+    {
+        startPage();
+        List<KnowledgeFile> list = knowledgeFileService.selectSysFileList(Knowledge);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出文件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:export')")
+    @Log(title = "文件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, KnowledgeFile Knowledge)
+    {
+        List<KnowledgeFile> list = knowledgeFileService.selectSysFileList(Knowledge);
+        ExcelUtil<KnowledgeFile> util = new ExcelUtil<KnowledgeFile>(KnowledgeFile.class);
+        util.exportExcel(response, list, "文件数据");
+    }
+
+    /**
+     * 获取文件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:query')")
+    @GetMapping(value = "/{fileId}")
+    public AjaxResult getInfo(@PathVariable("fileId") Long fileId)
+    {
+        return success(knowledgeFileService.selectSysFileByFileId(fileId));
+    }
+
+    /**
+     * 新增文件
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:add')")
+    @Log(title = "文件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody KnowledgeFile Knowledge)
+    {
+        return toAjax(knowledgeFileService.insertSysFile(Knowledge));
+    }
+
+    /**
+     * 修改文件
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:edit')")
+    @Log(title = "文件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody KnowledgeFile Knowledge)
+    {
+        return toAjax(knowledgeFileService.updateSysFile(Knowledge));
+    }
+
+    /**
+     * 删除文件
+     */
+    @PreAuthorize("@ss.hasPermi('system:file:remove')")
+    @Log(title = "文件", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{fileIds}")
+    public AjaxResult remove(@PathVariable Long[] fileIds)
+    {
+        return toAjax(knowledgeFileService.deleteSysFileByFileIds(fileIds));
+    }
+}

+ 116 - 0
xzl-admin/src/main/java/com/xzl/web/controller/SysFileFolderController.java

@@ -0,0 +1,116 @@
+package com.xzl.web.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xzl.common.core.domain.entity.SysFileFolder;
+import com.xzl.web.service.ISysFileFolderService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.xzl.common.annotation.Log;
+import com.xzl.common.core.controller.BaseController;
+import com.xzl.common.core.domain.AjaxResult;
+import com.xzl.common.enums.BusinessType;
+import com.xzl.common.utils.poi.ExcelUtil;
+import com.xzl.common.core.page.TableDataInfo;
+
+/**
+ * 文件文件夹(麻城知识库四级结构)Controller
+ *
+ * @author xzl
+ * @date 2025-06-17
+ */
+@RestController
+@RequestMapping("/system/folder")
+public class SysFileFolderController extends BaseController
+{
+    @Autowired
+    private ISysFileFolderService sysFileFolderService;
+
+    /**
+     * 查询文件文件夹(麻城知识库四级结构)列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:folder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysFileFolder sysFileFolder)
+    {
+        startPage();
+        List<SysFileFolder> list = sysFileFolderService.selectSysFileFolderList(sysFileFolder);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出文件文件夹(麻城知识库四级结构)列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:folder:export')")
+    @Log(title = "文件文件夹(麻城知识库四级结构)", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysFileFolder sysFileFolder)
+    {
+        List<SysFileFolder> list = sysFileFolderService.selectSysFileFolderList(sysFileFolder);
+        ExcelUtil<SysFileFolder> util = new ExcelUtil<SysFileFolder>(SysFileFolder.class);
+        util.exportExcel(response, list, "文件文件夹(麻城知识库四级结构)数据");
+    }
+
+    /**
+     * 获取文件文件夹(麻城知识库四级结构)详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:folder:query')")
+    @GetMapping(value = "/{folderId}")
+    public AjaxResult getInfo(@PathVariable("folderId") Long folderId)
+    {
+        return success(sysFileFolderService.selectSysFileFolderByFolderId(folderId));
+    }
+
+    /**
+     * 新增文件文件夹(麻城知识库四级结构)
+     */
+    @PreAuthorize("@ss.hasPermi('system:folder:add')")
+    @Log(title = "文件文件夹(麻城知识库四级结构)", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysFileFolder sysFileFolder)
+    {
+        return toAjax(sysFileFolderService.insertSysFileFolder(sysFileFolder));
+    }
+
+    /**
+     * 修改文件文件夹(麻城知识库四级结构)
+     */
+    @PreAuthorize("@ss.hasPermi('system:folder:edit')")
+    @Log(title = "文件文件夹(麻城知识库四级结构)", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SysFileFolder sysFileFolder)
+    {
+        return toAjax(sysFileFolderService.updateSysFileFolder(sysFileFolder));
+    }
+
+    /**
+     * 删除文件文件夹(麻城知识库四级结构)
+     */
+    @PreAuthorize("@ss.hasPermi('system:folder:remove')")
+    @Log(title = "文件文件夹(麻城知识库四级结构)", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{folderIds}")
+    public AjaxResult remove(@PathVariable Long[] folderIds)
+    {
+        return toAjax(sysFileFolderService.deleteSysFileFolderByFolderIds(folderIds));
+    }
+
+
+    /**
+     * 获取部门树列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:folder:query')")
+    @GetMapping("/folderTree")
+    public AjaxResult folderTree(SysFileFolder sysFileFolder)
+    {
+        return success(sysFileFolderService.selectSysFileFolderTree(sysFileFolder));
+    }
+}

+ 65 - 0
xzl-admin/src/main/java/com/xzl/web/service/ISysFileFolderService.java

@@ -0,0 +1,65 @@
+package com.xzl.web.service;
+
+import java.util.List;
+
+import com.xzl.common.core.domain.TreeSelect;
+import com.xzl.common.core.domain.entity.SysFileFolder;
+
+/**
+ * 文件文件夹(麻城知识库四级结构)Service接口
+ *
+ * @author xzl
+ * @date 2025-06-17
+ */
+public interface ISysFileFolderService
+{
+    /**
+     * 查询文件文件夹(麻城知识库四级结构)
+     *
+     * @param folderId 文件文件夹(麻城知识库四级结构)主键
+     * @return 文件文件夹(麻城知识库四级结构)
+     */
+    public SysFileFolder selectSysFileFolderByFolderId(Long folderId);
+
+    /**
+     * 查询文件文件夹(麻城知识库四级结构)列表
+     *
+     * @param knowledgeFileFolder 文件文件夹(麻城知识库四级结构)
+     * @return 文件文件夹(麻城知识库四级结构)集合
+     */
+    public List<SysFileFolder> selectSysFileFolderList(SysFileFolder knowledgeFileFolder);
+
+    /**
+     * 新增文件文件夹(麻城知识库四级结构)
+     *
+     * @param knowledgeFileFolder 文件文件夹(麻城知识库四级结构)
+     * @return 结果
+     */
+    public int insertSysFileFolder(SysFileFolder knowledgeFileFolder);
+
+    /**
+     * 修改文件文件夹(麻城知识库四级结构)
+     *
+     * @param knowledgeFileFolder 文件文件夹(麻城知识库四级结构)
+     * @return 结果
+     */
+    public int updateSysFileFolder(SysFileFolder knowledgeFileFolder);
+
+    /**
+     * 批量删除文件文件夹(麻城知识库四级结构)
+     *
+     * @param folderIds 需要删除的文件文件夹(麻城知识库四级结构)主键集合
+     * @return 结果
+     */
+    public int deleteSysFileFolderByFolderIds(Long[] folderIds);
+
+    /**
+     * 删除文件文件夹(麻城知识库四级结构)信息
+     *
+     * @param folderId 文件文件夹(麻城知识库四级结构)主键
+     * @return 结果
+     */
+    public int deleteSysFileFolderByFolderId(Long folderId);
+
+    public List<TreeSelect> selectSysFileFolderTree(SysFileFolder knowledgeFileFolder);
+}

+ 63 - 0
xzl-admin/src/main/java/com/xzl/web/service/KnowledgeFileService.java

@@ -0,0 +1,63 @@
+package com.xzl.web.service;
+
+
+import com.xzl.common.core.domain.entity.KnowledgeFile;
+
+import java.util.List;
+
+/**
+ * 文件Service接口
+ *
+ * @author xzl
+ * @date 2025-06-17
+ */
+public interface KnowledgeFileService
+{
+    /**
+     * 查询文件
+     *
+     * @param fileId 文件主键
+     * @return 文件
+     */
+    public KnowledgeFile selectSysFileByFileId(Long fileId);
+
+    /**
+     * 查询文件列表
+     *
+     * @param Knowledge 文件
+     * @return 文件集合
+     */
+    public List<KnowledgeFile> selectSysFileList(KnowledgeFile Knowledge);
+
+    /**
+     * 新增文件
+     *
+     * @param Knowledge 文件
+     * @return 结果
+     */
+    public int insertSysFile(KnowledgeFile Knowledge);
+
+    /**
+     * 修改文件
+     *
+     * @param Knowledge 文件
+     * @return 结果
+     */
+    public int updateSysFile(KnowledgeFile Knowledge);
+
+    /**
+     * 批量删除文件
+     *
+     * @param fileIds 需要删除的文件主键集合
+     * @return 结果
+     */
+    public int deleteSysFileByFileIds(Long[] fileIds);
+
+    /**
+     * 删除文件信息
+     *
+     * @param fileId 文件主键
+     * @return 结果
+     */
+    public int deleteSysFileByFileId(Long fileId);
+}

+ 97 - 0
xzl-admin/src/main/java/com/xzl/web/service/impl/KnowledgeFileServiceImpl.java

@@ -0,0 +1,97 @@
+package com.xzl.web.service.impl;
+
+import java.util.List;
+
+import com.xzl.common.core.domain.entity.KnowledgeFile;
+import com.xzl.common.utils.DateUtils;
+import com.xzl.web.mapper.KnowledgeFileMapper;
+import com.xzl.web.service.KnowledgeFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 文件Service业务层处理
+ *
+ * @author xzl
+ * @date 2025-06-17
+ */
+@Service
+public class KnowledgeFileServiceImpl implements KnowledgeFileService
+{
+    @Autowired
+    private KnowledgeFileMapper knowledgeFileMapper;
+
+    /**
+     * 查询文件
+     *
+     * @param fileId 文件主键
+     * @return 文件
+     */
+    @Override
+    public KnowledgeFile selectSysFileByFileId(Long fileId)
+    {
+        return knowledgeFileMapper.selectSysFileByFileId(fileId);
+    }
+
+    /**
+     * 查询文件列表
+     *
+     * @param KnowledgeFile 文件
+     * @return 文件
+     */
+    @Override
+    public List<KnowledgeFile> selectSysFileList(KnowledgeFile KnowledgeFile)
+    {
+        return knowledgeFileMapper.selectSysFileList(KnowledgeFile);
+    }
+
+    /**
+     * 新增文件
+     *
+     * @param KnowledgeFile 文件
+     * @return 结果
+     */
+    @Override
+    public int insertSysFile(KnowledgeFile KnowledgeFile)
+    {
+        KnowledgeFile.setCreateTime(DateUtils.getNowDate());
+        return knowledgeFileMapper.insertSysFile(KnowledgeFile);
+    }
+
+    /**
+     * 修改文件
+     *
+     * @param KnowledgeFile 文件
+     * @return 结果
+     */
+    @Override
+    public int updateSysFile(KnowledgeFile KnowledgeFile)
+    {
+        KnowledgeFile.setUpdateTime(DateUtils.getNowDate());
+        return knowledgeFileMapper.updateSysFile(KnowledgeFile);
+    }
+
+    /**
+     * 批量删除文件
+     *
+     * @param fileIds 需要删除的文件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysFileByFileIds(Long[] fileIds)
+    {
+        return knowledgeFileMapper.deleteSysFileByFileIds(fileIds);
+    }
+
+    /**
+     * 删除文件信息
+     *
+     * @param fileId 文件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysFileByFileId(Long fileId)
+    {
+        return knowledgeFileMapper.deleteSysFileByFileId(fileId);
+    }
+}

+ 163 - 0
xzl-admin/src/main/java/com/xzl/web/service/impl/SysFileFolderServiceImpl.java

@@ -0,0 +1,163 @@
+package com.xzl.web.service.impl;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import com.xzl.common.core.domain.TreeSelect;
+import com.xzl.common.core.domain.entity.SysFileFolder;
+import com.xzl.common.utils.DateUtils;
+import com.xzl.common.utils.StringUtils;
+import com.xzl.common.utils.spring.SpringUtils;
+import com.xzl.web.service.ISysFileFolderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.xzl.web.mapper.SysFileFolderMapper;
+import com.xzl.web.service.ISysFileFolderService;
+
+/**
+ * 文件文件夹(麻城知识库四级结构)Service业务层处理
+ *
+ * @author xzl
+ * @date 2025-06-17
+ */
+@Service
+public class SysFileFolderServiceImpl implements ISysFileFolderService
+{
+    @Autowired
+    private SysFileFolderMapper sysFileFolderMapper;
+
+    /**
+     * 查询文件文件夹(麻城知识库四级结构)
+     *
+     * @param folderId 文件文件夹(麻城知识库四级结构)主键
+     * @return 文件文件夹(麻城知识库四级结构)
+     */
+    @Override
+    public SysFileFolder selectSysFileFolderByFolderId(Long folderId)
+    {
+        return sysFileFolderMapper.selectSysFileFolderByFolderId(folderId);
+    }
+
+    /**
+     * 查询文件文件夹(麻城知识库四级结构)列表
+     *
+     * @param sysFileFolder 文件文件夹(麻城知识库四级结构)
+     * @return 文件文件夹(麻城知识库四级结构)
+     */
+    @Override
+    public List<SysFileFolder> selectSysFileFolderList(SysFileFolder sysFileFolder)
+    {
+        return sysFileFolderMapper.selectSysFileFolderList(sysFileFolder);
+    }
+
+    /**
+     * 新增文件文件夹(麻城知识库四级结构)
+     *
+     * @param sysFileFolder 文件文件夹(麻城知识库四级结构)
+     * @return 结果
+     */
+    @Override
+    public int insertSysFileFolder(SysFileFolder sysFileFolder)
+    {
+        sysFileFolder.setCreateTime(DateUtils.getNowDate());
+        return sysFileFolderMapper.insertSysFileFolder(sysFileFolder);
+    }
+
+    /**
+     * 修改文件文件夹(麻城知识库四级结构)
+     *
+     * @param sysFileFolder 文件文件夹(麻城知识库四级结构)
+     * @return 结果
+     */
+    @Override
+    public int updateSysFileFolder(SysFileFolder sysFileFolder)
+    {
+        sysFileFolder.setUpdateTime(DateUtils.getNowDate());
+        return sysFileFolderMapper.updateSysFileFolder(sysFileFolder);
+    }
+
+    /**
+     * 批量删除文件文件夹(麻城知识库四级结构)
+     *
+     * @param folderIds 需要删除的文件文件夹(麻城知识库四级结构)主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysFileFolderByFolderIds(Long[] folderIds)
+    {
+        return sysFileFolderMapper.deleteSysFileFolderByFolderIds(folderIds);
+    }
+
+    /**
+     * 删除文件文件夹(麻城知识库四级结构)信息
+     *
+     * @param folderId 文件文件夹(麻城知识库四级结构)主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysFileFolderByFolderId(Long folderId)
+    {
+        return sysFileFolderMapper.deleteSysFileFolderByFolderId(folderId);
+    }
+
+    private List<SysFileFolder> getChildList(List<SysFileFolder> list, SysFileFolder t) {
+        List<SysFileFolder> tlist = new ArrayList<SysFileFolder>();
+        Iterator<SysFileFolder> it = list.iterator();
+        while (it.hasNext()) {
+            SysFileFolder n = (SysFileFolder) it.next();
+            if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getFolderId().longValue()) {
+                tlist.add(n);
+            }
+        }
+        return tlist;
+    }
+
+    private void recursionFn(List<SysFileFolder> list, SysFileFolder t) {
+        // 得到子节点列表
+        List<SysFileFolder> childList = getChildList(list, t);
+        t.setChildren(childList);
+        for (SysFileFolder tChild : childList) {
+            if (hasChild(list, tChild)) {
+                recursionFn(list, tChild);
+            }
+        }
+    }
+
+    private boolean hasChild(List<SysFileFolder> list, SysFileFolder t) {
+        return getChildList(list, t).size() > 0;
+    }
+    public List<SysFileFolder> buildDeptTree(List<SysFileFolder> depts) {
+        List<SysFileFolder> returnList = new ArrayList<SysFileFolder>();
+        List<Long> tempList = depts.stream().map(SysFileFolder::getFolderId).collect(Collectors.toList());
+        for (SysFileFolder dept : depts) {
+            // 如果是顶级节点, 遍历该父节点的所有子节点
+            if (!tempList.contains(dept.getParentId())) {
+                recursionFn(depts, dept);
+                returnList.add(dept);
+            }
+        }
+        if (returnList.isEmpty()) {
+            returnList = depts;
+        }
+        return returnList;
+    }
+    /**
+     * 构建前端所需要下拉树结构
+     *
+     * @param sysFileFolders 文件列表
+     * @return 下拉树结构列表
+     */
+
+    public List<TreeSelect> buildSysFileFolderTreeSelect(List<SysFileFolder> sysFileFolders) {
+        List<SysFileFolder> sysFileFolderTrees = buildDeptTree(sysFileFolders);
+        return sysFileFolderTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
+    }
+
+    @Override
+    public List<TreeSelect> selectSysFileFolderTree(SysFileFolder sysFileFolder) {
+        List<SysFileFolder> sysFileFolders = this.selectSysFileFolderList(sysFileFolder);
+        return buildSysFileFolderTreeSelect(sysFileFolders);
+    }
+}

+ 152 - 0
xzl-common/src/main/java/com/xzl/common/core/domain/entity/KnowledgeFile.java

@@ -0,0 +1,152 @@
+package com.xzl.common.core.domain.entity;
+
+import com.xzl.common.annotation.Excel;
+import com.xzl.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 文件对象 sys_file
+ *
+ * @author xzl
+ * @date 2025-06-17
+ */
+public class KnowledgeFile extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 文件ID */
+    private Long fileId;
+
+    /** 所属文件夹ID */
+    @Excel(name = "所属文件夹ID")
+    private Long folderId;
+
+    /** 文件名称 */
+    @Excel(name = "文件名称")
+    private String fileName;
+
+    /** 文件类型 */
+    @Excel(name = "文件类型")
+    private String fileType;
+
+    /** 文件大小(字节) */
+    @Excel(name = "文件大小", readConverterExp = "字=节")
+    private Long fileSize;
+
+    /** 文件存储路径 */
+    @Excel(name = "文件存储路径")
+    private String filePath;
+
+    /** 下载次数 */
+    @Excel(name = "下载次数")
+    private Long downloadCount;
+
+    /** 状态(0正常 1停用) */
+    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    /** 删除标志(0存在 2删除) */
+    private String delFlag;
+
+    public void setFileId(Long fileId)
+    {
+        this.fileId = fileId;
+    }
+
+    public Long getFileId()
+    {
+        return fileId;
+    }
+    public void setFolderId(Long folderId)
+    {
+        this.folderId = folderId;
+    }
+
+    public Long getFolderId()
+    {
+        return folderId;
+    }
+    public void setFileName(String fileName)
+    {
+        this.fileName = fileName;
+    }
+
+    public String getFileName()
+    {
+        return fileName;
+    }
+    public void setFileType(String fileType)
+    {
+        this.fileType = fileType;
+    }
+
+    public String getFileType()
+    {
+        return fileType;
+    }
+    public void setFileSize(Long fileSize)
+    {
+        this.fileSize = fileSize;
+    }
+
+    public Long getFileSize()
+    {
+        return fileSize;
+    }
+    public void setFilePath(String filePath)
+    {
+        this.filePath = filePath;
+    }
+
+    public String getFilePath()
+    {
+        return filePath;
+    }
+    public void setDownloadCount(Long downloadCount)
+    {
+        this.downloadCount = downloadCount;
+    }
+
+    public Long getDownloadCount()
+    {
+        return downloadCount;
+    }
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+    public void setDelFlag(String delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag()
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+            .append("fileId", getFileId())
+            .append("folderId", getFolderId())
+            .append("fileName", getFileName())
+            .append("fileType", getFileType())
+            .append("fileSize", getFileSize())
+            .append("filePath", getFilePath())
+            .append("downloadCount", getDownloadCount())
+            .append("status", getStatus())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 165 - 0
xzl-common/src/main/java/com/xzl/common/core/domain/entity/SysFileFolder.java

@@ -0,0 +1,165 @@
+package com.xzl.common.core.domain.entity;
+
+import com.xzl.common.annotation.Excel;
+import com.xzl.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 文件文件夹(麻城知识库四级结构)对象 sys_file_folder
+ *
+ * @author xzl
+ * @date 2025-06-17
+ */
+public class SysFileFolder extends BaseEntity
+{
+
+    private List<SysFileFolder> children = new ArrayList<SysFileFolder>();
+    private static final long serialVersionUID = 1L;
+
+    /** 文件夹ID */
+    private Long folderId;
+
+    /** 父文件夹ID(0表示顶级) */
+    @Excel(name = "父文件夹ID", readConverterExp = "0=表示顶级")
+    private Long parentId;
+
+    /** 祖级列表(格式:,1,5,15,) */
+    @Excel(name = "祖级列表", readConverterExp = "格=式:,1,5,15,")
+    private String ancestors;
+
+    /** 文件夹名称 */
+    @Excel(name = "文件夹名称")
+    private String folderName;
+
+    /** 层级(1麻城知识库 2二级 3三级 4四级) */
+    @Excel(name = "层级", readConverterExp = "1=麻城知识库,2=二级,3=三级,4=四级")
+    private Long level;
+
+    /** 显示顺序 */
+    @Excel(name = "显示顺序")
+    private Long orderNum;
+
+    /** 完整路径(如/麻城知识库/部门文档/财务部/预算) */
+    @Excel(name = "完整路径", readConverterExp = "如=/麻城知识库/部门文档/财务部/预算")
+    private String fullPath;
+
+    /** 状态(0正常 1停用) */
+    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    /** 删除标志(0存在 2删除) */
+    private String delFlag;
+
+    public void setFolderId(Long folderId)
+    {
+        this.folderId = folderId;
+    }
+
+    public Long getFolderId()
+    {
+        return folderId;
+    }
+    public void setParentId(Long parentId)
+    {
+        this.parentId = parentId;
+    }
+
+    public Long getParentId()
+    {
+        return parentId;
+    }
+    public void setAncestors(String ancestors)
+    {
+        this.ancestors = ancestors;
+    }
+
+    public String getAncestors()
+    {
+        return ancestors;
+    }
+    public void setFolderName(String folderName)
+    {
+        this.folderName = folderName;
+    }
+    public List<SysFileFolder> getChildren()
+    {
+        return children;
+    }
+
+    public void setChildren(List<SysFileFolder> children)
+    {
+        this.children = children;
+    }
+    public String getFolderName()
+    {
+        return folderName;
+    }
+    public void setLevel(Long level)
+    {
+        this.level = level;
+    }
+
+    public Long getLevel()
+    {
+        return level;
+    }
+    public void setOrderNum(Long orderNum)
+    {
+        this.orderNum = orderNum;
+    }
+
+    public Long getOrderNum()
+    {
+        return orderNum;
+    }
+    public void setFullPath(String fullPath)
+    {
+        this.fullPath = fullPath;
+    }
+
+    public String getFullPath()
+    {
+        return fullPath;
+    }
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+    public void setDelFlag(String delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag()
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+            .append("folderId", getFolderId())
+            .append("parentId", getParentId())
+            .append("ancestors", getAncestors())
+            .append("folderName", getFolderName())
+            .append("level", getLevel())
+            .append("orderNum", getOrderNum())
+            .append("fullPath", getFullPath())
+            .append("status", getStatus())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 44 - 0
xzl-ui/src/api/system/file.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询文件列表
+export function listFile(query) {
+  return request({
+    url: '/system/file/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询文件详细
+export function getFile(fileId) {
+  return request({
+    url: '/system/file/' + fileId,
+    method: 'get'
+  })
+}
+
+// 新增文件
+export function addFile(data) {
+  return request({
+    url: '/system/file',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改文件
+export function updateFile(data) {
+  return request({
+    url: '/system/file',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除文件
+export function delFile(fileId) {
+  return request({
+    url: '/system/file/' + fileId,
+    method: 'delete'
+  })
+}

+ 52 - 0
xzl-ui/src/api/system/folder.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询文件文件夹(麻城知识库四级结构)列表
+export function listFolder(query) {
+  return request({
+    url: '/system/folder/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询文件文件夹(麻城知识库四级结构)详细
+export function getFolder(folderId) {
+  return request({
+    url: '/system/folder/' + folderId,
+    method: 'get'
+  })
+}
+
+// 新增文件文件夹(麻城知识库四级结构)
+export function addFolder(data) {
+  return request({
+    url: '/system/folder',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改文件文件夹(麻城知识库四级结构)
+export function updateFolder(data) {
+  return request({
+    url: '/system/folder',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除文件文件夹(麻城知识库四级结构)
+export function delFolder(folderId) {
+  return request({
+    url: '/system/folder/' + folderId,
+    method: 'delete'
+  })
+}
+
+// 查知识库下拉树结构
+export function folderTreeSelect() {
+  return request({
+    url: '/system/folder/folderTree',
+    method: 'get'
+  })
+}

+ 313 - 0
xzl-ui/src/views/fileTree/file/index.vue

@@ -0,0 +1,313 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="所属文件夹ID" prop="folderId">
+        <el-input
+          v-model="queryParams.folderId"
+          placeholder="请输入所属文件夹ID"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="文件名称" prop="fileName">
+        <el-input
+          v-model="queryParams.fileName"
+          placeholder="请输入文件名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="文件大小" prop="fileSize">
+        <el-input
+          v-model="queryParams.fileSize"
+          placeholder="请输入文件大小"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="下载次数" prop="downloadCount">
+        <el-input
+          v-model="queryParams.downloadCount"
+          placeholder="请输入下载次数"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:file:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:file:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:file:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:file:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="fileList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="文件ID" align="center" prop="fileId" />
+      <el-table-column label="所属文件夹ID" align="center" prop="folderId" />
+      <el-table-column label="文件名称" align="center" prop="fileName" />
+      <el-table-column label="文件类型" align="center" prop="fileType" />
+      <el-table-column label="文件大小" align="center" prop="fileSize" />
+      <el-table-column label="文件存储路径" align="center" prop="filePath" />
+      <el-table-column label="下载次数" align="center" prop="downloadCount" />
+      <el-table-column label="状态" align="center" prop="status" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:file:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:file:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改文件对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="所属文件夹ID" prop="folderId">
+          <el-input v-model="form.folderId" placeholder="请输入所属文件夹ID" />
+        </el-form-item>
+        <el-form-item label="文件名称" prop="fileName">
+          <el-input v-model="form.fileName" placeholder="请输入文件名称" />
+        </el-form-item>
+        <el-form-item label="文件大小" prop="fileSize">
+          <el-input v-model="form.fileSize" placeholder="请输入文件大小" />
+        </el-form-item>
+        <el-form-item label="文件存储路径" prop="filePath">
+          <el-input v-model="form.filePath" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="下载次数" prop="downloadCount">
+          <el-input v-model="form.downloadCount" placeholder="请输入下载次数" />
+        </el-form-item>
+        <el-form-item label="删除标志" prop="delFlag">
+          <el-input v-model="form.delFlag" placeholder="请输入删除标志" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listFile, getFile, delFile, addFile, updateFile } from "@/api/system/file";
+
+export default {
+  name: "File",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 文件表格数据
+      fileList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        folderId: null,
+        fileName: null,
+        fileType: null,
+        fileSize: null,
+        filePath: null,
+        downloadCount: null,
+        status: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        folderId: [
+          { required: true, message: "所属文件夹ID不能为空", trigger: "blur" }
+        ],
+        fileName: [
+          { required: true, message: "文件名称不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询文件列表 */
+    getList() {
+      this.loading = true;
+      listFile(this.queryParams).then(response => {
+        this.fileList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        fileId: null,
+        folderId: null,
+        fileName: null,
+        fileType: null,
+        fileSize: null,
+        filePath: null,
+        downloadCount: null,
+        status: null,
+        delFlag: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.fileId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加文件";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const fileId = row.fileId || this.ids
+      getFile(fileId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改文件";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.fileId != null) {
+            updateFile(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFile(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const fileIds = row.fileId || this.ids;
+      this.$modal.confirm('是否确认删除文件编号为"' + fileIds + '"的数据项?').then(function() {
+        return delFile(fileIds);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('system/file/export', {
+        ...this.queryParams
+      }, `file_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

Файловите разлики са ограничени, защото са твърде много
+ 696 - 0
xzl-ui/src/views/fileTree/folder/index.vue