diff --git a/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityNoticeServiceImpl.java b/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityNoticeServiceImpl.java index 4f1e5d1..58c87e1 100644 --- a/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityNoticeServiceImpl.java +++ b/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityNoticeServiceImpl.java @@ -2,6 +2,7 @@ package com.inspur.community.service.impl; import java.util.List; +import com.inspur.common.utils.DateUtils; import com.inspur.common.utils.uuid.IdUtils; import com.inspur.community.domain.CommunityPostReply; import com.inspur.community.mapper.CommunityPostReplyMapper; @@ -69,6 +70,7 @@ public class CommunityNoticeServiceImpl implements ICommunityNoticeService { communityNotice.setNoticeId(IdUtils.simpleUUID()); communityNotice.setStatus("0"); + communityNotice.setRemark(DateUtils.getTime()); return communityNoticeMapper.insertCommunityNotice(communityNotice); } diff --git a/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityPostReportServiceImpl.java b/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityPostReportServiceImpl.java index be70707..c25b157 100644 --- a/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityPostReportServiceImpl.java +++ b/inspur-service/inspur-community/src/main/java/com/inspur/community/service/impl/CommunityPostReportServiceImpl.java @@ -5,11 +5,15 @@ import java.util.List; import com.inspur.common.utils.DateUtils; import com.inspur.common.utils.SecurityUtils; import com.inspur.common.utils.uuid.IdUtils; +import com.inspur.community.domain.CommunityNotice; import com.inspur.community.domain.CommunityPostInfo; import com.inspur.community.domain.CommunityPostReply; +import com.inspur.community.domain.vo.CommunityPostInfoVO; import com.inspur.community.domain.vo.CommunityPostReportVO; +import com.inspur.community.mapper.CommunityNoticeMapper; import com.inspur.community.mapper.CommunityPostInfoMapper; import com.inspur.community.mapper.CommunityPostReplyMapper; +import com.inspur.community.service.ICommunityNoticeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.inspur.community.mapper.CommunityPostReportMapper; @@ -36,6 +40,8 @@ public class CommunityPostReportServiceImpl implements ICommunityPostReportServi @Autowired private CommunityPostReplyMapper communityPostReplyMapper; + @Autowired + private ICommunityNoticeService communityNoticeService; /** * 查询社区帖子举报 * @@ -87,20 +93,35 @@ public class CommunityPostReportServiceImpl implements ICommunityPostReportServi public int updateCommunityPostReport(CommunityPostReport communityPostReport) { Integer processStatus = communityPostReport.getResult().split(":")[0] != null ? Integer.parseInt(communityPostReport.getResult().split(":")[0]) : 0; - if(processStatus != 0){ + CommunityNotice communityNotice = new CommunityNotice(); //找到贴子或者评论 if("0".equals(communityPostReport.getReportType())){//帖子 + if(processStatus != 0) {//只有封禁或者删除才通知 + communityNotice.setPostId(communityPostReport.getReportContentId()); + CommunityPostInfoVO post = communityPostInfoMapper.selectCommunityPostInfoByPostId(communityPostReport.getReportContentId()); + communityNotice.setPostName(post.getPostTitle()); + communityNotice.setUserId(post.getUserId()); + } CommunityPostInfo communityPostInfo = new CommunityPostInfo(); communityPostInfo.setPostId(communityPostReport.getReportContentId()); communityPostInfo.setStatus(String.valueOf(processStatus)); communityPostInfoMapper.updateCommunityPostInfo(communityPostInfo); }else{//回复 + if(processStatus != 0) { + CommunityPostReply reply = communityPostReplyMapper.selectCommunityPostReplyByReplyId(communityPostReport.getReportContentId()); + communityNotice.setReplyId(communityPostReport.getReportContentId()); + communityNotice.setUserId(reply.getUserId()); + communityNotice.setReplyContent(reply.getReplyContent()); + } CommunityPostReply communityPostReply = new CommunityPostReply(); communityPostReply.setReplyId(communityPostReport.getReportContentId()); communityPostReply.setStatus(String.valueOf(processStatus)); communityPostReplyMapper.updateCommunityPostReply(communityPostReply); } - } + if(processStatus != 0) { + communityNotice.setNoticeType(processStatus == 1 ? "3" : "4"); + communityNoticeService.insertCommunityNotice(communityNotice); + } communityPostReport.setStatus("1"); return communityPostReportMapper.updateCommunityPostReport(communityPostReport); } diff --git a/inspur-ui/src/views/community/personal/index.vue b/inspur-ui/src/views/community/personal/index.vue index fbaff67..afa8174 100644 --- a/inspur-ui/src/views/community/personal/index.vue +++ b/inspur-ui/src/views/community/personal/index.vue @@ -87,7 +87,7 @@ class="notice-content" v-if="notice.replyId != null" >您的评论