Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
legobackend
/
lego-manage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c930097a
authored
2026-01-16 16:37:07 +0800
by
chentao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
隐藏系列
1 parent
e83742f8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
124 additions
and
2 deletions
lego-admin/src/main/java/com/lego/web/controller/core/BuildingBlockController.java
lego-core/src/main/java/com/lego/core/domain/BuildingBlock.java
lego-core/src/main/java/com/lego/core/domain/bo/BuildingBlockBo.java
lego-core/src/main/java/com/lego/core/domain/vo/BuildingBlockVo.java
lego-core/src/main/java/com/lego/core/service/IBuildingBlockService.java
lego-core/src/main/java/com/lego/core/service/impl/BuildingBlockServiceImpl.java
lego-admin/src/main/java/com/lego/web/controller/core/BuildingBlockController.java
View file @
c930097
...
...
@@ -98,4 +98,28 @@ public class BuildingBlockController extends BaseController {
public
R
<
Void
>
remove
(
@PathVariable
String
id
)
throws
ServerException
{
return
toAjax
(
service
.
remove
(
id
));
}
@RepeatSubmit
()
@PutMapping
(
"/display/{id}"
)
public
R
<
Void
>
display
(
@PathVariable
String
id
)
throws
ServerException
{
return
toAjax
(
service
.
display
(
id
));
}
@RepeatSubmit
()
@PutMapping
(
"/batch/display/{buildingBlockIds}"
)
public
R
<
Void
>
batchDisplay
(
@PathVariable
String
[]
buildingBlockIds
)
throws
ServerException
{
return
toAjax
(
service
.
batchDisplay
(
buildingBlockIds
));
}
@RepeatSubmit
()
@PutMapping
(
"/hide/{id}"
)
public
R
<
Void
>
hide
(
@PathVariable
String
id
)
throws
ServerException
{
return
toAjax
(
service
.
hide
(
id
));
}
@RepeatSubmit
()
@PutMapping
(
"/batch/hide/{buildingBlockIds}"
)
public
R
<
Void
>
batchHide
(
@PathVariable
String
[]
buildingBlockIds
)
throws
ServerException
{
return
toAjax
(
service
.
batchHide
(
buildingBlockIds
));
}
}
...
...
lego-core/src/main/java/com/lego/core/domain/BuildingBlock.java
View file @
c930097
...
...
@@ -64,4 +64,9 @@ public class BuildingBlock extends BaseEntity {
*/
private
Long
sort
;
/**
* 是否可见
*/
private
boolean
visible
;
}
...
...
lego-core/src/main/java/com/lego/core/domain/bo/BuildingBlockBo.java
View file @
c930097
...
...
@@ -44,4 +44,8 @@ public class BuildingBlockBo extends BaseBO {
* 排序
*/
private
Long
sort
;
/**
* 是否可见
*/
private
boolean
visible
;
}
...
...
lego-core/src/main/java/com/lego/core/domain/vo/BuildingBlockVo.java
View file @
c930097
...
...
@@ -55,4 +55,13 @@ public class BuildingBlockVo {
* 套件信息
*/
List
<
EntiretyVo
>
entiretyList
;
/**
* 是否可见
*/
private
boolean
visible
;
/**
* 是否可见
*/
private
String
display
;
}
...
...
lego-core/src/main/java/com/lego/core/service/IBuildingBlockService.java
View file @
c930097
...
...
@@ -82,4 +82,39 @@ public interface IBuildingBlockService {
*/
BuildingBlockVo
get
(
String
id
);
/**
* 隐藏
*
* @param id
* @return
* @throws ServerException
*/
boolean
hide
(
String
id
)
throws
ServerException
;
/**
* 批量隐藏
*
* @param buildingBlockIds
* @return
* @throws ServerException
*/
boolean
batchHide
(
String
[]
buildingBlockIds
)
throws
ServerException
;
/**
* 显示
*
* @param id
* @return
* @throws ServerException
*/
boolean
display
(
String
id
)
throws
ServerException
;
/**
* 批量显示
*
* @param buildingBlockIds
* @return
* @throws ServerException
*/
boolean
batchDisplay
(
String
[]
buildingBlockIds
)
throws
ServerException
;
}
...
...
lego-core/src/main/java/com/lego/core/service/impl/BuildingBlockServiceImpl.java
View file @
c930097
...
...
@@ -78,6 +78,12 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService {
vo
.
setOssUrl
(
ossUrlService
.
selectUrlByIds
(
vo
.
getOssId
()));
}
vo
.
setEntiretyList
(
entiretyMap
.
get
(
vo
.
getId
()));
if
(
vo
.
isVisible
()){
vo
.
setDisplay
(
"【已显示】"
);
}
else
{
vo
.
setDisplay
(
"【已隐藏】"
);
}
}
return
TableDataInfo
.
build
(
page
);
}
...
...
@@ -104,12 +110,12 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService {
*/
@Override
public
List
<
BuildingBlockVo
>
list
()
{
List
<
BuildingBlockVo
>
list
=
baseMapper
.
selectVoList
(
null
);
List
<
BuildingBlockVo
>
list
=
baseMapper
.
selectVoList
(
Wrappers
.<
BuildingBlock
>
lambdaQuery
().
eq
(
BuildingBlock:
:
isVisible
,
true
)
);
for
(
BuildingBlockVo
vo
:
list
)
{
if
(
StrUtil
.
isNotBlank
(
vo
.
getOssId
()))
{
vo
.
setOssUrl
(
ossUrlService
.
selectUrlByIds
(
vo
.
getOssId
()));
}
List
<
EntiretyVo
>
entiretyVoList
=
entiretyMapper
.
selectVoList
(
Wrappers
.<
Entirety
>
lambdaQuery
().
eq
(
Entirety:
:
getBuildingBlockId
,
vo
.
getId
()));
List
<
EntiretyVo
>
entiretyVoList
=
entiretyMapper
.
selectVoList
(
Wrappers
.<
Entirety
>
lambdaQuery
().
eq
(
Entirety:
:
getBuildingBlockId
,
vo
.
getId
())
.
eq
(
Entirety:
:
isVisible
,
true
)
);
for
(
EntiretyVo
entiretyVo:
entiretyVoList
){
if
(
StrUtil
.
isNotBlank
(
entiretyVo
.
getOssId
())){
entiretyVo
.
setOssUrl
(
ossUrlService
.
selectUrlByIds
(
entiretyVo
.
getOssId
()));
...
...
@@ -220,4 +226,43 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService {
}
}
}
@Override
public
boolean
display
(
String
id
)
throws
ServerException
{
BuildingBlockVo
entityVo
=
baseMapper
.
selectVoById
(
id
);
entityVo
.
setVisible
(
true
);
BuildingBlock
entity
=
BeanUtil
.
toBean
(
entityVo
,
BuildingBlock
.
class
);
return
baseMapper
.
updateById
(
entity
)
>
0
;
}
@Override
public
boolean
batchDisplay
(
String
[]
buildingBlockIds
)
throws
ServerException
{
for
(
String
id
:
buildingBlockIds
)
{
BuildingBlockVo
entityVo
=
baseMapper
.
selectVoById
(
id
);
entityVo
.
setVisible
(
true
);
BuildingBlock
entity
=
BeanUtil
.
toBean
(
entityVo
,
BuildingBlock
.
class
);
baseMapper
.
updateById
(
entity
);
}
return
true
;
}
@Override
public
boolean
hide
(
String
id
)
throws
ServerException
{
BuildingBlockVo
entityVo
=
baseMapper
.
selectVoById
(
id
);
entityVo
.
setVisible
(
false
);
BuildingBlock
entity
=
BeanUtil
.
toBean
(
entityVo
,
BuildingBlock
.
class
);
return
baseMapper
.
updateById
(
entity
)
>
0
;
}
@Override
public
boolean
batchHide
(
String
[]
buildingBlockIds
)
throws
ServerException
{
for
(
String
id
:
buildingBlockIds
)
{
BuildingBlockVo
entityVo
=
baseMapper
.
selectVoById
(
id
);
entityVo
.
setVisible
(
false
);
BuildingBlock
entity
=
BeanUtil
.
toBean
(
entityVo
,
BuildingBlock
.
class
);
baseMapper
.
updateById
(
entity
);
}
return
true
;
}
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment