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

分享给我的文档后台接口

wukai 2 жил өмнө
parent
commit
77abcabd16

+ 3 - 2
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocShareController.java

@@ -50,9 +50,10 @@ public class DocShareController extends BaseController {
      * 查询文档分享列表
      */
     @GetMapping("/receive")
-    public TableDataInfo receive() {
+    public TableDataInfo receive(DocShare docShare) {
         startPage();
-        List<DocShare> list = docShareService.selectDocShareReceive(SecurityUtils.getUserId());
+        docShare.setSearchValue(SecurityUtils.getUserId() + "");
+        List<DocShare> list = docShareService.selectDocShareReceive(docShare);
         return getDataTable(list);
     }
 

+ 14 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocShare.java

@@ -8,6 +8,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 import com.jjt.common.core.annotation.Excel;
 import com.jjt.common.core.web.domain.BaseEntity;
 
+import java.util.List;
+
 /**
  * 文档分享对象 doc_share
  *
@@ -67,6 +69,18 @@ public class DocShare extends BaseEntity {
      */
     @TableField(exist = false)
     private String user;
+    /**
+     * 文档标签
+     */
+    private List<DocTag> tagList;
+
+    public List<DocTag> getTagList() {
+        return tagList;
+    }
+
+    public void setTagList(List<DocTag> tagList) {
+        this.tagList = tagList;
+    }
 
     public String getDocType() {
         return docType;

+ 2 - 2
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocShareMapper.java

@@ -70,8 +70,8 @@ public interface DocShareMapper {
     /**
      * 最近接收文件
      *
-     * @param uid 用户ID
+     * @param docShare 用户ID
      * @return
      */
-    List<DocShare> selectDocShareReceive(Long uid);
+    List<DocShare> selectDocShareReceive(DocShare docShare);
 }

+ 2 - 2
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocShareService.java

@@ -70,8 +70,8 @@ public interface IDocShareService {
     /**
      * 最近接收文件
      *
-     * @param uid 用户ID
+     * @param docShare 用户ID
      * @return
      */
-    List<DocShare> selectDocShareReceive(Long uid);
+    List<DocShare> selectDocShareReceive(DocShare docShare);
 }

+ 12 - 3
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocShareServiceImpl.java

@@ -4,7 +4,9 @@ import java.util.List;
 
 import com.jjt.common.core.utils.DateUtils;
 import com.jjt.common.security.utils.SecurityUtils;
+import com.jjt.doc.domain.DocInfo;
 import com.jjt.doc.domain.DocShareAccepter;
+import com.jjt.doc.mapper.DocTagMapper;
 import org.springframework.stereotype.Service;
 import com.jjt.doc.mapper.DocShareMapper;
 import com.jjt.doc.domain.DocShare;
@@ -23,6 +25,8 @@ import com.jjt.doc.service.IDocShareService;
 public class DocShareServiceImpl implements IDocShareService {
     @Resource
     private DocShareMapper docShareMapper;
+    @Resource
+    private DocTagMapper tagMapper;
 
     /**
      * 查询文档分享
@@ -117,10 +121,15 @@ public class DocShareServiceImpl implements IDocShareService {
     /**
      * 最近接收文件
      *
-     * @param uid@return
+     * @param docShare
+     * @return
      */
     @Override
-    public List<DocShare> selectDocShareReceive(Long uid) {
-        return docShareMapper.selectDocShareReceive(uid);
+    public List<DocShare> selectDocShareReceive(DocShare docShare) {
+        List<DocShare> list = docShareMapper.selectDocShareReceive(docShare);
+        for (DocShare ds : list) {
+            ds.setTagList(tagMapper.selectDocTagList4docId(ds.getDocId()));
+        }
+        return list;
     }
 }

+ 15 - 7
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocShareMapper.xml

@@ -60,15 +60,23 @@
           and a.CREATE_BY = #{uid}
         order by a.update_time desc
     </select>
-    <select id="selectDocShareReceive" resultType="com.jjt.doc.domain.DocShare">
+    <select id="selectDocShareReceive" parameterType="DocShare" resultType="com.jjt.doc.domain.DocShare">
         select a.*, b.doc_name, b.doc_type, b.doc_path, b.create_by user
         from (select t.*
-            from doc_share t,
-            doc_share_accepter t1
-            where t.doc_id = t1.doc_id
-            and t1.user_id = #{uid}) a,
-            doc_info b
-        where a.doc_id = b.doc_id
+        from doc_share t,
+        doc_share_accepter t1
+        where t.doc_id = t1.doc_id
+        and t1.user_id = #{searchValue}) a,
+        doc_info b
+        <where>
+            a.doc_id = b.doc_id
+            <if test="docName != null  and docName != ''">and DOC_NAME like concat('%', #{docName}, '%')</if>
+            <if test="docType != null  and docType != ''">and DOC_TYPE = #{docType}</if>
+            <if test="createBy != null ">and CREATE_BY = #{createBy}</if>
+            <if test="params.tagId!=null and params.tagId!=''">and b.doc_id in(select doc_id from DOC_TAG_RELA where
+                tag_id=#{params.tagId})
+            </if>
+        </where>
         order by a.update_time desc
     </select>
 

+ 2 - 3
lzga-ui/vue.config.js

@@ -36,8 +36,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://192.168.188.99:8080`,
-        // target: `http://localhost:8080`,
-        target: `http://192.168.1.13:8080`,
+        target: `http://localhost:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''
@@ -47,7 +46,7 @@ module.exports = {
       '/dev-api/identificat/upload': {
         // target: `http://192.168.188.99:8080`,
         target: `http://192.168.1.11:19500/upload`,
-        changeOrigin: true1,
+        changeOrigin: true,
         pathRewrite: {
           '^/dev-api/identificat/upload': ''
         }