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
417a7ad6
Commit
417a7ad6
authored
Jan 06, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.云盘-我的文件业务代码
parent
9a142539
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
+1
-0
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
+7
-11
No files found.
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
View file @
417a7ad6
...
...
@@ -71,6 +71,7 @@ public class DiskCatalogueController {
}
diskCatalogue
.
setCreateUserId
(
empNum
);
diskCatalogue
.
setOrgId
(
orgCode
);
diskCatalogue
.
setUserName
(
userBean
.
getUserInfo
().
getName
());
diskCatalogue
.
setUpdateUserId
(
empNum
);
Boolean
count
=
diskCatalogue
.
insertOrUpdate
();
if
(
count
)
{
...
...
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
View file @
417a7ad6
...
...
@@ -71,8 +71,6 @@ public class DiskFilesController {
if
(
file
==
null
||
file
.
length
==
0
)
{
return
ResultUtil
.
error
(
"上传失败,请选择上传文件"
);
}
Integer
empNum
=
userBean
.
getEmpNum
();
Integer
orgCode
=
userBean
.
getOrgCode
();
DiskFiles
diskFiles
=
new
DiskFiles
();
DiskCatalogueFiles
diskCatalogueFiles
=
new
DiskCatalogueFiles
();
DiskFilesLog
diskFilesLog
=
new
DiskFilesLog
();
...
...
@@ -82,7 +80,7 @@ public class DiskFilesController {
imageUrls
=
ftpService
.
uploadFile
(
targetPath
,
file
,
reservedName
);
for
(
FileInfoDto
dto
:
imageUrls
)
{
//新增资源上传文件
diskFiles
.
setCreateUserId
(
empNum
);
diskFiles
.
setCreateUserId
(
userBean
.
getEmpNum
()
);
diskFiles
.
setFileType
(
dto
.
getFileSuffix
());
//"/home/disk/123456.jpg"
diskFiles
.
setDiskPath
(
root
+
targetPath
+
"/"
+
dto
.
getFileName
());
...
...
@@ -91,6 +89,7 @@ public class DiskFilesController {
diskFiles
.
setFileSize
(
dto
.
getFileSize
());
// 显示大小:10KB,5M,2G 后续优化
diskFiles
.
setShowSize
(
dto
.
getFileSize
()
+
"B"
);
diskFiles
.
setUserName
(
userBean
.
getUserInfo
().
getName
());
diskFiles
.
insert
();
//新增中间关系
...
...
@@ -104,7 +103,7 @@ public class DiskFilesController {
diskFilesLog
.
setFileSize
(
dto
.
getFileSize
()
+
"B"
);
diskFilesLog
.
setTitle
(
dto
.
getResourceFileName
());
diskFilesLog
.
setType
(
JxglEnumInterface
.
DiskFilesLogType
.
CREATE_LOG
.
getType
());
diskFilesLog
.
setUserId
(
empNum
);
diskFilesLog
.
setUserId
(
userBean
.
getEmpNum
()
);
diskFilesLog
.
setUserName
(
userBean
.
getUserInfo
().
getName
());
diskFilesLog
.
insert
();
...
...
@@ -124,8 +123,6 @@ public class DiskFilesController {
if
(
fileId
==
null
||
fileId
<=
0
)
{
return
ResultUtil
.
error
(
"下载失败,请选择文件下载"
);
}
Integer
empNum
=
userBean
.
getEmpNum
();
Integer
orgCode
=
userBean
.
getOrgCode
();
DiskFiles
diskFiles
=
DiskFiles
.
builder
().
id
(
fileId
).
build
().
selectById
();
if
(
StringUtils
.
isEmpty
(
diskFiles
)){
return
ResultUtil
.
error
(
"下载失败,文件不存在"
);
...
...
@@ -140,7 +137,7 @@ public class DiskFilesController {
diskFilesLog
.
setFileSize
(
diskFiles
.
getFileSize
()
+
"B"
);
diskFilesLog
.
setTitle
(
diskFiles
.
getTitle
());
diskFilesLog
.
setType
(
JxglEnumInterface
.
DiskFilesLogType
.
DOWN_LOAD_LOG
.
getType
());
diskFilesLog
.
setUserId
(
empNum
);
diskFilesLog
.
setUserId
(
userBean
.
getEmpNum
()
);
diskFilesLog
.
setUserName
(
userBean
.
getUserInfo
().
getName
());
diskFilesLog
.
insert
();
return
ResultUtil
.
success
();
...
...
@@ -162,15 +159,14 @@ public class DiskFilesController {
@ApiOperation
(
value
=
"文件重命名"
,
httpMethod
=
"POST"
,
notes
=
"文件重命名"
)
public
Result
<
Object
>
updateFileName
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
DiskFilesParam
diskFilesParam
)
{
try
{
Integer
empNum
=
userBean
.
getEmpNum
();
DiskFiles
entity
=
new
DiskFiles
();
DiskFiles
diskFiles
=
DiskFiles
.
builder
().
id
(
diskFilesParam
.
getId
()).
build
().
selectById
();
if
(
StringUtils
.
isEmpty
(
diskFiles
)
||
!
diskFiles
.
getCreateUserId
().
equals
(
empNum
))
{
if
(
StringUtils
.
isEmpty
(
diskFiles
)
||
!
diskFiles
.
getCreateUserId
().
equals
(
userBean
.
getEmpNum
()
))
{
return
ResultUtil
.
error
(
"操作失败!"
);
}
entity
.
setId
(
diskFiles
.
getId
());
entity
.
setTitle
(
diskFilesParam
.
getName
());
entity
.
setUpdateUserId
(
empNum
);
entity
.
setUpdateUserId
(
userBean
.
getEmpNum
()
);
DiskFilesLog
diskFilesLog
=
new
DiskFilesLog
();
diskFilesLog
.
setType
(
JxglEnumInterface
.
DiskFilesLogType
.
UPDATE_LOG
.
getType
());
if
(!
StringUtils
.
isEmpty
(
diskFilesParam
.
getDeleteFlag
())){
...
...
@@ -184,7 +180,7 @@ public class DiskFilesController {
diskFilesLog
.
setFilesId
(
diskFiles
.
getId
());
diskFilesLog
.
setFileSize
(
diskFiles
.
getFileSize
()
+
"B"
);
diskFilesLog
.
setTitle
(
diskFiles
.
getTitle
());
diskFilesLog
.
setUserId
(
empNum
);
diskFilesLog
.
setUserId
(
userBean
.
getEmpNum
()
);
diskFilesLog
.
setUserName
(
userBean
.
getUserInfo
().
getName
());
diskFilesLog
.
insert
();
return
ResultUtil
.
data
(
StringUtils
.
isEmpty
(
diskFilesParam
.
getDeleteFlag
())?
"文件重命名成功"
:
"删除文件成功"
);
...
...
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