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
e520a263
Commit
e520a263
authored
Jun 07, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:企微标签打标签改为消息队列
parent
0be28b3b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+10
-11
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
e520a263
...
@@ -484,12 +484,12 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
...
@@ -484,12 +484,12 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
}
}
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"corpid"
,
wxEnterprise
.
getCorpid
());
jsonObject
.
put
(
"corpid"
,
wxEnterprise
.
getCorpid
());
jsonObject
.
put
(
"suiteId"
,
wxSuiteid
);
jsonObject
.
put
(
"suiteId"
,
wxSuiteid
);
jsonObject
.
put
(
"wxUserId"
,
wxUserId
);
jsonObject
.
put
(
"wxUserId"
,
wxUserId
);
jsonObject
.
put
(
"externalUserId"
,
externalUserId
);
jsonObject
.
put
(
"externalUserId"
,
externalUserId
);
jsonObject
.
put
(
"needSetTags"
,
StringUtils
.
join
(
needSetTags
,
","
));
jsonObject
.
put
(
"needSetTags"
,
StringUtils
.
join
(
needSetTags
,
","
));
jsonObject
.
put
(
"needDelTags"
,
StringUtils
.
join
(
needDelTags
,
","
));
jsonObject
.
put
(
"needDelTags"
,
StringUtils
.
join
(
needDelTags
,
","
));
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
try
{
clientInstance
.
sendMessage
(
"qywxMarkTagMq"
,
jsonObject
.
toJSONString
());
clientInstance
.
sendMessage
(
"qywxMarkTagMq"
,
jsonObject
.
toJSONString
());
...
@@ -570,14 +570,14 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
...
@@ -570,14 +570,14 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
}
}
Map
<
String
,
Set
<
String
>>
externalTagMap
=
getExternalTagMap
(
externalUseridInfo
,
wxEnterpriseId
);
Map
<
String
,
Set
<
String
>>
externalTagMap
=
getExternalTagMap
(
externalUseridInfo
,
wxEnterpriseId
);
if
(
MapUtils
.
isEmpty
(
externalTagMap
))
{
if
(
MapUtils
.
isEmpty
(
externalTagMap
))
{
logger
.
info
(
"该用户没有不存在好友关系,获取不到关联导购打的标签,:externalUseridInfo:{}"
,
externalUseridInfo
);
logger
.
info
(
"该用户没有不存在好友关系,获取不到关联导购打的标签,:externalUseridInfo:{}"
,
externalUseridInfo
);
resp
.
setMessage
(
"该用户没有不存在好友关系,获取不到关联导购打的标签"
);
resp
.
setMessage
(
"该用户没有不存在好友关系,获取不到关联导购打的标签"
);
return
resp
;
return
resp
;
}
}
//当前操作用户企业打的标签
//当前操作用户企业打的标签
Set
<
String
>
staffChangeTagKeys
=
externalTagMap
.
get
(
wxUserId
);
Set
<
String
>
staffChangeTagKeys
=
externalTagMap
.
get
(
wxUserId
);
if
(
CollectionUtils
.
isEmpty
(
staffChangeTagKeys
))
{
if
(
CollectionUtils
.
isEmpty
(
staffChangeTagKeys
))
{
logger
.
info
(
"该用户没有不存在好友关系,获取不到关联导购打的标签,wxUserId:{}"
,
wxUserId
);
logger
.
info
(
"该用户没有不存在好友关系,获取不到关联导购打的标签,wxUserId:{}"
,
wxUserId
);
resp
.
setMessage
(
"该用户没有不存在好友关系,获取不到关联导购打的标签"
);
resp
.
setMessage
(
"该用户没有不存在好友关系,获取不到关联导购打的标签"
);
return
resp
;
return
resp
;
}
}
...
@@ -586,7 +586,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
...
@@ -586,7 +586,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//获取该外部联系人的所有会员
//获取该外部联系人的所有会员
List
<
TabHaobanExternalClerkRelated
>
clerkRelateds
=
externalClerkRelatedService
.
listExternalByExternalUserid
(
wxEnterpriseId
,
externalUserId
);
List
<
TabHaobanExternalClerkRelated
>
clerkRelateds
=
externalClerkRelatedService
.
listExternalByExternalUserid
(
wxEnterpriseId
,
externalUserId
);
if
(
CollectionUtils
.
isEmpty
(
clerkRelateds
))
{
if
(
CollectionUtils
.
isEmpty
(
clerkRelateds
))
{
logger
.
info
(
"该用户没关联对应的好友:{}"
,
externalUserId
);
logger
.
info
(
"该用户没关联对应的好友:{}"
,
externalUserId
);
resp
.
setMessage
(
"该用户没关联对应的好友"
);
resp
.
setMessage
(
"该用户没关联对应的好友"
);
return
resp
;
return
resp
;
}
}
...
@@ -932,8 +932,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
...
@@ -932,8 +932,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
String
externalUserId
=
jsonObject
.
getString
(
"externalUserId"
);
String
externalUserId
=
jsonObject
.
getString
(
"externalUserId"
);
String
needSetTags
=
jsonObject
.
getString
(
"needSetTags"
);
String
needSetTags
=
jsonObject
.
getString
(
"needSetTags"
);
String
needDelTags
=
jsonObject
.
getString
(
"needDelTags"
);
String
needDelTags
=
jsonObject
.
getString
(
"needDelTags"
);
String
key
=
"HAOBAN:QYWX:TAG:"
+
wxUserId
+
externalUserId
;
String
key
=
"HAOBAN:QYWX:TAG:"
+
wxUserId
+
externalUserId
;
//重试5次
Integer
currentTimes
=
Convert
.
toInt
(
RedisUtil
.
getCache
(
key
),
0
);
Integer
currentTimes
=
Convert
.
toInt
(
RedisUtil
.
getCache
(
key
),
0
);
if
(
currentTimes
>
MAX_TIMES
)
{
if
(
currentTimes
>
MAX_TIMES
)
{
logger
.
error
(
"企微打标签超过最大次数,key:{}"
,
key
);
logger
.
error
(
"企微打标签超过最大次数,key:{}"
,
key
);
...
@@ -945,7 +944,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
...
@@ -945,7 +944,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger
.
info
(
"权限不对,重试三次:{},{}"
,
wxUserId
,
externalUserId
);
logger
.
info
(
"权限不对,重试三次:{},{}"
,
wxUserId
,
externalUserId
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
try
{
clientInstance
.
sendMessage
(
"qywxMarkTagMq"
,
jsonObject
.
toJSONString
(),
30
);
clientInstance
.
sendMessage
(
"qywxMarkTagMq"
,
jsonObject
.
toJSONString
(),
30
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"企微标签同步qywxMarkTagMq发送失败:{}"
,
e
.
getMessage
(),
e
);
logger
.
info
(
"企微标签同步qywxMarkTagMq发送失败:{}"
,
e
.
getMessage
(),
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