From adaa4253315cc45da2c8d2fa01f0fa6dfb985841 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Mon, 30 Nov 2020 08:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=A6=E6=B0=B4=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=86=85=E5=AE=B9=E5=AE=A1=E6=A0=B8mq?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/RocketMqConstant.java | 18 +++++++ .../service/impl/CheckResultServiceImpl.java | 8 ++++ .../service/ReportIssueService.java | 9 ++++ .../service/impl/ReportIssueServiceImpl.java | 7 +++ .../consumer/RejectCheckRecordConsumer.java | 48 +++++++++++++++++++ .../modules/rocketmq/dto/RejectRecordDTO.java | 27 +++++++++++ .../src/main/resources/application.yml | 1 + .../activity/service/ActApplyInfoService.java | 9 ++++ .../service/impl/ActApplyInfoServiceImpl.java | 7 +++ .../consumer/RejectCheckRecordConsumer.java | 6 +++ 10 files changed, 140 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java index 074c114a..a26184ed 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java @@ -53,6 +53,10 @@ public interface RocketMqConstant { * 内容安全审核-初心互助-已报名活动-我要打卡-消息tag */ String MQ_TAG_HEART_SIGNIN_CONTENTSECURITY = "js_heart_signIn_contentSecurityTag"; + /** + * 内容安全审核-初心互助-已报名活动-我要打卡-消息tag + */ + String MQ_TAG_HEART_ACT_APPLY= "js_heart_act_apply"; //--------------------------------------------------------------------------- /** @@ -92,4 +96,18 @@ public interface RocketMqConstant { */ String MQ_TAG_GROUP_TOPIC_COMMENT_CONTENTSECURITY = "js_group_topic_comment_contentSecurityTag"; + + //--------------------------------------------------------------------------- + + /** + * 内容安全审核-我要举报 + */ + String MQ_TOPIC_REPORT_ISSUE = "js_reportIssue_contentSecurityTopic"; + + /** + * 内容安全审核 我要举报tag + */ + String MQ_TAG_REPORT_ISSUE_CONTENTSECURITY = "js_reportIssue_topic_contentSecurityTag"; + + } diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java index 87957e47..8afc76e6 100644 --- a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java @@ -180,6 +180,9 @@ public class CheckResultServiceImpl extends BaseServiceImpl { * @return void **/ void modifyOrganizationInfo(OrganizationModifyDTO dto); + /** + * @Description 违规删除 + * @Author songyunpeng + * @Date 2020/11/27 + * @Param [dto] + * @return void + **/ + void rejectActInfo(RejectRecordDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java index 7ef83a6c..c39d910a 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java @@ -44,6 +44,7 @@ import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity; import com.elink.esua.epdc.modules.reportissue.service.CustomImgService; import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService; import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -236,6 +237,12 @@ public class ReportIssueServiceImpl extends BaseServiceImpl { + + @Autowired + private ReportIssueService reportIssueService; + @Override + public void onMessage(MessageExt messageExt) { + log.info("EPDC-CUSTOM-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_REPORT_ISSUE, messageExt.getMsgId()); + try { + String charset = "UTF-8"; + String body = new String(messageExt.getBody(), charset); + String tag = messageExt.getTags(); + RejectRecordDTO dto = JSONObject.parseObject(body, RejectRecordDTO.class); + if(RocketMqConstant.MQ_TAG_REPORT_ISSUE_CONTENTSECURITY.equals(tag)){ + //删除发布活动相关信息 + reportIssueService.rejectActInfo(dto); + } + + log.info("EPDC-CUSTOM-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_REPORT_ISSUE, messageExt.getMsgId(), body); + } catch (Exception e) { + log.info("EPDC-CUSTOM-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); + e.printStackTrace(); + } + } +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java new file mode 100644 index 00000000..509c5afe --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.modules.rocketmq.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 内容审核驳回信息处理-发送MQ消息DTO + * + * @Author: wangtong + * @Date: 2020/7/14 14:58 + */ +@Data +public class RejectRecordDTO implements Serializable { + + private static final long serialVersionUID = 3032661994413974324L; + /** + * 用户ID + */ + private String userId; + + /** + * 关联信息ID + */ + private String relationId; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/application.yml index 58b8154a..0ebab4ae 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/application.yml @@ -74,4 +74,5 @@ rocketmq: name-server: @rocketmq.name.server@ consumer: group: @rocketmq.consumer.group@ + contentSecurity-group: @rocketmq.consumer.contentSecurity.group@ diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActApplyInfoService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActApplyInfoService.java index 1b77a53c..cffb1ea1 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActApplyInfoService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActApplyInfoService.java @@ -26,6 +26,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.modules.activity.entity.ActApplyInfoEntity; import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import java.util.List; import java.util.Map; @@ -129,4 +130,12 @@ public interface ActApplyInfoService extends BaseService { * @return void **/ void modifyOrganizationInfo(OrganizationModifyDTO dto); + /** + * @Description 删除我要申请 + * @Author songyunpeng + * @Date 2020/11/27 + * @Param [dto] + * @return void + **/ + void rejectActClockInfo(RejectRecordDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java index 8a8dae29..34c8d128 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java @@ -42,6 +42,7 @@ import com.elink.esua.epdc.modules.activity.service.ActApplyInfoService; import com.elink.esua.epdc.modules.feign.AdminFeignClient; import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -209,6 +210,12 @@ public class ActApplyInfoServiceImpl extends BaseServiceImpl { @Autowired private ActInfoService actInfoService; + @Autowired + private ActApplyInfoService actApplyInfoService; @Override public void onMessage(MessageExt messageExt) { @@ -41,6 +44,9 @@ public class RejectCheckRecordConsumer implements RocketMQListener { }else if(RocketMqConstant.MQ_TAG_HEART_SIGNIN_CONTENTSECURITY.equals(tag)){ //删除已报名活动-我要打卡相关信息 actInfoService.rejectActClockInfo(dto); + }else if(RocketMqConstant.MQ_TAG_HEART_ACT_APPLY.equals(tag)){ + //删除我要申请 + actApplyInfoService.rejectActClockInfo(dto); } log.info("EPDC-HEART-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, messageExt.getMsgId(), body);