| | |
| | | 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); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/getApplyDocument/{version}", method = RequestMethod.POST) |
| | |
| | | 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.getApplayInfo(fse); |
| | | return OK_List(applayInfo); |
| | | } |
| | | |
| | | } |
| | | |
| | | |