Browse Source

锦水第一次优化 内容审核mq信息新增

feature/syp_points
songyunpeng 5 years ago
parent
commit
adaa425331
  1. 18
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java
  2. 8
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java
  3. 9
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/ReportIssueService.java
  4. 7
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java
  5. 48
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java
  6. 27
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java
  7. 1
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/application.yml
  8. 9
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActApplyInfoService.java
  9. 7
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java
  10. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java

18
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 * 内容安全审核-初心互助-已报名活动-我要打卡-消息tag
*/ */
String MQ_TAG_HEART_SIGNIN_CONTENTSECURITY = "js_heart_signIn_contentSecurityTag"; 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_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";
} }

8
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<CheckResultDao, Chec
}else if(ModuleName.HELP_SIGNIN.getCode().equals(record.getModule())){ }else if(ModuleName.HELP_SIGNIN.getCode().equals(record.getModule())){
topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY; topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY;
tag = RocketMqConstant.MQ_TAG_HEART_SIGNIN_CONTENTSECURITY; tag = RocketMqConstant.MQ_TAG_HEART_SIGNIN_CONTENTSECURITY;
}else if(ModuleName.ACT_APPLY.getCode().equals(record.getModule())){
topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY;
tag = RocketMqConstant.MQ_TAG_HEART_ACT_APPLY;
} }
//议题项目 //议题项目
else if(ModuleName.ISSUE_SUBMIT.getCode().equals(record.getModule())){ else if(ModuleName.ISSUE_SUBMIT.getCode().equals(record.getModule())){
@ -200,6 +203,11 @@ public class CheckResultServiceImpl extends BaseServiceImpl<CheckResultDao, Chec
topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY; topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY;
tag = RocketMqConstant.MQ_TAG_GROUP_TOPIC_COMMENT_CONTENTSECURITY; tag = RocketMqConstant.MQ_TAG_GROUP_TOPIC_COMMENT_CONTENTSECURITY;
} }
//我要举报
else if(ModuleName.REPORT_ISSUE.getCode().equals(record.getModule())){
topic = RocketMqConstant.MQ_TOPIC_REPORT_ISSUE;
tag = RocketMqConstant.MQ_TAG_REPORT_ISSUE_CONTENTSECURITY;
}
RejectRecordDTO body = new RejectRecordDTO(); RejectRecordDTO body = new RejectRecordDTO();
body.setUserId(violationEntity.getUserId()); body.setUserId(violationEntity.getUserId());
body.setRelationId(violationEntity.getRelationId()); body.setRelationId(violationEntity.getRelationId());

9
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/ReportIssueService.java

@ -27,6 +27,7 @@ import com.elink.esua.epdc.dto.form.ReportIssueSubmitFormDTO;
import com.elink.esua.epdc.dto.result.ReportIssueResultDTO; import com.elink.esua.epdc.dto.result.ReportIssueResultDTO;
import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity; import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; 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.List;
import java.util.Map; import java.util.Map;
@ -146,4 +147,12 @@ public interface ReportIssueService extends BaseService<ReportIssueEntity> {
* @return void * @return void
**/ **/
void modifyOrganizationInfo(OrganizationModifyDTO dto); void modifyOrganizationInfo(OrganizationModifyDTO dto);
/**
* @Description 违规删除
* @Author songyunpeng
* @Date 2020/11/27
* @Param [dto]
* @return void
**/
void rejectActInfo(RejectRecordDTO dto);
} }

7
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.CustomImgService;
import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService; 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.OrganizationModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -236,6 +237,12 @@ public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, Repo
// 更新网格名称 // 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId()); baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
} }
@Override
public void rejectActInfo(RejectRecordDTO dto) {
baseDao.deleteById(dto.getRelationId());
}
/** /**
* 组织机构信息处理 * 组织机构信息处理
* *

48
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java

@ -0,0 +1,48 @@
package com.elink.esua.epdc.modules.rocketmq.consumer;
import com.alibaba.fastjson.JSONObject;
import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant;
import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
* 内容审核驳回信息处理-监听MQ消息
*
* @Authorwangtong
* @Date2020/7/14 1:54
*/
@Slf4j
@Component
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_REPORT_ISSUE, consumerGroup = "${rocketmq.consumer.contentSecurity-group}", messageModel = MessageModel.BROADCASTING)
public class RejectCheckRecordConsumer implements RocketMQListener<MessageExt> {
@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();
}
}
}

27
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;
}

1
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/application.yml

@ -74,4 +74,5 @@ rocketmq:
name-server: @rocketmq.name.server@ name-server: @rocketmq.name.server@
consumer: consumer:
group: @rocketmq.consumer.group@ group: @rocketmq.consumer.group@
contentSecurity-group: @rocketmq.consumer.contentSecurity.group@

9
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.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.entity.ActApplyInfoEntity; 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.OrganizationModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -129,4 +130,12 @@ public interface ActApplyInfoService extends BaseService<ActApplyInfoEntity> {
* @return void * @return void
**/ **/
void modifyOrganizationInfo(OrganizationModifyDTO dto); void modifyOrganizationInfo(OrganizationModifyDTO dto);
/**
* @Description 删除我要申请
* @Author songyunpeng
* @Date 2020/11/27
* @Param [dto]
* @return void
**/
void rejectActClockInfo(RejectRecordDTO dto);
} }

7
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.AdminFeignClient;
import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; 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.OrganizationModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -209,6 +210,12 @@ public class ActApplyInfoServiceImpl extends BaseServiceImpl<ActApplyInfoDao, Ac
// 更新网格名称 // 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId()); baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
} }
@Override
public void rejectActClockInfo(RejectRecordDTO dto) {
baseDao.deleteById(dto.getRelationId());
}
/** /**
* *
* 组织机构信息处理 * 组织机构信息处理

6
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java

@ -2,6 +2,7 @@ package com.elink.esua.epdc.modules.rocketmq.consumer;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant;
import com.elink.esua.epdc.modules.activity.service.ActApplyInfoService;
import com.elink.esua.epdc.modules.activity.service.ActInfoService; import com.elink.esua.epdc.modules.activity.service.ActInfoService;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -26,6 +27,8 @@ public class RejectCheckRecordConsumer implements RocketMQListener<MessageExt> {
@Autowired @Autowired
private ActInfoService actInfoService; private ActInfoService actInfoService;
@Autowired
private ActApplyInfoService actApplyInfoService;
@Override @Override
public void onMessage(MessageExt messageExt) { public void onMessage(MessageExt messageExt) {
@ -41,6 +44,9 @@ public class RejectCheckRecordConsumer implements RocketMQListener<MessageExt> {
}else if(RocketMqConstant.MQ_TAG_HEART_SIGNIN_CONTENTSECURITY.equals(tag)){ }else if(RocketMqConstant.MQ_TAG_HEART_SIGNIN_CONTENTSECURITY.equals(tag)){
//删除已报名活动-我要打卡相关信息 //删除已报名活动-我要打卡相关信息
actInfoService.rejectActClockInfo(dto); 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); log.info("EPDC-HEART-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, messageExt.getMsgId(), body);

Loading…
Cancel
Save