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
e2c17e9f
Commit
e2c17e9f
authored
Jul 19, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:代开发转换回退代码
parent
69437f1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
37 deletions
+0
-37
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+0
-4
QywxStaffSyncOperation.java
...ic/haoban/manage/service/task/QywxStaffSyncOperation.java
+0
-33
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
e2c17e9f
...
@@ -362,10 +362,6 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -362,10 +362,6 @@ public class StaffApiServiceImpl implements StaffApiService {
String
openUserid
=
getOpenUserid
(
userId
,
corpid
);
String
openUserid
=
getOpenUserid
(
userId
,
corpid
);
if
(
StringUtils
.
isNotBlank
(
openUserid
))
{
if
(
StringUtils
.
isNotBlank
(
openUserid
))
{
staff
.
setWxOpenUseId
(
openUserid
);
staff
.
setWxOpenUseId
(
openUserid
);
String
userid
=
getUserid
(
openUserid
,
wxEnterpriseId
);
if
(
StringUtils
.
isNotBlank
(
userid
))
{
staff
.
setWxUserId
(
userid
);
}
}
}
//成员更改或更新
//成员更改或更新
if
(
StringUtils
.
isBlank
(
staff
.
getStaffId
()))
{
if
(
StringUtils
.
isBlank
(
staff
.
getStaffId
()))
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/QywxStaffSyncOperation.java
View file @
e2c17e9f
...
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.DealParamMqDTO
;
import
com.gic.haoban.manage.api.dto.DealParamMqDTO
;
import
com.gic.haoban.manage.api.dto.SecretSettingDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.enums.PreDealStatusEnum
;
import
com.gic.haoban.manage.api.enums.PreDealStatusEnum
;
...
@@ -17,7 +16,6 @@ import com.gic.haoban.manage.service.config.Config;
...
@@ -17,7 +16,6 @@ import com.gic.haoban.manage.service.config.Config;
import
com.gic.haoban.manage.service.dao.mapper.WxApplicationMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxApplicationMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanSyncTask
;
import
com.gic.haoban.manage.service.entity.TabHaobanSyncTask
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.service.PreDealService
;
import
com.gic.haoban.manage.service.service.PreDealService
;
import
com.gic.haoban.manage.service.service.SecretSettingService
;
import
com.gic.haoban.manage.service.service.SecretSettingService
;
import
com.gic.haoban.manage.service.service.SyncTaskService
;
import
com.gic.haoban.manage.service.service.SyncTaskService
;
...
@@ -165,37 +163,6 @@ public class QywxStaffSyncOperation implements BaseSyncOperation {
...
@@ -165,37 +163,6 @@ public class QywxStaffSyncOperation implements BaseSyncOperation {
}
}
}
}
}
}
Integer
useridFlag
=
wxEnterpriseDTO
.
getUseridFlag
();
logger
.
info
(
"同步通讯录完成,批量处理wx_user_id,corpid:{},useridFlag:{}"
,
corpid
,
useridFlag
);
if
(
corpid
.
length
()
<
20
&&
useridFlag
==
1
)
{
// 限流器
RRateLimiter
rateLimiter
=
RedisUtil
.
getRedisClient
().
getRateLimiter
(
"haoban:manage3:updateWxUserId:limit"
);
// 每1秒产生5个令牌
rateLimiter
.
trySetRate
(
RateType
.
OVERALL
,
5
,
1
,
RateIntervalUnit
.
SECONDS
);
TabHaobanWxApplication
tabHaobanWxApplication
=
wxApplicationMapper
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
3
);
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
wxEnterpriseId
,
5
);
int
pageNum
=
1
;
while
(
true
)
{
// 获取令牌
rateLimiter
.
acquire
();
//企微转换最多支持1000个
//批量处理wx_user_id to wx_open_user_id
Page
<
StaffDTO
>
staffDTOPageInfo
=
staffApiService
.
listUserIdByWxEnterpriseId
(
wxEnterpriseId
,
pageNum
,
1000
);
List
<
StaffDTO
>
staffDTOS
=
staffDTOPageInfo
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
staffDTOS
))
{
logger
.
info
(
"openuseridToUserid 转换完成,为最后一个"
);
break
;
}
pageNum
++;
logger
.
info
(
"openuseridToUserid 请求:corpid:{}"
,
corpid
);
List
<
QywxNewUseridDTO
>
qywxNewUseridDTOS
=
qywxUserApiService
.
getSelfOpenuseridToUserid
(
tabHaobanWxApplication
.
getCorpid
(),
secretSetting
.
getSecretVal
(),
tabHaobanWxApplication
.
getAgentId
(),
staffDTOS
.
stream
().
map
(
StaffDTO:
:
getWxUserId
).
collect
(
Collectors
.
toList
()));
if
(
CollectionUtils
.
isNotEmpty
(
qywxNewUseridDTOS
))
{
for
(
QywxNewUseridDTO
qywxNewUseridDTO
:
qywxNewUseridDTOS
)
{
staffApiService
.
updateWxUserIdsByWxOpenUserId
(
wxEnterpriseId
,
qywxNewUseridDTO
.
getOpen_userid
(),
qywxNewUseridDTO
.
getUserid
());
}
}
}
}
}
}
}
}
RedisUtil
.
unlock
(
key
);
RedisUtil
.
unlock
(
key
);
...
...
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