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
134f4a30
Commit
134f4a30
authored
Mar 25, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购刷新好友超时时间
parent
c721c95b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
3 deletions
+39
-3
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+10
-2
FriendClerkSyncNewOperation.java
...nage/service/task/friend/FriendClerkSyncNewOperation.java
+29
-1
DealSyncTest.java
haoban-manage3-service/src/test/java/DealSyncTest.java
+0
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
134f4a30
...
@@ -795,7 +795,11 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
...
@@ -795,7 +795,11 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
}
String
res
=
qywxUserApiService
.
listSelfExternalUserid
(
enterprise
.
getCorpid
(),
secretSetting
.
getSecretVal
(),
wxUserId
);
String
res
=
qywxUserApiService
.
listSelfExternalUserid
(
enterprise
.
getCorpid
(),
secretSetting
.
getSecretVal
(),
wxUserId
);
log
.
info
(
"【查询自建应用】res={}"
,
res
);
log
.
info
(
"【查询自建应用】res={}"
,
res
);
if
(
StringUtils
.
isBlank
(
res
)){
if
(
res
!=
null
&&
res
.
equals
(
"1"
))
{
log
.
info
(
"代表需要重试"
);
return
null
;
}
if
(
StringUtils
.
isBlank
(
res
)){
return
list
;
return
list
;
}
}
JSONArray
jsonArr
=
JSON
.
parseArray
(
res
);
JSONArray
jsonArr
=
JSON
.
parseArray
(
res
);
...
@@ -819,7 +823,11 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
...
@@ -819,7 +823,11 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String
wxRes
=
qywxUserApiService
.
listExternalUserid
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
wxUserId
);
String
wxRes
=
qywxUserApiService
.
listExternalUserid
(
enterprise
.
getCorpid
(),
config
.
getWxSuiteid
(),
wxUserId
);
List
<
String
>
list
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
log
.
info
(
"【查询第三方应用】res={}"
,
wxRes
);
log
.
info
(
"【查询第三方应用】res={}"
,
wxRes
);
if
(
StringUtils
.
isBlank
(
wxRes
)){
if
(
wxRes
!=
null
&&
wxRes
.
equals
(
"1"
))
{
log
.
info
(
"代表需要重试"
);
return
null
;
}
if
(
StringUtils
.
isBlank
(
wxRes
)){
return
list
;
return
list
;
}
}
JSONArray
jsonArr
=
JSON
.
parseArray
(
wxRes
);
JSONArray
jsonArr
=
JSON
.
parseArray
(
wxRes
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/friend/FriendClerkSyncNewOperation.java
View file @
134f4a30
...
@@ -38,6 +38,8 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
...
@@ -38,6 +38,8 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
private
SyncTaskService
syncTaskService
;
private
SyncTaskService
syncTaskService
;
private
static
final
String
FRIEND_LOCK
=
"haoban_fresh_wx_friend_lock_"
;
private
static
final
String
FRIEND_LOCK
=
"haoban_fresh_wx_friend_lock_"
;
private
static
final
String
TRY_AGAIN
=
"haoban_fresh_wx_friend_again_"
;
@Override
@Override
public
void
dealSingleByMq
(
DealParamMqDTO
dealParamMqDTO
,
TabHaobanPreDealLog
dataPre
)
{
public
void
dealSingleByMq
(
DealParamMqDTO
dealParamMqDTO
,
TabHaobanPreDealLog
dataPre
)
{
logger
.
info
(
"dealParamMqDTO={},dataPre={}"
,
JSON
.
toJSONString
(
dealParamMqDTO
),
JSON
.
toJSONString
(
dataPre
));
logger
.
info
(
"dealParamMqDTO={},dataPre={}"
,
JSON
.
toJSONString
(
dealParamMqDTO
),
JSON
.
toJSONString
(
dataPre
));
...
@@ -49,7 +51,11 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
...
@@ -49,7 +51,11 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
String
wxUserId
=
dataPre
.
getDataId
();
String
wxUserId
=
dataPre
.
getDataId
();
//获取所有外部联系人的外部联系人ids
//获取所有外部联系人的外部联系人ids
List
<
String
>
selfUserIdList
=
memberUnionidRelatedApiService
.
listSelfExterialList
(
wxEnterpriseId
,
wxUserId
);
List
<
String
>
selfUserIdList
=
memberUnionidRelatedApiService
.
listSelfExterialList
(
wxEnterpriseId
,
wxUserId
);
logger
.
info
(
"selfUserIdList={}"
,
selfUserIdList
.
size
());
logger
.
info
(
"selfUserIdList={}"
,
JSONObject
.
toJSONString
(
selfUserIdList
));
if
(
null
==
selfUserIdList
&&
tryAgainToMq
(
dataPre
))
{
logger
.
info
(
"自建应用调用第三方接口进入重试"
);
return
;
}
if
(
CollectionUtils
.
isEmpty
(
selfUserIdList
))
{
if
(
CollectionUtils
.
isEmpty
(
selfUserIdList
))
{
logger
.
info
(
"改用户没有外部联系人:{}"
,
JSONObject
.
toJSONString
(
dataPre
));
logger
.
info
(
"改用户没有外部联系人:{}"
,
JSONObject
.
toJSONString
(
dataPre
));
dealFlag
=
false
;
dealFlag
=
false
;
...
@@ -58,6 +64,10 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
...
@@ -58,6 +64,10 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
}
}
//第三方服务商的外部联系人
//第三方服务商的外部联系人
List
<
String
>
userIdList
=
memberUnionidRelatedApiService
.
listExterialList
(
wxEnterpriseId
,
wxUserId
);
List
<
String
>
userIdList
=
memberUnionidRelatedApiService
.
listExterialList
(
wxEnterpriseId
,
wxUserId
);
if
(
null
==
selfUserIdList
&&
tryAgainToMq
(
dataPre
))
{
logger
.
info
(
"第三方服务商外部联系人调用失败进入重试:{}"
,
dataPre
.
getDataId
());
return
;
}
if
(
CollectionUtils
.
isEmpty
(
userIdList
))
{
if
(
CollectionUtils
.
isEmpty
(
userIdList
))
{
logger
.
info
(
"改用户没有外部联系人2:{}"
,
JSONObject
.
toJSONString
(
dataPre
));
logger
.
info
(
"改用户没有外部联系人2:{}"
,
JSONObject
.
toJSONString
(
dataPre
));
dealFlag
=
false
;
dealFlag
=
false
;
...
@@ -107,6 +117,24 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
...
@@ -107,6 +117,24 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
}
}
}
}
private
boolean
tryAgainToMq
(
TabHaobanPreDealLog
dataPre
)
{
logger
.
info
(
"需要重试:{}"
,
dataPre
.
getDataId
());
String
key
=
TRY_AGAIN
+
dataPre
.
getTaskId
()
+
":"
+
dataPre
.
getDataId
();
Object
cache
=
RedisUtil
.
getCache
(
key
);
if
(
null
==
cache
)
{
RedisUtil
.
setCache
(
key
,
1
);
}
else
{
Integer
count
=
Integer
.
valueOf
(
cache
.
toString
());
if
(
count
>
5
)
{
return
false
;
}
}
HashSet
<
String
>
reTrysIds
=
new
HashSet
<>();
reTrysIds
.
add
(
dataPre
.
getDataId
());
dealDepartmentToMq
(
dataPre
.
getTaskId
(),
reTrysIds
,
SyncTaskStatusEnum
.
friend_clerk_sync
);
return
true
;
}
@Override
@Override
public
void
dealException
(
String
taskId
,
String
dataId
,
String
enterpriseId
,
String
reason
)
{
public
void
dealException
(
String
taskId
,
String
dataId
,
String
enterpriseId
,
String
reason
)
{
preDealService
.
updateStatusByDataId
(
taskId
,
dataId
,
PreDealStatusEnum
.
exception
.
getVal
(),
reason
);
preDealService
.
updateStatusByDataId
(
taskId
,
dataId
,
PreDealStatusEnum
.
exception
.
getVal
(),
reason
);
...
...
haoban-manage3-service/src/test/java/DealSyncTest.java
View file @
134f4a30
This diff is collapsed.
Click to expand it.
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