Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
a004e9cf
Commit
a004e9cf
authored
Jan 13, 2022
by
翁国栋
Committed by
284718418@qq.com
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
所有文件
parent
6cc231db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
0 deletions
+87
-0
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
+87
-0
No files found.
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
View file @
a004e9cf
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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment