Commit 8dfd02d3 authored by liqin's avatar liqin 💬

bug fixed

parent 6567cd25
...@@ -69,6 +69,9 @@ public class CopyrightOwnerController extends BaseController { ...@@ -69,6 +69,9 @@ public class CopyrightOwnerController extends BaseController {
@Resource @Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService; private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Resource
private LearningContentService learningContentService;
@PostMapping("/save") @PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("copyright:owner:save") @RequiresAuthentication //@RequiresPermissions("copyright:owner:save")
@ApiOperation(value = "添加版权方", notes = "添加版权方") @ApiOperation(value = "添加版权方", notes = "添加版权方")
...@@ -302,8 +305,16 @@ public class CopyrightOwnerController extends BaseController { ...@@ -302,8 +305,16 @@ public class CopyrightOwnerController extends BaseController {
LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> deleteWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, id); LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> deleteWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, id);
this.copyrightOwnerVideoContentCatService.remove(deleteWrapper1); this.copyrightOwnerVideoContentCatService.remove(deleteWrapper1);
LambdaUpdateWrapper<LearningContentCopyrightOwner> deleteWrapper2 = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id); final LambdaQueryWrapper<LearningContentCopyrightOwner> learningContentCopyrightOwnerLambdaQueryWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaQuery().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
this.learningContentCopyrightOwnerService.remove(deleteWrapper2); final List<LearningContentCopyrightOwner> learningContentCopyrightOwnerList = this.learningContentCopyrightOwnerService.list(learningContentCopyrightOwnerLambdaQueryWrapper);
if (learningContentCopyrightOwnerList != null && !learningContentCopyrightOwnerList.isEmpty()) {
LambdaUpdateWrapper<LearningContentCopyrightOwner> deleteWrapper2 = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
this.learningContentCopyrightOwnerService.remove(deleteWrapper2);
if (learningContentCopyrightOwnerList.size() == 1) {
this.learningContentService.removeById(learningContentCopyrightOwnerList.get(0).getLearningContentId());
}
}
return getSuccessResult(); return getSuccessResult();
} }
......
...@@ -60,6 +60,8 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -60,6 +60,8 @@ public class ExhibitionBoardCatController extends BaseController {
@Resource @Resource
private LearningContentBoardCatService learningContentBoardCatService; private LearningContentBoardCatService learningContentBoardCatService;
@Resource @Resource
private LearningContentService learningContentService;
@Resource
private LearningContentBoardService learningContentBoardService; private LearningContentBoardService learningContentBoardService;
@PostMapping("/save") @PostMapping("/save")
...@@ -207,14 +209,22 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -207,14 +209,22 @@ public class ExhibitionBoardCatController extends BaseController {
LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getBoardCatId, id); LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getBoardCatId, id);
this.copyrightOwnerBoardCatService.remove(deleteWrapper); this.copyrightOwnerBoardCatService.remove(deleteWrapper);
LambdaUpdateWrapper<LearningContentBoardCat> deleteWrapper1 = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getExhibitionBoardCatId, id); final LambdaQueryWrapper<LearningContentBoardCat> learningContentBoardCatLambdaQueryWrapper = Wrappers.<LearningContentBoardCat>lambdaQuery().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
this.learningContentBoardCatService.remove(deleteWrapper1); final List<LearningContentBoardCat> learningContentBoardCatList = this.learningContentBoardCatService.list(learningContentBoardCatLambdaQueryWrapper);
if (learningContentBoardCatList != null && !learningContentBoardCatList.isEmpty()) {
LambdaUpdateWrapper<LearningContentBoardCat> deleteWrapper1 = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
this.learningContentBoardCatService.remove(deleteWrapper1);
if (learningContentBoardCatList.size() == 1) {
this.learningContentService.removeById(learningContentBoardCatList.get(0).getLearningContentId());
}
}
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper2 = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardCatId, id); LambdaUpdateWrapper<LearningContentBoard> deleteWrapper2 = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardCatId, id);
this.learningContentBoardService.remove(deleteWrapper2); this.learningContentBoardService.remove(deleteWrapper2);
final LambdaQueryWrapper<ExhibitionBoard> lambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getExhibitionBoardCatId, id).select(ExhibitionBoard::getId); final LambdaQueryWrapper<ExhibitionBoard> exhibitionBoardLambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getExhibitionBoardCatId, id).select(ExhibitionBoard::getId);
final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(lambdaQueryWrapper, Object::toString); final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(exhibitionBoardLambdaQueryWrapper, Object::toString);
this.exhibitionBoardTmpService.removeByIds(exhibitionBoardIdList); this.exhibitionBoardTmpService.removeByIds(exhibitionBoardIdList);
// final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id); // final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
......
...@@ -140,12 +140,13 @@ public class LearningProjectController extends BaseController { ...@@ -140,12 +140,13 @@ public class LearningProjectController extends BaseController {
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
@RequiresAuthentication //@RequiresPermissions("learning:project:delete") @RequiresAuthentication //@RequiresPermissions("learning:project:delete")
@ApiOperation(value = "根据ID下架学习项目", notes = "根据ID下架学习项目") @ApiOperation(value = "根据ID删除学习项目", notes = "根据ID删除学习项目")
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String", required = true) @ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String", required = true)
}) })
@MethodLog(operModule = OperModule.LEARNPROJECT, operType = OperType.DELETE) @MethodLog(operModule = OperModule.LEARNPROJECT, operType = OperType.DELETE)
public Map<String, Object> deleteLearningProject(@PathVariable("id") String id) { public Map<String, Object> deleteLearningProject(@PathVariable("id") String id) {
this.learningContentService.remove(Wrappers.<LearningContent>lambdaUpdate().eq(LearningContent::getLearningProjectId, id));
this.learningProjectService.removeById(id); this.learningProjectService.removeById(id);
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