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
e88567ca
Commit
e88567ca
authored
Jan 11, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改考勤计算
parent
4b27dbd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
attendance-performance-manager/src/main/java/com/mortals/xhx/common/utils/AddAttendThread.java
...in/java/com/mortals/xhx/common/utils/AddAttendThread.java
+7
-5
attendance-performance-manager/src/test/java/com/mortals/httpclient/system.http
...-manager/src/test/java/com/mortals/httpclient/system.http
+1
-1
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/common/utils/AddAttendThread.java
View file @
e88567ca
package
com.mortals.xhx.common.utils
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity
;
...
...
@@ -17,7 +18,7 @@ public class AddAttendThread implements Runnable {
private
AttendanceRecordHikService
hikService
;
private
AttendanceRecordHikEntity
hikEntity
;
private
AttendanceRecordHikEntity
hikEntity
;
private
Context
context
;
...
...
@@ -29,17 +30,18 @@ public class AddAttendThread implements Runnable {
//天数区间分段计算
DateTime
attendStart
=
DateUtil
.
parseDate
(
hikEntity
.
getAttendanceDateStart
());
DateTime
attendEnd
=
DateUtil
.
parseDate
(
hikEntity
.
getAttendanceDateEnd
());
int
compare
=
DateUtil
.
compare
(
attendEnd
,
attendStart
);
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch attend"
);
for
(
int
i
=
0
;
i
<=
compare
;
i
++){
log
.
info
(
"考勤计算天数区间:{}"
,
compare
);
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"考勤计算日期:{}"
,
curDate
.
toDateStr
());
log
.
info
(
"考勤计算日期:{}"
,
curDate
.
toDateStr
());
stopWatch
.
start
(
"执行本地方法"
);
hikEntity
.
setAttendanceDateStart
(
curDate
.
toDateStr
());
hikEntity
.
setAttendanceDateEnd
(
curDate
.
toDateStr
());
hikService
.
addAttendanceRecordByQuery
(
hikEntity
,
context
);
stopWatch
.
stop
();
log
.
info
(
"考勤计算日期:{} 完成,耗时:{}ms"
,
curDate
.
toDateStr
(),
stopWatch
.
getLastTaskTimeMillis
());
log
.
info
(
"考勤计算日期:{} 完成,耗时:{}ms"
,
curDate
.
toDateStr
(),
stopWatch
.
getLastTaskTimeMillis
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"考勤计算失败!"
,
e
);
...
...
attendance-performance-manager/src/test/java/com/mortals/httpclient/system.http
View file @
e88567ca
...
...
@@ -31,7 +31,7 @@ Content-Type: application/json
{
"attendanceDateStart":"2023-12-01",
"attendanceDateEnd":"202
3-12-0
1"
"attendanceDateEnd":"202
4-01-1
1"
}
...
...
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