Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart-office-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart-office-platform
Commits
97ab8a62
Commit
97ab8a62
authored
Jan 04, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改通知去重复
parent
48df4747
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
+23
-22
smart-office-manager/src/main/java/com/mortals/xhx/daemon/task/MeetSwitchTaskImpl.java
.../java/com/mortals/xhx/daemon/task/MeetSwitchTaskImpl.java
+23
-22
No files found.
smart-office-manager/src/main/java/com/mortals/xhx/daemon/task/MeetSwitchTaskImpl.java
View file @
97ab8a62
...
...
@@ -3,6 +3,7 @@ package com.mortals.xhx.daemon.task;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.ITask
;
...
...
@@ -81,11 +82,10 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
for
(
MettingRecordEntity
recordEntity
:
recordEntities
)
{
long
between
=
DateUtil
.
between
(
new
Date
(),
recordEntity
.
getMeetTimeStart
(),
DateUnit
.
MINUTE
);
if
(
between
<=
basicSetEntity
.
getPreMeetStart
())
{
RoomDeviceQuery
roomDeviceQuery
=
new
RoomDeviceQuery
();
roomDeviceQuery
.
setRoomId
(
recordEntity
.
getRoomId
());
RoomDeviceEntity
roomDeviceEntity
=
roomDeviceService
.
selectOne
(
roomDeviceQuery
);
if
(
ObjectUtils
.
isEmpty
(
roomDeviceEntity
))
return
;
if
(
ObjectUtils
.
isEmpty
(
roomDeviceEntity
))
return
;
//还需满足当前进行中的会议 是否已经结束超时 存在时才推送消息
mettingRecordQuery
=
new
MettingRecordQuery
();
...
...
@@ -93,23 +93,23 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
mettingRecordQuery
.
setRoomId
(
recordEntity
.
getRoomId
());
MettingRecordEntity
mettingRecordEntity
=
mettingRecordService
.
selectOne
(
mettingRecordQuery
);
if
(!
ObjectUtils
.
isEmpty
(
mettingRecordEntity
))
{
if
(
basicSetEntity
.
getPostMeetStart
()>
0
)
{
//查看结束通知是否设置
long
mettingBetween
=
DateUtil
.
between
(
mettingRecordEntity
.
getMeetTimeStart
(),
new
Date
(),
DateUnit
.
MINUTE
);
if
(
mettingBetween
<=
basicSetEntity
.
getPostMeetStart
())
{
log
.
info
(
"当前进行中的会议未结束,不推送下一个会议消息"
);
return
;
}
}
if
(
basicSetEntity
.
getMeetEnd
()==
YesNoEnum
.
YES
.
getValue
())
{
long
mettingBetween
=
DateUtil
.
between
(
mettingRecordEntity
.
getMeetTimeEnd
(),
new
Date
(),
DateUnit
.
MINUTE
);
if
(
mettingBetween
<=
basicSetEntity
.
getPostMeetStart
())
{
log
.
info
(
"当前进行中的会议未结束,不推送下一个会议消息"
);
return
;
}
}
if
(!
ObjectUtils
.
isEmpty
(
mettingRecordEntity
))
{
if
(
basicSetEntity
.
getPostMeetStart
()
>
0
)
{
//查看结束通知是否设置
long
mettingBetween
=
DateUtil
.
between
(
mettingRecordEntity
.
getMeetTimeStart
(),
new
Date
(),
DateUnit
.
MINUTE
);
if
(
mettingBetween
<=
basicSetEntity
.
getPostMeetStart
())
{
log
.
info
(
"当前进行中的会议未结束,不推送下一个会议消息"
);
return
;
}
}
if
(
basicSetEntity
.
getMeetEnd
()
==
YesNoEnum
.
YES
.
getValue
())
{
long
mettingBetween
=
DateUtil
.
between
(
mettingRecordEntity
.
getMeetTimeEnd
(),
new
Date
(),
DateUnit
.
MINUTE
);
if
(
mettingBetween
<=
basicSetEntity
.
getPostMeetStart
())
{
log
.
info
(
"当前进行中的会议未结束,不推送下一个会议消息"
);
return
;
}
}
}
//通知设备进行数据更新
...
...
@@ -119,7 +119,7 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
uploadDeviceReq
.
setDeviceCodeList
(
Arrays
.
asList
(
roomDeviceEntity
.
getDeviceCode
()));
uploadDeviceReq
.
setAction
(
"preMeetStart"
);
uploadDeviceReq
.
setContent
(
JSON
.
toJSONString
(
recordEntity
));
log
.
info
(
"preMeetStart send msg :{}"
,
roomDeviceEntity
.
getDeviceCode
());
log
.
info
(
"preMeetStart send msg :{}"
,
roomDeviceEntity
.
getDeviceCode
());
messageFeign
.
downMsg
(
uploadDeviceReq
);
}
}
...
...
@@ -140,12 +140,13 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
RoomDeviceQuery
roomDeviceQuery
=
new
RoomDeviceQuery
();
roomDeviceQuery
.
setRoomId
(
pendRecordEntity
.
getRoomId
());
RoomDeviceEntity
roomDeviceEntity
=
roomDeviceService
.
selectOne
(
roomDeviceQuery
);
if
(
ObjectUtils
.
isEmpty
(
roomDeviceEntity
))
return
;
if
(
ObjectUtils
.
isEmpty
(
roomDeviceEntity
))
return
;
UploadDeviceReq
uploadDeviceReq
=
new
UploadDeviceReq
();
uploadDeviceReq
.
setDeviceCodeList
(
Arrays
.
asList
(
roomDeviceEntity
.
getDeviceCode
()));
uploadDeviceReq
.
setAction
(
"postMeet"
);
messageFeign
.
downMsg
(
uploadDeviceReq
);
Rest
<
String
>
rest
=
messageFeign
.
downMsg
(
uploadDeviceReq
);
log
.
info
(
"会议结束提前通知 postMeet 返回结果:{}"
,
JSON
.
toJSONString
(
rest
));
}
}
...
...
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