From a518ef8df36abe8d80733797d4e1322af79a4c34 Mon Sep 17 00:00:00 2001 From: 杜洪波 <1074825718@qq.com> Date: 星期一, 26 八月 2024 15:47:06 +0800 Subject: [PATCH] Merge branch 'master' of http://nonxin.cn:8090/r/product/product-server-file/V2.0.0 --- src/main/java/com/product/file/controller/DocumentController.java | 79 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 74 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/product/file/controller/DocumentController.java b/src/main/java/com/product/file/controller/DocumentController.java index b91da85..3e38041 100644 --- a/src/main/java/com/product/file/controller/DocumentController.java +++ b/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,10 +528,35 @@ @RequestMapping(value = "/getApplayUserSort/{version}", method = RequestMethod.POST) @ApiVersion(1) public String getApplayUserSort(){ - DataTableEntity applayFileSort = documentService.getApplayUserSort(); + DataTableEntity applayFileSort = documentService.getApplyUserSort(); return OK_List(applayFileSort); } + /** + * 鑾峰彇鍊熼槄璇︽儏淇℃伅 + * @param request + */ + + @RequestMapping(value = "/getApplayInfo/{version}", method = RequestMethod.POST) + @ApiVersion(1) + public String getApplayInfo(HttpServletRequest request){ + //鑾峰彇鍙傛暟 + FieldSetEntity fse = null; + Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); + if (bean != null) { + RequestParameterEntity reqp = (RequestParameterEntity) bean; + fse = reqp.getFormData(); + } + //鍒ゆ柇鍙傛暟鏄惁涓虹┖ + if (fse == null) { + SpringMVCContextHolder + .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.getApplyInfo(fse); + return OK_List(applayInfo); + } + } -- Gitblit v1.9.2