杜洪波
2024-08-23 eca3b2b155c13a16cfeda2b10ce4f55eb1876975
src/main/java/com/product/file/controller/DocumentController.java
@@ -5,7 +5,6 @@
import com.alibaba.fastjson.JSONObject;
import com.product.core.config.CoreConst;
import com.product.core.controller.support.AbstractBaseController;
import com.product.core.dao.BaseDao;
import com.product.core.entity.DataTableEntity;
import com.product.core.entity.FieldSetEntity;
import com.product.core.entity.RequestParameterEntity;
@@ -25,7 +24,7 @@
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.function.DoubleConsumer;
/**
 * Copyright LX-BASE
@@ -371,7 +370,7 @@
            return this.error(DocumentCode.DOCUMENT_LOG_FAIL.getValue(), DocumentCode.DOCUMENT_LOG_FAIL.getText());
        }
    }
    /**
     *    文档收藏
     * @param request
@@ -407,6 +406,51 @@
            return OK();
         }
            return error(DocumentCode.DOCUMENT_CANCEL_COLLECTION_FAIL.getValue(), DocumentCode.DOCUMENT_CANCEL_COLLECTION_FAIL.getText());
        } catch (BaseException e) {
           e.printStackTrace();
            return this.error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage());
        }
    }
    /**
     *    文档历史版本
     * @param request
     * @return
     */
    @RequestMapping(value = "/document-history/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String findDocumentHistory(HttpServletRequest request) {
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION);
            return OK_List(documentService.findDocumentHistory(fse.getUUID()));
        } catch (BaseException e) {
           e.printStackTrace();
            return this.error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage());
        }
    }
    /**
     *    文档最新版本保存
     * @param request
     * @return
     */
    @RequestMapping(value = "/document-save-new-version/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String documentSaveNewVersion(HttpServletRequest request) {
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION);
            if (documentService.documentSaveNewVersion(fse)) {
            return OK();
         }
            return error(DocumentCode.DOCUMENT_SAVE_NEW_VERION_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_NEW_VERION_FAIL.getText());
        } catch (BaseException e) {
           e.printStackTrace();
            return this.error(e);
@@ -472,7 +516,7 @@
    @RequestMapping(value = "/getApplayFileSort/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String getApplayFileSort(){
        DataTableEntity applayFileSort = documentService.getApplayFileSort();
        DataTableEntity applayFileSort = documentService.getApplyFileSort();
        return  OK_List(applayFileSort);
    }
@@ -484,7 +528,7 @@
    @RequestMapping(value = "/getApplayUserSort/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String getApplayUserSort(){
        DataTableEntity applayFileSort = documentService.getApplayUserSort();
        DataTableEntity applayFileSort = documentService.getApplyUserSort();
        return  OK_List(applayFileSort);
    }
@@ -509,7 +553,7 @@
                    .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
            return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
        }
        FieldSetEntity applayInfo = documentService.getApplayInfo(fse);
        FieldSetEntity applayInfo = documentService.getApplyInfo(fse);
        return OK_List(applayInfo);
    }