Commit 19f4f5e6 by 阳浪

消息优化

parent b8412938
......@@ -5,11 +5,12 @@ import com.yizhi.assignment.application.vo.MessageTaskRemindVo;
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.assignment.application.vo.enums.EvenType;
import com.yizhi.message.application.enums.RelationType;
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 org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -27,7 +28,7 @@ public class AssignmentEvenSendMessage {
@Autowired
private CloudEventPublisher cloudEventPublisher;
private PublicSendMessageClient publicSendMessageClient;
private Logger logger = LoggerFactory.getLogger(AssignmentEvenSendMessage.class);
......@@ -69,7 +70,7 @@ public class AssignmentEvenSendMessage {
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);
......@@ -109,12 +110,12 @@ public class AssignmentEvenSendMessage {
if (remindVo.getHasDeleted()) {
vo.setHasDeleted(remindVo.getHasDeleted());
cloudEventPublisher.publish(Constans.MESSAGE_QUEUE, new EventWrapper<MessageRemindVo>(null, vo));
publicSendMessageClient.processBizEvent(new EventWrapper<MessageRemindVo>(null, vo));
} else {
if (remindVo.getTaskStatusUpdate()) {
//1 为消息业务可发送状态 0 则不行
vo.setTaskStatusUpdate(remindVo.getTaskStatusUpdate());
cloudEventPublisher.publish(Constans.MESSAGE_QUEUE, new EventWrapper<MessageRemindVo>(null, vo));
publicSendMessageClient.processBizEvent(new EventWrapper<MessageRemindVo>(null, vo));
logger.info("发送修改业务状态消息成功=====================");
return;
}
......@@ -127,10 +128,10 @@ public class AssignmentEvenSendMessage {
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);
}
......@@ -145,7 +146,7 @@ public class AssignmentEvenSendMessage {
return;
}
try {
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