Commit 484f05fd authored by liwei's avatar liwei

修改了bug

parent 8ee88be4
...@@ -543,12 +543,14 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -543,12 +543,14 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
dto.setCreateBy(Integer.valueOf(CyUserUtil.getAuthenBusinessId())); dto.setCreateBy(Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
dto.setUpdateBy(Integer.valueOf(CyUserUtil.getAuthenBusinessId())); dto.setUpdateBy(Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
int line = baseMapper.addComment(dto); int line = baseMapper.addComment(dto);
if (dto.getExamStatus().equals("1")){
//修改主表的评论数 //修改主表的评论数
baseMapper.addArticleCommentCount(dto.getArticleId()); baseMapper.addArticleCommentCount(dto.getArticleId());
//修改子表的评论数 给父级评论数+1 //修改子表的评论数 给父级评论数+1
if (dto.getParentId() != null){ if (dto.getParentId() != null){
baseMapper.addCommentCount(dto.getParentId()); baseMapper.addCommentCount(dto.getParentId());
} }
}
return new CyPersistModel(1); return new CyPersistModel(1);
} }
} }
...@@ -391,7 +391,8 @@ ...@@ -391,7 +391,8 @@
WHERE 1 = 1 WHERE 1 = 1
AND opc.del_flag = '0' AND opc.del_flag = '0'
AND opc.parent_id is null AND opc.parent_id is null
AND opc.article_id = 6 AND opc.article_id = #{articleId}
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)
...@@ -444,12 +445,12 @@ ...@@ -444,12 +445,12 @@
<insert id="addComment"> <insert id="addComment">
INSERT INTO opm_article_comment INSERT INTO opm_article_comment
( (
create_by, create_date, update_by, update_date, content, parent_id, article_id, user_id create_by, create_date, update_by, update_date, content, parent_id, article_id, user_id,exam_status
) )
VALUES VALUES
( (
#{entity.createBy}, #{entity.createDate},#{entity.updateBy},#{entity.updateDate}, #{entity.createBy}, #{entity.createDate},#{entity.updateBy},#{entity.updateDate},
#{entity.commentContent},#{entity.parentId},#{entity.articleId},#{entity.commentedUserId} #{entity.commentContent},#{entity.parentId},#{entity.articleId},#{entity.commentedUserId},#{entity.examStatus}
) )
</insert> </insert>
</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