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
2cdecfeb
Commit
2cdecfeb
authored
Jan 25, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加请假跨天判读
parent
9db80558
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
191 additions
and
384 deletions
+191
-384
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncDoorsEventAfterTaskImpl.java
.../mortals/xhx/daemon/task/SyncDoorsEventAfterTaskImpl.java
+2
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncDoorsEventTaskImpl.java
...a/com/mortals/xhx/daemon/task/SyncDoorsEventTaskImpl.java
+1
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/AttendanceRecordHikService.java
...module/attendance/service/AttendanceRecordHikService.java
+3
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceRecordHikServiceImpl.java
...tendance/service/impl/AttendanceRecordHikServiceImpl.java
+129
-379
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceRecordHikController.java
.../module/attendance/web/AttendanceRecordHikController.java
+43
-0
attendance-performance-manager/src/test/java/com/mortals/httpclient/system.http
...-manager/src/test/java/com/mortals/httpclient/system.http
+13
-2
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncDoorsEventAfterTaskImpl.java
View file @
2cdecfeb
...
@@ -56,8 +56,8 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
...
@@ -56,8 +56,8 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
// syncDoorEvents();
// syncDoorEvents();
//判断时间段 不在时间段的 不做计算
//判断时间段 不在时间段的 不做计算
//早上9点 子晚上8点 计算
//早上9点 子晚上8点 计算
Date
beginDateTime
=
DateUtil
.
parseDateTime
(
DateUtil
.
today
()
+
" 0
9
:00:00"
);
Date
beginDateTime
=
DateUtil
.
parseDateTime
(
DateUtil
.
today
()
+
" 0
7
:00:00"
);
Date
endDateTime
=
DateUtil
.
parseDateTime
(
DateUtil
.
today
()
+
" 2
0
:30:00"
);
Date
endDateTime
=
DateUtil
.
parseDateTime
(
DateUtil
.
today
()
+
" 2
3
:30:00"
);
boolean
in
=
DateUtil
.
isIn
(
new
Date
(),
beginDateTime
,
endDateTime
);
boolean
in
=
DateUtil
.
isIn
(
new
Date
(),
beginDateTime
,
endDateTime
);
if
(
in
)
{
if
(
in
)
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncDoorsEventTaskImpl.java
View file @
2cdecfeb
...
@@ -66,7 +66,7 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
...
@@ -66,7 +66,7 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
day
=
0
;
day
=
0
;
}
}
Date
beginDateTime
=
DateUtil
.
parseDateTime
(
DateUtil
.
today
()+
" 08:00:00"
);
Date
beginDateTime
=
DateUtil
.
parseDateTime
(
DateUtil
.
today
()+
" 08:00:00"
);
Date
endDateTime
=
DateUtil
.
parseDateTime
(
DateUtil
.
today
()+
" 2
0
:30:00"
);
Date
endDateTime
=
DateUtil
.
parseDateTime
(
DateUtil
.
today
()+
" 2
3
:30:00"
);
boolean
in
=
DateUtil
.
isIn
(
new
Date
(),
beginDateTime
,
endDateTime
);
boolean
in
=
DateUtil
.
isIn
(
new
Date
(),
beginDateTime
,
endDateTime
);
if
(
in
){
if
(
in
){
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/AttendanceRecordHikService.java
View file @
2cdecfeb
...
@@ -56,4 +56,7 @@ public interface AttendanceRecordHikService extends ICRUDService<AttendanceRecor
...
@@ -56,4 +56,7 @@ public interface AttendanceRecordHikService extends ICRUDService<AttendanceRecor
*/
*/
void
buildCustomHikRecord
(
AttendanceRecordHikQuery
recordHikQuery
,
Context
context
);
void
buildCustomHikRecord
(
AttendanceRecordHikQuery
recordHikQuery
,
Context
context
);
void
buildSourceHikRecord
(
AttendanceRecordHikQuery
recordHikQuery
,
Context
context
);
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceRecordHikServiceImpl.java
View file @
2cdecfeb
This diff is collapsed.
Click to expand it.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceRecordHikController.java
View file @
2cdecfeb
...
@@ -207,6 +207,49 @@ public class AttendanceRecordHikController extends BaseCRUDJsonBodyMappingContro
...
@@ -207,6 +207,49 @@ public class AttendanceRecordHikController extends BaseCRUDJsonBodyMappingContro
}
}
@PostMapping
(
value
=
"/addAttendanceHikRecordCustom"
)
@UnAuth
public
Rest
<
String
>
addAttendanceHikRecordCustom
(
@RequestBody
AttendanceRecordHikQuery
hikEntity
)
{
Rest
<
String
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
();
int
code
=
1
;
try
{
//天数区间分段计算
DateTime
attendStart
=
DateUtil
.
parseDate
(
hikEntity
.
getAttendanceDateStart
());
DateTime
attendEnd
=
DateUtil
.
parseDate
(
hikEntity
.
getAttendanceDateEnd
());
Long
compare
=
DateUtil
.
between
(
attendEnd
,
attendStart
,
DateUnit
.
DAY
);
StopWatch
stopWatch
=
new
StopWatch
(
"stopwatch attend1"
);
log
.
info
(
"考勤计算天数区间:{}"
,
compare
);
for
(
int
i
=
0
;
i
<=
compare
.
intValue
();
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
attendStart
,
i
);
log
.
info
(
"考勤计算日期:{}"
,
curDate
.
toDateStr
());
stopWatch
.
start
(
"执行本地方法"
);
hikEntity
.
setAttendanceDateStart
(
curDate
.
toDateStr
());
hikEntity
.
setAttendanceDateEnd
(
curDate
.
toDateStr
());
hikService
.
buildSourceHikRecord
(
hikEntity
,
context
);
stopWatch
.
stop
();
log
.
info
(
"考勤计算日期:{} 完成,耗时:{}ms"
,
curDate
.
toDateStr
(),
stopWatch
.
getLastTaskTimeMillis
());
}
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
e
);
model
.
put
(
"message_info"
,
e
.
getMessage
());
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
@Override
@Override
protected
void
doListBefore
(
AttendanceRecordHikEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
protected
void
doListBefore
(
AttendanceRecordHikEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
if
(
query
.
getStaffName
()
!=
null
&&
!
query
.
getStaffName
().
equals
(
""
))
{
if
(
query
.
getStaffName
()
!=
null
&&
!
query
.
getStaffName
().
equals
(
""
))
{
...
...
attendance-performance-manager/src/test/java/com/mortals/httpclient/system.http
View file @
2cdecfeb
...
@@ -61,8 +61,19 @@ Authorization: {{authToken}}
...
@@ -61,8 +61,19 @@ Authorization: {{authToken}}
Content-Type: application/json
Content-Type: application/json
{
{
"attendanceDateStart":"2024-01-17",
"attendanceDateStart":"2023-12-01",
"attendanceDateEnd":"2024-01-24"
"attendanceDateEnd":"2024-01-25"
}
###海康考勤打卡记录原始记录同步
POST {{baseUrl}}/attendance/record/hik/addAttendanceHikRecordCustom
Authorization: {{authToken}}
Content-Type: application/json
{
"attendanceDateStart":"2024-01-01",
"attendanceDateEnd":"2024-01-25"
}
}
...
...
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