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
6793fcf3
Commit
6793fcf3
authored
Jul 19, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://git.gicdev.com/haoban3.0/haoban-manage3.0.git
into developer
parents
b700a341
e2c17e9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
38 deletions
+5
-38
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+0
-4
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+5
-1
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 @
6793fcf3
...
...
@@ -362,10 +362,6 @@ public class StaffApiServiceImpl implements StaffApiService {
String
openUserid
=
getOpenUserid
(
userId
,
corpid
);
if
(
StringUtils
.
isNotBlank
(
openUserid
))
{
staff
.
setWxOpenUseId
(
openUserid
);
String
userid
=
getUserid
(
openUserid
,
wxEnterpriseId
);
if
(
StringUtils
.
isNotBlank
(
userid
))
{
staff
.
setWxUserId
(
userid
);
}
}
//成员更改或更新
if
(
StringUtils
.
isBlank
(
staff
.
getStaffId
()))
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
6793fcf3
...
...
@@ -231,6 +231,10 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
Long
hmId
=
hmQrcodeQDTO
.
getHmId
();
HmQrcodeBO
hmQrcodeBO
=
hmQrcodeService
.
queryById
(
hmId
);
if
(
hmQrcodeBO
==
null
)
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"该活码不存在"
);
}
Integer
hmType
=
hmQrcodeQDTO
.
getHmType
();
List
<
String
>
clerkIdList
=
setStoreClerk
(
hmQrcodeQDTO
,
wxEnterpriseId
,
hmId
,
hmType
);
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
...
...
@@ -239,10 +243,10 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
//更新活码
QywxExternalcontactDTO
qywxExternalcontactDTO
=
new
QywxExternalcontactDTO
();
qywxExternalcontactDTO
.
setType
(
hmQrcodeQDTO
.
getHmType
());
qywxExternalcontactDTO
.
setScene
(
2
);
qywxExternalcontactDTO
.
setRemark
(
hmQrcodeQDTO
.
getName
());
qywxExternalcontactDTO
.
setSkipVerify
(
hmQrcodeQDTO
.
getPassFlag
()
==
1
);
qywxExternalcontactDTO
.
setState
(
"HM"
+
hmId
);
qywxExternalcontactDTO
.
setConfigId
(
hmQrcodeBO
.
getWxConfigId
());
List
<
String
>
userIds
=
staffClerkRelationService
.
listWxUserIdByClerkIds
(
clerkIdList
,
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
userIds
))
{
return
ServiceResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()),
"导购未关联好办"
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/QywxStaffSyncOperation.java
View file @
6793fcf3
...
...
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
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.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.enums.PreDealStatusEnum
;
...
...
@@ -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.entity.TabHaobanPreDealLog
;
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.SecretSettingService
;
import
com.gic.haoban.manage.service.service.SyncTaskService
;
...
...
@@ -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
);
...
...
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