Commit b6f26d80 authored by liqin's avatar liqin 💬

bug fixed

parent d66b1c87
...@@ -118,12 +118,6 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -118,12 +118,6 @@ public class ExhibitionBoardCatController extends BaseController {
//todo 删除中间关联表 //todo 删除中间关联表
return getSuccessResult(); return getSuccessResult();
} }
...@@ -137,13 +131,13 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -137,13 +131,13 @@ public class ExhibitionBoardCatController extends BaseController {
final LambdaQueryWrapper<ExhibitionBoardCat> exhibitionBoardCatLambdaQueryWrapper = Wrappers.<ExhibitionBoardCat>lambdaQuery().orderByDesc(ExhibitionBoardCat::getCreateTime); final LambdaQueryWrapper<ExhibitionBoardCat> exhibitionBoardCatLambdaQueryWrapper = Wrappers.<ExhibitionBoardCat>lambdaQuery().orderByDesc(ExhibitionBoardCat::getCreateTime);
if (copyrightOwnerIdList != null && !copyrightOwnerIdList.isEmpty()) { if (copyrightOwnerIdList != null && !copyrightOwnerIdList.isEmpty()) {
final LambdaQueryWrapper<CopyrightOwnerBoardCat> queryWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaQuery().in(CopyrightOwnerBoardCat::getCopyrightOwnerId, copyrightOwnerIdList); final LambdaQueryWrapper<CopyrightOwnerBoardCat> queryWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaQuery().in(CopyrightOwnerBoardCat::getCopyrightOwnerId, copyrightOwnerIdList);
queryWrapper.select(CopyrightOwnerBoardCat::getBoardCatId); final List<CopyrightOwnerBoardCat> copyrightOwnerBoardCatList = this.copyrightOwnerBoardCatService.list(queryWrapper);
final List<String> boardCatIdList = this.copyrightOwnerBoardCatService.listObjs(queryWrapper, Object::toString); final List<String> collect = copyrightOwnerBoardCatList.stream().map(CopyrightOwnerBoardCat::getBoardCatId).distinct().collect(Collectors.toList());
exhibitionBoardCatLambdaQueryWrapper.in(ExhibitionBoardCat::getId, boardCatIdList); exhibitionBoardCatLambdaQueryWrapper.in(ExhibitionBoardCat::getId, collect);
List<ExhibitionBoardCat> exhibitionBoardCatList = exhibitionBoardCatService.list(exhibitionBoardCatLambdaQueryWrapper);
return getResult(exhibitionBoardCatList);
} }
return getResult("");
List<ExhibitionBoardCat> exhibitionBoardCatList = exhibitionBoardCatService.list(exhibitionBoardCatLambdaQueryWrapper);
return getResult(exhibitionBoardCatList);
} }
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
......
...@@ -2,14 +2,8 @@ package cn.wisenergy.chnmuseum.party.web.controller; ...@@ -2,14 +2,8 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwner; import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat; import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.model.VideoContent;
import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerVideoContentCatService;
import cn.wisenergy.chnmuseum.party.service.VideoContentCatService;
import cn.wisenergy.chnmuseum.party.service.VideoContentService;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...@@ -57,6 +51,12 @@ public class VideoContentCatController extends BaseController { ...@@ -57,6 +51,12 @@ public class VideoContentCatController extends BaseController {
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
@Resource
private ExhibitionBoardService exhibitionBoardService;
@Resource
private CopyrightOwnerBoardCatService copyrightOwnerBoardCatService;
@PostMapping(value = "/save") @PostMapping(value = "/save")
@RequiresAuthentication //@RequiresPermissions("video:content:cat:save") @RequiresAuthentication //@RequiresPermissions("video:content:cat:save")
@ApiOperation(value = "添加视频内容分类", notes = "添加视频内容分类") @ApiOperation(value = "添加视频内容分类", notes = "添加视频内容分类")
...@@ -169,8 +169,24 @@ public class VideoContentCatController extends BaseController { ...@@ -169,8 +169,24 @@ public class VideoContentCatController extends BaseController {
updateWrapper.set(VideoContent::getDeleted, true); updateWrapper.set(VideoContent::getDeleted, true);
this.videoContentService.update(updateWrapper); this.videoContentService.update(updateWrapper);
//todo 删除中间关联表 final LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> updateWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
this.copyrightOwnerVideoContentCatService.remove(updateWrapper1);
final LambdaQueryWrapper<CopyrightOwnerVideoContentCat> eq = Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
final List<CopyrightOwnerVideoContentCat> list = this.copyrightOwnerVideoContentCatService.list(eq);
final List<String> collect = list.stream().map(CopyrightOwnerVideoContentCat::getCopyrightOwnerId).distinct().collect(Collectors.toList());
final LambdaUpdateWrapper<VideoContent> updateWrapper2 = Wrappers.<VideoContent>lambdaUpdate().in(VideoContent::getVideoContentCopyrightOwnerId, collect);
updateWrapper2.set(VideoContent::getDeleted, true);
this.videoContentService.update(updateWrapper2);
final LambdaUpdateWrapper<ExhibitionBoard> updateWrapper3 = Wrappers.<ExhibitionBoard>lambdaUpdate().in(ExhibitionBoard::getBoardCopyrightOwnerId, collect);
updateWrapper3.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper3);
LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().in(CopyrightOwnerBoardCat::getCopyrightOwnerId, collect);
this.copyrightOwnerBoardCatService.remove(deleteWrapper);
return getSuccessResult(); return getSuccessResult();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment