Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
push-message
Project
Project
Details
Activity
Releases
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
liucheng
push-message
Commits
d06699bd
Commit
d06699bd
authored
Apr 22, 2022
by
renandong
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.单推推送日志兼容群推
parent
95873b51
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
PushLogServiceImpl.java
src/main/java/com/weface/serviceimpl/PushLogServiceImpl.java
+11
-4
UserTagsTask.java
src/main/java/com/weface/task/UserTagsTask.java
+18
-12
No files found.
src/main/java/com/weface/serviceimpl/PushLogServiceImpl.java
View file @
d06699bd
...
@@ -12,6 +12,7 @@ import com.weface.dto.InformForm;
...
@@ -12,6 +12,7 @@ import com.weface.dto.InformForm;
import
com.weface.entity.PushLogEntity
;
import
com.weface.entity.PushLogEntity
;
import
com.weface.service.PushLogService
;
import
com.weface.service.PushLogService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -38,10 +39,16 @@ public class PushLogServiceImpl extends ServiceImpl<PushLogDao, PushLogEntity> i
...
@@ -38,10 +39,16 @@ public class PushLogServiceImpl extends ServiceImpl<PushLogDao, PushLogEntity> i
pushLogEntity
.
setAppName
(
informForm
.
getEquipmentType
());
pushLogEntity
.
setAppName
(
informForm
.
getEquipmentType
());
pushLogEntity
.
setTaskId
(
key
);
pushLogEntity
.
setTaskId
(
key
);
pushLogEntity
.
setResult
(
data
.
toString
());
pushLogEntity
.
setResult
(
data
.
toString
());
String
phone
=
informForm
.
getPhone
();
if
(
StringUtils
.
isNotEmpty
(
phone
)){
DES
des
=
DES
.
getInstanceDes
();
DES
des
=
DES
.
getInstanceDes
();
pushLogEntity
.
setPhone
(
des
.
encrypt
(
informForm
.
getPhone
()));
pushLogEntity
.
setPhone
(
des
.
encrypt
(
phone
));
pushLogEntity
.
setMessageTemplate
(
informForm
.
getMessageTemplate
());
}
pushLogEntity
.
setPushTarget
(
informForm
.
getCid
());
Integer
messageTemplate
=
informForm
.
getMessageTemplate
();
if
(
messageTemplate
!=
null
){
pushLogEntity
.
setMessageTemplate
(
messageTemplate
);
}
pushLogEntity
.
setPushTarget
(
informForm
.
getCid
()
==
null
?
"all"
:
informForm
.
getCid
());
pushLogEntity
.
setPushContent
(
informForm
.
getBody
());
pushLogEntity
.
setPushContent
(
informForm
.
getBody
());
pushLogEntity
.
setArriveStatus
(
1001
);
pushLogEntity
.
setArriveStatus
(
1001
);
pushLogEntity
.
setUpdateTime
(
new
Date
());
pushLogEntity
.
setUpdateTime
(
new
Date
());
...
...
src/main/java/com/weface/task/UserTagsTask.java
View file @
d06699bd
...
@@ -62,6 +62,9 @@ public class UserTagsTask {
...
@@ -62,6 +62,9 @@ public class UserTagsTask {
*/
*/
private
static
final
Integer
TIME
=
2
;
private
static
final
Integer
TIME
=
2
;
/**
* 查询未推送消息成功记录,发送短信通知
*/
@Scheduled
(
cron
=
"0 0 0/1 * * ? "
)
@Scheduled
(
cron
=
"0 0 0/1 * * ? "
)
public
void
sendMessage
()
{
public
void
sendMessage
()
{
try
{
try
{
...
@@ -73,6 +76,7 @@ public class UserTagsTask {
...
@@ -73,6 +76,7 @@ public class UserTagsTask {
DES
des
=
DES
.
getInstanceDes
();
DES
des
=
DES
.
getInstanceDes
();
for
(
PushLogEntity
pushLogEntity
:
list
)
{
for
(
PushLogEntity
pushLogEntity
:
list
)
{
String
phone
=
pushLogEntity
.
getPhone
();
String
phone
=
pushLogEntity
.
getPhone
();
if
(
StringUtils
.
isNotEmpty
(
phone
)){
if
(
CommonUtil
.
isBase64
(
phone
))
{
if
(
CommonUtil
.
isBase64
(
phone
))
{
phone
=
des
.
decrypt
(
phone
);
phone
=
des
.
decrypt
(
phone
);
}
}
...
@@ -84,11 +88,13 @@ public class UserTagsTask {
...
@@ -84,11 +88,13 @@ public class UserTagsTask {
if
(
b
)
{
if
(
b
)
{
log
.
info
(
"执行短信发送成功"
);
log
.
info
(
"执行短信发送成功"
);
pushLogEntity
.
setArriveStatus
(
1003
);
pushLogEntity
.
setArriveStatus
(
1003
);
pushLogEntity
.
setUpdateTime
(
new
Date
());
updateBatch
.
add
(
pushLogEntity
);
updateBatch
.
add
(
pushLogEntity
);
}
}
}
}
}
}
}
}
}
if
(
updateBatch
!=
null
)
{
if
(
updateBatch
!=
null
)
{
pushLogService
.
updateBatchById
(
updateBatch
);
pushLogService
.
updateBatchById
(
updateBatch
);
}
}
...
...
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