zoukankan      html  css  js  c++  java
  • rabbitmq回顾

    回顾1

    base

    
    /*     */ import com.google.common.base.Splitter;
    /*     */ import java.util.Date;
    /*     */ import java.util.List;
    /*     */ import java.util.Map;
    /*     */ import org.slf4j.Logger;
    /*     */ import org.slf4j.LoggerFactory;
    /*     */ import org.springframework.amqp.AmqpException;
    /*     */ import org.springframework.amqp.core.Message;
    /*     */ import org.springframework.amqp.core.MessagePostProcessor;
    /*     */ import org.springframework.amqp.rabbit.core.RabbitTemplate;
    /*     */ import org.springframework.amqp.rabbit.support.CorrelationData;
    /*     */ import org.springframework.beans.factory.annotation.Autowired;
    /*     */ import org.springframework.messaging.Message;
    /*     */ import org.springframework.messaging.MessageHeaders;
    /*     */ import org.springframework.messaging.support.MessageBuilder;
    /*     */ 
    /*     */ public abstract class AbsSendMessage<T extends BaseService> {
    /*  22 */   private static final Logger log = LoggerFactory.getLogger(AbsSendMessage.class);
    /*     */ 
    /*     */   
    /*     */   @Autowired
    /*     */   private RabbitTemplate rabbitTemplate;
    /*     */   
    /*     */   @Autowired
    /*     */   private BrokerMessageService brokerMessageService;
    /*     */   
    /*  31 */   private Integer nextRetry = Integer.valueOf(5);
    /*     */   
    /*  33 */   private Splitter splitter = Splitter.on("#");
    /*     */ 
    /*     */ 
    /*     */ 
    /*     */ 
    /*     */ 
    /*     */   
    /*  40 */   protected final RabbitTemplate.ConfirmCallback confirmCallback = new RabbitTemplate.ConfirmCallback()
    /*     */     {
    /*     */       public void confirm(CorrelationData correlationData, boolean ack, String cause)
    /*     */       {
    /*  52 */         List<String> msgParam = AbsSendMessage.this.splitter.splitToList(correlationData.getId());
    /*  53 */         String messageId = msgParam.get(0);
    /*  54 */         long sendTime = Long.parseLong(msgParam.get(1));
    /*  55 */         String messageType = msgParam.get(2);
    /*     */ 
    /*     */         
    /*  58 */         IBrokerMessage iBrokerMessage = (IBrokerMessage)AbsSendMessage.this.getService().selectByPrimaryKey(messageId);
    /*  59 */         iBrokerMessage.setUpdateTime(new Date());
    /*  60 */         if (ack) {
    /*     */ 
    /*     */           
    /*  63 */           iBrokerMessage.setStatus(MessageStatusEnum.QUEUE.value);
    /*     */           
    /*  65 */           AbsSendMessage.log.info("MQ 成功接受到消息{}", messageId);
    /*     */         }
    /*     */         else {
    /*     */           
    /*  69 */           iBrokerMessage.setStatus(MessageStatusEnum.SEND_ERROR.value);
    /*     */           
    /*  71 */           AbsSendMessage.log.info("MQ 消息{},confirm失败 msg={}", messageId, cause);
    /*     */         } 
    /*     */         
    /*  74 */         AbsSendMessage.this.getService().updateByPrimaryKeySelective(iBrokerMessage);
    /*     */       }
    /*     */     };
    /*     */ 
    /*     */   
    /*     */   protected void send(IBrokerMessage iBrokerMessage, String eventExchange, String eventRoutingKey, Map<String, Object> properties) throws Exception {
    /*  89 */     MessageHeaders mhs = new MessageHeaders(properties);
    /*     */ 
    /*     */     
    /*  92 */     Message<Object> msg = MessageBuilder.createMessage(iBrokerMessage, mhs);
    /*     */ 
    /*     */     
    /*  95 */     this.rabbitTemplate.setConfirmCallback(this.confirmCallback);
    /*     */ 
    /*     */ 
    /*     */     
    /*  99 */     CorrelationData cd = new CorrelationData(String.format("%s#%s#%s", new Object[] {
    /* 100 */             iBrokerMessage.getMessageId(), 
    /* 101 */             Long.valueOf(System.currentTimeMillis()), iBrokerMessage
    /* 102 */             .getStatus()
    /*     */           }));
    /*     */     
    /* 105 */     this.rabbitTemplate.convertAndSend(eventExchange, eventRoutingKey, msg, new MessagePostProcessor()
    /*     */         {
    /*     */ 
    /*     */ 
    /*     */           
    /*     */           public Message postProcessMessage(Message message) throws AmqpException
    /*     */           {
    /* 112 */             System.out.println("MessagePostProcessor");
    /* 113 */             return message;
    /*     */           }
    /*     */         },  cd);
    /*     */   }
    /*     */   
    /*     */   public abstract T getService();
    /*     */ }
    
    

    consumer

    /*    */ import com.alibaba.fastjson.JSONObject;
    /*    */ import com.rabbitmq.client.Channel;
    /*    */ import org.apache.commons.lang3.StringUtils;
    /*    */ import org.slf4j.Logger;
    /*    */ import org.slf4j.LoggerFactory;
    /*    */ import org.springframework.amqp.rabbit.annotation.Exchange;
    /*    */ import org.springframework.amqp.rabbit.annotation.Queue;
    /*    */ import org.springframework.amqp.rabbit.annotation.QueueBinding;
    /*    */ import org.springframework.amqp.rabbit.annotation.RabbitHandler;
    /*    */ import org.springframework.amqp.rabbit.annotation.RabbitListener;
    /*    */ import org.springframework.beans.factory.annotation.Autowired;
    /*    */ import org.springframework.messaging.Message;
    /*    */ import org.springframework.stereotype.Component;
    /*    */ 
    /*    */ @Component
    /*    */ public class EmailMessageReceive {
    /* 25 */   private static final Logger log = LoggerFactory.getLogger(EmailMessageReceive.class);
    /*    */ 
    /*    */   
    /*    */   @Autowired
    /*    */   private RequestEventService requestEventService;
    /*    */ 
    /*    */ 
    /*    */   
    /*    */   @Autowired
    /*    */   private EmailBrokerMessageService emailBrokerMessageService;
    /*    */   @Autowired
    /*    */   private EventSourcePersonService eventSourcePersonService;
    /*    */   
    /*    */   @Autowired
    /*    */   private SendSysNoticeStrategy sendSysNoticeStrategy;
    /*    */   
    /*    */   @RabbitListener(bindings = {@QueueBinding(value = @Queue(value = "${message.email.queue}", durable = "true"), exchange = @Exchange(value = "${message.email.exchange}", durable = "true", type = "topic", ignoreDeclarationExceptions = "true"), key = "${message.email.routingKey}")})
    /*    */   @RabbitHandler
    /*    */   public void onMessage(Message message, Channel channel) throws Exception {
    /* 53 */     EmailBrokerMessage emailBrokerMessage = (EmailBrokerMessage)message.getPayload();
    /*    */     
    /* 55 */     log.info("# EmailMessageReceive.onMessage # 收到一条消息,消息的Id为{}
    ", emailBrokerMessage.getMessageId());
    /*    */ 
    /*    */     
    /* 58 */     Long deliveryTag = (Long)message.getHeaders().get("amqp_deliveryTag");
    /*    */     
    /* 60 */     String messageBody = emailBrokerMessage.getMessage();
    /* 61 */     if (StringUtils.isEmpty(messageBody)) {
    /* 62 */       log.error("# EmailMessageReceive.onMessage # 消息{}的消息体为空", emailBrokerMessage.getMessageId());
    /*    */     }
    /*    */     else {
    /*    */       
    /* 66 */       Thread.sleep(5000L);
    /*    */       
    /* 68 */       EmailMessageEntity emailMessageEntity = (EmailMessageEntity)JSONObject.parseObject(messageBody, EmailMessageEntity.class);
    /*    */       
    /* 70 */       this.sendSysNoticeStrategy.send(emailMessageEntity);
    /*    */       
    /* 72 */       emailBrokerMessage.setConsumeStatus(ConsumeStatusEnum.SUCCESS.value);
    /* 73 */       this.emailBrokerMessageService.updateByPrimaryKeySelective(emailBrokerMessage);
    /*    */ 
    /*    */       
    /* 76 */       channel.basicAck(deliveryTag.longValue(), false);
    /*    */     } 
    /*    */   }
    /*    */ }
    
    
    /*     */ 
    /*     */ import com.alibaba.fastjson.JSONObject;
    /*     */ import com.google.common.collect.ImmutableList;
    /*     */ import com.rabbitmq.client.Channel;
    /*     */ import java.util.List;
    /*     */ import java.util.Optional;
    /*     */ import org.apache.commons.lang3.StringUtils;
    /*     */ import org.slf4j.Logger;
    /*     */ import org.slf4j.LoggerFactory;
    /*     */ import org.springframework.amqp.rabbit.annotation.Exchange;
    /*     */ import org.springframework.amqp.rabbit.annotation.Queue;
    /*     */ import org.springframework.amqp.rabbit.annotation.QueueBinding;
    /*     */ import org.springframework.amqp.rabbit.annotation.RabbitHandler;
    /*     */ import org.springframework.amqp.rabbit.annotation.RabbitListener;
    /*     */ import org.springframework.beans.factory.annotation.Autowired;
    /*     */ import org.springframework.messaging.Message;
    /*     */ import org.springframework.stereotype.Component;
    /*     */ 
    /*     */ @Component
    /*     */ public class EventReceive {
    /*  31 */   private static final Logger log = LoggerFactory.getLogger(EventReceive.class);
    /*     */ 
    /*     */   
    /*     */   @Autowired
    /*     */   private RequestEventService requestEventService;
    /*     */ 
    /*     */   @Autowired
    /*     */   private BrokerMessageService brokerMessageService;
    /*     */ 
    /*     */ 
    /*     */   
    /*     */   @Autowired
    /*     */   private EventSourcePersonService eventSourcePersonService;
    /*     */ 
    /*     */   
    /*     */   @RabbitListener(bindings = {@QueueBinding(value = @Queue(value = "${message.event.queue}", durable = "true"), exchange = @Exchange(value = "${message.event.exchange}", durable = "true", type = "topic", ignoreDeclarationExceptions = "true"), key = "${message.event.routingKey}")})
    /*     */   @RabbitHandler
    /*     */   public void onMessage(Message message, Channel channel) throws Exception {
    /*  56 */     String body = (String)message.getPayload();
    /*     */     
    /*  58 */     EventBrokerMessage eventBrokerMessage = (EventBrokerMessage)JSONObject.parseObject(body, EventBrokerMessage.class);
    /*     */     
    /*  60 */     log.info("# EventReceive.onMessage # 收到一条消息,消息的Id为{}
    ", eventBrokerMessage.getMessageId());
    /*     */ 
    /*     */     
    /*  63 */     Long deliveryTag = (Long)message.getHeaders().get("amqp_deliveryTag");
    /*     */     
    /*  65 */     String messageBody = eventBrokerMessage.getMessage();
    /*  66 */     if (StringUtils.isEmpty(messageBody)) {
    /*  67 */       log.error("# EventReceive.onMessage # 消息{}的消息体为空", eventBrokerMessage.getMessageId());
    /*     */     } else {
    /*     */       
    /*  70 */       EventInformation eventInformation = (EventInformation)JSONObject.parseObject(messageBody, EventInformation.class);
    /*     */ 
    /*     */       
    /*  74 */       String eventSource = Optional.<String>ofNullable(eventInformation.getEventSource()).orElse("Monitor");
    /*     */       
    /*  76 */       EventSourcePerson eventSourcePerson = (EventSourcePerson)this.eventSourcePersonService.selectOne(
    /*  77 */           EventSourcePerson.builder()
    /*  78 */           .eventSource(eventSource)
    /*  79 */           .build());
    /*     */       
    /*  81 */       ItsmPerson person = new ItsmPerson();
    /*  82 */       person.setItsmId(eventSourcePerson.getId());
    /*  83 */       person.setItsmName(eventSourcePerson.getEventSource());
    /*     */ 
    /*     */       
    /*     */       try {
    /*  87 */         this.requestEventService.createEventInformation((List)ImmutableList.of(eventInformation), person);
    /*     */         
    /*  89 */         eventBrokerMessage.setStatus(MessageStatusEnum.SUCCESS.value);
    /*  90 */         eventBrokerMessage.setConsumeStatus(ConsumeStatusEnum.SUCCESS.value);
    /*  91 */         log.info("# EventReceive.onMessage # 消息{}消费成功
    ", eventBrokerMessage.getMessageId());
    /*     */       }
    /*  93 */       catch (Exception e) {
    /*  94 */         eventBrokerMessage.setStatus(MessageStatusEnum.SUCCESS.value);
    /*  95 */         eventBrokerMessage.setConsumeStatus(ConsumeStatusEnum.CONSUMER_ERROR.value);
    /*  96 */         log.error("# EventReceive.onMessage # 消息{}消费失败
    ", eventBrokerMessage.getMessageId());
    /*  97 */         log.error("# EventReceive.onMessage # 消息{}异常日志", eventBrokerMessage.getMessageId(), e);
    /*     */       } finally {}
    /*     */     } 
    /*     */ 
    /*     */ 
    /*     */     
    /* 103 */     this.brokerMessageService.updateByPrimaryKeySelective(eventBrokerMessage);
    /*     */ 
    /*     */     
    /* 106 */     channel.basicAck(deliveryTag.longValue(), false);
    /*     */   }
    /*     */ }
    
    
    /*    */ 
    /*    */ import com.alibaba.fastjson.JSON;
    /*    */ import com.google.common.collect.Lists;
    /*    */ import com.rabbitmq.client.Channel;
    /*    */ import java.util.List;
    /*    */ import org.slf4j.Logger;
    /*    */ import org.slf4j.LoggerFactory;
    /*    */ import org.springframework.amqp.rabbit.annotation.Exchange;
    /*    */ import org.springframework.amqp.rabbit.annotation.Queue;
    /*    */ import org.springframework.amqp.rabbit.annotation.QueueBinding;
    /*    */ import org.springframework.amqp.rabbit.annotation.RabbitListener;
    /*    */ import org.springframework.beans.factory.annotation.Autowired;
    /*    */ import org.springframework.messaging.Message;
    /*    */ import org.springframework.stereotype.Component;
    /*    */ 
    /*    */ @Component
    /*    */ public class MonitorReceive
    /*    */ {
    /* 29 */   private static final Logger log = LoggerFactory.getLogger(MonitorReceive.class);
    /*    */ 
    /*    */   
    /*    */   @Autowired
    /*    */   private SynchroService synchroService;
    /*    */ 
    /*    */   
    /*    */   @Autowired
    /*    */   private RequestEventService requestEventService;
    /*    */ 
    /*    */   @RabbitListener(bindings = {@QueueBinding(value = @Queue(value = "${message.monitor.queue}", durable = "true"), exchange = @Exchange(value = "${message.monitor.exchange}", durable = "true", type = "topic", ignoreDeclarationExceptions = "true"), key = "${message.monitor.routingKey}")})
    /*    */   public void onMessage(Message message, Channel channel) throws Exception {
    /* 51 */     String toString = message.getPayload().toString();
    /* 52 */     System.out.println(toString);
    /*    */     try {
    /* 54 */       if (StringUtils.isNotEmpty(toString)) {
    /* 55 */         List<EventInformation> eventInformation = Lists.newArrayList();
    /* 56 */         List<EventMassage> eventMassages = Lists.newArrayList((Object[])new EventMassage[] { (EventMassage)JSON.parseObject(toString, MonitorEventMassage.class) });
    /* 57 */         eventMassages.forEach(a -> {
    /*    */               EventInformation eventInfor = EventInformation.builder().content(a.getContent()).eventSource(a.getEventSource()).eventStatus(EventStatus.MALFUNCTION.getName()).level(EventLevelEnum.getEventLevelEnumById(a.getEventLevel()).getName()).id(a.getId()).name(a.getContent()).build();
    /*    */ 
    /*    */ 
    /*    */ 
    /*    */               
    /*    */               eventInformation.add(eventInfor);
    /*    */             });
    /*    */ 
    /*    */ 
    /*    */         
    /* 68 */         this.requestEventService.createEventInformation(eventInformation, EventPersonEnum.MONITOR_PERSON.getPerson());
    /* 69 */         Long deliveryTag = (Long)message.getHeaders().get("amqp_deliveryTag");
    /*    */         
    /* 71 */         channel.basicAck(deliveryTag.longValue(), false);
    /*    */       } 
    /* 73 */     } catch (Exception e) {
    /* 74 */       e.printStackTrace();
    /* 75 */       log.error("# MonitorReceive.onMessage # 消息{}消费失败");
    /* 76 */       log.error("# MonitorReceive.onMessage # 消息{}异常日志");
    /*    */     } finally {}
    /*    */   }
    /*    */ }
    
    
    /*    */ 
    /*    */ import com.rabbitmq.client.Channel;
    /*    */ import org.springframework.messaging.Message;
    /*    */ import org.springframework.stereotype.Component;
    /*    */ @Component
    /*    */ public class MqReceive
    /*    */ {
    /*    */   public void onMessage(Message message, Channel channel) throws Exception {
    /* 25 */     System.out.println("-------------------------------");
    /*    */     
    /* 27 */     System.out.println("消费消息:" + StringUtil.formatJson(message.getPayload()));
    /*    */ 
    /*    */     
    /* 30 */     Long deliveryTag = (Long)message.getHeaders().get("amqp_deliveryTag");
    /*    */ 
    /*    */     
    /* 33 */     channel.basicAck(deliveryTag.longValue(), false);
    /*    */   }
    /*    */ }
    
    
    import java.util.Date;
    
    public interface IRequestContent {
      Long getMyBoardLevel();
      
      String getMyBoardLevelName();
      
      Long getMyBoardTypeId();
      
      String getMyBoardTypeName();
      
      String getRequestName();
      
      String getMyBoardRequestTitle();
      
      String getMyBoardRequestContent();
      
      String getMyBoardNum();
      
      String getMyBoardCreatePersonName();
      
      String getMyBoardItsmImgPath();
      
      Date getMyBoardCreateDate();
      
      Date getMyBoardUpdateDate();
      
      Date getMyBoardEndDate();
      
      String getCurrentWorkHandler();
      
      String getStatus();
    }
    
    
    import java.util.Objects;
    
    @Table(name = "some") @Entity(name = "some")
    public class ServiceWorkList implements Serializable, IRequestContent { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ApiModelProperty("工单编号") @Column(columnDefinition = "varchar(225) comment '工单编号'") private String serviceWorkNum; @ApiModelProperty("服务目录ID") @Column(columnDefinition = "BIGINT(20) comment '服务目录ID'") @Deprecated private Long serviceDirectoryId; @ApiModelProperty("服务项类别id") @Column(columnDefinition = "BIGINT(20) comment '服务项类别id'") private Long itemTypeId; @ApiModelProperty("服务项ID") @Column(columnDefinition = "BIGINT(20) comment '服务目录ID'")
    /*     */   private Long serviceItemId; @ApiModelProperty("优先级颜色")
    /*     */   @Column(columnDefinition = "VARCHAR(50) comment '优先级颜色'")
    /*     */   private String color; @ApiModelProperty("SLA的Id")
    /*     */   @Column(columnDefinition = "BIGINT(20) comment 'SLA的Id'")
    /*     */   private Long slaId; @ApiModelProperty("优先级Id")
    /*     */   @Column(columnDefinition = "BIGINT(20) comment '优先级Id'")
    /*     */   private Long leveId; @ApiModelProperty("紧急程度")
    /*     */   @Column(columnDefinition = "BIGINT(1) comment '紧急程度'")
    /*     */   private Long urgentLevel; @ApiModelProperty("影响范围")
    /*     */   @Column(columnDefinition = "BIGINT(1) comment '影响范围'")
    /*     */   private Long influenceRange; @ApiModelProperty("SLA解决时间")
    /*     */   @Column(columnDefinition = "DateTime comment 'SLA解决时间'")
    /*     */   private Date solveTime; @ApiModelProperty("旧的SLA解决时间")
    /*     */   @Column(columnDefinition = "DateTime comment '旧的SLA解决时间'")
    /*     */   private Date oldSolveTime; @ApiModelProperty("SLA响应时间")
    /*     */   @Column(columnDefinition = "DateTime comment 'SLA响应时间'")
    /*     */   private Date slaResponseTime; @ApiModelProperty("流程模型ID")
    /*     */   @Column(columnDefinition = "BIGINT(20) comment '流程模型ID'")
    /*     */   private Long processModelId; @ApiModelProperty("流程实例ID")
    /*     */   @Column(columnDefinition = "varchar(225) comment '流程实例ID'")
    /*     */   private String processId; @ApiModelProperty("当前处理人Id")
    /*     */   @Column(columnDefinition = "BIGINT(20) DEFAULT -1 comment '当前处理人Id'")
    /*     */   private Long currentAssignorId; @ApiModelProperty("当前处理人名称")
    /*     */   @Column(columnDefinition = "varchar(225) comment '当前处理人名称'")
    /*     */   private String currentAssignorName; @ApiModelProperty("关单人Id")
    /*     */   @Column(columnDefinition = "BIGINT(20) DEFAULT -1 comment '关单人Id'")
    /*  28 */   private Long lastAssignorId; public void setId(Long id) { this.id = id; } @ApiModelProperty("当前处理人Id列表") @Column(columnDefinition = "varchar(225) DEFAULT ''  comment '当前处理人名称'") private String currentAssignorIds; @ApiModelProperty("当前分配方式") @Column(columnDefinition = "BIGINT(20) comment '当前分配方式'") private Long currentDistributionMode; @ApiModelProperty("当前任务ID") @Column(columnDefinition = "BIGINT(20) comment '当前任务ID'") private Long currentTaskId; @ApiModelProperty("人员范围") @Column(columnDefinition = "BIGINT(20) comment '人员范围'") private Long staffScope; @ApiModelProperty("当前任务名称") @Column(columnDefinition = "varchar(50) comment '当前任务名称'") private String currentTaskName; @ApiModelProperty("发起人ID") @Column(columnDefinition = "BIGINT(50) comment '发起人ID'") private Long initiatorId; @ApiModelProperty("发起人名称") @Column(columnDefinition = "varchar(50) comment '发起人名称'") private String initiatorName; @ApiModelProperty("发起人头像") @Column(columnDefinition = "varchar(225) DEFAULT '' comment '发起人头像'") private String itsmImgPath; @ApiModelProperty("流程是否完成") @Column(columnDefinition = "BIGINT(20) DEFAULT 0 comment '流程是否完成'") private Long complete; @ApiModelProperty("创建时间") @Column(columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP comment '创建时间'") private Date createDate; @ApiModelProperty("修改时间") @Column(columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP comment '修改时间'") private Date updateDate; @ApiModelProperty("处理状态") @Column(columnDefinition = "BIGINT(20) comment '处理状态'") private Long disposeStatus; @ApiModelProperty("服务项类型") @Column(columnDefinition = "BIGINT(20) comment '服务项类型'") private Long serviceItemType; @ApiModelProperty("标题") @Column(columnDefinition = "varchar(50) comment '标题'") private String title; @ApiModelProperty("级别") @Column(columnDefinition = "varchar(50) comment '级别'") private String disposeLevel; @ApiModelProperty("内容") @Column(columnDefinition = "varchar(225) comment '内容'") private String content; @ApiModelProperty("当前任务序号") @Column(columnDefinition = "BIGINT(20) comment '当前任务序号'") private Long currentTaskSerialNumber; @ApiModelProperty("当前ACT任务Id") @Column(columnDefinition = "varchar(225) DEFAULT '' comment '当前ACT任务Id'") private String actTaskId; public void setServiceWorkNum(String serviceWorkNum) { this.serviceWorkNum = serviceWorkNum; } @Deprecated public void setServiceDirectoryId(Long serviceDirectoryId) { this.serviceDirectoryId = serviceDirectoryId; } public void setItemTypeId(Long itemTypeId) { this.itemTypeId = itemTypeId; } public void setServiceItemId(Long serviceItemId) { this.serviceItemId = serviceItemId; } public void setColor(String color) { this.color = color; } public void setSlaId(Long slaId) { this.slaId = slaId; } public void setLeveId(Long leveId) { this.leveId = leveId; } public void setUrgentLevel(Long urgentLevel) { this.urgentLevel = urgentLevel; } public void setInfluenceRange(Long influenceRange) { this.influenceRange = influenceRange; } public void setSolveTime(Date solveTime) { this.solveTime = solveTime; } public void setOldSolveTime(Date oldSolveTime) { this.oldSolveTime = oldSolveTime; } public void setSlaResponseTime(Date slaResponseTime) { this.slaResponseTime = slaResponseTime; } public void setProcessModelId(Long processModelId) { this.processModelId = processModelId; } public void setProcessId(String processId) { this.processId = processId; } public void setCurrentAssignorId(Long currentAssignorId) { this.currentAssignorId = currentAssignorId; } public void setCurrentAssignorName(String currentAssignorName) { this.currentAssignorName = currentAssignorName; } public void setLastAssignorId(Long lastAssignorId) { this.lastAssignorId = lastAssignorId; } public void setCurrentAssignorIds(String currentAssignorIds) { this.currentAssignorIds = currentAssignorIds; } public void setCurrentDistributionMode(Long currentDistributionMode) { this.currentDistributionMode = currentDistributionMode; } public void setCurrentTaskId(Long currentTaskId) { this.currentTaskId = currentTaskId; } public void setStaffScope(Long staffScope) { this.staffScope = staffScope; } public void setCurrentTaskName(String currentTaskName) { this.currentTaskName = currentTaskName; } public void setInitiatorId(Long initiatorId) { this.initiatorId = initiatorId; } public void setInitiatorName(String initiatorName) { this.initiatorName = initiatorName; } public void setItsmImgPath(String itsmImgPath) { this.itsmImgPath = itsmImgPath; } public void setComplete(Long complete) { this.complete = complete; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } public void setDisposeStatus(Long disposeStatus) { this.disposeStatus = disposeStatus; } public void setServiceItemType(Long serviceItemType) { this.serviceItemType = serviceItemType; } public void setTitle(String title) { this.title = title; } public void setDisposeLevel(String disposeLevel) { this.disposeLevel = disposeLevel; } public void setContent(String content) { this.content = content; } public void setCurrentTaskSerialNumber(Long currentTaskSerialNumber) { this.currentTaskSerialNumber = currentTaskSerialNumber; } public void setActTaskId(String actTaskId) { this.actTaskId = actTaskId; } public void setUrl(String url) { this.url = url; } public void setSearch(String search) { this.search = search; } public void setResponseDate(Date responseDate) { this.responseDate = responseDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } public void setIsChange(Long isChange) { this.isChange = isChange; } public void setTriggerForm(String triggerForm) { this.triggerForm = triggerForm; } public void setHiStatus(Long hiStatus) { this.hiStatus = hiStatus; } public void setRequestLevel(String requestLevel) { this.requestLevel = requestLevel; } public void setEventId(String eventId) { this.eventId = eventId; } public void setEventNum(String eventNum) { this.eventNum = eventNum; } public void setRequestChangeId(Long requestChangeId) { this.requestChangeId = requestChangeId; } public void setRequestChangeNum(String requestChangeNum) { this.requestChangeNum = requestChangeNum; } public void setCiName(String ciName) { this.ciName = ciName; } public void setRequestProblemId(Long requestProblemId) { this.requestProblemId = requestProblemId; } public void setRequestProblemNum(String requestProblemNum) { this.requestProblemNum = requestProblemNum; } public void setEventSource(String eventSource) { this.eventSource = eventSource; } public void setEventStatus(String eventStatus) { this.eventStatus = eventStatus; } public void setRfId(Long rfId) { this.rfId = rfId; } public void setRequestJson(String requestJson) { this.requestJson = requestJson; } public void setCiId(Long ciId) { this.ciId = ciId; } public void setCiType(String ciType) { this.ciType = ciType; } public void setAssignPersonId(Long assignPersonId) { this.assignPersonId = assignPersonId; } public void setTaskCount(Long taskCount) { this.taskCount = taskCount; } public void setSuperProcessId(String superProcessId) { this.superProcessId = superProcessId; } public void setIsAgree(Long isAgree) { this.isAgree = isAgree; } public void setChangeType(String changeType) { this.changeType = changeType; }
    /*  29 */   ServiceWorkList(Long id, String serviceWorkNum, Long serviceDirectoryId, Long itemTypeId, Long serviceItemId, String color, Long slaId, Long leveId, Long urgentLevel, Long influenceRange, Date solveTime, Date oldSolveTime, Date slaResponseTime, Long processModelId, String processId, Long currentAssignorId, String currentAssignorName, Long lastAssignorId, String currentAssignorIds, Long currentDistributionMode, Long currentTaskId, Long staffScope, String currentTaskName, Long initiatorId, String initiatorName, String itsmImgPath, Long complete, Date createDate, Date updateDate, Long disposeStatus, Long serviceItemType, String title, String disposeLevel, String content, Long currentTaskSerialNumber, String actTaskId, String url, String search, Date responseDate, Date endDate, Long isChange, String triggerForm, Long hiStatus, String requestLevel, String eventId, String eventNum, Long requestChangeId, String requestChangeNum, String ciName, Long requestProblemId, String requestProblemNum, String eventSource, String eventStatus, Long rfId, String requestJson, Long ciId, String ciType, Long assignPersonId, Long taskCount, String superProcessId, Long isAgree, String changeType) { this.id = id; this.serviceWorkNum = serviceWorkNum; this.serviceDirectoryId = serviceDirectoryId; this.itemTypeId = itemTypeId; this.serviceItemId = serviceItemId; this.color = color; this.slaId = slaId; this.leveId = leveId; this.urgentLevel = urgentLevel; this.influenceRange = influenceRange; this.solveTime = solveTime; this.oldSolveTime = oldSolveTime; this.slaResponseTime = slaResponseTime; this.processModelId = processModelId; this.processId = processId; this.currentAssignorId = currentAssignorId; this.currentAssignorName = currentAssignorName; this.lastAssignorId = lastAssignorId; this.currentAssignorIds = currentAssignorIds; this.currentDistributionMode = currentDistributionMode; this.currentTaskId = currentTaskId; this.staffScope = staffScope; this.currentTaskName = currentTaskName; this.initiatorId = initiatorId; this.initiatorName = initiatorName; this.itsmImgPath = itsmImgPath; this.complete = complete; this.createDate = createDate; this.updateDate = updateDate; this.disposeStatus = disposeStatus; this.serviceItemType = serviceItemType; this.title = title; this.disposeLevel = disposeLevel; this.content = content; this.currentTaskSerialNumber = currentTaskSerialNumber; this.actTaskId = actTaskId; this.url = url; this.search = search; this.responseDate = responseDate; this.endDate = endDate; this.isChange = isChange; this.triggerForm = triggerForm; this.hiStatus = hiStatus; this.requestLevel = requestLevel; this.eventId = eventId; this.eventNum = eventNum; this.requestChangeId = requestChangeId; this.requestChangeNum = requestChangeNum; this.ciName = ciName; this.requestProblemId = requestProblemId; this.requestProblemNum = requestProblemNum; this.eventSource = eventSource; this.eventStatus = eventStatus; this.rfId = rfId; this.requestJson = requestJson; this.ciId = ciId; this.ciType = ciType; this.assignPersonId = assignPersonId; this.taskCount = taskCount; this.superProcessId = superProcessId; this.isAgree = isAgree; this.changeType = changeType; } public static ServiceWorkListBuilder builder() { return new ServiceWorkListBuilder(); } public static class ServiceWorkListBuilder { private Long id; private String serviceWorkNum; private Long serviceDirectoryId; private Long itemTypeId; private Long serviceItemId; private String color; private Long slaId; private Long leveId; private Long urgentLevel; private Long influenceRange; private Date solveTime; private Date oldSolveTime; private Date slaResponseTime; private Long processModelId; private String processId; private Long currentAssignorId; private String currentAssignorName; private Long lastAssignorId; private String currentAssignorIds; private Long currentDistributionMode; private Long currentTaskId; private Long staffScope; private String currentTaskName; private Long initiatorId; private String initiatorName; private String itsmImgPath; private Long complete; private Date createDate; private Date updateDate; private Long disposeStatus; private Long serviceItemType; private String title; private String disposeLevel; private String content; private Long currentTaskSerialNumber; private String actTaskId; private String url; private String search; private Date responseDate; private Date endDate; private Long isChange; private String triggerForm; private Long hiStatus; private String requestLevel; private String eventId; private String eventNum; private Long requestChangeId; private String requestChangeNum; private String ciName; private Long requestProblemId; private String requestProblemNum; private String eventSource; private String eventStatus; private Long rfId; private String requestJson; private Long ciId; private String ciType; private Long assignPersonId; private Long taskCount; private String superProcessId; private Long isAgree; private String changeType; public ServiceWorkListBuilder id(Long id) { this.id = id; return this; } public ServiceWorkListBuilder serviceWorkNum(String serviceWorkNum) { this.serviceWorkNum = serviceWorkNum; return this; } public ServiceWorkListBuilder serviceDirectoryId(Long serviceDirectoryId) { this.serviceDirectoryId = serviceDirectoryId; return this; } public ServiceWorkListBuilder itemTypeId(Long itemTypeId) { this.itemTypeId = itemTypeId; return this; } public ServiceWorkListBuilder serviceItemId(Long serviceItemId) { this.serviceItemId = serviceItemId; return this; } public ServiceWorkListBuilder color(String color) { this.color = color; return this; } public ServiceWorkListBuilder slaId(Long slaId) { this.slaId = slaId; return this; } public ServiceWorkListBuilder leveId(Long leveId) { this.leveId = leveId; return this; } public ServiceWorkListBuilder urgentLevel(Long urgentLevel) { this.urgentLevel = urgentLevel; return this; } public ServiceWorkListBuilder influenceRange(Long influenceRange) { this.influenceRange = influenceRange; return this; } public ServiceWorkListBuilder solveTime(Date solveTime) { this.solveTime = solveTime; return this; } public ServiceWorkListBuilder oldSolveTime(Date oldSolveTime) { this.oldSolveTime = oldSolveTime; return this; } public ServiceWorkListBuilder slaResponseTime(Date slaResponseTime) { this.slaResponseTime = slaResponseTime; return this; } public ServiceWorkListBuilder processModelId(Long processModelId) { this.processModelId = processModelId; return this; } public ServiceWorkListBuilder processId(String processId) { this.processId = processId; return this; } public ServiceWorkListBuilder currentAssignorId(Long currentAssignorId) { this.currentAssignorId = currentAssignorId; return this; } public ServiceWorkListBuilder currentAssignorName(String currentAssignorName) { this.currentAssignorName = currentAssignorName; return this; } public ServiceWorkListBuilder lastAssignorId(Long lastAssignorId) { this.lastAssignorId = lastAssignorId; return this; } public ServiceWorkListBuilder currentAssignorIds(String currentAssignorIds) { this.currentAssignorIds = currentAssignorIds; return this; } public ServiceWorkListBuilder currentDistributionMode(Long currentDistributionMode) { this.currentDistributionMode = currentDistributionMode; return this; } public ServiceWorkListBuilder currentTaskId(Long currentTaskId) { this.currentTaskId = currentTaskId; return this; } public ServiceWorkListBuilder staffScope(Long staffScope) { this.staffScope = staffScope; return this; } public ServiceWorkListBuilder currentTaskName(String currentTaskName) { this.currentTaskName = currentTaskName; return this; } public ServiceWorkListBuilder initiatorId(Long initiatorId) { this.initiatorId = initiatorId; return this; } public ServiceWorkListBuilder initiatorName(String initiatorName) { this.initiatorName = initiatorName; return this; } public ServiceWorkListBuilder itsmImgPath(String itsmImgPath) { this.itsmImgPath = itsmImgPath; return this; } public ServiceWorkListBuilder complete(Long complete) { this.complete = complete; return this; } public ServiceWorkListBuilder createDate(Date createDate) { this.createDate = createDate; return this; } public ServiceWorkListBuilder updateDate(Date updateDate) { this.updateDate = updateDate; return this; } public ServiceWorkListBuilder disposeStatus(Long disposeStatus) { this.disposeStatus = disposeStatus; return this; } public ServiceWorkListBuilder serviceItemType(Long serviceItemType) { this.serviceItemType = serviceItemType; return this; } public ServiceWorkListBuilder title(String title) { this.title = title; return this; } public ServiceWorkListBuilder disposeLevel(String disposeLevel) { this.disposeLevel = disposeLevel; return this; } public ServiceWorkListBuilder content(String content) { this.content = content; return this; } public ServiceWorkListBuilder currentTaskSerialNumber(Long currentTaskSerialNumber) { this.currentTaskSerialNumber = currentTaskSerialNumber; return this; } public ServiceWorkListBuilder actTaskId(String actTaskId) { this.actTaskId = actTaskId; return this; } public ServiceWorkListBuilder url(String url) { this.url = url; return this; } public ServiceWorkListBuilder search(String search) { this.search = search; return this; } public ServiceWorkListBuilder responseDate(Date responseDate) { this.responseDate = responseDate; return this; } public ServiceWorkListBuilder endDate(Date endDate) { this.endDate = endDate; return this; } public ServiceWorkListBuilder isChange(Long isChange) { this.isChange = isChange; return this; } public ServiceWorkListBuilder triggerForm(String triggerForm) { this.triggerForm = triggerForm; return this; } public ServiceWorkListBuilder hiStatus(Long hiStatus) { this.hiStatus = hiStatus; return this; } public ServiceWorkListBuilder requestLevel(String requestLevel) { this.requestLevel = requestLevel; return this; } public ServiceWorkListBuilder eventId(String eventId) { this.eventId = eventId; return this; } public ServiceWorkListBuilder eventNum(String eventNum) { this.eventNum = eventNum; return this; } public ServiceWorkListBuilder requestChangeId(Long requestChangeId) { this.requestChangeId = requestChangeId; return this; } public ServiceWorkListBuilder requestChangeNum(String requestChangeNum) { this.requestChangeNum = requestChangeNum; return this; } public ServiceWorkListBuilder ciName(String ciName) { this.ciName = ciName; return this; } public ServiceWorkListBuilder requestProblemId(Long requestProblemId) { this.requestProblemId = requestProblemId; return this; } public ServiceWorkListBuilder requestProblemNum(String requestProblemNum) { this.requestProblemNum = requestProblemNum; return this; } public ServiceWorkListBuilder eventSource(String eventSource) { this.eventSource = eventSource; return this; } public ServiceWorkListBuilder eventStatus(String eventStatus) { this.eventStatus = eventStatus; return this; } public ServiceWorkListBuilder rfId(Long rfId) { this.rfId = rfId; return this; } public ServiceWorkListBuilder requestJson(String requestJson) { this.requestJson = requestJson; return this; } public ServiceWorkListBuilder ciId(Long ciId) { this.ciId = ciId; return this; } public ServiceWorkListBuilder ciType(String ciType) { this.ciType = ciType; return this; } public ServiceWorkListBuilder assignPersonId(Long assignPersonId) { this.assignPersonId = assignPersonId; return this; } public ServiceWorkListBuilder taskCount(Long taskCount) { this.taskCount = taskCount; return this; } public ServiceWorkListBuilder superProcessId(String superProcessId) { this.superProcessId = superProcessId; return this; } public ServiceWorkListBuilder isAgree(Long isAgree) { this.isAgree = isAgree; return this; } public ServiceWorkListBuilder changeType(String changeType) { this.changeType = changeType; return this; } public ServiceWorkList build() { return new ServiceWorkList(this.id, this.serviceWorkNum, this.serviceDirectoryId, this.itemTypeId, this.serviceItemId, this.color, this.slaId, this.leveId, this.urgentLevel, this.influenceRange, this.solveTime, this.oldSolveTime, this.slaResponseTime, this.processModelId, this.processId, this.currentAssignorId, this.currentAssignorName, this.lastAssignorId, this.currentAssignorIds, this.currentDistributionMode, this.currentTaskId, this.staffScope, this.currentTaskName, this.initiatorId, this.initiatorName, this.itsmImgPath, this.complete, this.createDate, this.updateDate, this.disposeStatus, this.serviceItemType, this.title, this.disposeLevel, this.content, this.currentTaskSerialNumber, this.actTaskId, this.url, this.search, this.responseDate, this.endDate, this.isChange, this.triggerForm, this.hiStatus, this.requestLevel, this.eventId, this.eventNum, this.requestChangeId, this.requestChangeNum, this.ciName, this.requestProblemId, this.requestProblemNum, this.eventSource, this.eventStatus, this.rfId, this.requestJson, this.ciId, this.ciType, this.assignPersonId, this.taskCount, this.superProcessId, this.isAgree, this.changeType); } public String toString() { return "ServiceWorkList.ServiceWorkListBuilder(id=" + this.id + ", serviceWorkNum=" + this.serviceWorkNum + ", serviceDirectoryId=" + this.serviceDirectoryId + ", itemTypeId=" + this.itemTypeId + ", serviceItemId=" + this.serviceItemId + ", color=" + this.color + ", slaId=" + this.slaId + ", leveId=" + this.leveId + ", urgentLevel=" + this.urgentLevel + ", influenceRange=" + this.influenceRange + ", solveTime=" + this.solveTime + ", oldSolveTime=" + this.oldSolveTime + ", slaResponseTime=" + this.slaResponseTime + ", processModelId=" + this.processModelId + ", processId=" + this.processId + ", currentAssignorId=" + this.currentAssignorId + ", currentAssignorName=" + this.currentAssignorName + ", lastAssignorId=" + this.lastAssignorId + ", currentAssignorIds=" + this.currentAssignorIds + ", currentDistributionMode=" + this.currentDistributionMode + ", currentTaskId=" + this.currentTaskId + ", staffScope=" + this.staffScope + ", currentTaskName=" + this.currentTaskName + ", initiatorId=" + this.initiatorId + ", initiatorName=" + this.initiatorName + ", itsmImgPath=" + this.itsmImgPath + ", complete=" + this.complete + ", createDate=" + this.createDate + ", updateDate=" + this.updateDate + ", disposeStatus=" + this.disposeStatus + ", serviceItemType=" + this.serviceItemType + ", title=" + this.title + ", disposeLevel=" + this.disposeLevel + ", content=" + this.content + ", currentTaskSerialNumber=" + this.currentTaskSerialNumber + ", actTaskId=" + this.actTaskId + ", url=" + this.url + ", search=" + this.search + ", responseDate=" + this.responseDate + ", endDate=" + this.endDate + ", isChange=" + this.isChange + ", triggerForm=" + this.triggerForm + ", hiStatus=" + this.hiStatus + ", requestLevel=" + this.requestLevel + ", eventId=" + this.eventId + ", eventNum=" + this.eventNum + ", requestChangeId=" + this.requestChangeId + ", requestChangeNum=" + this.requestChangeNum + ", ciName=" + this.ciName + ", requestProblemId=" + this.requestProblemId + ", requestProblemNum=" + this.requestProblemNum + ", eventSource=" + this.eventSource + ", eventStatus=" + this.eventStatus + ", rfId=" + this.rfId + ", requestJson=" + this.requestJson + ", ciId=" + this.ciId + ", ciType=" + this.ciType + ", assignPersonId=" + this.assignPersonId + ", taskCount=" + this.taskCount + ", superProcessId=" + this.superProcessId + ", isAgree=" + this.isAgree + ", changeType=" + this.changeType + ")"; } } public String toString() {
    /*  30 */     return "ServiceWorkList(id=" + getId() + ", serviceWorkNum=" + getServiceWorkNum() + ", serviceDirectoryId=" + getServiceDirectoryId() + ", itemTypeId=" + getItemTypeId() + ", serviceItemId=" + getServiceItemId() + ", color=" + getColor() + ", slaId=" + getSlaId() + ", leveId=" + getLeveId() + ", urgentLevel=" + getUrgentLevel() + ", influenceRange=" + getInfluenceRange() + ", solveTime=" + getSolveTime() + ", oldSolveTime=" + getOldSolveTime() + ", slaResponseTime=" + getSlaResponseTime() + ", processModelId=" + getProcessModelId() + ", processId=" + getProcessId() + ", currentAssignorId=" + getCurrentAssignorId() + ", currentAssignorName=" + getCurrentAssignorName() + ", lastAssignorId=" + getLastAssignorId() + ", currentAssignorIds=" + getCurrentAssignorIds() + ", currentDistributionMode=" + getCurrentDistributionMode() + ", currentTaskId=" + getCurrentTaskId() + ", staffScope=" + getStaffScope() + ", currentTaskName=" + getCurrentTaskName() + ", initiatorId=" + getInitiatorId() + ", initiatorName=" + getInitiatorName() + ", itsmImgPath=" + getItsmImgPath() + ", complete=" + getComplete() + ", createDate=" + getCreateDate() + ", updateDate=" + getUpdateDate() + ", disposeStatus=" + getDisposeStatus() + ", serviceItemType=" + getServiceItemType() + ", title=" + getTitle() + ", disposeLevel=" + getDisposeLevel() + ", content=" + getContent() + ", currentTaskSerialNumber=" + getCurrentTaskSerialNumber() + ", actTaskId=" + getActTaskId() + ", url=" + getUrl() + ", search=" + getSearch() + ", responseDate=" + getResponseDate() + ", endDate=" + getEndDate() + ", isChange=" + getIsChange() + ", triggerForm=" + getTriggerForm() + ", hiStatus=" + getHiStatus() + ", requestLevel=" + getRequestLevel() + ", eventId=" + getEventId() + ", eventNum=" + getEventNum() + ", requestChangeId=" + getRequestChangeId() + ", requestChangeNum=" + getRequestChangeNum() + ", ciName=" + getCiName() + ", requestProblemId=" + getRequestProblemId() + ", requestProblemNum=" + getRequestProblemNum() + ", eventSource=" + getEventSource() + ", eventStatus=" + getEventStatus() + ", rfId=" + getRfId() + ", requestJson=" + getRequestJson() + ", ciId=" + getCiId() + ", ciType=" + getCiType() + ", assignPersonId=" + getAssignPersonId() + ", taskCount=" + getTaskCount() + ", superProcessId=" + getSuperProcessId() + ", isAgree=" + getIsAgree() + ", changeType=" + getChangeType() + ")";
    /*     */   }
    /*     */   
    /*     */   public Long getId() {
    /*  37 */     return this.id;
    /*     */   }
    /*     */   
    /*     */   public String getServiceWorkNum() {
    /*  41 */     return this.serviceWorkNum;
    /*     */   }
    /*     */   
    /*     */   @Deprecated
    /*     */   public Long getServiceDirectoryId() {
    /*  46 */     return this.serviceDirectoryId;
    /*     */   }
    /*     */   
    /*     */   public Long getItemTypeId() {
    /*  50 */     return this.itemTypeId;
    /*     */   }
    /*     */   
    /*     */   public Long getServiceItemId() {
    /*  54 */     return this.serviceItemId;
    /*     */   }
    /*     */   
    /*     */   public String getColor() {
    /*  58 */     return this.color;
    /*     */   }
    /*     */   
    /*     */   public Long getSlaId() {
    /*  62 */     return this.slaId;
    /*     */   }
    /*     */   
    /*     */   public Long getLeveId() {
    /*  66 */     return this.leveId;
    /*     */   }
    /*     */   
    /*     */   public Long getUrgentLevel() {
    /*  70 */     return this.urgentLevel;
    /*     */   }
    /*     */   
    /*     */   public Long getInfluenceRange() {
    /*  74 */     return this.influenceRange;
    /*     */   }
    /*     */   
    /*     */   public Date getSolveTime() {
    /*  78 */     return this.solveTime;
    /*     */   }
    /*     */   
    /*     */   public Date getOldSolveTime() {
    /*  82 */     return this.oldSolveTime;
    /*     */   }
    /*     */   
    /*     */   public Date getSlaResponseTime() {
    /*  86 */     return this.slaResponseTime;
    /*     */   }
    /*     */   
    /*     */   public Long getProcessModelId() {
    /*  90 */     return this.processModelId;
    /*     */   }
    /*     */   
    /*     */   public String getProcessId() {
    /*  94 */     return this.processId;
    /*     */   }
    /*     */   
    /*     */   public Long getCurrentAssignorId() {
    /*  98 */     return this.currentAssignorId;
    /*     */   }
    /*     */   
    /*     */   public String getCurrentAssignorName() {
    /* 102 */     return this.currentAssignorName;
    /*     */   }
    /*     */   
    /*     */   public Long getLastAssignorId() {
    /* 106 */     return this.lastAssignorId;
    /*     */   }
    /*     */   
    /*     */   public String getCurrentAssignorIds() {
    /* 110 */     return this.currentAssignorIds;
    /*     */   }
    /*     */   
    /*     */   public Long getCurrentDistributionMode() {
    /* 114 */     return this.currentDistributionMode;
    /*     */   }
    /*     */   
    /*     */   public Long getCurrentTaskId() {
    /* 118 */     return this.currentTaskId;
    /*     */   }
    /*     */   
    /*     */   public Long getStaffScope() {
    /* 122 */     return this.staffScope;
    /*     */   }
    /*     */   
    /*     */   public String getCurrentTaskName() {
    /* 126 */     return this.currentTaskName;
    /*     */   }
    /*     */   
    /*     */   public Long getInitiatorId() {
    /* 130 */     return this.initiatorId;
    /*     */   }
    /*     */   
    /*     */   public String getInitiatorName() {
    /* 134 */     return this.initiatorName;
    /*     */   }
    /*     */   
    /*     */   public String getItsmImgPath() {
    /* 138 */     return this.itsmImgPath;
    /*     */   }
    /*     */   
    /*     */   public Long getComplete() {
    /* 142 */     return this.complete;
    /*     */   }
    /*     */   
    /*     */   public Date getCreateDate() {
    /* 146 */     return this.createDate;
    /*     */   }
    /*     */   
    /*     */   public Date getUpdateDate() {
    /* 150 */     return this.updateDate;
    /*     */   }
    /*     */   
    /*     */   public Long getDisposeStatus() {
    /* 154 */     return this.disposeStatus;
    /*     */   }
    /*     */   
    /*     */   public Long getServiceItemType() {
    /* 158 */     return this.serviceItemType;
    /*     */   }
    /*     */   
    /*     */   public String getTitle() {
    /* 162 */     return this.title;
    /*     */   }
    /*     */   
    /*     */   public String getDisposeLevel() {
    /* 166 */     return this.disposeLevel;
    /*     */   }
    /*     */   
    /*     */   public String getContent() {
    /* 170 */     return this.content;
    /*     */   }
    /*     */   
    /*     */   public Long getCurrentTaskSerialNumber() {
    /* 174 */     return this.currentTaskSerialNumber;
    /*     */   }
    /*     */   
    /*     */   public String getActTaskId() {
    /* 178 */     return this.actTaskId; } @ApiModelProperty("指派标识")
    /*     */   @Transient
    /* 180 */   private String url = ""; @ApiModelProperty("搜索") @Transient private String search; @ApiModelProperty("响应时间") @Column(columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP comment '响应时间'") private Date responseDate; @ApiModelProperty("关闭时间") @Column(columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP comment '关闭时间'") private Date endDate; @ApiModelProperty("是否为配置变更") @Column(columnDefinition = "BIGINT(20) comment '关闭时间'") private Long isChange; @ApiModelProperty("trigger_form") @Column(columnDefinition = "TEXT comment '触发器'") private String triggerForm; @ApiModelProperty("是否是历史记录,1:是,0:否") @Column(columnDefinition = "BIGINT(1) DEFAULT 0 comment '是否是历史记录,1:是,0:否'") private Long hiStatus; @Transient private String requestLevel; @ApiModelProperty("事件id") @Column(columnDefinition = "varchar(999) DEFAULT '' comment '事件id'") private String eventId; @ApiModelProperty("事件编号") @Column(columnDefinition = "varchar(999) DEFAULT '[]' comment '事件编号'") private String eventNum; @ApiModelProperty("触发变更id") @Column(columnDefinition = "BIGINT(20) comment '触发变更id'") private Long requestChangeId; @ApiModelProperty("触发变更编号") @Column(columnDefinition = "varchar(50)  comment '触发变更编号'") private String requestChangeNum; @ApiModelProperty("关联CI") @Column(columnDefinition = "varchar(50)  comment '关联CI'") private String ciName; @ApiModelProperty("关联问题id") @Column(columnDefinition = "BIGINT(20) comment '关联问题id'") private Long requestProblemId; @ApiModelProperty("关联问题编号") @Column(columnDefinition = "varchar(50)  comment '关联问题编号'") private String requestProblemNum; @ApiModelProperty("事件来源") @Column(columnDefinition = "varchar(20)  comment '事件来源'") private String eventSource; @ApiModelProperty("事件状态") @Column(columnDefinition = "varchar(20)  comment '事件状态'") private String eventStatus; @ApiModelProperty("事件引用id") @Column(columnDefinition = "BIGINT(20)  comment '事件引用id'") private Long rfId; @ApiModelProperty("服务请求Json") @Column(columnDefinition = "varchar(9999) DEFAULT '[]' comment '服务请求Json'") private String requestJson; @ApiModelProperty("关联ci") @Column(columnDefinition = "BIGINT(20) comment '关联ci'") private Long ciId; @ApiModelProperty("关联ci类型") @Column(columnDefinition = "varchar(50) comment '关联ci类型'") private String ciType; @ApiModelProperty("指派处理人") @Column(columnDefinition = "BIGINT(20) comment '指派处理人'") private Long assignPersonId; @ApiModelProperty("当前会签次数") @Column(columnDefinition = "BIGINT(20) DEFAULT 0 comment '当前会签次数'") private Long taskCount; @ApiModelProperty("父流程执行Id") @Column(columnDefinition = "varchar(50) comment '父流程执行Id'") private String superProcessId; @ApiModelProperty("是否同意") @Column(columnDefinition = "BIGINT(20) DEFAULT 0 comment '是否同意'") private Long isAgree; @ApiModelProperty("变更类型")
    /*     */   @Column(columnDefinition = "varchar(50) comment '变更类型'")
    /* 182 */   private String changeType; public String getUrl() { return this.url; }
    /*     */
    /*     */   public String getSearch() {
    /* 186 */     return this.search;
    /*     */   }
    /*     */   
    /*     */   public Date getResponseDate() {
    /* 190 */     return this.responseDate;
    /*     */   }
    /*     */   
    /*     */   public Date getEndDate() {
    /* 194 */     return this.endDate;
    /*     */   }
    /*     */   
    /*     */   public Long getIsChange() {
    /* 198 */     return this.isChange;
    /*     */   }
    /*     */   
    /*     */   public String getTriggerForm() {
    /* 202 */     return this.triggerForm;
    /*     */   }
    /*     */   
    /*     */   public Long getHiStatus() {
    /* 206 */     return this.hiStatus;
    /*     */   }
    /*     */   public String getRequestLevel() {
    /* 209 */     return this.requestLevel;
    /*     */   }
    /*     */   
    /*     */   public String getEventId() {
    /* 213 */     return this.eventId;
    /*     */   }
    /*     */   
    /*     */   public String getEventNum() {
    /* 217 */     return this.eventNum;
    /*     */   }
    /*     */   
    /*     */   public Long getRequestChangeId() {
    /* 221 */     return this.requestChangeId;
    /*     */   }
    /*     */   
    /*     */   public String getRequestChangeNum() {
    /* 225 */     return this.requestChangeNum;
    /*     */   }
    /*     */   
    /*     */   public String getCiName() {
    /* 229 */     return this.ciName;
    /*     */   }
    /*     */   
    /*     */   public Long getRequestProblemId() {
    /* 233 */     return this.requestProblemId;
    /*     */   }
    /*     */   
    /*     */   public String getRequestProblemNum() {
    /* 237 */     return this.requestProblemNum;
    /*     */   }
    /*     */   
    /*     */   public String getEventSource() {
    /* 241 */     return this.eventSource;
    /*     */   }
    /*     */   
    /*     */   public String getEventStatus() {
    /* 245 */     return this.eventStatus;
    /*     */   }
    /*     */   
    /*     */   public Long getRfId() {
    /* 249 */     return this.rfId;
    /*     */   }
    /*     */   
    /*     */   public String getRequestJson() {
    /* 253 */     return this.requestJson;
    /*     */   }
    /*     */   
    /*     */   public Long getCiId() {
    /* 257 */     return this.ciId;
    /*     */   }
    /*     */   
    /*     */   public String getCiType() {
    /* 261 */     return this.ciType;
    /*     */   }
    /*     */   
    /*     */   public Long getAssignPersonId() {
    /* 265 */     return this.assignPersonId;
    /*     */   }
    /*     */   
    /*     */   public Long getTaskCount() {
    /* 269 */     return this.taskCount;
    /*     */   }
    /*     */   
    /*     */   public String getSuperProcessId() {
    /* 273 */     return this.superProcessId;
    /*     */   }
    /*     */   
    /*     */   public Long getIsAgree() {
    /* 277 */     return this.isAgree;
    /*     */   }
    /*     */   
    /*     */   public String getChangeType() {
    /* 281 */     return this.changeType;
    /*     */   }
    /*     */   
    /*     */   public void fillServiceWorkList(String processInstanceId, ServiceRequestForm serviceRequestForm) {
    /* 288 */     Long processId = serviceRequestForm.getProcessId();
    /* 289 */     Long serviceDirectoryId = serviceRequestForm.getServiceDirectoryId();
    /* 290 */     Long serviceItemId = serviceRequestForm.getServiceItemId();
    /*     */     
    /* 292 */     setProcessModelId(processId);
    /* 293 */     setProcessId(processInstanceId);
    /* 294 */     setServiceDirectoryId(serviceDirectoryId);
    /* 295 */     setServiceItemId(serviceItemId);
    /*     */   }
    /*     */   
    /*     */   public void fillEvent(Event event, Long constant) {
    /* 299 */     setComplete(constant);
    /* 300 */     setCurrentAssignorId(event.getDisposePersonId());
    /* 301 */     setCurrentAssignorName(event.getDisposePersonName());
    /* 302 */     setDisposeStatus(event.getDisposeStatus());
    /* 303 */     setDisposeLevel(event.getEventLevel());
    /* 304 */     setTitle(event.getServiceName());
    /* 305 */     setContent(event.getEventContent());
    /*     */   }
    /*     */   
    /*     */   public void fillChange(ItsmChange itsmChange, Long constant, Long disposeStatus) {
    /* 309 */     setComplete(constant);
    /* 310 */     setCurrentAssignorId(itsmChange.getAssignorId());
    /* 311 */     setCurrentAssignorName(itsmChange.getAssignorName());
    /* 312 */     setDisposeStatus(disposeStatus);
    /* 313 */     setDisposeLevel(LevelEnum.getLevelEnum(itsmChange.getChangeLevel()).getName());
    /* 314 */     setTitle(itsmChange.getChangeName());
    /*     */   }
    /*     */
    /*     */   
    /*     */   public void fillServiceWorkList(ServiceRequestForm serviceRequestForm, ServiceWorkList serviceWorkList) {
    /* 320 */     Date currentDate = DateUtil.getCurrentDate();
    /* 321 */     serviceWorkList.setResponseDate(currentDate);
    /* 322 */     serviceWorkList.setUpdateDate(currentDate);
    /* 323 */     serviceWorkList.setCreateDate(currentDate);
    /*     */     
    /* 325 */     serviceWorkList.setCiName(serviceRequestForm.getCiName());
    /* 326 */     serviceWorkList.setRequestProblemId(serviceRequestForm.getRequestProblemId());
    /* 327 */     serviceWorkList.setRequestProblemNum(serviceRequestForm.getRequestProblemNum());
    /* 328 */     serviceWorkList.setEventId(serviceRequestForm.getEventId());
    /* 329 */     serviceWorkList.setEventNum(serviceRequestForm.getEventNum());
    /* 330 */     serviceWorkList.setEventSource(serviceRequestForm.getEventSource());
    /* 331 */     serviceWorkList.setRequestJson(serviceRequestForm.getRequestJson());
    /*     */   }
    /*     */
    /*     */   public boolean equals(Object o) {
    /* 337 */     if (this == o) return true; 
    /* 338 */     if (o == null || getClass() != o.getClass()) return false;
    /*     */     
    /* 340 */     ServiceWorkList that = (ServiceWorkList)o;
    /*     */     
    /* 342 */     return (Objects.equal(this.id, that.id) &&
    /* 343 */       Objects.equal(this.serviceWorkNum, that.serviceWorkNum) && 
    /* 344 */       Objects.equal(this.serviceDirectoryId, that.serviceDirectoryId) && 
    /* 345 */       Objects.equal(this.serviceItemId, that.serviceItemId) && 
    /* 346 */       Objects.equal(this.processModelId, that.processModelId) && 
    /* 347 */       Objects.equal(this.processId, that.processId) && 
    /* 348 */       Objects.equal(this.currentAssignorId, that.currentAssignorId) && 
    /* 349 */       Objects.equal(this.currentAssignorName, that.currentAssignorName) && 
    /* 350 */       Objects.equal(this.currentAssignorIds, that.currentAssignorIds) && 
    /* 351 */       Objects.equal(this.currentDistributionMode, that.currentDistributionMode) && 
    /* 352 */       Objects.equal(this.currentTaskId, that.currentTaskId) && 
    /* 353 */       Objects.equal(this.currentTaskName, that.currentTaskName) && 
    /* 354 */       Objects.equal(this.initiatorId, that.initiatorId) && 
    /* 355 */       Objects.equal(this.initiatorName, that.initiatorName) && 
    /* 356 */       Objects.equal(this.itsmImgPath, that.itsmImgPath) && 
    /* 357 */       Objects.equal(this.complete, that.complete) && 
    /* 358 */       Objects.equal(this.createDate, that.createDate) && 
    /* 359 */       Objects.equal(this.updateDate, that.updateDate) && 
    /* 360 */       Objects.equal(this.disposeStatus, that.disposeStatus) && 
    /* 361 */       Objects.equal(this.serviceItemType, that.serviceItemType) && 
    /* 362 */       Objects.equal(this.title, that.title) && 
    /* 363 */       Objects.equal(this.disposeLevel, that.disposeLevel) && 
    /* 364 */       Objects.equal(this.content, that.content) && 
    /* 365 */       Objects.equal(this.currentTaskSerialNumber, that.currentTaskSerialNumber) && 
    /* 366 */       Objects.equal(this.responseDate, that.responseDate) && 
    /* 367 */       Objects.equal(this.endDate, that.endDate) && 
    /* 368 */       Objects.equal(this.isChange, that.isChange) && 
    /* 369 */       Objects.equal(this.triggerForm, that.triggerForm) && 
    /* 370 */       Objects.equal(this.hiStatus, that.hiStatus) && 
    /* 371 */       Objects.equal(this.eventId, that.eventId) && 
    /* 372 */       Objects.equal(this.eventNum, that.eventNum) && 
    /* 373 */       Objects.equal(this.requestChangeId, that.requestChangeId) && 
    /* 374 */       Objects.equal(this.ciName, that.ciName) && 
    /* 375 */       Objects.equal(this.requestProblemId, that.requestProblemId) && 
    /* 376 */       Objects.equal(this.requestProblemNum, that.requestProblemNum) && 
    /* 377 */       Objects.equal(this.eventSource, that.eventSource) && 
    /* 378 */       Objects.equal(this.eventStatus, that.eventStatus) && 
    /* 379 */       Objects.equal(this.rfId, that.rfId) && 
    /* 380 */       Objects.equal(this.requestJson, that.requestJson) && 
    /* 381 */       Objects.equal(this.ciId, that.ciId) && 
    /* 382 */       Objects.equal(this.ciType, that.ciType) && 
    /* 383 */       Objects.equal(this.assignPersonId, that.assignPersonId) && 
    /* 384 */       Objects.equal(this.superProcessId, that.superProcessId) && 
    /* 385 */       Objects.equal(this.slaId, that.slaId) && 
    /* 386 */       Objects.equal(this.leveId, that.leveId) && 
    /* 387 */       Objects.equal(this.color, that.color) && 
    /* 388 */       Objects.equal(this.oldSolveTime, that.oldSolveTime) && 
    /* 389 */       Objects.equal(this.itemTypeId, that.itemTypeId) && 
    /* 390 */       Objects.equal(this.isAgree, that.isAgree) && 
    /* 391 */       Objects.equal(this.requestChangeNum, that.requestChangeNum));
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public int hashCode() {
    /* 396 */     return Objects.hashCode(new Object[] { this.id, this.serviceWorkNum, this.serviceDirectoryId, this.serviceItemId, this.processModelId, this.processId, this.currentAssignorId, this.currentAssignorName, this.currentAssignorIds, this.currentDistributionMode, this.currentTaskId, this.currentTaskName, this.initiatorId, this.initiatorName, this.itsmImgPath, this.complete, this.createDate, this.updateDate, this.disposeStatus, this.serviceItemType, this.title, this.disposeLevel, this.content, this.currentTaskSerialNumber, this.slaId, this.leveId, this.color, this.oldSolveTime, this.itemTypeId, this.responseDate, this.endDate, this.isChange, this.triggerForm, this.hiStatus, this.eventId, this.eventNum, this.requestChangeId, this.requestChangeNum, this.requestProblemId, this.requestProblemNum, this.ciName, this.requestChangeId, this.eventSource, this.eventStatus, this.rfId, this.requestJson, this.ciId, this.ciType, this.assignPersonId, this.superProcessId, this.isAgree });
    /*     */   }
    /*     */
    /*     */   
    /*     */   public Long getTaskId() {
    /* 410 */     return this.currentTaskId;
    /*     */   }
    /*     */   
    /*     */   public Long getWorkId() {
    /* 419 */     return this.id;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public Long getMyBoardLevel() {
    /* 424 */     return Long.valueOf(1L);
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getMyBoardLevelName() {
    /* 429 */     return this.disposeLevel;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public Long getMyBoardTypeId() {
    /* 434 */     return this.serviceItemType;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getMyBoardTypeName() {
    /* 439 */     return RequestTypeEnum.getRequestTypeEnum(this.serviceItemType).getRequestName();
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getRequestName() {
    /* 444 */     return RequestTypeEnum.getRequestTypeEnum(this.serviceItemType).getRequestName();
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getMyBoardRequestTitle() {
    /* 449 */     return this.title;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getMyBoardRequestContent() {
    /* 454 */     return this.content;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getMyBoardNum() {
    /* 459 */     return this.serviceWorkNum;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getMyBoardCreatePersonName() {
    /* 464 */     return this.initiatorName;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getMyBoardItsmImgPath() {
    /* 469 */     return this.itsmImgPath;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public Date getMyBoardCreateDate() {
    /* 474 */     return this.createDate;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public Date getMyBoardUpdateDate() {
    /* 479 */     return this.updateDate;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public Date getMyBoardEndDate() {
    /* 484 */     return this.endDate;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getCurrentWorkHandler() {
    /* 489 */     return null;
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public String getStatus() {
    /* 494 */     return DisposeStatus.getDisposeStatusEnum(this.disposeStatus).getName();
    /*     */   }
    /*     */   
    /*     */   public ServiceWorkList() {} }
    
    
    /*    */ import cn.hutool.core.lang.UUID;
    /*    */ import com.alibaba.fastjson.JSONObject;
    /*    */ import com.google.common.base.Splitter;
    /*    */ import com.google.common.collect.Maps;
    /*    */ import java.time.LocalDateTime;
    /*    */ import java.util.Date;
    /*    */ import org.slf4j.Logger;
    /*    */ import org.slf4j.LoggerFactory;
    /*    */ import org.springframework.beans.factory.annotation.Autowired;
    /*    */ import org.springframework.beans.factory.annotation.Value;
    /*    */ import org.springframework.stereotype.Component;
    /*    */ 
    /*    */ @Component
    /*    */ public class EmailSendMessage extends AbsSendMessage<EmailBrokerMessageService> {
    /* 26 */   private static final Logger log = LoggerFactory.getLogger(EmailSendMessage.class);
    /*    */ 
    /*    */   
    /*    */   @Autowired
    /*    */   private EmailBrokerMessageService emailBrokerMessageService;
    /*    */   
    /* 32 */   private Integer nextRetry = Integer.valueOf(5);
    /*    */   
    /* 34 */   private Splitter splitter = Splitter.on("#");
    /*    */   
    /*    */   @Value("${message.email.exchange}")
    /*    */   private String emailExchange;
    /*    */   
    /*    */   @Value("${message.email.routingKey}")
    /*    */   private String emailRoutingKey;
    /*    */ 
    /*    */   
    /*    */   public EmailBrokerMessageService getService() {
    /* 44 */     return this.emailBrokerMessageService;
    /*    */   }
    /*    */ 
    
    /*    */   public void send(EmailMessageEntity emailMessageEntity) {
    /* 52 */     LocalDateTime nextRetrylDt = LocalDateTime.now().plus(this.nextRetry.intValue(), ChronoUnit.MINUTES);
    /* 53 */     Date nextRetryDate = JDKDateTimeUtils.LocalDateTime2Date(nextRetrylDt);
    
    /* 65 */     EmailBrokerMessage emailBrokerMessage = EmailBrokerMessage.builder().messageId(UUID.randomUUID().toString()).message(JSONObject.toJSONString(emailMessageEntity)).tryCount(Integer.valueOf(0)).status(MessageStatusEnum.SEND.value).consumeStatus(ConsumeStatusEnum.UNTREATED.value).nextRetry(nextRetryDate).build();
    /*    */     
    /* 69 */     this.emailBrokerMessageService.insert(emailBrokerMessage);
    /* 70 */     log.info("# EmailSendMessage.sendEvent # 成功录入一条通知消息记录
    ");
    /*    */     
    /*    */     try {
    /* 73 */       send((IBrokerMessage)emailBrokerMessage, this.emailExchange, this.emailRoutingKey, Maps.newHashMap());
    /* 74 */       log.info("# EmailSendMessage.sendEvent # 发送通知消息成功,JSON={}
    ", StringUtil.formatJson(emailBrokerMessage.getMessage()));
    /* 75 */     } catch (Exception e) {
    /* 76 */       log.error("# EmailSendMessage.sendEvent # 发送通知消息失败,JSON={}
    ", StringUtil.formatJson(emailBrokerMessage.getMessage()));
    /*    */     } 
    /*    */   }
    /*    */ }
    
    /*     */ 
    /*     */ import cn.hutool.core.lang.UUID;
    /*     */ import com.alibaba.fastjson.JSONObject;
    /*     */ import com.google.common.base.Splitter;
    /*     */ import com.google.common.collect.Lists;
    /*     */ import com.google.common.collect.Maps;
    /*     */ import java.time.LocalDateTime;
    /*     */ import java.time.temporal.ChronoUnit;
    /*     */ import java.util.Date;
    /*     */ import java.util.List;
    /*     */ import java.util.Map;
    /*     */ import org.slf4j.Logger;
    /*     */ import org.slf4j.LoggerFactory;
    /*     */ import org.springframework.amqp.AmqpException;
    /*     */ import org.springframework.amqp.core.Message;
    /*     */ import org.springframework.amqp.core.MessagePostProcessor;
    /*     */ import org.springframework.amqp.rabbit.core.RabbitTemplate;
    /*     */ import org.springframework.amqp.rabbit.support.CorrelationData;
    /*     */ import org.springframework.beans.factory.annotation.Autowired;
    /*     */ import org.springframework.beans.factory.annotation.Value;
    /*     */ import org.springframework.messaging.Message;
    /*     */ import org.springframework.messaging.MessageHeaders;
    /*     */ import org.springframework.messaging.support.MessageBuilder;
    /*     */ import org.springframework.stereotype.Component;
    /*     */ 
    /*     */ @Component
    /*     */ public class EventSendMessage
    /*     */ {
    /*  37 */   private static final Logger log = LoggerFactory.getLogger(EventSendMessage.class);
    /*     */ 
    /*     */   
    /*     */   @Autowired
    /*     */   private RabbitTemplate rabbitTemplate;
    /*     */   
    /*     */   @Autowired
    /*     */   private BrokerMessageService brokerMessageService;
    /*     */   
    /*  46 */   private Integer nextRetry = Integer.valueOf(5);
    /*     */   
    /*  48 */   private Splitter splitter = Splitter.on("#");
    /*     */ 
    /*     */   
    /*     */   @Value("${message.event.exchange}")
    /*     */   private String eventExchange;
    /*     */ 
    /*     */   
    /*     */   @Value("${message.event.routingKey}")
    /*     */   private String eventRoutingKey;
    /*     */ 
    /*     */   
    /*  59 */   final RabbitTemplate.ConfirmCallback confirmCallback = new RabbitTemplate.ConfirmCallback()
    /*     */     {
    /*     */ 
    /*     */ 
    /*     */       
    /*     */       public void confirm(CorrelationData correlationData, boolean ack, String cause)
    /*     */       {
    /*  71 */         List<String> msgParam = EventSendMessage.this.splitter.splitToList(correlationData.getId());
    /*  72 */         String messageId = msgParam.get(0);
    /*  73 */         long sendTime = Long.parseLong(msgParam.get(1));
    /*  74 */         String messageType = msgParam.get(2);
    /*     */ 
    /*     */         
    /*  77 */         EventBrokerMessage eventBrokerMessage = (EventBrokerMessage)EventSendMessage.this.brokerMessageService.selectByPrimaryKey(messageId);
    /*  78 */         eventBrokerMessage.setUpdateTime(new Date());
    /*  79 */         if (ack) {
    /*     */ 
    /*     */           
    /*  82 */           eventBrokerMessage.setStatus(MessageStatusEnum.QUEUE.value);
    /*     */           
    /*  84 */           EventSendMessage.log.info("MQ 成功接受到消息{}", messageId);
    /*     */         }
    /*     */         else {
    /*     */           
    /*  88 */           eventBrokerMessage.setStatus(MessageStatusEnum.SEND_ERROR.value);
    /*     */           
    /*  90 */           EventSendMessage.log.info("MQ 消息{},confirm失败 msg={}", messageId, cause);
    /*     */         } 
    /*     */         
    /*  93 */         EventSendMessage.this.brokerMessageService.updateByPrimaryKeySelective(eventBrokerMessage);
    /*     */       }
    /*     */     };
    /*     */ 
    /*     */   
    /*     */   public void sendEvent(List<EventInformation> eventList) {
    /* 103 */     LocalDateTime nextRetrylDt = LocalDateTime.now().plus(this.nextRetry.intValue(), ChronoUnit.MINUTES);
    /* 104 */     Date nextRetryDate = JDKDateTimeUtils.LocalDateTime2Date(nextRetrylDt);
    /*     */     
    /* 106 */     List<EventBrokerMessage> eventBrokerMessages = Lists.newArrayList();
    /*     */     
    /* 108 */     eventList.forEach(a -> {
    /*     */           EventBrokerMessage eventBrokerMessage = EventBrokerMessage.builder().messageId(UUID.randomUUID().toString()).message(JSONObject.toJSONString(a)).tryCount(Integer.valueOf(0)).status(MessageStatusEnum.SEND.value).consumeStatus(ConsumeStatusEnum.UNTREATED.value).nextRetry(nextRetryDate).build();
    /*     */ 
    /*     */   
    /*     */           eventBrokerMessages.add(eventBrokerMessage);
    /*     */         });
    /*     */ 
    /*     */     
    /* 126 */     eventBrokerMessages.forEach(a -> this.brokerMessageService.insert(a));
    /* 127 */     log.info("# EventSendMessage.sendEvent # 成功录入{}条事件记录
    ", Integer.valueOf(eventBrokerMessages.size()));
    /*     */     
    /* 129 */     eventBrokerMessages.forEach(a -> {
    /*     */           try {
    /*     */             send(a, Maps.newHashMap());
    /*     */             log.info("# EventSendMessage.sendEvent # 发送事件成功,JSON={}
    ", StringUtil.formatJson(a.getMessage()));
    /* 133 */           } catch (Exception e) {
    /*     */             log.error("# EventSendMessage.sendEvent # 发送事件失败,JSON={}
    ", StringUtil.formatJson(a.getMessage()));
    /*     */           } 
    /*     */         });
    /*     */   }
    /*     */ 
    /*     */   
    /*     */   public void send(EventBrokerMessage eventBrokerMessage, Map<String, Object> properties) throws Exception {
    /* 149 */     MessageHeaders mhs = new MessageHeaders(properties);
    /*     */ 
    /*     */     
    /* 152 */     Message<Object> msg = MessageBuilder.createMessage(eventBrokerMessage, mhs);
    /*     */ 
    /*     */     
    /* 155 */     this.rabbitTemplate.setConfirmCallback(this.confirmCallback);
    /*     */     
    /* 159 */     CorrelationData cd = new CorrelationData(String.format("%s#%s#%s", new Object[] {
    /* 160 */             eventBrokerMessage.getMessageId(), 
    /* 161 */             Long.valueOf(System.currentTimeMillis()), eventBrokerMessage
    /* 162 */             .getStatus()
    /*     */           }));
    /*     */     
    /* 165 */     this.rabbitTemplate.convertAndSend(this.eventExchange, this.eventRoutingKey, msg, new MessagePostProcessor()
    /*     */         {
    /*     */    
    /*     */           public Message postProcessMessage(Message message) throws AmqpException
    /*     */           {
    /* 172 */             System.out.println("MessagePostProcessor");
    /* 173 */             return message;
    /*     */           }
    /*     */         },  cd);
    /*     */   }
    /*     */ }
    
    
    /*    */ 
    /*    */ import java.util.Map;
    /*    */ import java.util.UUID;
    /*    */ import org.springframework.amqp.AmqpException;
    /*    */ import org.springframework.amqp.core.Message;
    /*    */ import org.springframework.amqp.core.MessagePostProcessor;
    /*    */ import org.springframework.amqp.rabbit.core.RabbitTemplate;
    /*    */ import org.springframework.amqp.rabbit.support.CorrelationData;
    /*    */ import org.springframework.beans.factory.annotation.Autowired;
    /*    */ import org.springframework.messaging.Message;
    /*    */ import org.springframework.messaging.MessageHeaders;
    /*    */ import org.springframework.messaging.support.MessageBuilder;
    /*    */ import org.springframework.stereotype.Component;
    /*    */ 
    /*    */ 
    /*    */ @Component
    /*    */ public class SendMessage
    /*    */ {
    /*    */   @Autowired
    /*    */   private RabbitTemplate rabbitTemplate;
    /*    */   
    /* 27 */   final RabbitTemplate.ConfirmCallback confirmCallback = new RabbitTemplate.ConfirmCallback()
    /*    */     {
    /*    */ 
    /*    */       public void confirm(CorrelationData correlationData, boolean ack, String cause)
    /*    */       {
    /* 37 */         System.out.println("----------");
    /*    */       }
    /*    */     };
    /*    */ 
    /*    */ 
    /*    */   public void send(Object message, Map<String, Object> properties) throws Exception {
    /* 52 */     MessageHeaders mhs = new MessageHeaders(properties);
    /*    */ 
    /*    */     
    /* 55 */     Message<Object> msg = MessageBuilder.createMessage(message, mhs);
    /*    */ 
    /*    */     
    /* 58 */     this.rabbitTemplate.setConfirmCallback(this.confirmCallback);
    /*    */ 
    /*    */     
    /* 61 */     CorrelationData cd = new CorrelationData(UUID.randomUUID().toString());
    /*    */ 
    /*    */     
    /* 64 */     this.rabbitTemplate.convertAndSend("exchange-1", "springboot.rabbit", msg, new MessagePostProcessor()
    /*    */         {
    /*    */           
    /*    */           public Message postProcessMessage(Message message) throws AmqpException
    /*    */           {
    /* 71 */             System.out.println("MessagePostProcessor");
    /* 72 */             return message;
    /*    */           }
    /*    */         },  cd);
    /*    */   }
    /*    */ }
    
    
    

    properties

    # rabbitMq 消息配置
    ## mq连接地址
    #spring.rabbitmq.addresses=127.0.0.1:5672
    #some
    spring.rabbitmq.addresses=127.0.0.1:5672
    ## mq连接账号
    spring.rabbitmq.username=guest
    ## mq连接密码
    spring.rabbitmq.password=guest
    ## 连接虚拟主机,默认为 / ,可以根据项目划分
    spring.rabbitmq.virtual-host=/
    ## 连接超时时间(毫秒)
    spring.rabbitmq.connection-timeout=15000
    #=============== 生产端 ===============
    ## 启用消息确认模式
    spring.rabbitmq.publisher-confirms=true 
    #=============== 消费端 ===============
    spring.rabbitmq.listener.acknowledge-mode=manual
    spring.rabbitmq.listener.concurrency=5
    spring.rabbitmq.listener.max-concurrency=10
    ## 批量消息发送
    spring.rabbitmq.listener.prefetch=1
    ## 事件消息配置
    message.event.exchange=exchange-ev1ent-dev
    message.event.routingKey=eve1nt-dev
    message.event.queue=event.que1ue-dev
    message.monitor.exchange=exchange-moni1tor-dev
    message.monitor.routingKey=moni1tor-dev
    message.monitor.queue=event.moni1tor-dev
    message.email.exchange=exchange-ema1il-dev
    message.email.routingKey=ema1il-dev
    message.email.queue=event.ema1il-dev
    
    

    回顾2

    consumer

    
    import com.rabbitmq.client.*;
    import com.ykmimi.rabbitmqtopic.util.RabbitMQUtil;
    
    import java.io.IOException;
    import java.util.concurrent.TimeoutException;
    
    public class TestCustomerOption {
    
        public final static String EXCHANGE_NAME = "topics_exchange";
    
        public static void startCustomerOption(String consumerName,String queueOption) throws IOException, TimeoutException {
            //为当前消费者取名称
            final String name = consumerName;
    
            //判断服务器是否启动
            RabbitMQUtil.checkServer();
            // 创建连接工厂
            ConnectionFactory factory = new ConnectionFactory();
            //设置RabbitMQ地址
            factory.setHost("localhost");
            //创建一个新的连接
            Connection connection = factory.newConnection();
            //创建一个通道
            Channel channel = connection.createChannel();
            //交换机声明(参数为:交换机名称;交换机类型)
            channel.exchangeDeclare(EXCHANGE_NAME,"topic");
            //获取一个临时队列
            String queueName = channel.queueDeclare().getQueue();
            //接受 News 信息
    
            channel.queueBind(queueName, EXCHANGE_NAME, queueOption);
            System.out.println(name +" 等待接受消息");
            //DefaultConsumer类实现了Consumer接口,通过传入一个频道,
            // 告诉服务器我们需要那个频道的消息,如果频道中有消息,就会执行回调函数handleDelivery
            Consumer consumer = new DefaultConsumer(channel) {
                @Override
                public void handleDelivery(String consumerTag, Envelope envelope,
                                           AMQP.BasicProperties properties, byte[] body)
                        throws IOException {
                    String message = new String(body, "UTF-8");
                    System.out.println(name + " 接收到消息 '" + message + "'");
                }
            };
            //自动回复队列应答 -- RabbitMQ中的消息确认机制
            channel.basicConsume(queueName, true, consumer);
        }
    }
    
    

    producer

    
    import com.rabbitmq.client.Channel;
    import com.rabbitmq.client.Connection;
    import com.rabbitmq.client.ConnectionFactory;
    import com.ykmimi.rabbitmqtopic.util.RabbitMQUtil;
    
    import java.io.IOException;
    import java.util.concurrent.TimeoutException;
    
    public class TestProducer {
    
        public final static String EXCHANGE_NAME="topics_exchange";
    
        public static void startProducer() throws IOException, TimeoutException {
    
            RabbitMQUtil.checkServer();
    
            //创建连接工厂
            ConnectionFactory factory = new ConnectionFactory();
            //设置RabbitMQ相关信息
            factory.setHost("localhost");
            //创建一个新的连接
            Connection connection = factory.newConnection();
            //创建一个通道
            Channel channel = connection.createChannel();
    
            channel.exchangeDeclare(EXCHANGE_NAME, "topic");
    
            String[] routing_keys = new String[] { "usa.news", "usa.weather",
                    "europe.news", "europe.weather" };
            String[] messages = new String[] { "美国新闻", "美国天气",
                    "欧洲新闻", "欧洲天气" };
    
            for (int i = 0; i < routing_keys.length; i++) {
                String routingKey = routing_keys[i];
                String message = messages[i];
                channel.basicPublish(EXCHANGE_NAME, routingKey, null, message
                        .getBytes());
                System.out.printf("发送消息到路由:%s, 内容是: %s%n ", routingKey,message);
    
            }
    
            //关闭通道和连接
            channel.close();
            connection.close();
        }
    }
    
    

    util

    
    
    import cn.hutool.core.util.NetUtil;
    
    import javax.swing.*;
    
    public class RabbitMQUtil {
    
        public static void checkServer(){
            if(NetUtil.isUsableLocalPort(15672)){
                JOptionPane.showMessageDialog(null,"RabbitMQ服务器未启动");
                System.exit(1);
            }
        }
    }
    
    

    main

    package com.nice.rabbitmqtopic;
    
    import com.nice.rabbitmqtopic.customer.TestCustomerOption;
    import com.nice.rabbitmqtopic.producer.TestProducer;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    
    import java.io.IOException;
    import java.util.concurrent.TimeoutException;
    
    @SpringBootApplication
    public class RabbitmqTopicApplication {
    
        public static void main(String[] args) throws IOException, TimeoutException, InterruptedException {
            TestCustomerOption.startCustomerOption("consumer-news","*.news");
            TestCustomerOption.startCustomerOption("consumer-weather","*.weather");
            TestCustomerOption.startCustomerOption("consumer-usa","usa.*");
            TestCustomerOption.startCustomerOption("consumer-europe","europe.*");
            Thread.sleep(3000);
            TestProducer.startProducer();
            //SpringApplication.run(RabbitmqTopicApplication.class, args);
        }
    
    }
    consumer-news 等待接受消息
    consumer-weather 等待接受消息
    consumer-usa 等待接受消息
    consumer-europe 等待接受消息
    发送消息到路由:usa.news, 内容是: 美国新闻
     发送消息到路由:usa.weather, 内容是: 美国天气
     发送消息到路由:europe.news, 内容是: 欧洲新闻
     发送消息到路由:europe.weather, 内容是: 欧洲天气
     consumer-europe 接收到消息 '欧洲新闻'
    consumer-news 接收到消息 '美国新闻'
    consumer-usa 接收到消息 '美国新闻'
    consumer-europe 接收到消息 '欧洲天气'
    consumer-weather 接收到消息 '美国天气'
    consumer-usa 接收到消息 '美国天气'
    consumer-news 接收到消息 '欧洲新闻'
    consumer-weather 接收到消息 '欧洲天气'
    
    
  • 相关阅读:
    linux 信号处理 二 (信号的默认处理)
    linux 信号处理 一 (基本概念)
    POSIX 消息队列 之 参数说明
    System V 消息队列 实例
    KDB支持单步调试功能(ARM架构)
    找工作笔试面试那些事儿(16)---linux相关知识点(1)
    Central Europe Regional Contest 2012 Problem H: Darts
    计算机数据结构之——什么是艺术品?
    老罗android开发视频教程 下载地址
    HTML5 实现拖拽
  • 原文地址:https://www.cnblogs.com/ukzq/p/13327002.html
Copyright © 2011-2022 走看看