| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | 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 com.product.file.util.ResultInfo; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.util.BaseUtil; |
| | | import com.product.util.support.AbstractBaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.swing.text.Document; |
| | | import java.util.*; |
| | | import java.util.function.DoubleConsumer; |
| | | |
| | | |
| | | /** |
| | | * Copyright LX-BASE |
| | |
| | | @RequestMapping("/api/document") |
| | | @RestController |
| | | public class DocumentController extends AbstractBaseController { |
| | | @Autowired |
| | | public DocumentService documentService; |
| | | @Autowired |
| | | public DocumentService documentService; |
| | | |
| | | /** |
| | | * 新增文件数据(上传)3 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/addDocument/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String addDocument(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request); |
| | | IDocumentService service = (IDocumentService) getProxyInstance(documentService); |
| | | String uuids = service.addDocument(fse); |
| | | return OK_Add(uuids); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | @PostMapping("/permission/{version}") |
| | | @ApiVersion(1) |
| | | public String permission(HttpServletRequest request) { |
| | | try { |
| | | FieldSetEntity fieldSetEntity = BaseUtil.getFieldSetEntity(request); |
| | | String documentUuid = fieldSetEntity.getString("document_uuid"); |
| | | return BaseUtil.success(documentService.isPermission(documentUuid)); |
| | | } catch (BaseException e) { |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | return this.error(DocumentCode.GET_DOCUMENT_PERMISSIONS_FAIL, e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 重命名(编辑)4 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/upDocumentName/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String upDocumentName(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | IDocumentService service = (IDocumentService) getProxyInstance(documentService); |
| | | boolean flag = service.upDocumentName(fse); |
| | | if (flag) { |
| | | return OK(); |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText()); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | /** |
| | | * 新增文件数据(上传)3 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/addDocument/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String addDocument(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request); |
| | | IDocumentService service = (IDocumentService) getProxyInstance(documentService); |
| | | String uuids = service.addDocument(fse); |
| | | return OK_Add(uuids); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除文件(批量删除)5 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/delDocument/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String delDocument(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | IDocumentService service = (IDocumentService) getProxyInstance(documentService); |
| | | boolean flag = service.delDocument(fse); |
| | | if (flag) { |
| | | return OK(); |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_DELETE_FAIL.getText()); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_DELETE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据文件夹获取文件列表(查看)1 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/documentAll/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String documentAll(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | DataTableEntity dataTableEntity = documentService.documentAll(fse); |
| | | return OK_List(dataTableEntity); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_GET_LIST_FAIL.getValue(), DocumentCode.DOCUMENT_GET_LIST_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取文件详情(查看)1 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/documentInfo/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String documentInfo(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | return OK_List(documentService.documentInfo(fse)); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_GET_FAIL.getValue(), DocumentCode.DOCUMENT_GET_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取当前用户文档目录按钮权限权限 |
| | | * 和文件全路径 |
| | | * 若有查看权限查看所有文件 |
| | | * 权限1(查看),2(下载),3(新增{批量上传}),4(修改),5(批量删除),6(批量移动) |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getButtonPermissions/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getButtonPermissions(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | if (BaseUtil.strIsNull(fse.getString(CmnConst.DIRECTORY_UUID))) { |
| | | return OK(); |
| | | } |
| | | FieldSetEntity fieldSet = documentService.getButtonPermissions(fse); |
| | | DataTableEntity dataTableEntity = fieldSet.getSubDataTable("dataTable"); |
| | | String str = OK_List(dataTableEntity); |
| | | JSONObject object = JSONObject.parseObject(str); |
| | | JSONArray systemFieldMeta = object.getJSONArray("systemFieldMeta"); |
| | | Object systemSeniorQueryString = object.get("systemSeniorQueryString"); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("systemFieldMeta", systemFieldMeta); |
| | | map.put("systemSeniorQueryString", systemSeniorQueryString); |
| | | //传入fieldSet, 和额外的map 对象 |
| | | return BaseUtil.success(fieldSet, map); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_GET_LIST_FAIL.getValue(), DocumentCode.DOCUMENT_GET_LIST_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 弹出移动目录框 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/popBoxGetFileDirectory/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String popBoxGetFileDirectory(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | JSONObject obj = documentService.popBoxGetFileDirectory(fse); |
| | | return ResultInfo.success(obj); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 移动(文件批量移动)6 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/fileMoveTo/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String fileMoveTo(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | if (documentService.fileMoveTo(fse)) { |
| | | return OK(); |
| | | } else { |
| | | return this.error(DocumentCode.DOCUMENT_USER_RIGHT_FAIL.getValue(), DocumentCode.DOCUMENT_USER_RIGHT_FAIL.getText()); |
| | | } |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_MOVE_FAIL.getValue(), DocumentCode.DOCUMENT_MOVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getDocumentLog/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getDocumentLog(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | return OK_List(documentService.getDocumentLog(fse)); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_LOG_FAIL.getValue(), DocumentCode.DOCUMENT_LOG_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 文档收藏 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/collection/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String documentCollection(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION); |
| | | return OK_Add(documentService.documentCollection(fse)); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return this.error(DocumentCode.DOCUMENT_COLLECTION_FAIL.getValue(), DocumentCode.DOCUMENT_COLLECTION_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 文档取消收藏 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/cancel-collection/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String documentCancelCollection(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION); |
| | | if (documentService.documentCancelCollection(fse.getString("document_uuid"))) { |
| | | /** |
| | | * 重命名(编辑)4 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/upDocumentName/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String upDocumentName(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | IDocumentService service = (IDocumentService) getProxyInstance(documentService); |
| | | boolean flag = service.upDocumentName(fse); |
| | | if (flag) { |
| | | 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 this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText()); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除文件(批量删除)5 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/delDocument/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String delDocument(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | IDocumentService service = (IDocumentService) getProxyInstance(documentService); |
| | | boolean flag = service.delDocument(fse); |
| | | if (flag) { |
| | | 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()); |
| | | } |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_DELETE_FAIL.getText()); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_DELETE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据文件夹获取文件列表(查看)1 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/documentAll/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String documentAll(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | DataTableEntity dataTableEntity = documentService.documentAll(fse); |
| | | return OK_List(dataTableEntity); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_GET_LIST_FAIL.getValue(), DocumentCode.DOCUMENT_GET_LIST_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取文件详情(查看)1 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/documentInfo/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String documentInfo(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | return OK_List(documentService.documentInfo(fse)); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_GET_FAIL.getValue(), DocumentCode.DOCUMENT_GET_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取当前用户文档目录按钮权限权限 |
| | | * 和文件全路径 |
| | | * 若有查看权限查看所有文件 |
| | | * 权限1(查看),2(下载),3(新增{批量上传}),4(修改),5(批量删除),6(批量移动) |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getButtonPermissions/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getButtonPermissions(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | if (BaseUtil.strIsNull(fse.getString(CmnConst.DIRECTORY_UUID))) { |
| | | return OK(); |
| | | } |
| | | FieldSetEntity fieldSet = documentService.getButtonPermissions(fse); |
| | | DataTableEntity dataTableEntity = fieldSet.getSubDataTable("dataTable"); |
| | | String str = OK_List(dataTableEntity); |
| | | JSONObject object = JSONObject.parseObject(str); |
| | | JSONArray systemFieldMeta = object.getJSONArray("systemFieldMeta"); |
| | | Object systemSeniorQueryString = object.get("systemSeniorQueryString"); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("systemFieldMeta", systemFieldMeta); |
| | | map.put("systemSeniorQueryString", systemSeniorQueryString); |
| | | //传入fieldSet, 和额外的map 对象 |
| | | return BaseUtil.success(fieldSet, map); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_GET_LIST_FAIL.getValue(), DocumentCode.DOCUMENT_GET_LIST_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 弹出移动目录框 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/popBoxGetFileDirectory/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String popBoxGetFileDirectory(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | JSONObject obj = documentService.popBoxGetFileDirectory(fse); |
| | | return ResultInfo.success(obj); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 移动(文件批量移动)6 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/fileMoveTo/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String fileMoveTo(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | if (documentService.fileMoveTo(fse)) { |
| | | return OK(); |
| | | } else { |
| | | return this.error(DocumentCode.DOCUMENT_USER_RIGHT_FAIL.getValue(), DocumentCode.DOCUMENT_USER_RIGHT_FAIL.getText()); |
| | | } |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_MOVE_FAIL.getValue(), DocumentCode.DOCUMENT_MOVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/getApplyDocument/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getApplyDocument(HttpServletRequest request){ |
| | | /** |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getDocumentLog/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getDocumentLog(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | return OK_List(documentService.getDocumentLog(fse)); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_LOG_FAIL.getValue(), DocumentCode.DOCUMENT_LOG_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | DataTableEntity applyDocument = documentService.getApplyDocument(fse); |
| | | return OK_List(applyDocument); |
| | | /** |
| | | * 文档收藏 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/collection/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String documentCollection(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION); |
| | | return OK_Add(documentService.documentCollection(fse)); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return this.error(DocumentCode.DOCUMENT_COLLECTION_FAIL.getValue(), DocumentCode.DOCUMENT_COLLECTION_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | /** |
| | | * 文档取消收藏 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/cancel-collection/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String documentCancelCollection(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION); |
| | | if (documentService.documentCancelCollection(fse.getString("document_uuid"))) { |
| | | 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_HISTORY); |
| | | 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); |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 文档申请保存与更新 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/addOrUpdateApplyDocument/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String addOrUpdateApplyDocument(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()); |
| | | } |
| | | documentService.addOrUpdateApplyDocument(fse); |
| | | return OK(); |
| | | } |
| | | @RequestMapping(value = "/getApplyDocument/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getApplyDocument(HttpServletRequest request) { |
| | | |
| | | /** |
| | | * 借阅文档排名 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getApplayFileSort/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getApplayFileSort(){ |
| | | DataTableEntity applayFileSort = documentService.getApplayFileSort(); |
| | | return OK_List(applayFileSort); |
| | | } |
| | | //获取参数 |
| | | 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()); |
| | | } |
| | | DataTableEntity applyDocument = documentService.getApplyDocument(fse); |
| | | return OK_List(applyDocument); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 文档借阅人员排名 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getApplayUserSort/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getApplayUserSort(){ |
| | | DataTableEntity applayFileSort = documentService.getApplayUserSort(); |
| | | return OK_List(applayFileSort); |
| | | } |
| | | /** |
| | | * 文档申请保存与更新 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/addOrUpdateApplyDocument/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String addOrUpdateApplyDocument(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()); |
| | | } |
| | | documentService.addOrUpdateApplyDocument(fse); |
| | | return OK(); |
| | | } |
| | | |
| | | /** |
| | | * 获取借阅详情信息 |
| | | * @param request |
| | | */ |
| | | /** |
| | | * 借阅文档排名 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getApplayFileSort/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getApplayFileSort() { |
| | | DataTableEntity applayFileSort = documentService.getApplyFileSort(); |
| | | return OK_List(applayFileSort); |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | | * 文档借阅人员排名 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getApplayUserSort/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String 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); |
| | | } |
| | | |
| | | } |
| | | |