Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
8c768cca
Commit
8c768cca
authored
Feb 21, 2022
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
每次请求单独获取access_token
parent
0f30d2f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
WechatFollowServiceImpl.java
...oup/xyqb/service/wechat/impl/WechatFollowServiceImpl.java
+12
-4
No files found.
src/main/java/cn/quantgroup/xyqb/service/wechat/impl/WechatFollowServiceImpl.java
View file @
8c768cca
...
...
@@ -151,7 +151,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
}
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"
excuateWechatFollowStatus
--{}"
,
ex
.
getMessage
());
log
.
error
(
"
同步微信公众号数据失败
--{}"
,
ex
.
getMessage
());
return
null
;
}
return
null
;
...
...
@@ -189,7 +189,7 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
System
.
out
.
println
(
userIdList
);
if
(!
userIdList
.
isEmpty
())
{
// 批量查询客户详情
batchQueryCustomerDetailInfo
(
accessTokenResponse
.
getAccessToken
(),
userIdList
,
""
,
period
);
batchQueryCustomerDetailInfo
(
userIdList
,
""
,
period
);
}
}
System
.
out
.
println
(
departmentListResponse
);
...
...
@@ -203,7 +203,14 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
return
null
;
}
private
void
batchQueryCustomerDetailInfo
(
String
accessToken
,
List
<
String
>
userIdList
,
String
cursor
,
Integer
period
)
{
private
JsonResult
batchQueryCustomerDetailInfo
(
List
<
String
>
userIdList
,
String
cursor
,
Integer
period
)
{
String
response
=
httpService
.
get
(
qyAccessTokenUrl
);
if
(
StringUtils
.
isEmpty
(
response
))
{
return
null
;
}
AccessTokenResponse
accessTokenResponse
=
JSONObject
.
parseObject
(
response
,
AccessTokenResponse
.
class
);
String
accessToken
=
accessTokenResponse
.
getAccessToken
();
// 查询客户详情
HashMap
<
String
,
Object
>
parameters
=
new
HashMap
<>();
parameters
.
put
(
"userid_list"
,
userIdList
);
...
...
@@ -228,9 +235,10 @@ public class WechatFollowServiceImpl implements IWechatFollowService {
// 根据unionid 添加现有指定信息
// 判断nextCursor不为空,继续获取更多客户
if
(!
""
.
equals
(
customerListResponse
.
getNextCursor
()))
{
batchQueryCustomerDetailInfo
(
accessToken
,
userIdList
,
customerListResponse
.
getNextCursor
(),
period
);
batchQueryCustomerDetailInfo
(
userIdList
,
customerListResponse
.
getNextCursor
(),
period
);
}
}
return
JsonResult
.
buildSuccessResult
();
}
private
void
initTask
()
{
...
...
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