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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
15 deletions
+45
-15
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
+45
-15
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
->{
// List<DiskCatalogue> subFileList =DiskCatalogue.builder().build().selectList(new QueryWrapper<DiskCatalogue>().lambda()
getSubCatalogueList
(
d
.
getId
());
// .like(DiskCatalogue::getParentIds,d.getId())
// .eq(DiskCatalogue::getDeleteFlag,0));
// List<DiskCatalogue> subFileList =diskCatalogueService.getSubCatalogueList(d.getId().toString(),diskCatalogueParam.getUserId());
// subFileList.forEach(s->{
// 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()));
// });
// s.setDeleteFlag(1);
// s.updateById();
// });
d
.
setDeleteFlag
(
1
);
d
.
setDeleteFlag
(
1
);
d
.
updateById
();
d
.
updateById
();
});
});
return
ResultUtil
.
success
();
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()
// .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));
// if(diskCatalogueFilesList!=null) {
// 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.updateById();
// });
// }
}
}
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