Commit 671b203a authored by liwei's avatar liwei

修改了动态评论删除和新增

parent 6b661824
...@@ -51,7 +51,7 @@ public class AppOpmArticleController extends CyPaginationController<OpmArticle> ...@@ -51,7 +51,7 @@ public class AppOpmArticleController extends CyPaginationController<OpmArticle>
} }
@PreAuthorize("@cyPerm.hasPerm('sys:opmArticle:delete')") @PreAuthorize("@cyPerm.hasPerm('app:opmArticle:delete')")
@CyOpeLogAnno(title = "system-opmArticle管理管理-删除动态", businessType = CyLogTypeEnum.DELETE) @CyOpeLogAnno(title = "system-opmArticle管理管理-删除动态", businessType = CyLogTypeEnum.DELETE)
@Operation(summary="删除动态", description="删除动态") @Operation(summary="删除动态", description="删除动态")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true)}) @Parameters({@Parameter(name = "businessId", description = "businessId", required = true)})
......
...@@ -612,6 +612,13 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> { ...@@ -612,6 +612,13 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
/** /**
* 学历认证图片url * 学历认证图片url
*/ */
@TableField(exist = false)
private String memEducationUrl; private String memEducationUrl;
/**
* 动态内容
*/
@TableField(exist = false)
private String articleContent;
} }
...@@ -84,6 +84,12 @@ public class ArticleCommentVO { ...@@ -84,6 +84,12 @@ public class ArticleCommentVO {
*/ */
private String isLike; private String isLike;
/**
* 审核状态
*/
private String examStatus;
/** /**
* 子评论 * 子评论
*/ */
......
...@@ -243,5 +243,11 @@ public class OpmArticle extends CyIdIncreEntity<OpmArticle> { ...@@ -243,5 +243,11 @@ public class OpmArticle extends CyIdIncreEntity<OpmArticle> {
*/ */
@TableField(exist = false) @TableField(exist = false)
private String isPay; private String isPay;
/**
* 话题名称
*/
@TableField(exist = false)
private Integer topicName;
} }
...@@ -497,23 +497,31 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -497,23 +497,31 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public CyPersistModel removeComment(ArticleCommentDTO dto,String type){ public CyPersistModel removeComment(ArticleCommentDTO dto,String type){
if (type.equals("app")){ if (type.equals("app")){
//app端 //app端
ArticleCommentVO comment = baseMapper.selectCommentById(dto.getBusinessId());
//删除评论 //删除评论
int line = baseMapper.deleteComment(dto); int line = baseMapper.deleteComment(dto);
int childrenCommentCount = 0; int childrenCommentCount = 0;
OpmArticle article = new OpmArticle();
article.setBusinessId(dto.getArticleId());
if (dto.getParentId() != null){ if (dto.getParentId() != null){
//删除的子评论 需要减掉父评论的数量 if (comment.getExamStatus().equals("1")){
baseMapper.reduceCommentCount(dto.getParentId()); //删除的子评论 需要减掉父评论的数量
baseMapper.reduceCommentCount(dto.getParentId());
article.setCommentCount(1);
}
} else { } else {
//删除的是父评论 要查父评论下的子评论数量 if (comment.getExamStatus().equals("1")){
ArticleCommentVO vo = new ArticleCommentVO(); //删除的是父评论 要查父评论下的子评论数量
vo.setParentId(dto.getBusinessId()); ArticleCommentVO vo = new ArticleCommentVO();
Integer count = baseMapper.selectArticleChildrenCommentCount(vo); vo.setParentId(dto.getBusinessId());
childrenCommentCount = count; Integer count = baseMapper.selectArticleChildrenCommentCount(vo);
childrenCommentCount = count;
article.setCommentCount(childrenCommentCount + 1);
}
}
if (comment.getExamStatus().equals("1")){
baseMapper.updateArticleCommentCountById(article);
} }
OpmArticle article = new OpmArticle();
article.setBusinessId(dto.getArticleId());
article.setCommentCount(childrenCommentCount + 1);
baseMapper.updateArticleCommentCountById(article);
return new CyPersistModel(1); return new CyPersistModel(1);
} else { } else {
//web端 //web端
......
...@@ -538,6 +538,7 @@ ...@@ -538,6 +538,7 @@
mi.mem_career AS memCareer, mi.mem_career AS memCareer,
mi.mem_nick_name AS memNickName, mi.mem_nick_name AS memNickName,
mi.avatar AS avatarId, mi.avatar AS avatarId,
opt.topic_name,
# oi.url AS memAvatar, # oi.url AS memAvatar,
CASE CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0 WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
...@@ -546,6 +547,7 @@ ...@@ -546,6 +547,7 @@
FROM FROM
opm_article opa opm_article opa
LEFT JOIN mem_info mi ON mi.user_id = opa.create_by LEFT JOIN mem_info mi ON mi.user_id = opa.create_by
LEFT JOIN opm_topic opt ON opt.business_id = opa.topic_id
# LEFT JOIN ( # LEFT JOIN (
# SELECT # SELECT
# opm_article.business_id, # opm_article.business_id,
...@@ -682,6 +684,7 @@ ...@@ -682,6 +684,7 @@
AND opc.del_flag = '0' AND opc.del_flag = '0'
AND opc.article_id = #{articleId} AND opc.article_id = #{articleId}
and opc.parent_id = #{parentId} and opc.parent_id = #{parentId}
and opc.exam_status = '1'
AND NOT EXISTS ( AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = #{loginUserId} AND obl.target_id = opc.user_id) WHERE (obl.user_id = #{loginUserId} AND obl.target_id = opc.user_id)
......
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