Commit 8cd9aafc authored by liqin's avatar liqin 💬

bug fixed

parent 87c3be8c
......@@ -49,11 +49,6 @@ public class ExhibitionBoardCat implements Serializable {
@Length(min = 0, max = 100, message = "备注的字数超过最大限制100")
private String remarks;
@ApiModelProperty("是否已删除")
@TableField("is_deleted")
@TableLogic
private Boolean deleted;
@ApiModelProperty("创建日期")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
......
......@@ -44,6 +44,10 @@ public class LearningContentBoard implements Serializable {
@NotBlank(message = "学习内容ID不能为空", groups = {Add.class, Update.class})
private String learningContentId;
@ApiModelProperty("展板类别ID")
@TableField("exhibition_board_cat_id")
private String exhibitionBoardCatId;
@ApiModelProperty("展板ID")
@TableField("exhibition_board_id")
@NotBlank(message = "展板ID不能为空", groups = {Add.class, Update.class})
......
......@@ -57,6 +57,8 @@ public class ExhibitionBoardCatController extends BaseController {
private CopyrightOwnerBoardCatService copyrightOwnerBoardCatService;
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@Resource
private LearningContentBoardService learningContentBoardService;
@PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:save")
......@@ -200,13 +202,15 @@ public class ExhibitionBoardCatController extends BaseController {
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);
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper2 = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardCatId, id);
this.learningContentBoardService.remove(deleteWrapper2);
// final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
// updateWrapper.set(VideoContent::getDeleted, true);
// this.videoContentService.update(updateWrapper);
......
......@@ -170,32 +170,6 @@ public class ExhibitionBoardController extends BaseController {
return getFailResult();
}
@DeleteMapping("/delete/{id}")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:delete")
@ApiOperation(value = "根据ID删除展板", notes = "根据ID删除展板")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
})
@MethodLog(operModule = OperModule.DISPLAYCONTENT, operType = OperType.DELETE)
public Map<String, Object> deleteExhibitionBoard(@PathVariable("id") String id) {
TUser user = getcurUser();
final Audit audit = Audit.builder()
.content(this.exhibitionBoardService.getById(id).getName())
.userId(user.getId())
.refItemId(id)
.type(AuditTypeEnum.EXHIBITION_BOARD.name())
.operation(AuditOperationEnum.REMOVE.name())
.status(AuditStatusEnum.TBC.name())
.deleted(false)
.level(AuditStatusEnum.TBC.name())
.build();
final boolean result = this.auditService.save(audit);
if (result) {
return getSuccessResult();
}
return getFailResult();
}
@PostMapping("/getList")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:list")
@ApiOperation(value = "获取展板全部列表(无分页)", notes = "获取展板全部列表(无分页)")
......@@ -428,5 +402,31 @@ public class ExhibitionBoardController extends BaseController {
return getSuccessResult();
}
@DeleteMapping("/delete/{id}")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:delete")
@ApiOperation(value = "根据ID删除展板", notes = "根据ID删除展板")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
})
@MethodLog(operModule = OperModule.DISPLAYCONTENT, operType = OperType.DELETE)
public Map<String, Object> deleteExhibitionBoard(@PathVariable("id") String id) {
TUser user = getcurUser();
final Audit audit = Audit.builder()
.content(this.exhibitionBoardService.getById(id).getName())
.userId(user.getId())
.refItemId(id)
.type(AuditTypeEnum.EXHIBITION_BOARD.name())
.operation(AuditOperationEnum.REMOVE.name())
.status(AuditStatusEnum.TBC.name())
.deleted(false)
.level(AuditStatusEnum.TBC.name())
.build();
final boolean result = this.auditService.save(audit);
if (result) {
return getSuccessResult();
}
return getFailResult();
}
}
......@@ -107,7 +107,11 @@ public class LearningContentController extends BaseController {
final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList();
for (String exhibitionBoardId : exhibitionBoardIdList) {
LearningContentBoard learningContentBoard = LearningContentBoard.builder().exhibitionBoardId(exhibitionBoardId).learningContentId(learningContentId).build();
LearningContentBoard learningContentBoard = LearningContentBoard.builder()
.learningContentId(learningContentId)
.exhibitionBoardCatId(this.exhibitionBoardService.getById(exhibitionBoardId).getExhibitionBoardCatId())
.exhibitionBoardId(exhibitionBoardId)
.build();
QueryWrapper<LearningContentBoard> learningContentBoardQueryWrapper = new QueryWrapper<>();
learningContentBoardQueryWrapper.select("max(sortorder) as sortorder");
LearningContentBoard one = this.learningContentBoardService.getOne(learningContentBoardQueryWrapper);
......@@ -178,7 +182,11 @@ public class LearningContentController extends BaseController {
this.learningContentBoardService.remove(lambdaUpdateWrapper);
for (String exhibitionBoardId : exhibitionBoardIdList) {
LearningContentBoard learningContentBoard = LearningContentBoard.builder().exhibitionBoardId(exhibitionBoardId).learningContentId(learningContentId).build();
LearningContentBoard learningContentBoard = LearningContentBoard.builder()
.learningContentId(learningContentId)
.exhibitionBoardCatId(this.exhibitionBoardService.getById(exhibitionBoardId).getExhibitionBoardCatId())
.exhibitionBoardId(exhibitionBoardId)
.build();
this.learningContentBoardService.save(learningContentBoard);
}
}
......
......@@ -7,14 +7,13 @@
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="remarks" property="remarks"/>
<result column="is_deleted" property="deleted"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, remarks, is_deleted, create_time, update_time
id, name, remarks, create_time, update_time
</sql>
</mapper>
......@@ -4,14 +4,15 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.LearningContentBoard">
<id column="id" property="id" />
<result column="learning_content_id" property="learningContentId" />
<result column="exhibition_board_id" property="exhibitionBoardId" />
</resultMap>
<id column="id" property="id"/>
<result column="learning_content_id" property="learningContentId"/>
<result column="exhibition_board_cat_id" property="exhibitionBoardCatId"/>
<result column="exhibition_board_id" property="exhibitionBoardId"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, learning_content_id, exhibition_board_id
id, learning_content_id, exhibition_board_cat_id, exhibition_board_id
</sql>
</mapper>
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