Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
fbafa87d
Commit
fbafa87d
authored
Apr 14, 2023
by
daijunxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改定时任务人员储存为空
parent
e8957d26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
32 deletions
+35
-32
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+35
-32
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
fbafa87d
...
...
@@ -15,6 +15,7 @@ import com.mortals.xhx.module.dept.model.DeptEntity;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.staff.dao.ibatis.StaffDaoImpl
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -39,6 +40,9 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
@Autowired
private
DeptService
deptService
;
@Autowired
private
StaffService
service
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
log
.
info
(
"同步用户--部门"
);
...
...
@@ -52,22 +56,22 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
//查询数据库信息
DeptEntity
deptEntity
=
deptDao
.
queryDept
(
listDept
.
getOrgIndexCode
());
DeptEntity
deptEntityParent
=
deptDao
.
queryDeptParient
(
listDept
.
getParentOrgIndexCode
());
DeptEntity
deptEntity1
=
new
DeptEntity
();
if
(
Objects
.
isNull
(
deptEntity
))
{
if
(
Objects
.
nonNull
(
deptEntityParent
))
{
deptEntity
1
.
setParentId
(
deptEntityParent
.
getId
());
deptEntity
.
setParentId
(
deptEntityParent
.
getId
());
}
deptEntity
1
.
setDeptName
(
listDept
.
getOrgName
());
deptEntity
1
.
setDeptCode
(
listDept
.
getOrgIndexCode
());
deptEntity
1
.
setAncestors
(
listDept
.
getOrgPath
());
deptEntity
1
.
setDeptStatus
(
1
);
deptEntity
1
.
setOrderNum
(
0
);
deptEntity
1
.
setRemark
(
listDept
.
getParentOrgIndexCode
());
deptEntity
1
.
setCreateTime
(
new
Date
());
deptEntity
1
.
setCreateUserId
(
Long
.
valueOf
(
1
));
deptEntity
1
.
setUpdateTime
(
new
Date
());
deptEntity
1
.
setUpdateUserId
(
Long
.
valueOf
(
1
));
deptService
.
save
(
deptEntity
1
);
deptEntity
.
setDeptName
(
listDept
.
getOrgName
());
deptEntity
.
setDeptCode
(
listDept
.
getOrgIndexCode
());
deptEntity
.
setAncestors
(
listDept
.
getOrgPath
());
deptEntity
.
setDeptStatus
(
1
);
deptEntity
.
setOrderNum
(
0
);
deptEntity
.
setRemark
(
listDept
.
getParentOrgIndexCode
());
deptEntity
.
setCreateTime
(
new
Date
());
deptEntity
.
setCreateUserId
(
Long
.
valueOf
(
1
));
deptEntity
.
setUpdateTime
(
new
Date
());
deptEntity
.
setUpdateUserId
(
Long
.
valueOf
(
1
));
deptService
.
save
(
deptEntity
);
}
else
{
if
(
Objects
.
nonNull
(
deptEntityParent
))
{
deptEntity
.
setParentId
(
deptEntityParent
.
getId
());
...
...
@@ -94,27 +98,27 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
//判断本地数据是否为空
if
(
Objects
.
isNull
(
staffEntity1
))
{
//如果为空则将数据存入数据库
StaffEntity
staffEntity
=
new
StaffEntity
();
if
(
Objects
.
nonNull
(
deptEntity
))
{
staffEntity
.
setDeptId
(
deptEntity
.
getId
());
staffEntity1
.
initAttrValue
();
if
(
Objects
.
nonNull
(
staffEntity1
))
{
staffEntity
1
.
setDeptId
(
deptEntity
.
getId
());
}
staffEntity
.
setName
(
list
.
getPersonName
());
staffEntity
.
setRemarkId
(
list
.
getPersonId
());
staffEntity
.
setPhotoPath
(
list
.
getPersonPhoto
().
getPicUri
());
staffEntity
.
setDeptName
(
list
.
getOrgName
());
staffEntity
.
setSource
(
1
);
staffEntity
.
setStatus
(
1
);
staffEntity
.
setGender
(
list
.
getGender
());
staffEntity
.
setWorkNum
(
list
.
getJobNo
());
staffEntity
.
setCreateUserId
(
Long
.
valueOf
(
1
));
staffEntity
.
setCreateTime
(
new
Date
());
staffEntity
1
.
setName
(
list
.
getPersonName
());
staffEntity
1
.
setRemarkId
(
list
.
getPersonId
());
staffEntity
1
.
setPhotoPath
(
list
.
getPersonPhoto
().
getPicUri
());
staffEntity
1
.
setDeptName
(
list
.
getOrgName
());
staffEntity
1
.
setSource
(
1
);
staffEntity
1
.
setStatus
(
1
);
staffEntity
1
.
setGender
(
list
.
getGender
());
staffEntity
1
.
setWorkNum
(
list
.
getJobNo
());
staffEntity
1
.
setCreateUserId
(
Long
.
valueOf
(
1
));
staffEntity
1
.
setCreateTime
(
new
Date
());
if
(
list
.
getBirthday
()
!=
null
)
{
staffEntity
.
setBirthday
((
Date
)
list
.
getBirthday
());
staffEntity
1
.
setBirthday
((
Date
)
list
.
getBirthday
());
}
if
(
list
.
getPhoneNo
()
!=
null
)
{
staffEntity
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
staffEntity
1
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
}
s
taffDao
.
insert
(
staffEntity
);
s
ervice
.
save
(
staffEntity1
);
DeptEntity
deptEntity1
=
deptService
.
get
(
staffEntity1
.
getDeptId
());
String
ancestor
=
deptEntity1
.
getAncestors
().
split
(
","
,
2
)[
1
];
String
[]
ancestors
=
ancestor
.
split
(
","
);
...
...
@@ -135,6 +139,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
//本地数据不为空
else
{
//执行修改
staffEntity1
.
initAttrValue
();
if
(
Objects
.
nonNull
(
deptEntity
))
{
staffEntity1
.
setDeptId
(
deptEntity
.
getId
());
}
...
...
@@ -142,8 +147,6 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity1
.
setRemarkId
(
list
.
getPersonId
());
staffEntity1
.
setPhotoPath
(
list
.
getPersonPhoto
().
getPicUri
());
staffEntity1
.
setDeptName
(
list
.
getOrgName
());
staffEntity1
.
setSource
(
1
);
staffEntity1
.
setStatus
(
1
);
staffEntity1
.
setGender
(
list
.
getGender
());
staffEntity1
.
setWorkNum
(
list
.
getJobNo
());
staffEntity1
.
setCreateUserId
(
Long
.
valueOf
(
1
));
...
...
@@ -154,7 +157,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
if
(
list
.
getPhoneNo
()
!=
null
)
{
staffEntity1
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
}
s
taffDao
.
update
(
staffEntity1
);
s
ervice
.
update
(
staffEntity1
);
DeptEntity
deptEntity1
=
deptService
.
get
(
staffEntity1
.
getDeptId
());
String
ancestor
=
deptEntity1
.
getAncestors
().
split
(
","
,
2
)[
1
];
String
[]
ancestors
=
ancestor
.
split
(
","
);
...
...
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