| | |
| | | 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; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | import java.util.function.DoubleConsumer; |
| | | |
| | | |
| | | /** |
| | | * Copyright LX-BASE |
| | |
| | | return this.error(DocumentCode.DOCUMENT_LOG_FAIL.getValue(), DocumentCode.DOCUMENT_LOG_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 文档收藏 |
| | | * @param request |
| | |
| | | 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); |
| | |
| | | @RequestMapping(value = "/getApplayFileSort/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getApplayFileSort(){ |
| | | DataTableEntity applayFileSort = documentService.getApplayFileSort(); |
| | | DataTableEntity applayFileSort = documentService.getApplyFileSort(); |
| | | return OK_List(applayFileSort); |
| | | } |
| | | |
| | |
| | | @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); |
| | | } |
| | | |
| | | } |
| | | |
| | | |