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
f71898b3
Commit
f71898b3
authored
Jan 15, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
a4eca9a8
51db094a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
15 deletions
+90
-15
attendance-performance-manager-ui/admin/src/views/attendance/stat/list.vue
...mance-manager-ui/admin/src/views/attendance/stat/list.vue
+18
-4
attendance-performance-manager/src/main/java/com/mortals/xhx/common/utils/AddAttendThread.java
...in/java/com/mortals/xhx/common/utils/AddAttendThread.java
+52
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/StartService.java
...m/mortals/xhx/daemon/applicationservice/StartService.java
+1
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+1
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
...odule/attendance/service/work/FixWorkOtherAttendance.java
+2
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceRecordHikController.java
.../module/attendance/web/AttendanceRecordHikController.java
+5
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
...rtals/xhx/module/staff/service/impl/StaffServiceImpl.java
+0
-4
attendance-performance-manager/src/test/java/com/mortals/httpclient/system.http
...-manager/src/test/java/com/mortals/httpclient/system.http
+11
-2
No files found.
attendance-performance-manager-ui/admin/src/views/attendance/stat/list.vue
View file @
f71898b3
...
...
@@ -246,14 +246,18 @@ export default {
{
v
.
goWorkResult
==
1
?
(
<
span
style
=
"
marginRight:10px
"
>
打卡时间:
{(
v
.
goWorkDate
=
timestampToTime
(
v
.
goWorkDate
,
6
))}
{
v
.
goWorkDate
?
(
v
.
goWorkDate
=
timestampToTime
(
v
.
goWorkDate
,
6
))
:
(
v
.
goWorkDate
=
"
--
"
)}
{
"
"
}
打卡结果:
{
this
.
tableData
.
dict
.
goWorkResult
[
v
.
goWorkResult
]}
<
/span
>
)
:
(
<
span
style
=
"
color:red;marginRight:10px
"
>
打卡时间:
{(
v
.
goWorkDate
=
timestampToTime
(
v
.
goWorkDate
,
6
))}
{
v
.
goWorkDate
?
(
v
.
goWorkDate
=
timestampToTime
(
v
.
goWorkDate
,
6
))
:
(
v
.
goWorkDate
=
"
--
"
)}
{
"
"
}
打卡结果:
{
this
.
tableData
.
dict
.
goWorkResult
[
v
.
goWorkResult
]}
<
/span
>
...
...
@@ -261,14 +265,24 @@ export default {
{
v
.
offWorkResult
==
1
?
(
<
span
>
打卡时间:
{(
v
.
offWorkDate
=
timestampToTime
(
v
.
offWorkDate
,
6
))}
{
v
.
offWorkDate
?
(
v
.
offWorkDate
=
timestampToTime
(
v
.
offWorkDate
,
6
))
:
(
v
.
offWorkDate
=
"
--
"
)}
{
"
"
}
打卡结果:
{
this
.
tableData
.
dict
.
offWorkResult
[
v
.
offWorkResult
]}
<
/span
>
)
:
(
<
span
style
=
"
color:red
"
>
打卡时间:
{(
v
.
offWorkDate
=
timestampToTime
(
v
.
offWorkDate
,
6
))}
{
v
.
offWorkDate
?
(
v
.
offWorkDate
=
timestampToTime
(
v
.
offWorkDate
,
6
))
:
(
v
.
offWorkDate
=
"
--
"
)}
{
"
"
}
打卡结果:
{
this
.
tableData
.
dict
.
offWorkResult
[
v
.
offWorkResult
]}
<
/span
>
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/common/utils/AddAttendThread.java
0 → 100644
View file @
f71898b3
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
;
import
com.mortals.xhx.module.attendance.service.AttendanceRecordHikService
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.StopWatch
;
@AllArgsConstructor
@Slf4j
public
class
AddAttendThread
implements
Runnable
{
private
AttendanceRecordHikService
hikService
;
private
AttendanceRecordHikEntity
hikEntity
;
private
Context
context
;
@Override
public
void
run
()
{
log
.
info
(
"考勤计算开始!"
);
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 attend"
);
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
.
addAttendanceRecordByQuery
(
hikEntity
,
context
);
stopWatch
.
stop
();
log
.
info
(
"考勤计算日期:{} 完成,耗时:{}ms"
,
curDate
.
toDateStr
(),
stopWatch
.
getLastTaskTimeMillis
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"考勤计算失败!"
,
e
);
}
log
.
info
(
"考勤计算结束!"
);
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/StartService.java
View file @
f71898b3
...
...
@@ -12,7 +12,7 @@ public class StartService implements IApplicationStartedService {
@Override
public
void
start
()
{
ThreadPool
.
getInstance
().
init
(
2
0
);
ThreadPool
.
getInstance
().
init
(
1
0
);
}
@Override
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
f71898b3
...
...
@@ -87,7 +87,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
if
(
ObjectUtils
.
isEmpty
(
deptEntity
))
{
deptEntity
=
new
DeptEntity
();
deptEntity
.
initAttrValue
();
if
(
ObjectUtils
.
isEmpty
(
deptEntityParent
))
{
if
(
!
ObjectUtils
.
isEmpty
(
deptEntityParent
))
{
deptEntity
.
setParentId
(
deptEntityParent
.
getId
());
}
deptEntity
.
setDeptName
(
orgInfo
.
getOrgName
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
View file @
f71898b3
...
...
@@ -352,7 +352,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
errorEntity
.
setShiftsName
(
recordDetailEntity
.
getShiftsName
());
errorEntity
.
setProcessStatus
(
YesNoEnum
.
NO
.
getValue
());
errorEntity
.
setCreateTime
(
new
Date
());
errorEntity
.
setCreateUserId
(
context
.
getUser
().
getId
()
);
errorEntity
.
setCreateUserId
(
1L
);
Date
goWorkDate
=
attendanceClassDetailEntity
.
getGoWorkDate
();
errorEntity
.
setGoOffDateTime
(
DateUtil
.
parseDateTime
(
dateStr
+
" "
+
DateUtil
.
formatTime
(
goWorkDate
)).
toJdkDate
());
if
(!
ObjectUtils
.
isEmpty
(
recordDetailEntity
.
getGoWorkDate
()))
{
...
...
@@ -382,7 +382,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
errorEntity
.
setShiftsName
(
recordDetailEntity
.
getShiftsName
());
errorEntity
.
setProcessStatus
(
YesNoEnum
.
NO
.
getValue
());
errorEntity
.
setCreateTime
(
new
Date
());
errorEntity
.
setCreateUserId
(
context
.
getUser
().
getId
());
errorEntity
.
setCreateUserId
(
context
==
null
?
1L
:
context
.
getUser
().
getId
());
Date
offWorkDate
=
attendanceClassDetailEntity
.
getOffWorkDate
();
errorEntity
.
setGoOffDateTime
(
DateUtil
.
parseDateTime
(
dateStr
+
" "
+
DateUtil
.
formatTime
(
offWorkDate
)).
toJdkDate
());
if
(!
ObjectUtils
.
isEmpty
(
recordDetailEntity
.
getOffWorkDate
()))
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceRecordHikController.java
View file @
f71898b3
...
...
@@ -9,11 +9,13 @@ import com.mortals.framework.model.Context;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.framework.utils.ServletUtils
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.base.system.upload.service.UploadService
;
import
com.mortals.xhx.common.keys.RedisCacheKeys
;
import
com.mortals.xhx.common.utils.AddAttendThread
;
import
com.mortals.xhx.module.attendance.model.AttendanceClassEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceExportRecordEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceGroupEntity
;
...
...
@@ -144,7 +146,9 @@ public class AttendanceRecordHikController extends BaseCRUDJsonBodyMappingContro
if
(
ObjectUtils
.
isEmpty
(
hikEntity
.
getAttendanceDateStart
()))
{
throw
new
AppException
(
"请选择开始日期"
);
}
hikService
.
addAttendanceRecordByQuery
(
hikEntity
,
getContext
());
AddAttendThread
addAttendThread
=
new
AddAttendThread
(
hikService
,
hikEntity
,
getContext
());
ThreadPool
.
getInstance
().
execute
(
addAttendThread
);
//hikService.addAttendanceRecordByQuery(hikEntity, getContext());
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
f71898b3
...
...
@@ -147,7 +147,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
staffQuery
.
setStatusNotList
(
Arrays
.
asList
(
StaffSatusEnum
.
离职
.
getValue
()));
Map
<
String
,
StaffEntity
>
staffCollect
=
this
.
find
(
staffQuery
).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getWorkNum
(),
y
->
y
,
(
o
,
n
)
->
n
));
List
<
PersonInfo
>
personInfoList
=
personRest
.
getData
().
getList
();
for
(
PersonInfo
personInfo
:
personInfoList
)
{
if
(
ObjectUtils
.
isEmpty
(
personInfo
.
getJobNo
()))
{
...
...
@@ -156,7 +155,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}
if
(
staffCollect
.
containsKey
(
personInfo
.
getJobNo
()))
{
staffCollect
.
remove
(
personInfo
.
getJobNo
());
}
StaffEntity
staffEntity
=
this
.
getExtCache
(
StrUtil
.
padPre
(
personInfo
.
getJobNo
(),
8
,
"0"
));
...
...
@@ -191,7 +189,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
staffEntity
.
setCreateUserId
(
1L
);
staffEntity
.
setCreateTime
(
new
Date
());
this
.
save
(
staffEntity
);
}
else
{
//更新
if
(!
ObjectUtils
.
isEmpty
(
deptEntity
))
{
...
...
@@ -225,7 +222,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
if
(
staffCollect
.
size
()
>
0
)
{
//需要将此人员变更为离职
staffCollect
.
entrySet
().
stream
().
forEach
(
item
->
{
String
key
=
item
.
getKey
();
if
(!
ObjectUtils
.
isEmpty
(
key
))
{
StaffEntity
staff
=
item
.
getValue
();
...
...
attendance-performance-manager/src/test/java/com/mortals/httpclient/system.http
View file @
f71898b3
...
...
@@ -24,6 +24,15 @@ Content-Type: application/json
{}
###海康考勤打卡记录计算
POST {{baseUrl}}/attendance/record/hik/addAttendanceRecord
Authorization: {{authToken}}
Content-Type: application/json
{
"attendanceDateStart":"2023-12-01",
"attendanceDateEnd":"2024-01-11"
}
...
...
@@ -34,7 +43,7 @@ Content-Type: application/json
{
"attendanceDateStart":"2023-12-01",
"attendanceDateEnd":"2023-12-3
0
"
"attendanceDateEnd":"2023-12-3
1
"
}
...
...
@@ -43,7 +52,7 @@ POST {{baseUrl}}//attendance/stat/summary
Authorization: {{authToken}}
Content-Type: application/json
{"summaryTimeStart":"202
4-01-01","summaryTimeEnd":"2024-01-03
"}
{"summaryTimeStart":"202
3-12-01","summaryTimeEnd":"2023-12-31
"}
###短信设置编辑
...
...
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