Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
feo-jobs
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
feo-jobs
Commits
5a481232
Commit
5a481232
authored
Nov 24, 2021
by
钱坤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
从企微同步人员信息时候记录一下概要,不然像恒泰这样几千人一直在同步的,都不知道具体啥原因
parent
e7a0f333
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
OrgSyncByWxcpJob.java
...main/java/com/tanpu/feo/feojob/jobs/OrgSyncByWxcpJob.java
+17
-5
No files found.
src/main/java/com/tanpu/feo/feojob/jobs/OrgSyncByWxcpJob.java
View file @
5a481232
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.crypto.digest.MD5
;
import
cn.hutool.json.JSONUtil
;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.feo.feojob.constant.BaseConstant
;
import
com.tanpu.feo.feojob.constant.OrgExtConstant
;
import
com.tanpu.feo.feojob.dao.user.entity.*
;
...
...
@@ -30,10 +31,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -112,13 +110,15 @@ public class OrgSyncByWxcpJob {
}
log
.
info
(
"======从企业微信获取组织信息及员工信息 结束======"
);
logOrgManSimpleInfo
(
orgId
,
wxCpDepartDtoList
);
//4 判断是否需要 同步
String
digestHex
=
isExecute
(
isAuto
,
wxCpDepartDtoList
,
orgExtEntity
.
getMd5WxcpData
());
log
.
info
(
"====== 机构:{}整体digest, old: {}, new: {}======="
,
orgId
,
orgExtEntity
.
getMd5WxcpData
(),
digestHex
);
if
(
StrUtil
.
isBlank
(
digestHex
))
{
log
.
info
(
"====== 机构:{} 不需要执行同步======="
,
orgId
);
continue
;
}
String
qrCodeUrl
=
getQrCodeUrl
(
orgEntity
.
getId
());
//5 开始比对 5张表 数据 user_info employee department department_employee employee_role
...
...
@@ -141,6 +141,18 @@ public class OrgSyncByWxcpJob {
}
private
void
logOrgManSimpleInfo
(
String
orgId
,
List
<
WxCpDepartDto
>
wxCpDepartDtoList
)
{
if
(
CollectionUtils
.
isEmpty
(
wxCpDepartDtoList
))
{
log
.
info
(
"机构{}当前无部门人员信息"
,
orgId
);
return
;
}
Map
<
String
,
Integer
>
map
=
new
LinkedHashMap
<>(
wxCpDepartDtoList
.
size
());
for
(
WxCpDepartDto
departDto
:
wxCpDepartDtoList
)
{
map
.
put
(
departDto
.
getName
()
+
","
+
departDto
.
getEnName
()
+
","
+
departDto
.
getId
(),
departDto
.
getMembers
());
}
log
.
info
(
"机构{}当前部门数:{}, 人员数概要是: {}"
,
orgId
,
wxCpDepartDtoList
.
size
(),
JsonUtil
.
toJson
(
map
));
}
private
String
getQrCodeUrl
(
String
orgId
)
{
CommonResp
<
String
>
commonResp
=
feignClientForFatools
.
getQrCodeUrl
(
orgId
);
if
(
commonResp
.
isNotSuccess
())
{
...
...
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