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
3ea6b73b
Commit
3ea6b73b
authored
Jan 19, 2022
by
钱坤
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into dev
parents
773b6e3d
76faa63f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
OrgSyncByWxcpJob.java
...main/java/com/tanpu/feo/feojob/jobs/OrgSyncByWxcpJob.java
+12
-6
No files found.
src/main/java/com/tanpu/feo/feojob/jobs/OrgSyncByWxcpJob.java
View file @
3ea6b73b
...
...
@@ -67,7 +67,7 @@ public class OrgSyncByWxcpJob {
@Resource
private
FeignClientForFatools
feignClientForFatools
;
@Scheduled
(
cron
=
"10 0/
3
0 6-19/1 * * ?"
)
//每日凌晨6点30开始执行,半小时检查一次
@Scheduled
(
cron
=
"10 0/
1
0 6-19/1 * * ?"
)
//每日凌晨6点30开始执行,半小时检查一次
public
void
execute
()
{
log
.
info
(
"====== 开始执行OrgSyncByWxcpJob ======"
);
try
{
...
...
@@ -181,7 +181,7 @@ public class OrgSyncByWxcpJob {
List
<
WxCpUser
>
wxCpUserList
=
wxCpDepartDto
.
getWxCpUserList
();
for
(
WxCpUser
wxCpUser
:
wxCpUserList
)
{
// key employee_id + '&' + role_id
String
type
=
wxCpUser
.
getIsLeader
()
==
1
?
RoleTypeEnum
.
TEAM
.
code
:
RoleTypeEnum
.
IFA
.
code
;
String
type
=
wxCpUser
.
getIsLeader
()
!=
null
&&
wxCpUser
.
getIsLeader
()
==
1
?
RoleTypeEnum
.
TEAM
.
code
:
RoleTypeEnum
.
IFA
.
code
;
hashMap
.
put
(
corpId
+
"_"
+
wxCpUser
.
getUserId
()
+
"&"
+
roleMap
.
get
(
type
),
wxCpUser
);
}
}
...
...
@@ -257,7 +257,7 @@ public class OrgSyncByWxcpJob {
continue
;
}
//更新
String
type
=
wxCpUser
.
getIsLeader
()
==
1
?
EmployeeDutyEnum
.
DIRECTOR
.
code
:
EmployeeDutyEnum
.
STAFF
.
code
;
String
type
=
wxCpUser
.
getIsLeader
()
!=
null
&&
wxCpUser
.
getIsLeader
()
==
1
?
EmployeeDutyEnum
.
DIRECTOR
.
code
:
EmployeeDutyEnum
.
STAFF
.
code
;
if
(!
departmentEmployee
.
getType
().
equals
(
type
))
{
departmentEmployee
.
setType
(
type
);
updateList
.
add
(
departmentEmployee
);
...
...
@@ -266,7 +266,7 @@ public class OrgSyncByWxcpJob {
}
for
(
String
s
:
hashMap
.
keySet
())
{
WxCpUser
wxCpUser
=
hashMap
.
get
(
s
);
String
type
=
wxCpUser
.
getIsLeader
()
==
1
?
EmployeeDutyEnum
.
DIRECTOR
.
code
:
EmployeeDutyEnum
.
STAFF
.
code
;
String
type
=
wxCpUser
.
getIsLeader
()
!=
null
&&
wxCpUser
.
getIsLeader
()
==
1
?
EmployeeDutyEnum
.
DIRECTOR
.
code
:
EmployeeDutyEnum
.
STAFF
.
code
;
String
[]
split
=
s
.
split
(
"&"
);
String
departmentId
=
split
[
0
];
String
employeeId
=
split
[
1
];
...
...
@@ -460,8 +460,10 @@ public class OrgSyncByWxcpJob {
||
!
wxCpUser
.
getUserId
().
equals
(
userInfo
.
getWxcpUid
())
||
StrUtil
.
isBlankIfStr
(
userInfo
.
getUiWechatXcxQrcode
())
||
!
userInfo
.
getUiShenfen
().
equals
(
String
.
valueOf
(
wxCpUser
.
getIsLeader
()))
||
!
StringUtils
.
equals
(
userInfo
.
getUiHeadimg
(),
wxCpUser
.
getThumbAvatar
()))
{
if
(
StringUtils
.
equals
(
userInfo
.
getUiHeadimg
(),
wxCpUser
.
getThumbAvatar
()))
{
log
.
info
(
"用户头像未变化,无须重新生成qrcode,{}"
,
JsonUtil
.
toJson
(
userInfo
));
if
((
StringUtils
.
equals
(
userInfo
.
getUiHeadimg
(),
wxCpUser
.
getThumbAvatar
())
||
StringUtils
.
isBlank
(
userInfo
.
getUiHeadimg
())
&&
StringUtils
.
isBlank
(
wxCpUser
.
getThumbAvatar
()))
&&
StringUtils
.
isNotBlank
(
userInfo
.
getUiWechatXcxQrcode
()))
{
log
.
info
(
"用户头像未变化,无须重新生成qrcode,{}, {}"
,
JsonUtil
.
toJson
(
userInfo
),
JsonUtil
.
toJson
(
wxCpUser
));
}
else
{
userInfo
.
setUiWechatXcxQrcode
(
orgSyncService
.
createWechatXcxQrcode
(
userInfo
.
getId
(),
wxCpUser
.
getThumbAvatar
(),
qrCodeUrl
));
}
...
...
@@ -543,6 +545,10 @@ public class OrgSyncByWxcpJob {
for
(
WxCpDepart
wxCpDepart
:
wxCpDepartList
)
{
try
{
List
<
WxCpUser
>
wxCpUsers
=
cpService
.
getUserService
().
listByDepartment
(
wxCpDepart
.
getId
(),
Boolean
.
FALSE
,
0
);
if
(
wxCpUsers
==
null
)
{
wxCpUsers
=
new
ArrayList
<>();
}
wxCpUsers
.
stream
().
filter
(
p
->
p
.
getIsLeader
()
==
null
).
forEach
(
p
->
p
.
setIsLeader
(
0
));
WxCpDepartDto
wxCpDepartDto
=
new
WxCpDepartDto
();
BeanUtil
.
copyProperties
(
wxCpDepart
,
wxCpDepartDto
,
true
);
wxCpDepartDto
.
setWxCpUserList
(
wxCpUsers
);
...
...
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