fangqing 1 месяц назад
Родитель
Сommit
67bddfdb2e

+ 6 - 6
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/CommunityReportController.java

@@ -186,7 +186,7 @@ public class CommunityReportController {
             String disposalType = communityReportPunishVo.getDisposalType().toString(); //封禁类型
             Long disposalTime = communityReportPunishVo.getDisposalTime();              //封禁时间
             String dispositionReason = communityReportPunishVo.getDispositionReason();  //封禁理由
-            Long typeId = communityReportPunishVo.getTypeId();//封禁ID
+
             //计算封禁的时间
             Date date = DateUtils.parseDate(DateUtils.getTime());
             Date futureDate = null;
@@ -211,7 +211,7 @@ public class CommunityReportController {
             reportUser.setUpdateBy(SecurityUtils.getUserId());
             reportUser.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));
 
-
+            Long replyId = communityReportPunishVo.getReplyId();
             switch (disposalType) {
                 case "0": //不处理
                     break;
@@ -226,13 +226,13 @@ public class CommunityReportController {
                 case "3": //静置
                     CommunityArticle communityArticle = new CommunityArticle();
                     communityArticle.setIsDraft(true);
-                    communityArticleService.update(communityArticle, new UpdateWrapper<CommunityArticle>().eq("id", communityReportPunishVo.getTypeId()));
+                    communityArticleService.update(communityArticle, new UpdateWrapper<CommunityArticle>().eq("id", communityReportPunishVo.getArticleId()));
                     communityReportUserMapper.updateById(reportUser);
                     break;
                 case "4": //删除
-                    if (communityReportPunishVo.getIsReply()){
+                    if (replyId != null){
                         CommunityCommentReply communityCommentReply = new CommunityCommentReply();
-                        communityCommentReply.setId(typeId);
+                        communityCommentReply.setId(communityReportPunishVo.getReplyId());
                         communityCommentReply.setDelete(true);
                         communityCommentReply.setUpdateBy(SecurityUtils.getUserId());
                         communityCommentReply.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));
@@ -240,7 +240,7 @@ public class CommunityReportController {
                         communityReportUserMapper.updateById(reportUser);
                     }else {
                         CommunityArticleComment communityArticleComment = new CommunityArticleComment();
-                        communityArticleComment.setId(typeId);
+                        communityArticleComment.setId(communityReportPunishVo.getCommentId());
                         communityArticleComment.setDelete(true);
                         communityArticleComment.setUpdateBy(SecurityUtils.getUserId());
                         communityArticleComment.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));

+ 17 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityReportUser.java

@@ -129,6 +129,23 @@ public class CommunityReportUser implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
+    /**
+     * 文章ID
+     */
+    @ApiModelProperty("文章ID")
+    private Long articleId;
+
+    /**
+     * 评论ID
+     */
+    @ApiModelProperty("评论ID")
+    private Long commentId;
+
+    /**
+     * 子评论ID
+     */
+    @ApiModelProperty("子评论ID")
+    private Long replyId;
 
 
 

+ 3 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/service/CommunityReportUserServiceImpl.java

@@ -49,6 +49,9 @@ public class CommunityReportUserServiceImpl extends ServiceImpl<CommunityReportU
         reportUser.setContent(communityReportUser.getContent());
         reportUser.setTypeId(communityReportUser.getTypeId());
         reportUser.setReportContent(communityReportUser.getReportContent());
+        reportUser.setArticleId(communityReportUser.getArticleId());
+        reportUser.setCommentId(communityReportUser.getCommentId());
+        reportUser.setReplyId(communityReportUser.getReplyId());
 
         //根据用户信息查询用户头像名称
         SysUser sysUser = sysUserMapper.selectUserById(reportUser.getUserId());

+ 17 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/vo/CommunityReportPunishVo.java

@@ -72,4 +72,21 @@ public class CommunityReportPunishVo {
     private String dispositionReason;
 
 
+    /**
+     * 文章ID
+     */
+    @ApiModelProperty("文章ID")
+    private Long articleId;
+
+    /**
+     * 评论ID
+     */
+    @ApiModelProperty("评论ID")
+    private Long commentId;
+
+    /**
+     * 子评论ID
+     */
+    @ApiModelProperty("子评论ID")
+    private Long replyId;
 }

+ 16 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/vo/CommunityReportUserVo.java

@@ -124,5 +124,21 @@ public class CommunityReportUserVo implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
+    /**
+     * 文章ID
+     */
+    @ApiModelProperty("文章ID")
+    private Long articleId;
 
+    /**
+     * 评论ID
+     */
+    @ApiModelProperty("评论ID")
+    private Long commentId;
+
+    /**
+     * 子评论ID
+     */
+    @ApiModelProperty("子评论ID")
+    private Long replyId;
 }

+ 3 - 1
ruoyi-generator/src/main/resources/mapper/community/CommunityReportUserMapper.xml

@@ -38,7 +38,9 @@
         user_state,
         avatar,
         content as report_content,
-        type_id as report_typeId,
+        article_id,
+        comment_id,
+        reply_id,
         is_delete,
         create_by as report_create_by,
         create_time as report_create_time,