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
acdc81a7
Commit
acdc81a7
authored
Mar 28, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改同步
parent
951fc619
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
49 deletions
+49
-49
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
...rtals/xhx/module/staff/service/impl/StaffServiceImpl.java
+49
-49
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
acdc81a7
...
@@ -511,62 +511,62 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -511,62 +511,62 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
try
{
try
{
for
(
DoorEntity
doorEntity
:
doorEntities
)
{
for
(
DoorEntity
doorEntity
:
doorEntities
)
{
StaffReq
staffReq
=
new
StaffReq
();
StaffReq
staffReq
=
new
StaffReq
();
Rest
<
UserSearchInfo
>
personCountRest
=
hikStaffService
.
getPersonCount
(
staffReq
,
doorEntity
);
Rest
<
UserSearchInfo
>
personCountRest
=
hikStaffService
.
getPersonCount
(
staffReq
,
doorEntity
);
if
(
personCountRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
if
(
personCountRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
int
totalNum
=
personCountRest
.
getData
().
getUserInfoSearch
().
getTotalMatches
();
int
totalNum
=
personCountRest
.
getData
().
getUserInfoSearch
().
getTotalMatches
();
int
size
=
30
;
int
size
=
30
;
int
pages
=
totalNum
/
size
;
int
pages
=
totalNum
/
size
;
for
(
int
i
=
0
;
i
<=
pages
;
i
++)
{
for
(
int
i
=
0
;
i
<=
pages
;
i
++)
{
StaffReq
searchReq
=
new
StaffReq
();
StaffReq
searchReq
=
new
StaffReq
();
searchReq
.
setPageNo
(
i
);
searchReq
.
setPageNo
(
i
);
searchReq
.
setPageSize
(
size
);
searchReq
.
setPageSize
(
size
);
Rest
<
UserSearchInfo
>
rest
=
hikStaffService
.
getPersonList
(
searchReq
,
doorEntity
);
Rest
<
UserSearchInfo
>
rest
=
hikStaffService
.
getPersonList
(
searchReq
,
doorEntity
);
if
(
rest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
if
(
rest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
//做差集 更新本地用户为离职员工
//做差集 更新本地用户为离职员工
UserInfoSearch
userInfoSearch
=
rest
.
getData
().
getUserInfoSearch
();
UserInfoSearch
userInfoSearch
=
rest
.
getData
().
getUserInfoSearch
();
List
<
UserInfoItem
>
userInfoList
=
userInfoSearch
.
getUserInfo
();
List
<
UserInfoItem
>
userInfoList
=
userInfoSearch
.
getUserInfo
();
for
(
UserInfoItem
userInfoItem
:
userInfoList
)
{
for
(
UserInfoItem
userInfoItem
:
userInfoList
)
{
if
(
ObjectUtils
.
isEmpty
(
userInfoItem
.
getEmployeeNo
()))
{
if
(
ObjectUtils
.
isEmpty
(
userInfoItem
.
getEmployeeNo
()))
{
log
.
info
(
"EmployeeNo is null ==>{}"
,
JSON
.
toJSONString
(
userInfoItem
));
log
.
info
(
"EmployeeNo is null ==>{}"
,
JSON
.
toJSONString
(
userInfoItem
));
continue
;
continue
;
}
}
if
(
staffCollect
.
containsKey
(
userInfoItem
.
getEmployeeNo
()))
{
if
(
staffCollect
.
containsKey
(
userInfoItem
.
getEmployeeNo
()))
{
staffCollect
.
remove
(
userInfoItem
.
getEmployeeNo
());
staffCollect
.
remove
(
userInfoItem
.
getEmployeeNo
());
}
}
StaffEntity
staffEntity
=
this
.
getExtCache
(
StrUtil
.
padPre
(
userInfoItem
.
getEmployeeNo
(),
8
,
"0"
));
StaffEntity
staffEntity
=
this
.
getExtCache
(
StrUtil
.
padPre
(
userInfoItem
.
getEmployeeNo
(),
8
,
"0"
));
//设置到默认部门
//设置到默认部门
//判断本地数据是否为空
//判断本地数据是否为空
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
{
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
{
//新增员工信息
//新增员工信息
staffEntity
=
new
StaffEntity
();
staffEntity
=
new
StaffEntity
();
staffEntity
.
initAttrValue
();
staffEntity
.
initAttrValue
();
DeptQuery
deptQuery
=
new
DeptQuery
();
DeptQuery
deptQuery
=
new
DeptQuery
();
deptQuery
.
setParentId
(
0L
);
deptQuery
.
setParentId
(
0L
);
DeptEntity
deptEntity
=
deptService
.
selectOne
(
deptQuery
);
DeptEntity
deptEntity
=
deptService
.
selectOne
(
deptQuery
);
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
))
{
staffEntity
.
setDeptId
(
deptEntity
.
getId
());
staffEntity
.
setDeptId
(
deptEntity
.
getId
());
staffEntity
.
setDeptName
(
deptEntity
.
getDeptName
());
staffEntity
.
setDeptName
(
deptEntity
.
getDeptName
());
}
staffEntity
.
setName
(
userInfoItem
.
getName
());
staffEntity
.
setGender
(
"male"
.
equals
(
userInfoItem
.
getGender
())
?
1
:
2
);
staffEntity
.
setWorkNum
(
userInfoItem
.
getEmployeeNo
());
staffEntity
.
setStatus
(
StaffSatusEnum
.
正式
.
getValue
());
staffEntity
.
setCreateUserId
(
1L
);
staffEntity
.
setCreateTime
(
new
Date
());
this
.
save
(
staffEntity
);
}
}
staffEntity
.
setName
(
userInfoItem
.
getName
());
staffEntity
.
setGender
(
"male"
.
equals
(
userInfoItem
.
getGender
())
?
1
:
2
);
staffEntity
.
setWorkNum
(
userInfoItem
.
getEmployeeNo
());
staffEntity
.
setStatus
(
StaffSatusEnum
.
正式
.
getValue
());
staffEntity
.
setCreateUserId
(
1L
);
staffEntity
.
setCreateTime
(
new
Date
());
this
.
save
(
staffEntity
);
}
}
}
}
}
}
}
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
){
log
.
error
(
"同步人员信息失败:{}"
,
e
.
getMessage
());
log
.
error
(
"同步人员信息失败:{}"
,
e
.
getMessage
());
staffCollect
=
new
HashMap
<>();
staffCollect
=
List
}
}
if
(
staffCollect
.
size
()
>
0
)
{
if
(
staffCollect
.
size
()
>
0
)
{
//需要将此人员变更为离职
//需要将此人员变更为离职
...
...
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