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
a27f8807
Commit
a27f8807
authored
May 22, 2021
by
吴泽佳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改取值逻辑
parent
629a12db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
OrgSyncByWxcpJob.java
...main/java/com/tanpu/feo/feojob/jobs/OrgSyncByWxcpJob.java
+6
-6
OrgSyncByWxcpService.java
...m/tanpu/feo/feojob/jobs/service/OrgSyncByWxcpService.java
+8
-8
No files found.
src/main/java/com/tanpu/feo/feojob/jobs/OrgSyncByWxcpJob.java
View file @
a27f8807
...
@@ -33,8 +33,7 @@ import java.util.*;
...
@@ -33,8 +33,7 @@ import java.util.*;
@Slf4j
@Slf4j
public
class
OrgSyncByWxcpJob
{
public
class
OrgSyncByWxcpJob
{
final
static
String
keyStr
=
"{\"corpId\":\"ww08675a3a48c9e8a2\",\"agentId\":\"1000006\",\"corpSecret\":\"VNh2sdxSOPJ0wcHVoWWUrcCjXFXPsxOs12KkAogyCQI\",\"token\":\"jyzyceshi888\",\"aesKey\":\"wHkEDvDLOM8xqiuGn0VCeN9rtJWgeaQ12cxKpcmWsSS\",\"sendMessageAppId\":\"wxe177c62fa1e1c602\"}\n"
;
final
static
String
keyStr
=
"{\"corpId\":\"ww08675a3a48c9e8a2\",\"agentId\":\"1000013\",\"corpSecret\":\"l7eLNC5DDNxmucc9emHsEaSXym4VKDy_D5w4IoOpvqk\",\"token\":\"E1zDvDkXWt\",\"aesKey\":\"43P8lbP5yt8AHLOUPGBPS252c60K9Vzofzm5NOxHHeP\",\"sendMessageAppId\":\"wxe177c62fa1e1c602\"}\n"
;
@Resource
@Resource
private
OrgExtService
orgExtService
;
private
OrgExtService
orgExtService
;
@Resource
@Resource
...
@@ -309,7 +308,7 @@ public class OrgSyncByWxcpJob {
...
@@ -309,7 +308,7 @@ public class OrgSyncByWxcpJob {
}
}
//更新
//更新
Long
parentId1
=
wxCpDepartDto
.
getParentId
();
Long
parentId1
=
wxCpDepartDto
.
getParentId
();
String
parentId
=
parentId1
==
1
?
null
:
orgId
+
"_"
+
parentId1
;
String
parentId
=
ObjectUtil
.
isNull
(
hashMap2
.
get
(
parentId1
))
?
null
:
orgId
+
"_"
+
parentId1
;
// ObjectUtil.isNull(hashMap2.get(parentId1))
if
(!
department
.
getDepartmentName
().
equals
(
wxCpDepartDto
.
getName
())
||
StrUtil
.
compareIgnoreCase
(
department
.
getParentDepartId
(),
parentId
,
false
)
!=
0
if
(!
department
.
getDepartmentName
().
equals
(
wxCpDepartDto
.
getName
())
||
StrUtil
.
compareIgnoreCase
(
department
.
getParentDepartId
(),
parentId
,
false
)
!=
0
||
!
department
.
getMembers
().
equals
(
wxCpDepartDto
.
getMembers
()))
{
||
!
department
.
getMembers
().
equals
(
wxCpDepartDto
.
getMembers
()))
{
department
.
setDepartmentName
(
wxCpDepartDto
.
getName
());
department
.
setDepartmentName
(
wxCpDepartDto
.
getName
());
...
@@ -323,7 +322,7 @@ public class OrgSyncByWxcpJob {
...
@@ -323,7 +322,7 @@ public class OrgSyncByWxcpJob {
for
(
String
departmentId
:
hashMap
.
keySet
())
{
for
(
String
departmentId
:
hashMap
.
keySet
())
{
WxCpDepartDto
wxCpDepartDto
=
hashMap
.
get
(
departmentId
);
WxCpDepartDto
wxCpDepartDto
=
hashMap
.
get
(
departmentId
);
Long
parentId1
=
wxCpDepartDto
.
getParentId
();
Long
parentId1
=
wxCpDepartDto
.
getParentId
();
String
parentId
=
parentId1
==
1
?
null
:
orgId
+
"_"
+
parentId1
;
String
parentId
=
ObjectUtil
.
isNull
(
hashMap2
.
get
(
parentId1
))
?
null
:
orgId
+
"_"
+
parentId1
;
Department
department
=
new
Department
();
Department
department
=
new
Department
();
department
.
setDepartmentId
(
orgId
+
"_"
+
wxCpDepartDto
.
getId
());
department
.
setDepartmentId
(
orgId
+
"_"
+
wxCpDepartDto
.
getId
());
department
.
setParentDepartId
(
parentId
);
department
.
setParentDepartId
(
parentId
);
...
@@ -340,10 +339,11 @@ public class OrgSyncByWxcpJob {
...
@@ -340,10 +339,11 @@ public class OrgSyncByWxcpJob {
}
}
private
Integer
getLevel
(
HashMap
<
Long
,
WxCpDepartDto
>
hashMap2
,
Long
id
)
{
private
Integer
getLevel
(
HashMap
<
Long
,
WxCpDepartDto
>
hashMap2
,
Long
id
)
{
if
(
hashMap2
.
get
(
id
).
getParentId
()
==
1
)
{
Long
parentId
=
hashMap2
.
get
(
id
).
getParentId
();
if
(
ObjectUtil
.
isNull
(
hashMap2
.
get
(
parentId
)))
{
return
1
;
return
1
;
}
}
return
1
+
getLevel
(
hashMap2
,
hashMap2
.
get
(
id
).
getParentId
()
);
return
1
+
getLevel
(
hashMap2
,
parentId
);
}
}
private
WorkDataDto
<
Employee
>
employeeWork
(
String
orgId
,
List
<
WxCpDepartDto
>
wxCpDepartDtoList
,
String
corpId
)
{
private
WorkDataDto
<
Employee
>
employeeWork
(
String
orgId
,
List
<
WxCpDepartDto
>
wxCpDepartDtoList
,
String
corpId
)
{
...
...
src/main/java/com/tanpu/feo/feojob/jobs/service/OrgSyncByWxcpService.java
View file @
a27f8807
...
@@ -82,14 +82,14 @@ public class OrgSyncByWxcpService {
...
@@ -82,14 +82,14 @@ public class OrgSyncByWxcpService {
employee
.
setUpdateBy
(
"SYS"
);
employee
.
setUpdateBy
(
"SYS"
);
employee
.
setUpdateTime
(
now
);
employee
.
setUpdateTime
(
now
);
employee
.
setDeleteTag
(
"1"
);
employee
.
setDeleteTag
(
"1"
);
employeeMapper
.
dele
teById
(
employee
);
employeeMapper
.
upda
teById
(
employee
);
}
}
List
<
Employee
>
workEmployeeUpdateList
=
workEmployee
.
getUpdateList
();
List
<
Employee
>
workEmployeeUpdateList
=
workEmployee
.
getUpdateList
();
for
(
Employee
employee
:
workEmployeeUpdateList
)
{
for
(
Employee
employee
:
workEmployeeUpdateList
)
{
employee
.
setUpdateBy
(
"SYS"
);
employee
.
setUpdateBy
(
"SYS"
);
employee
.
setUpdateTime
(
now
);
employee
.
setUpdateTime
(
now
);
employee
.
setDeleteTag
(
"0"
);
employee
.
setDeleteTag
(
"0"
);
employeeMapper
.
dele
teById
(
employee
);
employeeMapper
.
upda
teById
(
employee
);
}
}
//3
//3
...
@@ -107,14 +107,14 @@ public class OrgSyncByWxcpService {
...
@@ -107,14 +107,14 @@ public class OrgSyncByWxcpService {
department
.
setUpdateBy
(
"SYS"
);
department
.
setUpdateBy
(
"SYS"
);
department
.
setUpdateTime
(
now
);
department
.
setUpdateTime
(
now
);
department
.
setDeleteTag
(
"1"
);
department
.
setDeleteTag
(
"1"
);
departmentMapper
.
dele
teById
(
department
);
departmentMapper
.
upda
teById
(
department
);
}
}
List
<
Department
>
workDepartmentUpdateList
=
workDepartment
.
getUpdateList
();
List
<
Department
>
workDepartmentUpdateList
=
workDepartment
.
getUpdateList
();
for
(
Department
department
:
workDepartmentUpdateList
)
{
for
(
Department
department
:
workDepartmentUpdateList
)
{
department
.
setUpdateBy
(
"SYS"
);
department
.
setUpdateBy
(
"SYS"
);
department
.
setUpdateTime
(
now
);
department
.
setUpdateTime
(
now
);
department
.
setDeleteTag
(
"0"
);
department
.
setDeleteTag
(
"0"
);
departmentMapper
.
dele
teById
(
department
);
departmentMapper
.
upda
teById
(
department
);
}
}
//4
//4
List
<
DepartmentEmployee
>
workDepartmentEmployeeInsertList
=
workDepartmentEmployee
.
getInsertList
();
List
<
DepartmentEmployee
>
workDepartmentEmployeeInsertList
=
workDepartmentEmployee
.
getInsertList
();
...
@@ -131,14 +131,14 @@ public class OrgSyncByWxcpService {
...
@@ -131,14 +131,14 @@ public class OrgSyncByWxcpService {
departmentEmployee
.
setUpdateBy
(
"SYS"
);
departmentEmployee
.
setUpdateBy
(
"SYS"
);
departmentEmployee
.
setUpdateTime
(
now
);
departmentEmployee
.
setUpdateTime
(
now
);
departmentEmployee
.
setDeleteTag
(
"1"
);
departmentEmployee
.
setDeleteTag
(
"1"
);
departmentEmployeeMapper
.
dele
teById
(
departmentEmployee
);
departmentEmployeeMapper
.
upda
teById
(
departmentEmployee
);
}
}
List
<
DepartmentEmployee
>
workDepartmentEmployeeUpdateList
=
workDepartmentEmployee
.
getUpdateList
();
List
<
DepartmentEmployee
>
workDepartmentEmployeeUpdateList
=
workDepartmentEmployee
.
getUpdateList
();
for
(
DepartmentEmployee
departmentEmployee
:
workDepartmentEmployeeUpdateList
)
{
for
(
DepartmentEmployee
departmentEmployee
:
workDepartmentEmployeeUpdateList
)
{
departmentEmployee
.
setUpdateBy
(
"SYS"
);
departmentEmployee
.
setUpdateBy
(
"SYS"
);
departmentEmployee
.
setUpdateTime
(
now
);
departmentEmployee
.
setUpdateTime
(
now
);
departmentEmployee
.
setDeleteTag
(
"0"
);
departmentEmployee
.
setDeleteTag
(
"0"
);
departmentEmployeeMapper
.
dele
teById
(
departmentEmployee
);
departmentEmployeeMapper
.
upda
teById
(
departmentEmployee
);
}
}
//5
//5
List
<
EmployeeRole
>
workEmployeeRoleInsertList
=
workEmployeeRole
.
getInsertList
();
List
<
EmployeeRole
>
workEmployeeRoleInsertList
=
workEmployeeRole
.
getInsertList
();
...
@@ -155,14 +155,14 @@ public class OrgSyncByWxcpService {
...
@@ -155,14 +155,14 @@ public class OrgSyncByWxcpService {
employeeRole
.
setUpdateBy
(
"SYS"
);
employeeRole
.
setUpdateBy
(
"SYS"
);
employeeRole
.
setUpdateTime
(
now
);
employeeRole
.
setUpdateTime
(
now
);
employeeRole
.
setDeleteTag
(
"1"
);
employeeRole
.
setDeleteTag
(
"1"
);
employeeRoleMapper
.
dele
teById
(
employeeRole
);
employeeRoleMapper
.
upda
teById
(
employeeRole
);
}
}
List
<
EmployeeRole
>
workEmployeeRoleUpdateList
=
workEmployeeRole
.
getUpdateList
();
List
<
EmployeeRole
>
workEmployeeRoleUpdateList
=
workEmployeeRole
.
getUpdateList
();
for
(
EmployeeRole
employeeRole
:
workEmployeeRoleUpdateList
)
{
for
(
EmployeeRole
employeeRole
:
workEmployeeRoleUpdateList
)
{
employeeRole
.
setUpdateBy
(
"SYS"
);
employeeRole
.
setUpdateBy
(
"SYS"
);
employeeRole
.
setUpdateTime
(
now
);
employeeRole
.
setUpdateTime
(
now
);
employeeRole
.
setDeleteTag
(
"0"
);
employeeRole
.
setDeleteTag
(
"0"
);
employeeRoleMapper
.
dele
teById
(
employeeRole
);
employeeRoleMapper
.
upda
teById
(
employeeRole
);
}
}
return
assetsArrayList
;
return
assetsArrayList
;
}
}
...
...
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