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
0a91088e
Commit
0a91088e
authored
May 05, 2022
by
renandong
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改发送短信定时任务异常
parent
4c874e35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
PushCallBackServiceImpl.java
.../java/com/weface/serviceimpl/PushCallBackServiceImpl.java
+1
-1
UserTagsTask.java
src/main/java/com/weface/task/UserTagsTask.java
+7
-10
No files found.
src/main/java/com/weface/serviceimpl/PushCallBackServiceImpl.java
View file @
0a91088e
...
...
@@ -122,7 +122,7 @@ public class PushCallBackServiceImpl extends ServiceImpl<PushCallBackDao, PushCa
List
<
PushCallBackEntity
>
list
=
new
ArrayList
<>();
while
(
matcher
.
find
())
{
String
group
=
matcher
.
group
(
1
);
log
.
info
(
"回调信息:{}"
,
group
);
log
.
error
(
"回调信息:{}"
,
group
);
PushCallBackEntity
callBackInfo
=
JSONObject
.
parseObject
(
group
,
PushCallBackEntity
.
class
);
String
desc
=
JSONObject
.
parseObject
(
group
).
getString
(
"desc"
);
callBackInfo
.
setDescStr
(
desc
);
...
...
src/main/java/com/weface/task/UserTagsTask.java
View file @
0a91088e
...
...
@@ -16,6 +16,7 @@ import com.weface.service.UserTagService;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
...
@@ -52,6 +53,7 @@ public class UserTagsTask {
private
MenuTagsService
menuTagsService
;
@Autowired
@Qualifier
(
value
=
"asyncServiceExecutor"
)
private
ThreadPoolTaskExecutor
asyncServiceExecutor
;
@Autowired
...
...
@@ -68,11 +70,9 @@ public class UserTagsTask {
@Scheduled
(
cron
=
"0 0 0/1 * * ? "
)
public
void
sendMessage
()
{
try
{
log
.
info
(
"开始执行短信发送任务"
);
log
.
error
(
"开始执行短信发送任务"
);
List
<
PushLogEntity
>
list
=
pushLogService
.
getPushLogByTime
(
TIME
);
List
<
PushLogEntity
>
updateBatch
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
updateBatch
=
new
ArrayList
<>(
list
.
size
());
DES
des
=
DES
.
getInstanceDes
();
for
(
PushLogEntity
pushLogEntity
:
list
)
{
String
phone
=
pushLogEntity
.
getPhone
();
...
...
@@ -86,18 +86,15 @@ public class UserTagsTask {
if
(
1001
==
arriveStatus
)
{
boolean
b
=
ShortMsgSend
.
sendMobileByRegister
(
pushContent
,
phone
,
messageTemplate
);
if
(
b
)
{
log
.
info
(
"执行短信发送成功"
);
log
.
error
(
"执行短信发送成功"
);
pushLogEntity
.
setArriveStatus
(
1003
);
pushLogEntity
.
setUpdateTime
(
new
Date
());
updateBatch
.
ad
d
(
pushLogEntity
);
pushLogService
.
updateByI
d
(
pushLogEntity
);
}
}
}
}
}
if
(
updateBatch
!=
null
)
{
pushLogService
.
updateBatchById
(
updateBatch
);
}
}
catch
(
IOException
e
)
{
log
.
error
(
"执行短信发送失败:{}"
,
e
.
getMessage
());
e
.
printStackTrace
();
...
...
@@ -112,7 +109,7 @@ public class UserTagsTask {
public
void
updateRedisHashKey
()
{
try
{
log
.
error
(
"开始更新任务缓存"
);
Hash
Set
<
Object
>
hashSet
=
new
HashSet
<>();
Set
<
Object
>
hashSet
=
new
HashSet
<>();
Set
<
Object
>
keys
=
RedisUtil
.
HashOps
.
hKeys
(
Constant
.
PUSH_TASK_INFO
);
for
(
Object
key
:
keys
)
{
Object
hashValue
=
RedisUtil
.
HashOps
.
hGet
(
Constant
.
PUSH_TASK_INFO
,
key
.
toString
());
...
...
@@ -125,7 +122,7 @@ public class UserTagsTask {
}
}
}
if
(!
hashSet
.
isEmpty
(
))
{
if
(!
CollectionUtils
.
isEmpty
(
hashSet
))
{
RedisUtil
.
HashOps
.
hDelete
(
Constant
.
PUSH_TASK_INFO
,
hashSet
.
toArray
());
}
}
catch
(
Exception
e
)
{
...
...
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