JiangChongBo 2 jaren geleden
bovenliggende
commit
9cb0d4e39e

+ 2 - 2
src/main/java/com/caimei/mapper/cmMapper/FileMapper.java

@@ -81,10 +81,10 @@ public interface FileMapper {
 
     FileTreeVo findFileByArticleId(Integer id);
 
-    List<Integer> findDictionaryById(Integer fileId,@Param("fileName") String fileName);
+    List<Integer> findDictionaryById(Integer fileId,@Param("fileName") String fileName,Integer authUserId);
 
     List<Integer> getNewestInfoById();
 
-    List<Integer> findSecondDictionaryById(Integer fileId,@Param("fileName") String fileName);
+    List<Integer> findSecondDictionaryById(Integer fileId,@Param("fileName") String fileName,Integer authUserId);
 
 }

+ 3 - 3
src/main/java/com/caimei/service/data/impl/DatabaseServiceImpl.java

@@ -443,12 +443,12 @@ public class DatabaseServiceImpl implements DatabaseService {
                         //判断是否根目录
                         List<Integer> dictionaryById=new ArrayList<>();
                         if(null!=fileTreeVo.getParentId()&&0==fileTreeVo.getParentId()){
-                            dictionaryById=fileMapper.findDictionaryById(null,filePathArr[i]);
+                            dictionaryById=fileMapper.findDictionaryById(null,filePathArr[i],authUserId);
                         }else{
-                             dictionaryById = fileMapper.findDictionaryById(fileTreeVo.getParentId(),filePathArr[i]);
+                             dictionaryById = fileMapper.findDictionaryById(fileTreeVo.getParentId(),filePathArr[i],authUserId);
                              if(null==dictionaryById||dictionaryById.size()<=0){
                                  //判断次级目录是否存在
-                                 List<Integer> secondDictionaryById = fileMapper.findSecondDictionaryById(fileTreeVo.getParentId(), filePathArr[i]);
+                                 List<Integer> secondDictionaryById = fileMapper.findSecondDictionaryById(fileTreeVo.getParentId(), filePathArr[i],authUserId);
                                  if(null!=secondDictionaryById&&secondDictionaryById.size()>0){
                                      dictionaryById.add(secondDictionaryById.get(0));
                                  }

+ 2 - 2
src/main/resources/mapper/FileMapper.xml

@@ -327,7 +327,7 @@
     <select id="findDictionaryById" resultType="java.lang.Integer">
         select id
         from cm_tree_file
-        where 1=1
+        where authUserId=#{authUserId}
         <if test="null != fileId">
             and  id = #{fileId}
         </if>
@@ -344,7 +344,7 @@
     <select id="findSecondDictionaryById" resultType="java.lang.Integer">
         select id
         from cm_tree_file
-        where 1=1
+        where authUserId=#{authUserId}
         <if test="null != fileId">
             and  parentId = #{fileId}
         </if>