Ejemplo n.º 1
0
 /**
  * @Title: batchRecover @Description: Ajax批量恢复
  *
  * @param ids
  * @return JsonResult
  */
 @RequestMapping(value = "/batchrecover", method = RequestMethod.POST)
 public @ResponseBody JsonResult batchRecover(String ids) {
   File entity = new File();
   entity.setIs_delete(false);
   entity.getMap().put("ids", ids.split(","));
   return fileService.modifyRecover(entity);
 }
Ejemplo n.º 2
0
 /**
  * @Title: batchDelete @Description: Ajax批量逻辑删除
  *
  * @param ids
  * @return JsonResult
  */
 @RequestMapping(value = "/batchlogicdelete", method = RequestMethod.POST)
 public @ResponseBody JsonResult batchLogicDelete(String ids) {
   File entity = new File();
   entity.getMap().put("ids", ids.split(","));
   entity.setIs_delete(true);
   return fileService.modify(entity);
 }
Ejemplo n.º 3
0
 /**
  * @Title: update @Description: 进入修改页面
  *
  * @param id
  * @param directory_id 文件夹id
  * @param model
  * @return String
  */
 @RequestMapping("/update")
 public String update(Integer id, Integer directory_id, Model model) {
   File entity = fileService.findById(id);
   model.addAttribute("model", entity);
   model.addAttribute("directory_id", directory_id);
   return getPathUpdate();
 }
Ejemplo n.º 4
0
 /**
  * @Title: delete @Description: Ajax逻辑删除
  *
  * @param id
  * @return JsonResult
  */
 @RequestMapping(value = "/logicdelete", method = RequestMethod.POST)
 @ResponseBody
 public JsonResult logicDelete(Integer id) {
   File entity = new File();
   entity.setId(id);
   entity.setIs_delete(true);
   return fileService.modify(entity);
 }
Ejemplo n.º 5
0
  /**
   * @Title: update @Description: 进入修改文件名页面
   *
   * @param id
   * @param model
   * @return String
   */
  @RequestMapping("/updatename")
  public String updateName(Integer id, Model model) {
    File entity = fileService.findById(id);
    model.addAttribute("model", entity);
    model.addAttribute("file_name", entity.gainFileNameWithoutExt());

    return getPath("updatename");
  }
Ejemplo n.º 6
0
 /**
  * @Description 根据指定文件id下载文件
  *
  * @param id
  * @param request
  * @param response void
  */
 @RequestMapping("/download")
 public void download(Integer id, HttpServletRequest request, HttpServletResponse response) {
   File entity = fileService.findById(id);
   if (entity != null) {
     FileDownload download = new FileDownload(request, response);
     download.process(entity.getUrl(), entity.getName());
   }
 }
Ejemplo n.º 7
0
  /**
   * @Description 获取列表数据
   *
   * @param request
   * @param model
   * @author davidwan
   */
  private void getList(HttpServletRequest request, Model model) {
    int pageIndex = WebUtil.getInt(request, "page_index", 0);
    int pageSize = WebUtil.getInt(request, "page_size", ConfigValue.PAGE_SIZE);
    int menu_id = WebUtil.getInt(request, "menu_id", 0);
    Integer directoryId = WebUtil.getInteger(request, "directory_id", null);
    Integer creatorId = WebUtil.getInteger(request, "creator_id", null);
    String name = WebUtil.getString(request, "name", "");
    String types = WebUtil.getString(request, "types", "");
    String minCreateTime = WebUtil.getString(request, "min_create_time", "");
    String maxCreateTime = WebUtil.getString(request, "max_create_time", "");
    String notIds = WebUtil.getString(request, "not_ids", "");
    boolean isDelete = WebUtil.getBoolean(request, "is_delete", false);

    File entity = new File();
    entity.setDirectory_id(directoryId);
    entity.setCreator_id(creatorId);
    if (!isDelete) {
      entity.setModule_type(EnumDirModuleType.我的文档.getValue());
    }
    entity.getMap().put("is_delete", isDelete);

    if (StringUtils.isNotBlank(name)) {
      entity.getMap().put("name", name);
    }
    if (StringUtils.isNotBlank(types)) {
      entity.getMap().put("types", types.split(","));
    }
    if (StringUtils.isNotBlank(minCreateTime)) {
      entity.getMap().put("min_create_time", minCreateTime);
    }
    if (StringUtils.isNotBlank(maxCreateTime)) {
      entity.getMap().put("max_create_time", maxCreateTime);
    }
    if (StringUtils.isNotBlank(notIds)) {
      entity.getMap().put("not_ids", notIds.split(","));
    }

    PageInfo<File> pageInfo = fileService.queryPageList(entity, pageIndex, pageSize);
    model.addAttribute("list", pageInfo.getData());
    model.addAttribute("pageInfo", pageInfo);

    model.addAttribute("roleMenuList", super.gainRoleMenu(menu_id));
  }
Ejemplo n.º 8
0
  /**
   * @Description 获取总结文档列表数据
   *
   * @param request
   * @param model
   * @author davidwan
   */
  private void getSummaryList(HttpServletRequest request, Model model) {
    int pageIndex = WebUtil.getInt(request, "page_index", 0);
    int pageSize = WebUtil.getInt(request, "page_size", ConfigValue.PAGE_SIZE);
    int menu_id = WebUtil.getInt(request, "menu_id", 0);
    Integer directoryId = WebUtil.getInteger(request, "directory_id", null);
    // Integer creatorId = WebUtil.getInteger(request, "creator_id", null);
    Integer deptId = WebUtil.getInteger(request, "dept_id", null);
    String name = WebUtil.getString(request, "name", null);
    String creatorName = WebUtil.getString(request, "creator_name", null);
    String minCreateTime = WebUtil.getString(request, "min_create_time", null);
    String maxCreateTime = WebUtil.getString(request, "max_create_time", null);
    boolean isDelete = WebUtil.getBoolean(request, "is_delete", false);

    File entity = new File();
    entity.setDirectory_id(directoryId);
    entity.setModule_type(EnumDirModuleType.总结文档.getValue());
    entity.getMap().put("is_delete", isDelete);
    entity.getMap().put("dept_id", deptId);
    entity.getMap().put("current_user_id", getCurrentUserId());

    if (StringUtils.isNotBlank(name)) {
      entity.getMap().put("name", name);
    }
    if (StringUtils.isNotBlank(creatorName)) {
      entity.getMap().put("creator_name", creatorName);
    }
    if (StringUtils.isNotBlank(minCreateTime)) {
      entity.getMap().put("min_create_time", minCreateTime);
    }
    if (StringUtils.isNotBlank(maxCreateTime)) {
      entity.getMap().put("max_create_time", maxCreateTime);
    }

    model.addAttribute("userId", getCurrentUserId());

    PageInfo<File> pageInfo = fileService.querySummaryPageList(entity, pageIndex, pageSize);
    model.addAttribute("list", pageInfo.getData());
    model.addAttribute("pageInfo", pageInfo);
    model.addAttribute("roleMenuList", super.gainRoleMenu(menu_id));
  }
Ejemplo n.º 9
0
  /**
   * @Description 获取列表数据
   *
   * @param request
   * @param model
   * @return String
   * @author davidwan
   */
  @RequestMapping("/showdatalist")
  public String showDatalist(HttpServletRequest request, Model model) {
    int pageIndex = WebUtil.getInt(request, "page_index", 0);
    int pageSize = WebUtil.getInt(request, "page_size", ConfigValue.PAGE_SIZE);
    String name = WebUtil.getString(request, "name", null);
    String minCreateTime = WebUtil.getString(request, "min_create_time", null);
    String maxCreateTime = WebUtil.getString(request, "max_create_time", null);

    File entity = new File();
    entity.setModule_type(3);
    if (StringUtils.isNotBlank(name)) {
      entity.getMap().put("name", name);
    }
    if (StringUtils.isNotBlank(minCreateTime)) {
      entity.getMap().put("min_create_time", minCreateTime);
    }
    if (StringUtils.isNotBlank(maxCreateTime)) {
      entity.getMap().put("max_create_time", maxCreateTime);
    }
    PageInfo<File> pageInfo = fileService.queryPageList(entity, pageIndex, pageSize);
    model.addAttribute("list", pageInfo.getData());
    model.addAttribute("pageInfo", pageInfo);
    return getPath("showdata_list");
  }
Ejemplo n.º 10
0
 /**
  * @Description Ajax保存批量设置可见用户
  *
  * @param file_ids
  * @param user_ids
  * @return JsonResult
  */
 @RequestMapping(value = "/batchfileuser", method = RequestMethod.POST)
 public @ResponseBody JsonResult batchFileUser(String file_ids, String user_ids) {
   return fileService.modifyForFileUser(file_ids, user_ids);
 }
Ejemplo n.º 11
0
 /**
  * @Description 进入详情页面
  *
  * @param id
  * @param model
  * @return String
  * @author davidwan
  */
 @RequestMapping("/view")
 public String view(Integer id, Model model) {
   File entity = fileService.findById(id);
   model.addAttribute("model", entity);
   return getPathView();
 }
Ejemplo n.º 12
0
 /**
  * @Title: add @Description: Ajax保存添加数据
  *
  * @param entity
  * @return JsonResult
  */
 @RequestMapping(value = "/add", method = RequestMethod.POST)
 public @ResponseBody JsonResult add(File entity) {
   return fileService.create(entity);
 }
Ejemplo n.º 13
0
 /**
  * @Title: delete @Description: Ajax删除
  *
  * @param id
  * @return JsonResult
  */
 @RequestMapping(value = "/delete", method = RequestMethod.POST)
 @ResponseBody
 public JsonResult delete(Integer id) {
   return fileService.removeById(id);
 }
Ejemplo n.º 14
0
 /**
  * @Title: batchDelete @Description: Ajax批量删除
  *
  * @param ids
  * @return JsonResult
  */
 @RequestMapping(value = "/batchdelete", method = RequestMethod.POST)
 public @ResponseBody JsonResult batchDelete(String ids) {
   return fileService.removeByIds(ids);
 }
Ejemplo n.º 15
0
 /**
  * @Title: update @Description: Ajax保存修改信息
  *
  * @param entity
  * @return JsonResult
  */
 @RequestMapping(value = "/update", method = RequestMethod.POST)
 public @ResponseBody JsonResult update(File entity) {
   return fileService.modify(entity);
 }
Ejemplo n.º 16
0
 /**
  * @Title: recover @Description: Ajax恢复
  *
  * @param id
  * @return JsonResult
  */
 @RequestMapping(value = "/recover", method = RequestMethod.POST)
 @ResponseBody
 public JsonResult recover(Integer id) {
   File entity = new File(id, false);
   return fileService.modify(entity);
 }
Ejemplo n.º 17
0
 /**
  * @Title: update @Description: Ajax保存修改文件名信息
  *
  * @param entity
  * @return JsonResult
  */
 @RequestMapping(value = "/updatename", method = RequestMethod.POST)
 public @ResponseBody JsonResult updateName(File entity) {
   entity.setName(entity.getName() + "." + entity.getExtension());
   return fileService.modify(entity);
 }
Ejemplo n.º 18
0
 /**
  * @Title: update @Description: 进入修改页面
  *
  * @param id
  * @param model
  * @return String
  */
 @RequestMapping("/fileuser")
 public String fileuser(Integer id, Model model) {
   File entity = fileService.findWithUsersById(id);
   model.addAttribute("model", entity);
   return getPath("fileuser");
 }
Ejemplo n.º 19
0
 /**
  * @Title: update @Description: Ajax保存修改信息
  *
  * @param entity
  * @return JsonResult
  */
 @RequestMapping(value = "/fileuser", method = RequestMethod.POST)
 public @ResponseBody JsonResult fileuser(Integer file_id, String user_ids) {
   return fileService.modifyForFileUser(file_id, user_ids);
 }