Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
training-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
training-project
Commits
a712cd71
Commit
a712cd71
authored
Feb 19, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息优化
parent
80880699
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
cloud-training-project-service/src/main/java/com/yizhi/training/application/util/TrainingEvenSendMessage.java
+11
-12
No files found.
cloud-training-project-service/src/main/java/com/yizhi/training/application/util/TrainingEvenSendMessage.java
View file @
a712cd71
...
@@ -2,14 +2,13 @@ package com.yizhi.training.application.util;
...
@@ -2,14 +2,13 @@ package com.yizhi.training.application.util;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.core.application.event.EventWrapper
;
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.message.application.enums.RelationType
;
import
com.yizhi.training.application.constant.ProjectConstant
;
import
com.yizhi.training.application.constant.ProjectConstant
;
import
com.yizhi.training.application.domain.TrainingProject
;
import
com.yizhi.training.application.domain.TrainingProject
;
import
com.yizhi.training.application.vo.EvenType
;
import
com.yizhi.training.application.vo.EvenType
;
import
com.yizhi.
messag
e.application.vo.MessageRemindVo
;
import
com.yizhi.
cor
e.application.vo.MessageRemindVo
;
import
com.yizhi.
messag
e.application.vo.TaskVo
;
import
com.yizhi.
cor
e.application.vo.TaskVo
;
import
com.yizhi.training.application.vo.manage.MessageTaskRemindVo
;
import
com.yizhi.training.application.vo.manage.MessageTaskRemindVo
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -28,7 +27,7 @@ public class TrainingEvenSendMessage {
...
@@ -28,7 +27,7 @@ public class TrainingEvenSendMessage {
@Autowired
@Autowired
private
CloudEventPublisher
cloudEventPublisher
;
private
PublicSendMessageClient
publicSendMessageClient
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
TrainingEvenSendMessage
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
TrainingEvenSendMessage
.
class
);
...
@@ -67,7 +66,7 @@ public class TrainingEvenSendMessage {
...
@@ -67,7 +66,7 @@ public class TrainingEvenSendMessage {
vo
.
setRequestContext
(
requestContext
);
vo
.
setRequestContext
(
requestContext
);
try
{
try
{
//临时取消触发功能
//临时取消触发功能
// cloudEventPublisher.publish(Constans.MESSAGE_QUEUE,
new EventWrapper<MessageRemindVo>(null, vo));
publicSendMessageClient
.
processBizEvent
(
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
error
(
"发送消息失败====================="
,
e
);
logger
.
error
(
"发送消息失败====================="
,
e
);
...
@@ -109,13 +108,13 @@ public class TrainingEvenSendMessage {
...
@@ -109,13 +108,13 @@ public class TrainingEvenSendMessage {
}
}
if
(
remindVo
.
getHasDeleted
())
{
if
(
remindVo
.
getHasDeleted
())
{
vo
.
setHasDeleted
(
remindVo
.
getHasDeleted
());
vo
.
setHasDeleted
(
remindVo
.
getHasDeleted
());
cloudEventPublisher
.
publish
(
Constans
.
MESSAGE_QUEUE
,
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
publicSendMessageClient
.
processBizEvent
(
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
logger
.
info
(
"发送删除消息成功!!"
);
logger
.
info
(
"发送删除消息成功!!"
);
}
else
{
}
else
{
if
(
remindVo
.
getVisibleRangeUpdate
())
{
if
(
remindVo
.
getVisibleRangeUpdate
())
{
vo
.
setVisibleRangeUpdate
(
remindVo
.
getVisibleRangeUpdate
());
vo
.
setVisibleRangeUpdate
(
remindVo
.
getVisibleRangeUpdate
());
vo
.
setVisibleRange
(
trainingProject
.
getVisibleRange
());
vo
.
setVisibleRange
(
trainingProject
.
getVisibleRange
());
cloudEventPublisher
.
publish
(
Constans
.
MESSAGE_QUEUE
,
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
publicSendMessageClient
.
processBizEvent
(
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
logger
.
info
(
"发送计划同步可见范围消息成功!!"
);
logger
.
info
(
"发送计划同步可见范围消息成功!!"
);
return
;
return
;
}
}
...
@@ -124,7 +123,7 @@ public class TrainingEvenSendMessage {
...
@@ -124,7 +123,7 @@ public class TrainingEvenSendMessage {
//1 为消息业务可发送状态 0 则不行
//1 为消息业务可发送状态 0 则不行
vo
.
setTaskStatus
(
trainingProject
.
getStatus
().
equals
(
ProjectConstant
.
PROJECT_STATUS_ENABLE
)
?
1
:
0
);
vo
.
setTaskStatus
(
trainingProject
.
getStatus
().
equals
(
ProjectConstant
.
PROJECT_STATUS_ENABLE
)
?
1
:
0
);
vo
.
setTaskStatusUpdate
(
remindVo
.
getTaskStatusUpdate
());
vo
.
setTaskStatusUpdate
(
remindVo
.
getTaskStatusUpdate
());
cloudEventPublisher
.
publish
(
Constans
.
MESSAGE_QUEUE
,
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
publicSendMessageClient
.
processBizEvent
(
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
logger
.
info
(
"发送修改业务状态消息成功====================="
);
logger
.
info
(
"发送修改业务状态消息成功====================="
);
return
;
return
;
}
}
...
@@ -139,10 +138,10 @@ public class TrainingEvenSendMessage {
...
@@ -139,10 +138,10 @@ public class TrainingEvenSendMessage {
vo
.
setMessageId
(
remindVo
.
getMessageId
());
vo
.
setMessageId
(
remindVo
.
getMessageId
());
vo
.
setIsChangge
(
remindVo
.
getIsChangge
());
vo
.
setIsChangge
(
remindVo
.
getIsChangge
());
List
<
MessageTaskRemindVo
>
m
=
remindVo
.
getMessageTaskRemindVos
();
List
<
MessageTaskRemindVo
>
m
=
remindVo
.
getMessageTaskRemindVos
();
List
<
com
.
yizhi
.
messag
e
.
application
.
vo
.
MessageTaskRemindVo
>
m2
=
new
ArrayList
<>();
List
<
com
.
yizhi
.
cor
e
.
application
.
vo
.
MessageTaskRemindVo
>
m2
=
new
ArrayList
<>();
for
(
MessageTaskRemindVo
m1:
m
for
(
MessageTaskRemindVo
m1:
m
)
{
)
{
com
.
yizhi
.
message
.
application
.
vo
.
MessageTaskRemindVo
mx
=
new
com
.
yizhi
.
messag
e
.
application
.
vo
.
MessageTaskRemindVo
();
com
.
yizhi
.
core
.
application
.
vo
.
MessageTaskRemindVo
mx
=
new
com
.
yizhi
.
cor
e
.
application
.
vo
.
MessageTaskRemindVo
();
BeanUtils
.
copyProperties
(
m1
,
mx
);
BeanUtils
.
copyProperties
(
m1
,
mx
);
m2
.
add
(
mx
);
m2
.
add
(
mx
);
}
}
...
@@ -159,7 +158,7 @@ public class TrainingEvenSendMessage {
...
@@ -159,7 +158,7 @@ public class TrainingEvenSendMessage {
}
}
try
{
try
{
cloudEventPublisher
.
publish
(
Constans
.
MESSAGE_QUEUE
,
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
publicSendMessageClient
.
processBizEvent
(
new
EventWrapper
<
MessageRemindVo
>(
null
,
vo
));
logger
.
info
(
"发送消息成功====================="
);
logger
.
info
(
"发送消息成功====================="
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment