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
9a7134df
Commit
9a7134df
authored
Jun 02, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改人员同步 不存在的人离职问题
parent
098c7693
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/staff/service/impl/HikStaffServiceImpl.java
...hx/module/hik/staff/service/impl/HikStaffServiceImpl.java
+2
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
...rtals/xhx/module/staff/service/impl/StaffServiceImpl.java
+12
-13
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/hik/staff/service/impl/HikStaffServiceImpl.java
View file @
9a7134df
...
@@ -44,8 +44,8 @@ public class HikStaffServiceImpl extends AbstractHikService implements IHikStaff
...
@@ -44,8 +44,8 @@ public class HikStaffServiceImpl extends AbstractHikService implements IHikStaff
try
{
try
{
int
lHandler
=
hCNetSDK
.
NET_DVR_StartRemoteConfig
(
userID
,
HCNetSDK
.
NET_DVR_JSON_CONFIG
,
ptrByteArray
.
getPointer
(),
strInBuffer
.
length
(),
null
,
null
);
int
lHandler
=
hCNetSDK
.
NET_DVR_StartRemoteConfig
(
userID
,
HCNetSDK
.
NET_DVR_JSON_CONFIG
,
ptrByteArray
.
getPointer
(),
strInBuffer
.
length
(),
null
,
null
);
if
(
lHandler
<
0
)
{
if
(
lHandler
<
0
)
{
log
.
info
(
"SearchUserInfo NET_DVR_StartRemoteConfig 失败,错误码为==>{}
"
,
hCNetSDK
.
NET_DVR_GetLastError
());
log
.
info
(
"SearchUserInfo NET_DVR_StartRemoteConfig 失败,错误码为==>{}
,deviceName:{}"
,
hCNetSDK
.
NET_DVR_GetLastError
(),
doorEntity
.
getDeviceName
());
throw
new
AppException
(
String
.
format
(
"SearchUserInfo NET_DVR_StartRemoteConfig 失败,错误码为==>%s
"
,
hCNetSDK
.
NET_DVR_GetLastError
()));
throw
new
AppException
(
String
.
format
(
"SearchUserInfo NET_DVR_StartRemoteConfig 失败,错误码为==>%s
,deviceName==>%s"
,
hCNetSDK
.
NET_DVR_GetLastError
(),
doorEntity
.
getDeviceName
()));
}
else
{
}
else
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonSearchCond
=
new
JSONObject
();
JSONObject
jsonSearchCond
=
new
JSONObject
();
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
9a7134df
...
@@ -116,9 +116,9 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -116,9 +116,9 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
@Override
@Override
protected
void
updateBefore
(
StaffEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateBefore
(
StaffEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateBefore
(
entity
,
context
);
super
.
updateBefore
(
entity
,
context
);
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getDeptId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getDeptId
()))
{
DeptEntity
deptEntity
=
deptService
.
get
(
entity
.
getDeptId
());
DeptEntity
deptEntity
=
deptService
.
get
(
entity
.
getDeptId
());
entity
.
setDeptName
(
deptEntity
==
null
?
""
:
deptEntity
.
getDeptName
());
entity
.
setDeptName
(
deptEntity
==
null
?
""
:
deptEntity
.
getDeptName
());
}
}
}
}
...
@@ -129,15 +129,14 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -129,15 +129,14 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
throw
new
AppException
(
"工号重复!工号:"
+
entity
.
getWorkNum
());
throw
new
AppException
(
"工号重复!工号:"
+
entity
.
getWorkNum
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getDeptId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getDeptId
()))
{
DeptEntity
deptEntity
=
deptService
.
get
(
entity
.
getDeptId
());
DeptEntity
deptEntity
=
deptService
.
get
(
entity
.
getDeptId
());
entity
.
setDeptName
(
deptEntity
==
null
?
""
:
deptEntity
.
getDeptName
());
entity
.
setDeptName
(
deptEntity
==
null
?
""
:
deptEntity
.
getDeptName
());
}
}
}
}
@Override
@Override
public
StaffInfoVo
queryAll
(
Context
context
)
{
public
StaffInfoVo
queryAll
(
Context
context
)
{
StaffInfoVo
staffInfoVo
=
new
StaffInfoVo
();
StaffInfoVo
staffInfoVo
=
new
StaffInfoVo
();
...
@@ -522,10 +521,10 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -522,10 +521,10 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
Map
<
String
,
StaffEntity
>
staffCollect
=
this
.
find
(
staffQuery
).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getWorkNum
(),
y
->
y
,
(
o
,
n
)
->
n
));
Map
<
String
,
StaffEntity
>
staffCollect
=
this
.
find
(
staffQuery
).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getWorkNum
(),
y
->
y
,
(
o
,
n
)
->
n
));
List
<
DoorEntity
>
doorEntities
=
doorService
.
find
(
new
DoorQuery
());
List
<
DoorEntity
>
doorEntities
=
doorService
.
find
(
new
DoorQuery
());
if
(
ObjectUtils
.
isEmpty
(
doorEntities
))
return
Rest
.
fail
(
"未找到门禁设备!"
);
if
(
ObjectUtils
.
isEmpty
(
doorEntities
))
return
Rest
.
fail
(
"未找到门禁设备!"
);
try
{
try
{
DoorEntity
doorEntity
=
doorEntities
.
get
(
0
);
//
DoorEntity doorEntity = doorEntities.get(0);
//
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
())
{
...
@@ -572,7 +571,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -572,7 +571,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
staffEntity
.
setCreateUserId
(
1L
);
staffEntity
.
setCreateUserId
(
1L
);
staffEntity
.
setCreateTime
(
new
Date
());
staffEntity
.
setCreateTime
(
new
Date
());
this
.
save
(
staffEntity
);
this
.
save
(
staffEntity
);
}
else
{
}
else
{
//更新员工状态
//更新员工状态
staffEntity
.
setStatus
(
StaffSatusEnum
.
正式
.
getValue
());
staffEntity
.
setStatus
(
StaffSatusEnum
.
正式
.
getValue
());
staffEntity
.
setUpdateUserId
(
1L
);
staffEntity
.
setUpdateUserId
(
1L
);
...
@@ -582,18 +581,18 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
...
@@ -582,18 +581,18 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
StaffLeaveQuery
staffLeaveQuery
=
new
StaffLeaveQuery
();
StaffLeaveQuery
staffLeaveQuery
=
new
StaffLeaveQuery
();
staffLeaveQuery
.
setWorkNum
(
staffEntity
.
getWorkNum
());
staffLeaveQuery
.
setWorkNum
(
staffEntity
.
getWorkNum
());
StaffLeaveEntity
staffLeaveEntity
=
staffLeaveService
.
selectOne
(
staffLeaveQuery
,
null
);
StaffLeaveEntity
staffLeaveEntity
=
staffLeaveService
.
selectOne
(
staffLeaveQuery
,
null
);
if
(!
ObjectUtils
.
isEmpty
(
staffEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
staffEntity
))
{
staffLeaveService
.
remove
(
staffLeaveEntity
.
getId
(),
null
);
staffLeaveService
.
remove
(
staffLeaveEntity
.
getId
(),
null
);
}
}
}
}
}
}
}
}
}
}
}
else
{
}
else
{
log
.
info
(
"人员信息为空"
);
log
.
info
(
"人员信息为空"
);
throw
new
AppException
(
personCountRest
.
getMsg
());
throw
new
AppException
(
personCountRest
.
getMsg
());
}
}
//
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"同步人员信息失败:{}"
,
e
.
getMessage
());
log
.
error
(
"同步人员信息失败:{}"
,
e
.
getMessage
());
staffCollect
=
new
HashMap
<>();
staffCollect
=
new
HashMap
<>();
...
...
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