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
316d69dd
Commit
316d69dd
authored
Aug 22, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改请假计算考勤
parent
aaf8abe9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
34 additions
and
13 deletions
+34
-13
attendance-performance-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
...er/src/main/java/com/mortals/xhx/common/key/RedisKey.java
+4
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/common/utils/AddAttendThread.java
...in/java/com/mortals/xhx/common/utils/AddAttendThread.java
+4
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncDoorsEventAfterTaskImpl.java
.../mortals/xhx/daemon/task/SyncDoorsEventAfterTaskImpl.java
+0
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncDoorsEventWeekTaskImpl.java
...m/mortals/xhx/daemon/task/SyncDoorsEventWeekTaskImpl.java
+10
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceLeaveRecordServiceImpl.java
...ndance/service/impl/AttendanceLeaveRecordServiceImpl.java
+2
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
...odule/attendance/service/work/FixWorkOtherAttendance.java
+3
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceRecordHikController.java
.../module/attendance/web/AttendanceRecordHikController.java
+10
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformAttendRecordServiceImpl.java
.../perform/service/impl/PerformAttendRecordServiceImpl.java
+0
-3
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformEffectRecordServiceImpl.java
.../perform/service/impl/PerformEffectRecordServiceImpl.java
+0
-2
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/key/RedisKey.java
View file @
316d69dd
...
...
@@ -25,6 +25,10 @@ public class RedisKey {
/** 考勤统计 **/
public
static
final
String
KEY_ATTENDANCE_STAT_CACHE
=
"attendance:stat"
;
/** 考勤统计lock **/
public
static
final
String
KEY_ATTENDANCE_STAT_LOCK_CACHE
=
"attendance:stat:lock"
;
/** 考勤统计时间 **/
public
static
final
String
ATTENDANCE_STAT_TIME
=
"attendanceSummaryTime"
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/common/utils/AddAttendThread.java
View file @
316d69dd
...
...
@@ -19,6 +19,7 @@ import org.springframework.util.StopWatch;
import
java.util.Arrays
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
KEY_ATTENDANCE_STAT_CACHE
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
KEY_ATTENDANCE_STAT_LOCK_CACHE
;
@AllArgsConstructor
...
...
@@ -64,8 +65,9 @@ public class AddAttendThread implements Runnable {
hikEntity
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"attendanceDate"
)));
hikService
.
addAttendanceRecordByQuery
(
hikEntity
,
context
);
stopWatch
.
stop
();
log
.
info
(
"考勤计算日期:{} 完成,耗时:{}ms"
,
curDate
.
toDateStr
(),
stopWatch
.
getLastTaskTimeMillis
());
log
.
info
(
"考勤计算日期:{} 完成,耗时:{}ms"
,
curDate
.
toDateStr
(),
stopWatch
.
getLastTaskTimeMillis
());
}
//cacheService.del(KEY_ATTENDANCE_STAT_LOCK_CACHE);
//生成汇总信息
/* log.info("生成考勤汇总消息开始。。。");
AttendanceSummaryQuery query = new AttendanceSummaryQuery();
...
...
@@ -83,7 +85,7 @@ public class AddAttendThread implements Runnable {
public
static
void
main
(
String
[]
args
)
{
int
compare
=
0
;
int
compare
=
0
;
for
(
int
i
=
0
;
i
<=
compare
;
i
++)
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncDoorsEventAfterTaskImpl.java
View file @
316d69dd
...
...
@@ -49,8 +49,6 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
private
AttendanceRecordHikService
recordHikService
;
@Autowired
private
AttendanceStatService
attendanceStatService
;
@Autowired
private
ICacheService
cacheService
;
@Value
(
"${hik.host:}"
)
protected
String
hikhost
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncDoorsEventWeekTaskImpl.java
View file @
316d69dd
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.framework.util.ThreadPool
;
...
...
@@ -26,6 +27,8 @@ import org.springframework.util.StopWatch;
import
java.util.Date
;
import
java.util.List
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
KEY_ATTENDANCE_STAT_LOCK_CACHE
;
/**
* 同步获取本周门禁事件与计算(同步钉钉请假事件)
*/
...
...
@@ -39,6 +42,8 @@ public class SyncDoorsEventWeekTaskImpl implements ITaskExcuteService {
private
AttendanceLeaveRecordService
attendanceLeaveRecordService
;
@Autowired
private
DoorService
doorService
;
@Autowired
private
ICacheService
cacheService
;
@Value
(
"${dingtalk.domain:}"
)
...
...
@@ -103,8 +108,11 @@ public class SyncDoorsEventWeekTaskImpl implements ITaskExcuteService {
}
}
log
.
info
(
"开始计算及统计最近7天考勤!"
);
AddAttendThread
addAttendThread
=
new
AddAttendThread
(
recordHikService
,
hikEntity
,
null
);
ThreadPool
.
getInstance
().
execute
(
addAttendThread
);
String
expire
=
cacheService
.
get
(
KEY_ATTENDANCE_STAT_LOCK_CACHE
);
if
(
ObjectUtils
.
isEmpty
(
expire
))
{
AddAttendThread
addAttendThread
=
new
AddAttendThread
(
recordHikService
,
hikEntity
,
null
);
ThreadPool
.
getInstance
().
execute
(
addAttendThread
);
}
//同步最近钉钉请假事件
checkDingDingEvent
(
attendStart
,
attendEnd
,
hikEntity
);
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceLeaveRecordServiceImpl.java
View file @
316d69dd
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.aliyun.dingtalkworkflow_1_0.models.ListProcessInstanceIdsResponse
;
import
com.aliyun.dingtalkworkflow_1_0.models.ListProcessInstanceIdsResponseBody
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.util.DateUtils
;
...
...
@@ -156,6 +157,7 @@ public class AttendanceLeaveRecordServiceImpl extends AbstractCRUDServiceImpl<At
attendanceRecordHikQuery
.
setAttendanceDateStart
(
DateUtil
.
formatDate
(
entity
.
getStartTime
()));
attendanceRecordHikQuery
.
setAttendanceDateEnd
(
DateUtil
.
formatDate
(
entity
.
getEndTime
()));
}
AddAttendThread
addAttendThread
=
new
AddAttendThread
(
hikService
,
attendanceRecordHikQuery
,
context
);
ThreadPool
.
getInstance
().
execute
(
addAttendThread
);
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
View file @
316d69dd
...
...
@@ -457,8 +457,10 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
errorQuery
.
setErrorDateTimeEnd
(
dateStr
);
errorQuery
.
setStaffId
(
staffId
);
errorQuery
.
setProcessStatus
(
YesNoEnum
.
NO
.
getValue
());
Long
[]
errorIds
=
errorService
.
find
(
errorQuery
).
stream
().
map
(
i
->
i
.
getId
()).
toArray
(
Long
[]::
new
);
List
<
AttendanceRecordErrorEntity
>
attendanceRecordErrorEntities
=
errorService
.
find
(
errorQuery
);
Long
[]
errorIds
=
attendanceRecordErrorEntities
.
stream
().
map
(
i
->
i
.
getId
()).
toArray
(
Long
[]::
new
);
if
(!
ObjectUtils
.
isEmpty
(
errorIds
))
{
log
.
info
(
"删除 {} 人员:{} 异常记录:{}"
,
dateStr
,
staffId
,
JSON
.
toJSONString
(
attendanceRecordErrorEntities
));
errorService
.
remove
(
errorIds
,
context
);
}
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/web/AttendanceRecordHikController.java
View file @
316d69dd
...
...
@@ -17,6 +17,7 @@ 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.key.RedisKey
;
import
com.mortals.xhx.common.keys.RedisCacheKeys
;
import
com.mortals.xhx.common.utils.AddAttendThread
;
import
com.mortals.xhx.module.attendance.model.*
;
...
...
@@ -51,6 +52,8 @@ import java.io.InputStream;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
KEY_ATTENDANCE_STAT_LOCK_CACHE
;
/**
* 海康考勤打卡记录汇总信息
*
...
...
@@ -161,6 +164,13 @@ public class AttendanceRecordHikController extends BaseCRUDJsonBodyMappingContro
}
AddAttendThread
addAttendThread
=
new
AddAttendThread
(
hikService
,
hikEntity
,
getContext
());
ThreadPool
.
getInstance
().
execute
(
addAttendThread
);
/* String expire = cacheService.get(KEY_ATTENDANCE_STAT_LOCK_CACHE);
if(ObjectUtils.isEmpty(expire)){
cacheService.set(KEY_ATTENDANCE_STAT_LOCK_CACHE, "1", 60 * 60);
}else{
throw new AppException("有统计任务在运行,请稍后再试");
}*/
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformAttendRecordServiceImpl.java
View file @
316d69dd
...
...
@@ -54,8 +54,6 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
@Autowired
private
CheckAttendRecordService
checkAttendRecordService
;
@Autowired
private
DeptService
deptService
;
@Autowired
private
AttendanceGroupService
attendanceGroupService
;
@Autowired
private
AttendanceGroupFixedworkService
fixedworkService
;
...
...
@@ -63,7 +61,6 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
private
AttendanceClassDetailService
classDetailService
;
@Autowired
private
PerformRulesCategoryService
categoryService
;
@Autowired
private
PerformRulesService
rulesService
;
@Autowired
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformEffectRecordServiceImpl.java
View file @
316d69dd
...
...
@@ -58,8 +58,6 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
private
PerformStaffConfService
performStaffConfService
;
@Autowired
private
PerformStaffConfDetailService
performStaffConfDetailService
;
@Autowired
private
PerformErrorRecordService
errorRecordService
;
@Override
protected
void
saveBefore
(
PerformEffectRecordEntity
entity
,
Context
context
)
throws
AppException
{
...
...
attendance-performance-manager/src/test/java/com/mortals/httpclient/system.http
View file @
316d69dd
...
...
@@ -37,7 +37,7 @@ POST {{baseUrl}}/attendance/record/hik/addAttendanceRecord
Content-Type: application/json
{
"attendanceDateStart": "2024-07-
19
",
"attendanceDateStart": "2024-07-
01
",
"attendanceDateEnd": "2024-07-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