Commit e9765b17 by 284718418@qq.com

Merge remote-tracking branch 'origin/develop' into develop

parents 44ba2b77 725bc6b3
package cn.timer.api.controller.disk;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.disk.DiskCatalogue;
import cn.timer.api.bean.disk.DiskCatalogueFiles;
import cn.timer.api.bean.disk.DiskCloudDiskUser;
import cn.timer.api.bean.disk.DiskFiles;
import cn.timer.api.bean.htzz.HtzzAdminZzda;
import cn.timer.api.bean.kqgl.UserAttendanceRel;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.sbgjj.SbgjjAssoCbfa;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.JxglEnumInterface;
......@@ -17,8 +21,13 @@ import cn.timer.api.dto.disk.DiskCatalogueDto;
import cn.timer.api.dto.disk.DiskCatalogueParam;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.beust.jcommander.internal.Lists;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.base.Strings;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -305,4 +314,82 @@ public class DiskCatalogueController {
throw new CustomException("删除文件夹以及文件异常");
}
}
@GetMapping(value="/allFileList")
@ApiOperation(value = "获取企业下所有人的文件", httpMethod = "GET", notes = "获取企业下所有人的文件")
public Result<Object> allFileList(@CurrentUser UserBean userBean,
@ApiParam("当前页") @RequestParam(required = false, defaultValue = "1") Integer pageNum,
@ApiParam("每页条数") @RequestParam(required = false, defaultValue = "10") Integer pageSize,
@ApiParam("搜索关键字") @RequestParam(required = false) String query) {
Page<YgglMainEmp> page = new Page<YgglMainEmp>(
pageNum == null ? 1 : pageNum,
pageSize == null ? 10 : pageSize);
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code",userBean.getOrgCode());
IPage<YgglMainEmp> ygglMainEmpPage = YgglMainEmp.builder().build().selectPage(page, queryWrapper);
List<YgglMainEmp> zccrkgls = page.getRecords();
ygglMainEmpPage.getCurrent();
ygglMainEmpPage.getPages();
ygglMainEmpPage.getTotal();
ygglMainEmpPage.getSize();
return ResultUtil.data(ygglMainEmpPage, zccrkgls, "搜索成功");
}
@GetMapping(value = "/getFileById")
@ApiOperation(value = "查看用户文件夹列表", httpMethod = "GET", notes = "文件夹或共享空间:type=0共享空间,1文件夹")
@ApiOperationSupport(order = 2)
public Result<Object> getFileOfId(@CurrentUser UserBean userBean, DiskCatalogueParam diskCatalogueParam) {
diskCatalogueParam.setOrgId(userBean.getOrgCode());
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum,diskCatalogueParam.getUserId()));
// 获取文件夹
List<DiskCatalogue> diskCatalogueList = DiskCatalogue.builder().build().selectList(new QueryWrapper<DiskCatalogue>()
.lambda().eq(DiskCatalogue::getOrgId, userBean.getOrgCode())
.eq(diskCatalogueParam.getUserId()!=null,DiskCatalogue::getCreateUserId, diskCatalogueParam.getUserId())
.eq(DiskCatalogue::getParentId, diskCatalogueParam.getParentId())
.eq(DiskCatalogue::getType, diskCatalogueParam.getType())
.eq(DiskCatalogue::getDeleteFlag, 0)
);
if(StringUtils.isEmpty(diskCatalogueParam.getParentId()) || diskCatalogueParam.getParentId() == 0
&& JxglEnumInterface.DiskCatalogueType.DISK_YUN.getType().equals(diskCatalogueParam.getType())){
//空间 获取有权限的
List<DiskCatalogue> diskCatalogueList2 = diskCloudDiskUserService.getDiskCatalogueList(diskCatalogueParam);
if(!CollectionUtils.isEmpty(diskCatalogueList2)){
diskCatalogueList.addAll(diskCatalogueList2);
}
}
// 获取文件夹下所有文件
List<DiskFiles> filesList = diskFilesService.getDiskFiles(diskCatalogueParam);
// 获取面包屑
List<DiskCatalogue> breadcrumbDataList = Lists.newArrayList();
DiskCatalogue catalogue = DiskCatalogue.builder().id(diskCatalogueParam.getParentId()).build().selectById();
if(!StringUtils.isEmpty(catalogue)){
List<Integer> ids = new ArrayList<>();
if(!StringUtils.isEmpty(catalogue.getParentIds())){
String[] list = catalogue.getParentIds().split(",");
for (String str :list) {
ids.add(Integer.parseInt(str));
}
}
ids.add(catalogue.getId());
breadcrumbDataList = DiskCatalogue.builder().build().selectList(new QueryWrapper<DiskCatalogue>()
.lambda().in(DiskCatalogue::getId,ids)
.eq(DiskCatalogue::getOrgId, userBean.getOrgCode())
//.eq(DiskCatalogue::getCreateUserId, userBean.getEmpNum())
.eq(DiskCatalogue::getDeleteFlag, 0)
);
}
if (diskCatalogueParam.getType()!=0) {
breadcrumbDataList.add(0, DiskCatalogue.builder().name(ygglMainEmp.getName()).id(0).parentId(0).build());
}else{
breadcrumbDataList.add(0, DiskCatalogue.builder().name("共享空间").id(0).parentId(0).build());
}
Map<String,Object> map = new HashMap<>(3);
map.put("diskCatalogueData",diskCatalogueList);
map.put("diskFileData",filesList);
map.put("breadcrumbData",breadcrumbDataList);
return ResultUtil.data(map);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment