Commit 8cd9aafc authored by liqin's avatar liqin 💬

bug fixed

parent 87c3be8c
...@@ -49,11 +49,6 @@ public class ExhibitionBoardCat implements Serializable { ...@@ -49,11 +49,6 @@ public class ExhibitionBoardCat implements Serializable {
@Length(min = 0, max = 100, message = "备注的字数超过最大限制100") @Length(min = 0, max = 100, message = "备注的字数超过最大限制100")
private String remarks; private String remarks;
@ApiModelProperty("是否已删除")
@TableField("is_deleted")
@TableLogic
private Boolean deleted;
@ApiModelProperty("创建日期") @ApiModelProperty("创建日期")
@TableField(value = "create_time", fill = FieldFill.INSERT) @TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime; private LocalDateTime createTime;
......
...@@ -44,6 +44,10 @@ public class LearningContentBoard implements Serializable { ...@@ -44,6 +44,10 @@ public class LearningContentBoard implements Serializable {
@NotBlank(message = "学习内容ID不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "学习内容ID不能为空", groups = {Add.class, Update.class})
private String learningContentId; private String learningContentId;
@ApiModelProperty("展板类别ID")
@TableField("exhibition_board_cat_id")
private String exhibitionBoardCatId;
@ApiModelProperty("展板ID") @ApiModelProperty("展板ID")
@TableField("exhibition_board_id") @TableField("exhibition_board_id")
@NotBlank(message = "展板ID不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "展板ID不能为空", groups = {Add.class, Update.class})
......
...@@ -57,6 +57,8 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -57,6 +57,8 @@ public class ExhibitionBoardCatController extends BaseController {
private CopyrightOwnerBoardCatService copyrightOwnerBoardCatService; private CopyrightOwnerBoardCatService copyrightOwnerBoardCatService;
@Resource @Resource
private LearningContentBoardCatService learningContentBoardCatService; private LearningContentBoardCatService learningContentBoardCatService;
@Resource
private LearningContentBoardService learningContentBoardService;
@PostMapping("/save") @PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:save") @RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:save")
...@@ -200,13 +202,15 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -200,13 +202,15 @@ public class ExhibitionBoardCatController extends BaseController {
updateWrapper.set(ExhibitionBoard::getDeleted, true); updateWrapper.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper); this.exhibitionBoardService.update(updateWrapper);
//todo 删除中间关联表
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); LambdaUpdateWrapper<LearningContentBoardCat> deleteWrapper1 = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
this.learningContentBoardCatService.remove(deleteWrapper1); 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); // final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
// updateWrapper.set(VideoContent::getDeleted, true); // updateWrapper.set(VideoContent::getDeleted, true);
// this.videoContentService.update(updateWrapper); // this.videoContentService.update(updateWrapper);
......
...@@ -170,32 +170,6 @@ public class ExhibitionBoardController extends BaseController { ...@@ -170,32 +170,6 @@ public class ExhibitionBoardController extends BaseController {
return getFailResult(); 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") @PostMapping("/getList")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:list") @RequiresAuthentication //@RequiresPermissions("exhibition:board:list")
@ApiOperation(value = "获取展板全部列表(无分页)", notes = "获取展板全部列表(无分页)") @ApiOperation(value = "获取展板全部列表(无分页)", notes = "获取展板全部列表(无分页)")
...@@ -428,5 +402,31 @@ public class ExhibitionBoardController extends BaseController { ...@@ -428,5 +402,31 @@ public class ExhibitionBoardController extends BaseController {
return getSuccessResult(); 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 { ...@@ -107,7 +107,11 @@ public class LearningContentController extends BaseController {
final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList(); final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList();
for (String exhibitionBoardId : exhibitionBoardIdList) { 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<>(); QueryWrapper<LearningContentBoard> learningContentBoardQueryWrapper = new QueryWrapper<>();
learningContentBoardQueryWrapper.select("max(sortorder) as sortorder"); learningContentBoardQueryWrapper.select("max(sortorder) as sortorder");
LearningContentBoard one = this.learningContentBoardService.getOne(learningContentBoardQueryWrapper); LearningContentBoard one = this.learningContentBoardService.getOne(learningContentBoardQueryWrapper);
...@@ -178,7 +182,11 @@ public class LearningContentController extends BaseController { ...@@ -178,7 +182,11 @@ public class LearningContentController extends BaseController {
this.learningContentBoardService.remove(lambdaUpdateWrapper); this.learningContentBoardService.remove(lambdaUpdateWrapper);
for (String exhibitionBoardId : exhibitionBoardIdList) { 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); this.learningContentBoardService.save(learningContentBoard);
} }
} }
......
...@@ -7,14 +7,13 @@ ...@@ -7,14 +7,13 @@
<id column="id" property="id"/> <id column="id" property="id"/>
<result column="name" property="name"/> <result column="name" property="name"/>
<result column="remarks" property="remarks"/> <result column="remarks" property="remarks"/>
<result column="is_deleted" property="deleted"/>
<result column="create_time" property="createTime"/> <result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/> <result column="update_time" property="updateTime"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, remarks, is_deleted, create_time, update_time id, name, remarks, create_time, update_time
</sql> </sql>
</mapper> </mapper>
...@@ -4,14 +4,15 @@ ...@@ -4,14 +4,15 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.LearningContentBoard"> <resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.LearningContentBoard">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="learning_content_id" property="learningContentId" /> <result column="learning_content_id" property="learningContentId"/>
<result column="exhibition_board_id" property="exhibitionBoardId" /> <result column="exhibition_board_cat_id" property="exhibitionBoardCatId"/>
<result column="exhibition_board_id" property="exhibitionBoardId"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, learning_content_id, exhibition_board_id id, learning_content_id, exhibition_board_cat_id, exhibition_board_id
</sql> </sql>
</mapper> </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