Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
f0f91796
Commit
f0f91796
authored
Feb 21, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:加好友重试5次
parent
03579d1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
+14
-1
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+14
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
f0f91796
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.crypto.SecureUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -76,6 +77,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -83,6 +85,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private
static
final
Logger
log
=
LogManager
.
getLogger
(
MemberUnionidRelatedApiServiceImpl
.
class
);
private
static
final
String
SELF_APP
=
"selfSuiteId"
;
/**
* 限制次数
*/
private
static
final
Integer
MAX_TIMES
=
5
;
@Autowired
private
MemberUnionRelatedService
memberUnionRelatedService
;
...
...
@@ -1843,9 +1849,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
TabHaobanExternalClerkRelated
externalClerkRelated
=
externalClerkRelatedMapper
.
getByRelationKey
(
relationKey
);
if
(
externalClerkRelated
==
null
)
{
log
.
error
(
"关注公共号-会员回调好办关联好友,未查询到,relationKey:{}"
,
relationKey
);
//重试5次
Integer
currentTimes
=
Convert
.
toInt
(
RedisUtil
.
getCache
(
relationKey
),
0
);
if
(
currentTimes
>
MAX_TIMES
)
{
log
.
error
(
"关注公共号-会员回调好办关联好友重试超过最大次数,relationKey:{}"
,
relationKey
);
return
;
}
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
clientInstance
.
sendMessage
(
"addMemberUnionidWechatAccountByClerkMq"
,
res
,
5
);
clientInstance
.
sendMessage
(
"addMemberUnionidWechatAccountByClerkMq"
,
res
,
180
);
RedisUtil
.
setCache
(
relationKey
,
currentTimes
+
1
,
2L
,
TimeUnit
.
HOURS
);
}
catch
(
Exception
e
)
{
log
.
info
(
"发送消息异常:{}"
,
e
.
getMessage
());
}
...
...
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