117 changed files with 2997 additions and 97 deletions
@ -0,0 +1,38 @@ |
|||
package com.elink.esua.epdc.rocketmq.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* |
|||
* 组织机构信息修改-发送MQ消息DTO |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/16 9:30 |
|||
*/ |
|||
@Data |
|||
public class OrganizationModifyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -1330090682508121169L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 旧部门名称 |
|||
*/ |
|||
private String oldDeptName; |
|||
|
|||
/** |
|||
* 新部门名称 |
|||
*/ |
|||
private String newDeptName; |
|||
|
|||
/** |
|||
* 部门类型 |
|||
*/ |
|||
private String typeKey; |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.elink.esua.epdc.rocketmq.producer; |
|||
|
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.rocketmq.client.producer.SendResult; |
|||
import org.apache.rocketmq.common.message.Message; |
|||
import org.apache.rocketmq.spring.core.RocketMQTemplate; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* |
|||
* 组织机构信息修改-发送MQ消息 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/16 13:38 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
public class OrganizationModifyProducer { |
|||
|
|||
@Autowired |
|||
private RocketMQTemplate rocketMQTemplate; |
|||
|
|||
/** |
|||
* |
|||
* 发送消息 |
|||
* |
|||
* @params [topic, tag, keys, body] |
|||
* @return void |
|||
* @author liuchuang |
|||
* @since 2020/3/6 21:09 |
|||
*/ |
|||
public void sendMessage(String topic, String tag, String keys, String body) { |
|||
Message message = new Message(topic, tag, keys, body.getBytes()); |
|||
try { |
|||
SendResult sendResult = rocketMQTemplate.getProducer().send(message); |
|||
log.info("EPDC-ADMIN-SERVER发送消息结果:{sendStatus:{}, topic:{}, msgId:{}}", sendResult.getSendStatus(), topic, sendResult.getMsgId()); |
|||
} catch (Exception e) { |
|||
log.error("EPDC-ADMIN-SERVER发送消息异常:{topic:{}, tag:{}, keys:{}, body:{}}", topic, tag, keys, body); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.elink.esua.epdc.commons.tools.constant; |
|||
|
|||
/** |
|||
* |
|||
* RocketMq 常量类 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/16 14:50 |
|||
*/ |
|||
public interface RocketMqConstant { |
|||
|
|||
/** |
|||
* 组织机构信息修改-消息topic |
|||
*/ |
|||
String MQ_TOPIC_ORGANIZATION = "jinshui-organizationTopic"; |
|||
|
|||
/** |
|||
* 组织机构信息修改-消息tag |
|||
*/ |
|||
String MQ_TAG_ORGANIZATION = "jinshui-organizationTag"; |
|||
|
|||
/** |
|||
* 分类信息修改-消息topic |
|||
*/ |
|||
String MQ_TOPIC_CATEGORY = "jinshui-categoryTopic"; |
|||
|
|||
/** |
|||
* 分类信息修改-消息tag |
|||
*/ |
|||
String MQ_TAG_CATEGORY = "jinshui-categoryTag"; |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.elink.esua.epdc.dto.events.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 12:46 |
|||
*/ |
|||
@Data |
|||
public class GroupFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 5915096900970194933L; |
|||
|
|||
/** |
|||
* 社群ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 社群名称 |
|||
*/ |
|||
private String groupName; |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
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.events.service.EpdcEventsService; |
|||
import com.elink.esua.epdc.modules.issue.service.IssueService; |
|||
import com.elink.esua.epdc.modules.item.service.ItemService; |
|||
import com.elink.esua.epdc.modules.rocketmq.dto.CategoryModifyDTO; |
|||
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消息 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 16:29 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_CATEGORY, consumerGroup = "${rocketmq.consumer.category-group}", messageModel = MessageModel.BROADCASTING) |
|||
public class CategoryModifyConsumer implements RocketMQListener<MessageExt> { |
|||
|
|||
@Autowired |
|||
private EpdcEventsService epdcEventsService; |
|||
|
|||
@Autowired |
|||
private IssueService issueService; |
|||
|
|||
@Autowired |
|||
private ItemService itemService; |
|||
|
|||
@Override |
|||
public void onMessage(MessageExt messageExt) { |
|||
log.info("EPDC-EVENTS-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_CATEGORY, messageExt.getMsgId()); |
|||
try { |
|||
String charset = "UTF-8"; |
|||
String body = new String(messageExt.getBody(), charset); |
|||
CategoryModifyDTO dto = JSONObject.parseObject(body, CategoryModifyDTO.class); |
|||
// 事件表修改分类信息
|
|||
epdcEventsService.modifyCategoryInfo(dto); |
|||
// 议题表修改分类信息
|
|||
issueService.modifyCategoryInfo(dto); |
|||
// 项目表修改分类信息
|
|||
itemService.modifyCategoryInfo(dto); |
|||
log.info("EPDC-EVENTS-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_CATEGORY, messageExt.getMsgId(), body); |
|||
} catch (Exception e) { |
|||
log.info("EPDC-EVENTS-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
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.events.service.EpdcEventsService; |
|||
import com.elink.esua.epdc.modules.issue.service.IssueHandleService; |
|||
import com.elink.esua.epdc.modules.issue.service.IssueService; |
|||
import com.elink.esua.epdc.modules.item.service.*; |
|||
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; |
|||
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消息 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/6 0:21 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_ORGANIZATION, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING) |
|||
public class OrganizationModifyConsumer implements RocketMQListener<MessageExt> { |
|||
|
|||
@Autowired |
|||
private EpdcEventsService epdcEventsService; |
|||
|
|||
@Autowired |
|||
private IssueService issueService; |
|||
|
|||
@Autowired |
|||
private IssueHandleService issueHandleService; |
|||
|
|||
@Autowired |
|||
private ItemService itemService; |
|||
|
|||
@Autowired |
|||
private ItemDeptService itemDeptService; |
|||
|
|||
@Autowired |
|||
private ItemEvaluateDeptService itemEvaluateDeptService; |
|||
|
|||
@Autowired |
|||
private ItemHandleProcessService itemHandleProcessService; |
|||
|
|||
@Autowired |
|||
private ItemInformationService itemInformationService; |
|||
|
|||
@Override |
|||
public void onMessage(MessageExt messageExt) { |
|||
log.info("EPDC-EVENTS-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId()); |
|||
try { |
|||
String charset = "UTF-8"; |
|||
String body = new String(messageExt.getBody(), charset); |
|||
OrganizationModifyDTO dto = JSONObject.parseObject(body, OrganizationModifyDTO.class); |
|||
// 事件修改组织机构信息
|
|||
epdcEventsService.modifyOrganizationInfo(dto); |
|||
// 议题修改组织机构信息
|
|||
issueService.modifyOrganizationInfo(dto); |
|||
// 议题处理进度修改操作人部门名称
|
|||
issueHandleService.modifyOrganizationInfo(dto); |
|||
// 项目修改组织机构信息
|
|||
itemService.modifyOrganizationInfo(dto); |
|||
// 项目部门关系表修改部门名称
|
|||
itemDeptService.modifyOrganizationInfo(dto); |
|||
// 项目部门评价表修改被评价部门名称
|
|||
itemEvaluateDeptService.modifyOrganizationInfo(dto); |
|||
// 项目处理进度表修改操作人部门
|
|||
itemHandleProcessService.modifyOrganizationInfo(dto); |
|||
//项目消息表修改处理部门
|
|||
itemInformationService.modifyOrganizationInfo(dto); |
|||
log.info("EPDC-EVENTS-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body); |
|||
} catch (Exception e) { |
|||
log.info("EPDC-EVENTS-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.elink.esua.epdc.modules.rocketmq.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* |
|||
* RocketMQ消息DTO |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 16:21 |
|||
*/ |
|||
@Data |
|||
public class CategoryModifyDTO implements Serializable { |
|||
private static final long serialVersionUID = -5012212832912602966L; |
|||
|
|||
/** |
|||
* 分类ID |
|||
*/ |
|||
private Long categoryId; |
|||
|
|||
/** |
|||
* 旧分类名称 |
|||
*/ |
|||
private String oldCategoryName; |
|||
|
|||
/** |
|||
* 新分类名称 |
|||
*/ |
|||
private String newCategoryName; |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.elink.esua.epdc.modules.rocketmq.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* |
|||
* 组织机构信息修改-接收MQ消息DTO |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/6 22:34 |
|||
*/ |
|||
@Data |
|||
public class OrganizationModifyDTO implements Serializable { |
|||
private static final long serialVersionUID = 6288521726874495827L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 旧部门名称 |
|||
*/ |
|||
private String oldDeptName; |
|||
|
|||
/** |
|||
* 新部门名称 |
|||
*/ |
|||
private String newDeptName; |
|||
|
|||
/** |
|||
* 部门类型 |
|||
*/ |
|||
private String typeKey; |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.elink.esua.epdc.modules.rocketmq.producer; |
|||
|
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.rocketmq.client.producer.SendResult; |
|||
import org.apache.rocketmq.common.message.Message; |
|||
import org.apache.rocketmq.spring.core.RocketMQTemplate; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* |
|||
* 分类信息修改-发送MQ消息 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 16:14 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
public class CategoryModifyProducer { |
|||
|
|||
@Autowired |
|||
private RocketMQTemplate rocketMQTemplate; |
|||
|
|||
/** |
|||
* |
|||
* 发送消息 |
|||
* |
|||
* @params [topic, tag, keys, body] |
|||
* @return void |
|||
* @author liuchuang |
|||
* @since 2020/3/6 21:09 |
|||
*/ |
|||
public void sendMessage(String topic, String tag, String keys, String body) { |
|||
Message message = new Message(topic, tag, keys, body.getBytes()); |
|||
try { |
|||
SendResult sendResult = rocketMQTemplate.getProducer().send(message); |
|||
log.info("EPDC-EVENTS-SERVER发送消息结果:{sendStatus:{}, topic:{}, msgId:{}}", sendResult.getSendStatus(), topic, sendResult.getMsgId()); |
|||
} catch (Exception e) { |
|||
log.error("EPDC-EVENTS-SERVER发送消息异常:{topic:{}, tag:{}, keys:{}, body:{}}", topic, tag, keys, body); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
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.group.service.GroupService; |
|||
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; |
|||
import com.elink.esua.epdc.modules.topic.service.TopicService; |
|||
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消息 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 1:54 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_ORGANIZATION, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING) |
|||
public class OrganizationModifyConsumer implements RocketMQListener<MessageExt> { |
|||
|
|||
@Autowired |
|||
private GroupService groupService; |
|||
|
|||
@Autowired |
|||
private TopicService topicService; |
|||
|
|||
@Override |
|||
public void onMessage(MessageExt messageExt) { |
|||
log.info("EPDC-GROUP-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId()); |
|||
try { |
|||
String charset = "UTF-8"; |
|||
String body = new String(messageExt.getBody(), charset); |
|||
OrganizationModifyDTO dto = JSONObject.parseObject(body, OrganizationModifyDTO.class); |
|||
// 话题修改组织机构信息
|
|||
topicService.modifyOrganizationInfo(dto); |
|||
// 邻里党群修改组织机构信息
|
|||
groupService.modifyOrganizationInfo(dto); |
|||
log.info("EPDC-GROUP-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body); |
|||
} catch (Exception e) { |
|||
log.info("EPDC-GROUP-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.elink.esua.epdc.modules.rocketmq.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* |
|||
* 组织机构信息修改-接收MQ消息DTO |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 1:53 |
|||
*/ |
|||
@Data |
|||
public class OrganizationModifyDTO implements Serializable { |
|||
private static final long serialVersionUID = 6288521726874495827L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 旧部门名称 |
|||
*/ |
|||
private String oldDeptName; |
|||
|
|||
/** |
|||
* 新部门名称 |
|||
*/ |
|||
private String newDeptName; |
|||
|
|||
/** |
|||
* 部门类型 |
|||
*/ |
|||
private String typeKey; |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
package com.elink.esua.epdc.rocketmq.consumer; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; |
|||
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; |
|||
import com.elink.esua.epdc.service.BannerService; |
|||
import com.elink.esua.epdc.service.NewsService; |
|||
import com.elink.esua.epdc.service.NoticeService; |
|||
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消息 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 13:44 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_ORGANIZATION, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING) |
|||
public class OrganizationModifyConsumer implements RocketMQListener<MessageExt> { |
|||
|
|||
@Autowired |
|||
private BannerService bannerService; |
|||
|
|||
@Autowired |
|||
private NewsService newsService; |
|||
|
|||
@Autowired |
|||
private NoticeService noticeService; |
|||
|
|||
@Override |
|||
public void onMessage(MessageExt messageExt) { |
|||
log.info("EPDC-NEWS-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId()); |
|||
try { |
|||
String charset = "UTF-8"; |
|||
String body = new String(messageExt.getBody(), charset); |
|||
OrganizationModifyDTO dto = JSONObject.parseObject(body, OrganizationModifyDTO.class); |
|||
// banner表修改组织机构信息
|
|||
bannerService.modifyOrganizationInfo(dto); |
|||
// 新闻表修改组织机构信息
|
|||
newsService.modifyOrganizationInfo(dto); |
|||
// 通知表修改组织机构信息
|
|||
noticeService.modifyOrganizationInfo(dto); |
|||
log.info("EPDC-NEWS-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body); |
|||
} catch (Exception e) { |
|||
log.info("EPDC-NEWS-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.elink.esua.epdc.rocketmq.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* |
|||
* 组织机构信息修改-接收MQ消息DTO |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 13:43 |
|||
*/ |
|||
@Data |
|||
public class OrganizationModifyDTO implements Serializable { |
|||
private static final long serialVersionUID = -5692602006311937083L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 旧部门名称 |
|||
*/ |
|||
private String oldDeptName; |
|||
|
|||
/** |
|||
* 新部门名称 |
|||
*/ |
|||
private String newDeptName; |
|||
|
|||
/** |
|||
* 部门类型 |
|||
*/ |
|||
private String typeKey; |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
package com.elink.esua.epdc.rocketmq.consumer; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; |
|||
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; |
|||
import com.elink.esua.epdc.service.*; |
|||
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消息 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 13:47 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_ORGANIZATION, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING) |
|||
public class OrganizationModifyConsumer implements RocketMQListener<MessageExt> { |
|||
|
|||
@Autowired |
|||
private PartyAuthenticationFailedService partyAuthenticationFailedService; |
|||
|
|||
@Autowired |
|||
private PartyMembersService partyMembersService; |
|||
|
|||
@Autowired |
|||
private UserService userService; |
|||
|
|||
@Autowired |
|||
private UserGridRelationService userGridRelationService; |
|||
|
|||
@Autowired |
|||
private UserInvitationRecordService userInvitationRecordService; |
|||
|
|||
@Override |
|||
public void onMessage(MessageExt messageExt) { |
|||
log.info("EPDC-USER-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId()); |
|||
try { |
|||
String charset = "UTF-8"; |
|||
String body = new String(messageExt.getBody(), charset); |
|||
OrganizationModifyDTO dto = JSONObject.parseObject(body, OrganizationModifyDTO.class); |
|||
// 党员认证失败表修改组织机构信息
|
|||
partyAuthenticationFailedService.modifyOrganizationInfo(dto); |
|||
// 党员表修改组织机构信息
|
|||
partyMembersService.modifyOrganizationInfo(dto); |
|||
// 用户表修改组织机构信息
|
|||
userService.modifyOrganizationInfo(dto); |
|||
// 用户网格关系表修改组织机构信息
|
|||
userGridRelationService.modifyOrganizationInfo(dto); |
|||
// 用户邀请记录表修改组织机构信息
|
|||
userInvitationRecordService.modifyOrganizationInfo(dto); |
|||
log.info("EPDC-USER-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body); |
|||
} catch (Exception e) { |
|||
log.info("EPDC-USER-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.elink.esua.epdc.rocketmq.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* |
|||
* 组织机构信息修改-接收MQ消息DTO |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/3/7 13:46 |
|||
*/ |
|||
@Data |
|||
public class OrganizationModifyDTO implements Serializable { |
|||
private static final long serialVersionUID = -5692602006311937083L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 旧部门名称 |
|||
*/ |
|||
private String oldDeptName; |
|||
|
|||
/** |
|||
* 新部门名称 |
|||
*/ |
|||
private String newDeptName; |
|||
|
|||
/** |
|||
* 部门类型 |
|||
*/ |
|||
private String typeKey; |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue