Commit 1dd5bf23 by 阳浪

消息优化

parent 8138f834
......@@ -4,12 +4,13 @@ import com.alibaba.fastjson.JSON;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.event.EventWrapper;
import com.yizhi.core.application.publish.CloudEventPublisher;
import com.yizhi.core.application.publish.PublicSendMessageClient;
import com.yizhi.message.application.constans.Constans;
import com.yizhi.message.application.enums.RelationType;
import com.yizhi.research.application.eum.ResearchState;
import com.yizhi.research.application.vo.EvenType;
import com.yizhi.message.application.vo.MessageRemindVo;
import com.yizhi.message.application.vo.TaskVo;
import com.yizhi.core.application.vo.MessageRemindVo;
import com.yizhi.core.application.vo.TaskVo;
import com.yizhi.research.application.vo.MessageTaskRemindVo;
import com.yizhi.research.application.vo.domain.Research;
import org.apache.commons.lang3.time.DateUtils;
......@@ -28,7 +29,7 @@ import java.util.List;
public class ResearchEvenSendMessage {
@Autowired
private CloudEventPublisher cloudEventPublisher;
private PublicSendMessageClient publicSendMessageClient;
private Logger logger = LoggerFactory.getLogger(ResearchEvenSendMessage.class);
......@@ -65,7 +66,7 @@ public class ResearchEvenSendMessage {
vo.setRequestContext(requestContext);
try {
//临时取消触发功能
// cloudEventPublisher.publish(Constans.MESSAGE_QUEUE, new EventWrapper<MessageRemindVo>(null, vo));
// publicSendMessageClient.processBizEvent( new EventWrapper<MessageRemindVo>(null, vo));
} catch (Exception e) {
e.printStackTrace();
logger.error("发送消息失败=====================", e);
......@@ -102,7 +103,7 @@ public class ResearchEvenSendMessage {
if (null != remindVo && null != remindVo.getIsCopy() && remindVo.getIsCopy()) {
vo.setIsCopy(remindVo.getIsCopy());
vo.setOldRelationId(remindVo.getOldRelationId());
cloudEventPublisher.publish(Constans.MESSAGE_QUEUE, new EventWrapper<MessageRemindVo>(null, vo));
publicSendMessageClient.processBizEvent( new EventWrapper<MessageRemindVo>(null, vo));
logger.error("发送复制消息成功=====================");
return;
}
......@@ -115,7 +116,7 @@ public class ResearchEvenSendMessage {
}
if (null != remindVo.getHasDeleted() && remindVo.getHasDeleted()) {
vo.setHasDeleted(remindVo.getHasDeleted());
cloudEventPublisher.publish(Constans.MESSAGE_QUEUE, new EventWrapper<MessageRemindVo>(null, vo));
publicSendMessageClient.processBizEvent( new EventWrapper<MessageRemindVo>(null, vo));
logger.error("发送删除消息成功=====================");
} else {
//修改调研的状态
......@@ -123,7 +124,7 @@ public class ResearchEvenSendMessage {
//1 为消息业务可发送状态 0 则不行
vo.setTaskStatusUpdate(true);
vo.setTaskStatus(research.getState() == ResearchState.RELEASED.getValue() ? 1 : 0);
cloudEventPublisher.publish(Constans.MESSAGE_QUEUE, new EventWrapper<MessageRemindVo>(null, vo));
publicSendMessageClient.processBizEvent( new EventWrapper<MessageRemindVo>(null, vo));
logger.info("发送修改业务状态消息成功=====================");
return;
}
......@@ -137,10 +138,10 @@ public class ResearchEvenSendMessage {
vo.setMessageId(remindVo.getMessageId());
vo.setIsChangge(remindVo.getIsChangge());
List<MessageTaskRemindVo> m= remindVo.getMessageTaskRemindVos();
List<com.yizhi.message.application.vo.MessageTaskRemindVo> m2=new ArrayList<>();
List<com.yizhi.core.application.vo.MessageTaskRemindVo> m2=new ArrayList<>();
for (MessageTaskRemindVo m1:m
) {
com.yizhi.message.application.vo.MessageTaskRemindVo mx=new com.yizhi.message.application.vo.MessageTaskRemindVo();
com.yizhi.core.application.vo.MessageTaskRemindVo mx=new com.yizhi.core.application.vo.MessageTaskRemindVo();
BeanUtils.copyProperties(m1,mx);
m2.add(mx);
}
......@@ -156,7 +157,7 @@ public class ResearchEvenSendMessage {
logger.info("相关参数缺失!!!!!");
return;
}
cloudEventPublisher.publish(Constans.MESSAGE_QUEUE, new EventWrapper<MessageRemindVo>(null, vo));
publicSendMessageClient.processBizEvent( new EventWrapper<MessageRemindVo>(null, vo));
logger.info("发送消息成功=====================");
} catch (Exception e) {
e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment