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