Эх сурвалжийг харах

解决全局搜索时公共文件相关BUG

wukai 1 жил өмнө
parent
commit
2c41ff40f0

+ 6 - 2
doc-biz/src/main/java/com/doc/biz/controller/DocInfoController.java

@@ -261,11 +261,14 @@ public class DocInfoController extends BaseController {
             dirMap.put(dir.getDirId(), dir);
         });
 
+        DocInfo docInfo = new DocInfo();
         spaceList.forEach(space -> {
+            if (type != null && type.equals(space.getSpaceType())) {
+                docInfo.setSpaceId(space.getSpaceId());
+            }
             spaceMap.put(space.getSpaceId(), space);
         });
 
-        DocInfo docInfo = new DocInfo();
         docInfo.setFileName(keyword);
         if (dirIds.size() > 0) {
             Map<String, Object> map = new HashMap<>(4);
@@ -404,7 +407,8 @@ public class DocInfoController extends BaseController {
 
     /**
      * 写入文件流
-     * @param doc doc
+     *
+     * @param doc      doc
      * @param fileName 文件流
      * @param response res
      */

+ 2 - 2
doc-biz/src/main/resources/mapper/biz/DocInfoMapper.xml

@@ -34,7 +34,7 @@
         <include refid="selectDocInfoVo"/>
         <where>
             <if test="dirId != null  and dirId != ''">and DIR_ID = #{dirId}</if>
-            <if test="spaceId != null  and spaceId != ''">and SPACE_ID like concat('%', #{spaceId}, '%')</if>
+            <if test="spaceId != null  and spaceId != ''">and SPACE_ID = #{spaceId}</if>
             <if test="fileName != null  and fileName != ''">and FILE_NAME like concat('%', #{fileName}, '%')</if>
             <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
                 and CREATE_TIME between #{params.beginCreateTime} and #{params.endCreateTime}
@@ -118,4 +118,4 @@
             #{docId}
         </foreach>
     </delete>
-</mapper>
+</mapper>