18756
2024-08-23 2d93efd310612e24b99c8a487102638cfa3fbadf
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;
    }
}