Commit e2fa041d authored by liqin's avatar liqin 💬

bug fixed

parent 12f4e2af
......@@ -6,10 +6,7 @@ import cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum;
import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException;
import cn.wisenergy.chnmuseum.party.mapper.AuditMapper;
import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.AuditService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
import cn.wisenergy.chnmuseum.party.service.LearningContentService;
import cn.wisenergy.chnmuseum.party.service.VideoContentService;
import cn.wisenergy.chnmuseum.party.service.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
......@@ -52,6 +49,9 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
@Resource
private LearningContentService learningContentService;
@Resource
private LearningContentBoardService learningContentBoardService;
@Override
public Page<Audit> getUserList(Page<Audit> page, TUser user) {
return page.setRecords(auditMapper.getUserList(page, user));
......@@ -308,6 +308,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.exhibitionBoardService.updateById(exhibitionBoard);
break;
case REMOVE:
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardId, exhibitionBoard.getId()));
update = this.exhibitionBoardService.removeById(exhibitionBoard);
break;
case ADD:
......
......@@ -364,9 +364,7 @@ public class ChinaMobileRestApiController extends BaseController {
}
if (exhibitionBoard.getVideoContentId() != null) {
final VideoContent videoContent = this.videoContentService.getById(exhibitionBoard.getVideoContentId());
if (videoContent == null) {
exhibitionBoard.setBoardVideoContentThumbnail(videoContent.getThumbnail());
} else {
if (videoContent != null) {
exhibitionBoard.setBoardVideoContentThumbnail(videoContent.getThumbnail());
}
}
......
......@@ -7,14 +7,8 @@ import cn.wisenergy.chnmuseum.party.common.log.OperType;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwner;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardCat;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoardCat;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerBoardCatService;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardCatService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
......@@ -61,6 +55,8 @@ public class ExhibitionBoardCatController extends BaseController {
private CopyrightOwnerService copyrightOwnerService;
@Resource
private CopyrightOwnerBoardCatService copyrightOwnerBoardCatService;
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:save")
......@@ -109,38 +105,6 @@ public class ExhibitionBoardCatController extends BaseController {
return getFailResult();
}
@DeleteMapping("/delete/{id}")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:delete")
@ApiOperation(value = "根据ID删除展板分类", notes = "根据ID删除展板分类")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
})
@MethodLog(operModule = OperModule.DISPLAYCLASSIFY, operType = OperType.DELETE)
public Map<String, Object> deleteExhibitionBoardCat(@PathVariable("id") String id) {
this.exhibitionBoardCatService.removeById(id);
final LambdaUpdateWrapper<ExhibitionBoard> updateWrapper = Wrappers.<ExhibitionBoard>lambdaUpdate().eq(ExhibitionBoard::getExhibitionBoardCatId, id);
updateWrapper.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper);
//todo 删除中间关联表
// final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
// updateWrapper.set(VideoContent::getDeleted, true);
// this.videoContentService.update(updateWrapper);
//
// final LambdaUpdateWrapper<ExhibitionBoard> updateWrapper1 = Wrappers.<ExhibitionBoard>lambdaUpdate().eq(ExhibitionBoard::getBoardCopyrightOwnerId, id);
// updateWrapper1.set(ExhibitionBoard::getDeleted, true);
// this.exhibitionBoardService.update(updateWrapper1);
//
// LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getCopyrightOwnerId, id);
// this.copyrightOwnerBoardCatService.remove(deleteWrapper);
//
// LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> deleteWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, id);
// this.copyrightOwnerVideoContentCatService.remove(deleteWrapper1);
return getSuccessResult();
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "copyrightOwnerId", value = "展板内容版权方ID", paramType = "query", dataType = "String")
})
......@@ -222,5 +186,43 @@ public class ExhibitionBoardCatController extends BaseController {
return getResult(exhibitionBoardCat);
}
@DeleteMapping("/delete/{id}")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:delete")
@ApiOperation(value = "根据ID删除展板分类", notes = "根据ID删除展板分类")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
})
@MethodLog(operModule = OperModule.DISPLAYCLASSIFY, operType = OperType.DELETE)
public Map<String, Object> deleteExhibitionBoardCat(@PathVariable("id") String id) {
this.exhibitionBoardCatService.removeById(id);
final LambdaUpdateWrapper<ExhibitionBoard> updateWrapper = Wrappers.<ExhibitionBoard>lambdaUpdate().eq(ExhibitionBoard::getExhibitionBoardCatId, id);
updateWrapper.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper);
//todo 删除中间关联表
LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getBoardCatId, id);
this.copyrightOwnerBoardCatService.remove(deleteWrapper);
LambdaUpdateWrapper<LearningContentBoardCat> deleteWrapper1 = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
this.learningContentBoardCatService.remove(deleteWrapper1);
// final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
// updateWrapper.set(VideoContent::getDeleted, true);
// this.videoContentService.update(updateWrapper);
//
// final LambdaUpdateWrapper<ExhibitionBoard> updateWrapper1 = Wrappers.<ExhibitionBoard>lambdaUpdate().eq(ExhibitionBoard::getBoardCopyrightOwnerId, id);
// updateWrapper1.set(ExhibitionBoard::getDeleted, true);
// this.exhibitionBoardService.update(updateWrapper1);
//
// LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getCopyrightOwnerId, id);
// this.copyrightOwnerBoardCatService.remove(deleteWrapper);
//
// LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> deleteWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, id);
// this.copyrightOwnerVideoContentCatService.remove(deleteWrapper1);
return getSuccessResult();
}
}
......@@ -329,8 +329,10 @@ public class LearningContentController extends BaseController {
final List<String> exhibitionBoardIdList = this.learningContentBoardService.listObjs(queryWrapper2, Object::toString);
if (!exhibitionBoardIdList.isEmpty()) {
final List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.listByIds(exhibitionBoardIdList);
if (!exhibitionBoardList.isEmpty()) {
learningContent.setExhibitionBoardIdList(exhibitionBoardList.stream().map(ExhibitionBoard::getId).collect(Collectors.toList()));
learningContent.setExhibitionBoardNameList(exhibitionBoardList.stream().map(ExhibitionBoard::getName).collect(Collectors.toList()));
}
for (ExhibitionBoard exhibitionBoard : exhibitionBoardList) {
String exhibitionBoardCatId = exhibitionBoard.getExhibitionBoardCatId();
......
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