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
6e837a8a
Commit
6e837a8a
authored
Jan 14, 2022
by
翁国栋
Committed by
284718418@qq.com
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除用户下的所有文件
parent
599a63ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
13 deletions
+43
-13
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
+43
-13
No files found.
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
View file @
6e837a8a
...
@@ -40,6 +40,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -40,6 +40,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.transaction.Transactional
;
import
javax.transaction.Transactional
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -406,26 +407,55 @@ public class DiskCatalogueController {
...
@@ -406,26 +407,55 @@ public class DiskCatalogueController {
}
}
/*查找ids第一个*/
/*查找ids第一个*/
diskCatalogueList
.
forEach
(
d
->{
diskCatalogueList
.
forEach
(
d
->{
getSubCatalogueList
(
d
.
getId
());
d
.
setDeleteFlag
(
1
);
d
.
updateById
();
});
return
ResultUtil
.
success
();
}
private
void
getSubCatalogueList
(
Integer
id
){
List
<
DiskCatalogue
>
subFileList
=
DiskCatalogue
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
DiskCatalogue
>().
lambda
()
.
like
(
DiskCatalogue:
:
getParentId
,
id
)
.
eq
(
DiskCatalogue:
:
getDeleteFlag
,
0
));
subFileList
.
forEach
(
s
->{
if
(
subFileList
.
size
()>
0
){
getSubCatalogueList
(
s
.
getId
());
}
List
<
DiskCatalogueFiles
>
diskCatalogueFilesList
=
DiskCatalogueFiles
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
DiskCatalogueFiles
>().
lambda
()
.
eq
(
DiskCatalogueFiles:
:
getCatalogueId
,
s
.
getId
())
.
eq
(
DiskCatalogueFiles:
:
getDeleteFlag
,
0
));
diskCatalogueFilesList
.
forEach
(
f
->{
DiskFiles
.
builder
().
deleteFlag
(
1
).
build
().
update
(
new
QueryWrapper
<
DiskFiles
>().
lambda
().
eq
(
DiskFiles:
:
getId
,
f
.
getFilesId
()));
f
.
setDeleteFlag
(
1
);
f
.
updateById
();
});
s
.
setDeleteFlag
(
1
);
s
.
updateById
();
});
}
// private void getSubCatalogueList2(Integer id){
// List<DiskCatalogue> subFileList =DiskCatalogue.builder().build().selectList(new QueryWrapper<DiskCatalogue>().lambda()
// List<DiskCatalogue> subFileList =DiskCatalogue.builder().build().selectList(new QueryWrapper<DiskCatalogue>().lambda()
// .like(DiskCatalogue::getParentId
s,d.getId()
)
// .like(DiskCatalogue::getParentId
,id
)
// .eq(DiskCatalogue::getDeleteFlag,0));
// .eq(DiskCatalogue::getDeleteFlag,0));
// List<DiskCatalogue> subFileList =diskCatalogueService.getSubCatalogueList(d.getId().toString(),diskCatalogueParam.getUserId());
// subFileList.forEach(s->{
// subFileList.forEach(s->{
// if(subFileList.size()>0){
// getSubCatalogueList(s.getId());
// }
// List<DiskCatalogueFiles> diskCatalogueFilesList = DiskCatalogueFiles.builder().build().selectList(new QueryWrapper<DiskCatalogueFiles>().lambda()
// List<DiskCatalogueFiles> diskCatalogueFilesList = DiskCatalogueFiles.builder().build().selectList(new QueryWrapper<DiskCatalogueFiles>().lambda()
// .eq(DiskCatalogueFiles::getCatalogueId,s.getId())
// .eq(DiskCatalogueFiles::getCatalogueId,s.getId())
// .eq(DiskCatalogueFiles::getDeleteFlag,0));
// .eq(DiskCatalogueFiles::getDeleteFlag,0));
// diskCatalogueFilesList.forEach(f->{
// if(diskCatalogueFilesList!=null) {
// DiskFiles.builder().deleteFlag(1).build().update(new QueryWrapper<DiskFiles>().lambda().eq(DiskFiles::getId,f.getFilesId()));
// if(diskCatalogueFilesList.size()>0) {
// });
// diskFilesService.deleteDiskFile(diskCatalogueFilesList.stream().map(DiskCatalogueFiles::getFilesId).collect(Collectors.toList()));
// }
// }
//// diskCatalogueFilesList.forEach(f->{
//// DiskFiles.builder().deleteFlag(1).build().update(new QueryWrapper<DiskFiles>().lambda().eq(DiskFiles::getId,f.getFilesId()));
//// });
// s.setDeleteFlag(1);
// s.setDeleteFlag(1);
// s.updateById();
// s.updateById();
// });
// });
d
.
setDeleteFlag
(
1
);
// }
d
.
updateById
();
});
return
ResultUtil
.
success
();
}
}
}
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