| | |
| | | import com.product.module.sys.config.SystemErrorCode; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.util.BaseUtil; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | @RequestMapping("/api/directory") |
| | | @RestController |
| | | public class DocumentDirectoryConstoller extends AbstractBaseController { |
| | | |
| | | @Autowired |
| | | public DocumentDirectoryService documentDirectoryService; |
| | | DocumentDirectoryService documentDirectoryService; |
| | | |
| | | /** |
| | | * 数据权限验证 |
| | | */ |
| | | @Autowired |
| | | PermissionService permissionService; |
| | | |
| | | /** |
| | | * 新增文件夹数据 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/all-directory-tree/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String allDirectoryTree(HttpServletRequest request) { |
| | | try { |
| | | // 获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DIRECTORY); |
| | | return com.product.util.ResultInfo.success(BaseUtil.dataTableEntityToJson(documentDirectoryService.allDirectoryTree())); |
| | | } 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_SAVE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增文件夹数据 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | 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()); |
| | | 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()); |
| | | } |
| | | IDocumentDirectoryService service = (IDocumentDirectoryService)getProxyInstance(documentDirectoryService); |
| | | return OK_Add(service.addDocumentDirectory(fse)); |
| | |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改文件夹 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | 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()); |
| | | 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()); |
| | | } |
| | | String uuid = fse.getString(CmnConst.UUID);//表uuid |
| | | //超级管理员为1 普通单位管理员2 |
| | |
| | | type = CoreConst.DATA_PERMISSION_VALID_TYPE_USER; |
| | | } |
| | | //数据操作的权限验证 |
| | | if(!permissionService.validDataPermission(CmnConst.product_oa_DIRECTORY,uuid,type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | if (!permissionService.validDataPermission(CmnConst.PRODUCT_OA_DIRECTORY, uuid, type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | } |
| | | IDocumentDirectoryService service = (IDocumentDirectoryService)getProxyInstance(documentDirectoryService); |
| | | if(service.upDocumentDirectory(fse)) { |
| | | return OK(); |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_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_CATALOG_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 个人文件夹重命名 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | 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()); |
| | | 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()); |
| | | } |
| | | String uuid = fse.getString(CmnConst.UUID);//表uuid |
| | | //超级管理员为1 普通单位管理员2 |
| | |
| | | type = CoreConst.DATA_PERMISSION_VALID_TYPE_USER; |
| | | } |
| | | //数据操作的权限验证 |
| | | if(!permissionService.validDataPermission(CmnConst.product_oa_DIRECTORY,uuid,type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | if (!permissionService.validDataPermission(CmnConst.PRODUCT_OA_DIRECTORY, uuid, type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | } |
| | | IDocumentDirectoryService service = (IDocumentDirectoryService)getProxyInstance(documentDirectoryService); |
| | | if(service.upDocumentDirectoryName(fse)) { |
| | | return OK(); |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getValue(), DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_DIRECTORY_NAME_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_DIRECTORY_NAME_FAIL.getValue(), DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除文件夹 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | 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()); |
| | | 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()); |
| | | } |
| | | String uuid = fse.getString(CmnConst.UUID);//表uuid |
| | | //超级管理员为1 普通单位管理员2 |
| | |
| | | type = CoreConst.DATA_PERMISSION_VALID_TYPE_USER; |
| | | } |
| | | //数据操作的权限验证 |
| | | if(!permissionService.validDataPermission(CmnConst.product_oa_DIRECTORY,uuid,type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | if (!permissionService.validDataPermission(CmnConst.PRODUCT_OA_DIRECTORY, uuid, type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | } |
| | | IDocumentDirectoryService service = (IDocumentDirectoryService)getProxyInstance(documentDirectoryService); |
| | | if(service.delDocumentDirectory(fse)){ |
| | | return OK(); |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_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_CATALOG_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 文件目录列表展示 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | 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()); |
| | | 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(documentDirectoryService.moveToList(fse)); |
| | | } catch (BaseException 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()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取文档目录树形列表 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | 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()); |
| | | 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 ResultInfo.success(documentDirectoryService.treeListAll(fse)); |
| | | } catch (BaseException e) { |
| | |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_TREE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_GET_TREE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_TREE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_GET_TREE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取文档目录详情 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | 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()); |
| | | 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()); |
| | | } |
| | | String uuid = fse.getString(CmnConst.UUID);//表uuid |
| | | //超级管理员为1 普通单位管理员2 |
| | |
| | | type = CoreConst.DATA_PERMISSION_VALID_TYPE_USER; |
| | | } |
| | | //数据操作的权限验证 |
| | | if(!permissionService.validDataPermission(CmnConst.product_oa_DIRECTORY,uuid,type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | if (!permissionService.validDataPermission(CmnConst.PRODUCT_OA_DIRECTORY, uuid, type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | } |
| | | return OK_List(documentDirectoryService.documentDirectoryInfo(fse)); |
| | | } catch (BaseException 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()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText()); |
| | | } |
| | | } |
| | | } |