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
086cc8b1
Commit
086cc8b1
authored
Feb 24, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改BUG1350
parent
986e3bea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
0 deletions
+53
-0
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
+2
-0
src/main/java/cn/timer/api/controller/disk/sevice/DiskCatalogueService.java
+9
-0
src/main/java/cn/timer/api/controller/disk/sevice/DiskCatalogueServiceImpl.java
+31
-0
src/main/java/cn/timer/api/dao/disk/DiskCatalogueMapper.java
+6
-0
src/main/resources/mapping/disk/DiskCatalogueMapper.xml
+5
-0
No files found.
src/main/java/cn/timer/api/controller/disk/DiskCatalogueController.java
View file @
086cc8b1
...
@@ -355,6 +355,8 @@ public class DiskCatalogueController {
...
@@ -355,6 +355,8 @@ public class DiskCatalogueController {
boolean
flag
=
diskCatalogue
.
updateById
();
boolean
flag
=
diskCatalogue
.
updateById
();
if
(
flag
){
if
(
flag
){
//资源上传文件 资源目录,上传文件中间关系
diskCatalogueService
.
updateDiskCatalogue
(
diskCatalogue
);
return
ResultUtil
.
success
();
return
ResultUtil
.
success
();
}
else
{
}
else
{
return
ResultUtil
.
error
(
"操作失败!"
);
return
ResultUtil
.
error
(
"操作失败!"
);
...
...
src/main/java/cn/timer/api/controller/disk/sevice/DiskCatalogueService.java
View file @
086cc8b1
...
@@ -27,4 +27,13 @@ public interface DiskCatalogueService {
...
@@ -27,4 +27,13 @@ public interface DiskCatalogueService {
* @return
* @return
*/
*/
List
<
DiskCatalogue
>
getDiskCatalogue
(
DiskCatalogueParam
diskCatalogueParam
);
List
<
DiskCatalogue
>
getDiskCatalogue
(
DiskCatalogueParam
diskCatalogueParam
);
/**
* 逻辑删除 文件夹,空间 ,中间关系以及文件
* @param diskCatalogue
* @return Boolean
*/
boolean
updateDiskCatalogue
(
DiskCatalogue
diskCatalogue
);
}
}
src/main/java/cn/timer/api/controller/disk/sevice/DiskCatalogueServiceImpl.java
View file @
086cc8b1
...
@@ -70,6 +70,37 @@ public class DiskCatalogueServiceImpl implements DiskCatalogueService {
...
@@ -70,6 +70,37 @@ public class DiskCatalogueServiceImpl implements DiskCatalogueService {
return
null
;
return
null
;
}
}
@Override
public
boolean
updateDiskCatalogue
(
DiskCatalogue
diskCatalogue
)
{
List
<
Integer
>
ids
=
diskCatalogueMapper
.
selectIdListById
(
diskCatalogue
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
ids
)){
return
true
;
}
List
<
DiskCatalogueFiles
>
diskCatalogueFilesList
=
DiskCatalogueFiles
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
DiskCatalogueFiles
>()
.
lambda
().
in
(
DiskCatalogueFiles:
:
getCatalogueId
,
ids
)
.
eq
(
DiskCatalogueFiles:
:
getDeleteFlag
,
0
)
);
if
(
CollectionUtils
.
isEmpty
(
diskCatalogueFilesList
)){
return
true
;
}
// 逻辑删除
DiskCatalogueFiles
.
builder
().
deleteFlag
(
1
).
build
().
update
(
new
QueryWrapper
<
DiskCatalogueFiles
>()
.
lambda
().
in
(
DiskCatalogueFiles:
:
getCatalogueId
,
ids
)
.
eq
(
DiskCatalogueFiles:
:
getDeleteFlag
,
0
)
);
List
<
Integer
>
filesIds
=
diskCatalogueFilesList
.
stream
().
map
(
item
->
item
.
getFilesId
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
filesIds
)){
return
true
;
}
// 逻辑删除
DiskFiles
.
builder
().
deleteFlag
(
1
).
updateUserId
(
diskCatalogue
.
getUpdateUserId
()).
build
().
update
(
new
QueryWrapper
<
DiskFiles
>()
.
lambda
().
in
(
DiskFiles:
:
getId
,
filesIds
)
.
eq
(
DiskFiles:
:
getDeleteFlag
,
0
)
);
return
true
;
}
/**
/**
* 递归获取树形结构
* 递归获取树形结构
*
*
...
...
src/main/java/cn/timer/api/dao/disk/DiskCatalogueMapper.java
View file @
086cc8b1
...
@@ -2,9 +2,13 @@ package cn.timer.api.dao.disk;
...
@@ -2,9 +2,13 @@ package cn.timer.api.dao.disk;
import
cn.timer.api.bean.disk.DiskCatalogue
;
import
cn.timer.api.bean.disk.DiskCatalogue
;
import
cn.timer.api.dto.disk.DiskCatalogueParam
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
/**
* 云盘-资源目录表
* 云盘-资源目录表
*
*
...
@@ -14,5 +18,7 @@ import org.springframework.stereotype.Repository;
...
@@ -14,5 +18,7 @@ import org.springframework.stereotype.Repository;
*/
*/
@Repository
@Repository
public
interface
DiskCatalogueMapper
extends
BaseMapper
<
DiskCatalogue
>
{
public
interface
DiskCatalogueMapper
extends
BaseMapper
<
DiskCatalogue
>
{
List
<
Integer
>
selectIdListById
(
@Param
(
"id"
)
Integer
id
);
}
}
src/main/resources/mapping/disk/DiskCatalogueMapper.xml
View file @
086cc8b1
...
@@ -23,4 +23,8 @@
...
@@ -23,4 +23,8 @@
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
</resultMap>
<select
id=
"selectIdListById"
resultType=
"java.lang.Integer"
>
SELECT id FROM disk_catalogue WHERE delete_flag = 0 AND find_in_set(#{id},parent_ids)
</select>
</mapper>
</mapper>
\ No newline at end of file
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