From 2d93efd310612e24b99c8a487102638cfa3fbadf Mon Sep 17 00:00:00 2001
From: 18756 <1875631620@qq.com>
Date: 星期五, 23 八月 2024 16:29:24 +0800
Subject: [PATCH] 文档借阅功能8.23

---
 src/main/java/com/product/file/service/DocumentService.java |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/product/file/service/DocumentService.java b/src/main/java/com/product/file/service/DocumentService.java
index 284ed77..89a7bce 100644
--- a/src/main/java/com/product/file/service/DocumentService.java
+++ b/src/main/java/com/product/file/service/DocumentService.java
@@ -6,7 +6,6 @@
 import com.product.common.collect.ListUtils;
 import com.product.common.collect.MapUtils;
 import com.product.common.lang.DateUtils;
-import com.product.core.config.Global;
 import com.product.core.dao.BaseDao;
 import com.product.core.entity.DataTableEntity;
 import com.product.core.entity.FieldMetaEntity;
@@ -81,14 +80,14 @@
             fseDocument.setValue(CmnConst.FILE_TYPE, file_type);
             //淇濆瓨鏁版嵁
             String documentUUID = baseDao.add(fseDocument);
-            
+
             //鍒涘缓鏂囨。鐗堟湰鏁版嵁瀹瑰櫒
             FieldSetEntity fseDocumentHistory = new FieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT_HISTORY);
             BaseUtil.createCreatorAndCreationTime(fseDocumentHistory);
             fseDocument.setValue("document_uuid", documentUUID);
             fseDocument.setValue("attachment_uuid", attachment.getUUID());
             baseDao.add(fseDocumentHistory);
-            
+
             uuidList.add(documentUUID);
             fileNameList.add(file_name);
         }
@@ -480,7 +479,7 @@
         return baseDao.listTable("SELECT CONCAT(b.show_name, a.state) log,a.created_utc_datetime FROM PRODUCT_OA_document_log a LEFT JOIN product_sys_staffs b on a.created_by = b.user_id WHERE document_uuid = ? ORDER BY a.created_utc_datetime DESC",
                 new String[]{fieldSetEntity.getString(CmnConst.DOCUMENT_UUID)}, fieldSetEntity.getInteger(CmnConst.PAGESIZE), fieldSetEntity.getInteger(CmnConst.CPAGE));
     }
-    
+
     /**
      * 	鏂囨。鏀惰棌
      * @param fse
@@ -491,7 +490,7 @@
     	fse.setValue("document_collector", SpringMVCContextHolder.getCurrentUserId());
     	return baseDao.add(fse);
     }
-    
+
     /**
      * 	鏂囨。鍙栨秷鏀惰棌
      * @param documentUUID
@@ -504,9 +503,15 @@
     @Override
     public DataTableEntity getApplyDocument(FieldSetEntity fse) throws BaseException {
 
-        String document_name = fse.getString("document_name");
-        String filter="file_name like '%"+document_name+"'%";
-        DataTableEntity product_oa_document = baseDao.listTable("product_oa_document",filter);
+        DataTableEntity product_oa_document;
+        if(ObjectUtil.isNotEmpty(fse.getString("document_name"))){
+            String document_name = fse.getString("document_name");
+            String filter="file_name like '%"+document_name+"'%";
+            product_oa_document = baseDao.listTable("product_oa_document",filter);
+        }else {
+            product_oa_document = baseDao.listTable("product_oa_document");
+        }
+
 
         return product_oa_document;
     }
@@ -559,7 +564,7 @@
     }
 
     @Override
-    public DataTableEntity getApplayFileSort() throws BaseException {
+    public DataTableEntity getApplyFileSort() throws BaseException {
         StringBuilder sb=new StringBuilder();
         sb.append(" SELECT b.* FROM (");
         sb.append(" SELECT t.uuid,t.file_name,s.show_name,t.created_utc_datetime,count(t.uuid) as applyCount");
@@ -575,7 +580,7 @@
     }
 
     @Override
-    public DataTableEntity getApplayUserSort() throws BaseException {
+    public DataTableEntity getApplyUserSort() throws BaseException {
         StringBuilder sb=new StringBuilder();
         sb.append(" SELECT a.borrower,a.show_name,a.applayCount,a.applayFileCount ");
         sb.append(" FROM (");
@@ -595,4 +600,11 @@
         DataTableEntity dataTableEntity = baseDao.listTable(sb.toString());
         return dataTableEntity;
     }
+
+    @Override
+    public FieldSetEntity getApplyInfo(FieldSetEntity fes) throws BaseException {
+        String uuid = fes.getString("uuid");
+        FieldSetEntity product_oa_document_borrow = baseDao.getFieldSetEntity("product_oa_document_borrow", uuid, false);
+        return product_oa_document_borrow;
+    }
 }

--
Gitblit v1.9.2