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
b3065992
Commit
b3065992
authored
Apr 03, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加员工钉钉同步userId
parent
b9b0ae79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
5 deletions
+50
-5
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceLeaveRecordServiceImpl.java
...ndance/service/impl/AttendanceLeaveRecordServiceImpl.java
+50
-5
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceLeaveRecordServiceImpl.java
View file @
b3065992
...
...
@@ -38,6 +38,7 @@ import com.mortals.xhx.module.staff.service.StaffService;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -225,6 +226,9 @@ public class AttendanceLeaveRecordServiceImpl extends AbstractCRUDServiceImpl<At
return
Rest
.
ok
();
}
@Value
(
"${source.type:''}"
)
protected
String
sourceType
;
private
void
getLeaveRecordByUserList
(
AttendanceLeaveRecordQuery
query
,
List
<
StaffEntity
>
staffCacheList
,
List
<
AttendanceLeaveRecordEntity
>
waitSyncLeaveRecords
)
{
List
<
List
<
StaffEntity
>>
partition
=
Lists
.
partition
(
staffCacheList
,
10
);
for
(
List
<
StaffEntity
>
staffList
:
partition
)
{
...
...
@@ -234,13 +238,35 @@ public class AttendanceLeaveRecordServiceImpl extends AbstractCRUDServiceImpl<At
long
endTime
=
DateUtil
.
parseDateTime
(
query
.
getEndTimeEnd
()
+
" 23:59:59"
).
getTime
();
Long
nextToken
=
0L
;
long
maxResults
=
20L
;
for
(
ProcessInstanceEnum
processInstanceEnum
:
ProcessInstanceEnum
.
values
())
{
try
{
getRecords
(
waitSyncLeaveRecords
,
processInstanceEnum
,
startTime
,
endTime
,
nextToken
,
maxResults
,
dingUserIds
);
}
catch
(
Exception
e
)
{
log
.
error
(
"同步请假记录异常"
,
e
);
if
(
AttendSourceTypeEnum
.
海康云平台
.
getValue
().
equals
(
sourceType
))
{
for
(
ProcessInstanceEnum
processInstanceEnum
:
ProcessInstanceEnum
.
values
())
{
try
{
getRecords
(
waitSyncLeaveRecords
,
processInstanceEnum
,
startTime
,
endTime
,
nextToken
,
maxResults
,
dingUserIds
);
}
catch
(
Exception
e
)
{
log
.
error
(
"同步请假记录异常"
,
e
);
}
}
}
else
if
(
AttendSourceTypeEnum
.
钉钉
.
getValue
().
equals
(
sourceType
))
{
for
(
QiongLaiProcessInstanceEnum
processInstanceEnum
:
QiongLaiProcessInstanceEnum
.
values
())
{
try
{
getRecords
(
waitSyncLeaveRecords
,
processInstanceEnum
,
startTime
,
endTime
,
nextToken
,
maxResults
,
dingUserIds
);
}
catch
(
Exception
e
)
{
log
.
error
(
"同步请假记录异常"
,
e
);
}
}
}
else
{
for
(
ProcessInstanceEnum
processInstanceEnum
:
ProcessInstanceEnum
.
values
())
{
try
{
getRecords
(
waitSyncLeaveRecords
,
processInstanceEnum
,
startTime
,
endTime
,
nextToken
,
maxResults
,
dingUserIds
);
}
catch
(
Exception
e
)
{
log
.
error
(
"同步请假记录异常"
,
e
);
}
}
}
}
}
...
...
@@ -263,6 +289,25 @@ public class AttendanceLeaveRecordServiceImpl extends AbstractCRUDServiceImpl<At
}
}
private
void
getRecords
(
List
<
AttendanceLeaveRecordEntity
>
waitSyncLeaveRecords
,
QiongLaiProcessInstanceEnum
processInstanceEnum
,
long
startTime
,
long
endTime
,
Long
nextToken
,
long
maxResults
,
List
<
String
>
dingUserIds
)
throws
Exception
{
Rest
<
ListProcessInstanceIdsResponseBody
.
ListProcessInstanceIdsResponseBodyResult
>
rest
=
dingPersonService
.
getProcessInstanceIdByUserIds
(
processInstanceEnum
.
getValue
(),
startTime
,
endTime
,
nextToken
,
maxResults
,
dingUserIds
);
if
(
YesNoEnum
.
YES
.
getValue
()
==
rest
.
getCode
())
{
if
(
ObjectUtils
.
isEmpty
(
rest
.
getData
().
getNextToken
()))
{
List
<
String
>
processInstanceList
=
rest
.
getData
().
getList
();
for
(
String
process
:
processInstanceList
)
{
AttendanceLeaveRecordEntity
leaveRecord
=
new
AttendanceLeaveRecordEntity
();
leaveRecord
.
setRemark
(
process
);
// leaveRecord.setStaffId(item.getCustomerId());
waitSyncLeaveRecords
.
add
(
leaveRecord
);
log
.
info
(
"更新记录成功==>"
+
process
);
}
}
else
{
nextToken
=
DataUtil
.
converStr2Long
(
rest
.
getData
().
getNextToken
(),
0L
);
getRecords
(
waitSyncLeaveRecords
,
processInstanceEnum
,
startTime
,
endTime
,
nextToken
,
maxResults
,
dingUserIds
);
}
}
}
private
void
creatPerformAttend
(
AttendanceLeaveRecordEntity
entity
,
Context
context
)
{
try
{
if
(
AppealResultEnum
.
通过
.
getValue
()
==
entity
.
getAuditResult
()
&&
LeaveTypeEnum
.
事假
.
getValue
()
==
entity
.
getLeaveType
())
{
...
...
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