Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
f864fb81
Commit
f864fb81
authored
Jun 15, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息提醒
parent
7a7cb06e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
MsgInfoServiceImpl.java
...fu/cloud/plus/v1/msg/service/impl/MsgInfoServiceImpl.java
+27
-3
No files found.
yifu-msg/yifu-msg-biz/src/main/java/com/yifu/cloud/plus/v1/msg/service/impl/MsgInfoServiceImpl.java
View file @
f864fb81
...
...
@@ -32,9 +32,14 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
*
*
...
...
@@ -114,18 +119,37 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
* @Param
* @return
**/
@Transactional
@Override
public
void
updateOverTimeMsg
()
{
// 1. 删除未读的超时,如果有继续生成
baseMapper
.
delete
(
Wrappers
.<
MsgInfo
>
query
().
lambda
()
.
eq
(
MsgInfo:
:
getRead
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
MsgInfo:
:
getAlertType
,
CommonConstants
.
ONE_STRING
));
List
<
MsgInfo
>
temps
=
baseMapper
.
selectList
(
Wrappers
.<
MsgInfo
>
query
().
lambda
()
.
eq
(
MsgInfo:
:
getAlertType
,
CommonConstants
.
ONE_STRING
)
.
eq
(
MsgInfo:
:
getRead
,
CommonConstants
.
ONE_STRING
));
Map
<
String
,
MsgInfo
>
tempMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
temps
)){
for
(
MsgInfo
msg:
temps
){
tempMap
.
put
(
msg
.
getOrderNo
(),
msg
);
}
}
List
<
MsgInfo
>
msgInfos
=
baseMapper
.
getMsgByTask
();
List
<
MsgInfo
>
saves
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
msgInfos
)){
//1.先删除
baseMapper
.
delete
(
Wrappers
.<
MsgInfo
>
query
().
lambda
().
eq
(
MsgInfo:
:
getAlertType
,
CommonConstants
.
ONE_STRING
));
//2. 重新生成
MsgInfo
temp
;
for
(
MsgInfo
ms:
msgInfos
){
temp
=
tempMap
.
get
(
ms
.
getOrderNo
());
if
(
Common
.
isNotNull
(
temp
)){
continue
;
}
ms
.
setCreateTime
(
LocalDateTime
.
now
());
ms
.
setUrl
(
MesConstants
.
orderUrl
+
ms
.
getOrderId
());
saves
.
add
(
ms
);
}
this
.
saveBatch
(
msgInfo
s
);
this
.
saveBatch
(
save
s
);
}
}
}
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