Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
exam-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
exam-project
Commits
06bfe990
Commit
06bfe990
authored
Feb 19, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息优化
parent
fcff9d8a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
cloud-exam/src/main/java/com/yizhi/application/util/ExamEvenSendMessage.java
+9
-10
No files found.
cloud-exam/src/main/java/com/yizhi/application/util/ExamEvenSendMessage.java
View file @
06bfe990
package
com
.
yizhi
.
application
.
util
;
import
com.yizhi.core.application.publish.PublicSendMessageClient
;
import
com.yizhi.exam.application.vo.MessageTaskRemindVo
;
import
com.yizhi.exam.application.vo.domain.Exam
;
import
com.yizhi.message.application.constans.Constans
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.exam.application.enums.EvenType
;
import
com.yizhi.message.application.enums.RelationType
;
import
com.yizhi.core.application.event.EventWrapper
;
import
com.yizhi.core.application.publish.CloudEventPublisher
;
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
;
...
...
@@ -26,7 +25,7 @@ import java.util.List;
public
class
ExamEvenSendMessage
{
@Autowired
private
CloudEventPublisher
cloudEventPublisher
;
private
PublicSendMessageClient
publicSendMessageClient
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ExamEvenSendMessage
.
class
);
/**
...
...
@@ -105,13 +104,13 @@ public class ExamEvenSendMessage {
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
;
}
...
...
@@ -124,10 +123,10 @@ public class ExamEvenSendMessage {
vo
.
setMessageId
(
remindVo
.
getMessageId
());
vo
.
setIsChangge
(
remindVo
.
getIsChangge
());
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
)
{
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
);
m2
.
add
(
mx
);
}
...
...
@@ -143,7 +142,7 @@ public class ExamEvenSendMessage {
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
();
...
...
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