c930097a by chentao

隐藏系列

1 parent e83742f8
...@@ -98,4 +98,28 @@ public class BuildingBlockController extends BaseController { ...@@ -98,4 +98,28 @@ public class BuildingBlockController extends BaseController {
98 public R<Void> remove(@PathVariable String id) throws ServerException { 98 public R<Void> remove(@PathVariable String id) throws ServerException {
99 return toAjax(service.remove(id)); 99 return toAjax(service.remove(id));
100 } 100 }
101
102 @RepeatSubmit()
103 @PutMapping("/display/{id}")
104 public R<Void> display(@PathVariable String id) throws ServerException {
105 return toAjax(service.display(id));
106 }
107
108 @RepeatSubmit()
109 @PutMapping("/batch/display/{buildingBlockIds}")
110 public R<Void> batchDisplay(@PathVariable String[] buildingBlockIds) throws ServerException {
111 return toAjax(service.batchDisplay(buildingBlockIds));
112 }
113
114 @RepeatSubmit()
115 @PutMapping("/hide/{id}")
116 public R<Void> hide(@PathVariable String id) throws ServerException {
117 return toAjax(service.hide(id));
118 }
119
120 @RepeatSubmit()
121 @PutMapping("/batch/hide/{buildingBlockIds}")
122 public R<Void> batchHide(@PathVariable String[] buildingBlockIds) throws ServerException {
123 return toAjax(service.batchHide(buildingBlockIds));
124 }
101 } 125 }
......
...@@ -64,4 +64,9 @@ public class BuildingBlock extends BaseEntity { ...@@ -64,4 +64,9 @@ public class BuildingBlock extends BaseEntity {
64 */ 64 */
65 private Long sort; 65 private Long sort;
66 66
67 /**
68 * 是否可见
69 */
70 private boolean visible;
71
67 } 72 }
......
...@@ -44,4 +44,8 @@ public class BuildingBlockBo extends BaseBO { ...@@ -44,4 +44,8 @@ public class BuildingBlockBo extends BaseBO {
44 * 排序 44 * 排序
45 */ 45 */
46 private Long sort; 46 private Long sort;
47 /**
48 * 是否可见
49 */
50 private boolean visible;
47 } 51 }
......
...@@ -55,4 +55,13 @@ public class BuildingBlockVo { ...@@ -55,4 +55,13 @@ public class BuildingBlockVo {
55 * 套件信息 55 * 套件信息
56 */ 56 */
57 List<EntiretyVo> entiretyList; 57 List<EntiretyVo> entiretyList;
58
59 /**
60 * 是否可见
61 */
62 private boolean visible;
63 /**
64 * 是否可见
65 */
66 private String display;
58 } 67 }
......
...@@ -82,4 +82,39 @@ public interface IBuildingBlockService { ...@@ -82,4 +82,39 @@ public interface IBuildingBlockService {
82 */ 82 */
83 BuildingBlockVo get(String id); 83 BuildingBlockVo get(String id);
84 84
85 /**
86 * 隐藏
87 *
88 * @param id
89 * @return
90 * @throws ServerException
91 */
92 boolean hide(String id) throws ServerException;
93
94 /**
95 * 批量隐藏
96 *
97 * @param buildingBlockIds
98 * @return
99 * @throws ServerException
100 */
101 boolean batchHide(String[] buildingBlockIds) throws ServerException;
102 /**
103 * 显示
104 *
105 * @param id
106 * @return
107 * @throws ServerException
108 */
109 boolean display(String id) throws ServerException;
110
111 /**
112 * 批量显示
113 *
114 * @param buildingBlockIds
115 * @return
116 * @throws ServerException
117 */
118 boolean batchDisplay(String[] buildingBlockIds) throws ServerException;
119
85 } 120 }
......
...@@ -78,6 +78,12 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { ...@@ -78,6 +78,12 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService {
78 vo.setOssUrl(ossUrlService.selectUrlByIds(vo.getOssId())); 78 vo.setOssUrl(ossUrlService.selectUrlByIds(vo.getOssId()));
79 } 79 }
80 vo.setEntiretyList(entiretyMap.get(vo.getId())); 80 vo.setEntiretyList(entiretyMap.get(vo.getId()));
81 if(vo.isVisible()){
82 vo.setDisplay("【已显示】");
83 }
84 else{
85 vo.setDisplay("【已隐藏】");
86 }
81 } 87 }
82 return TableDataInfo.build(page); 88 return TableDataInfo.build(page);
83 } 89 }
...@@ -104,12 +110,12 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { ...@@ -104,12 +110,12 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService {
104 */ 110 */
105 @Override 111 @Override
106 public List<BuildingBlockVo> list() { 112 public List<BuildingBlockVo> list() {
107 List<BuildingBlockVo> list = baseMapper.selectVoList(null); 113 List<BuildingBlockVo> list = baseMapper.selectVoList(Wrappers.<BuildingBlock>lambdaQuery().eq(BuildingBlock::isVisible, true));
108 for (BuildingBlockVo vo : list) { 114 for (BuildingBlockVo vo : list) {
109 if (StrUtil.isNotBlank(vo.getOssId())) { 115 if (StrUtil.isNotBlank(vo.getOssId())) {
110 vo.setOssUrl(ossUrlService.selectUrlByIds(vo.getOssId())); 116 vo.setOssUrl(ossUrlService.selectUrlByIds(vo.getOssId()));
111 } 117 }
112 List<EntiretyVo> entiretyVoList = entiretyMapper.selectVoList(Wrappers.<Entirety>lambdaQuery().eq(Entirety::getBuildingBlockId, vo.getId())); 118 List<EntiretyVo> entiretyVoList = entiretyMapper.selectVoList(Wrappers.<Entirety>lambdaQuery().eq(Entirety::getBuildingBlockId, vo.getId()).eq(Entirety::isVisible, true));
113 for(EntiretyVo entiretyVo:entiretyVoList){ 119 for(EntiretyVo entiretyVo:entiretyVoList){
114 if(StrUtil.isNotBlank(entiretyVo.getOssId())){ 120 if(StrUtil.isNotBlank(entiretyVo.getOssId())){
115 entiretyVo.setOssUrl(ossUrlService.selectUrlByIds(entiretyVo.getOssId())); 121 entiretyVo.setOssUrl(ossUrlService.selectUrlByIds(entiretyVo.getOssId()));
...@@ -220,4 +226,43 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { ...@@ -220,4 +226,43 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService {
220 } 226 }
221 } 227 }
222 } 228 }
229
230
231 @Override
232 public boolean display(String id) throws ServerException {
233 BuildingBlockVo entityVo = baseMapper.selectVoById(id);
234 entityVo.setVisible(true);
235 BuildingBlock entity = BeanUtil.toBean(entityVo, BuildingBlock.class);
236 return baseMapper.updateById(entity) > 0;
237 }
238
239 @Override
240 public boolean batchDisplay(String[] buildingBlockIds) throws ServerException {
241 for (String id : buildingBlockIds) {
242 BuildingBlockVo entityVo = baseMapper.selectVoById(id);
243 entityVo.setVisible(true);
244 BuildingBlock entity = BeanUtil.toBean(entityVo, BuildingBlock.class);
245 baseMapper.updateById(entity);
246 }
247 return true;
248 }
249
250 @Override
251 public boolean hide(String id) throws ServerException {
252 BuildingBlockVo entityVo = baseMapper.selectVoById(id);
253 entityVo.setVisible(false);
254 BuildingBlock entity = BeanUtil.toBean(entityVo, BuildingBlock.class);
255 return baseMapper.updateById(entity) > 0;
256 }
257
258 @Override
259 public boolean batchHide(String[] buildingBlockIds) throws ServerException {
260 for (String id : buildingBlockIds) {
261 BuildingBlockVo entityVo = baseMapper.selectVoById(id);
262 entityVo.setVisible(false);
263 BuildingBlock entity = BeanUtil.toBean(entityVo, BuildingBlock.class);
264 baseMapper.updateById(entity);
265 }
266 return true;
267 }
223 } 268 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!