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
0046f601
Commit
0046f601
authored
Oct 08, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理代码
parent
c5722674
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
55 deletions
+39
-55
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/AttendanceWorkAbstract.java
...odule/attendance/service/work/AttendanceWorkAbstract.java
+39
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
...odule/attendance/service/work/FixWorkOtherAttendance.java
+0
-55
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/AttendanceWorkAbstract.java
View file @
0046f601
...
...
@@ -5,6 +5,10 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.module.attendance.model.*
;
import
com.mortals.xhx.module.holiday.model.HolidayEntity
;
import
com.mortals.xhx.module.holiday.model.HolidayQuery
;
import
com.mortals.xhx.module.holiday.service.HolidayService
;
import
com.mortals.xhx.utils.SpringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -26,6 +30,8 @@ public abstract class AttendanceWorkAbstract {
abstract
void
initData
();
private
HolidayService
holidayService
;
public
abstract
void
doHandleWork
(
CommonData
commonData
);
...
...
@@ -136,8 +142,41 @@ public abstract class AttendanceWorkAbstract {
}
protected
Boolean
checkWorkByHoliday
(
String
date
)
{
Boolean
bool
=
false
;
HolidayQuery
holidayQuery
=
new
HolidayQuery
();
holidayQuery
.
setStartTimeStart
(
date
);
holidayQuery
.
setStartTimeEnd
(
date
);
HolidayEntity
holidayEntity
=
holidayService
.
selectOne
(
holidayQuery
);
if
(!
ObjectUtils
.
isEmpty
(
holidayEntity
))
{
Integer
workorholiday
=
holidayEntity
.
getWorkorholiday
();
if
(
workorholiday
==
YesNoEnum
.
YES
.
getValue
())
{
bool
=
true
;
}
}
return
bool
;
}
protected
Boolean
checkHolidayByWorkDay
(
String
date
)
{
Boolean
bool
=
false
;
HolidayQuery
holidayQuery
=
new
HolidayQuery
();
holidayQuery
.
setStartTimeStart
(
date
);
holidayQuery
.
setStartTimeEnd
(
date
);
HolidayEntity
holidayEntity
=
holidayService
.
selectOne
(
holidayQuery
);
if
(!
ObjectUtils
.
isEmpty
(
holidayEntity
))
{
Integer
workorholiday
=
holidayEntity
.
getWorkorholiday
();
if
(
workorholiday
==
YesNoEnum
.
NO
.
getValue
())
{
bool
=
true
;
}
}
return
bool
;
}
public
AttendanceWorkAbstract
(
int
type
)
{
this
.
holidayService
=
SpringUtils
.
getBean
(
HolidayService
.
class
);
this
.
type
=
type
;
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
View file @
0046f601
...
...
@@ -32,38 +32,17 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
private
AttendanceGroupFixedworkService
attendanceGroupFixedworkService
;
private
AttendanceClassService
attendanceClassService
;
private
AttendanceClassDetailService
attendanceClassDetailService
;
private
AttendanceGroupFixedworkSpecialService
specialService
;
private
AttendanceRecordService
attendanceRecordService
;
private
AttendanceRecordHikService
recordHikService
;
private
AttendanceRecordErrorService
errorService
;
private
HolidayService
holidayService
;
private
AttendanceLeaveRecordService
attendanceLeaveRecordService
;
private
AttendanceRecordDetailService
attendanceRecordDetailService
;
private
Map
<
Long
,
AttendanceClassDetailEntity
>
classDetailEntityMap
;
public
FixWorkOtherAttendance
(
int
type
)
{
super
(
type
);
this
.
attendanceGroupFixedworkService
=
SpringUtils
.
getBean
(
AttendanceGroupFixedworkService
.
class
);
this
.
attendanceClassService
=
SpringUtils
.
getBean
(
AttendanceClassService
.
class
);
this
.
specialService
=
SpringUtils
.
getBean
(
AttendanceGroupFixedworkSpecialService
.
class
);
this
.
attendanceRecordService
=
SpringUtils
.
getBean
(
AttendanceRecordService
.
class
);
this
.
recordHikService
=
SpringUtils
.
getBean
(
AttendanceRecordHikService
.
class
);
this
.
attendanceClassDetailService
=
SpringUtils
.
getBean
(
AttendanceClassDetailService
.
class
);
this
.
errorService
=
SpringUtils
.
getBean
(
AttendanceRecordErrorService
.
class
);
this
.
holidayService
=
SpringUtils
.
getBean
(
HolidayService
.
class
);
this
.
attendanceLeaveRecordService
=
SpringUtils
.
getBean
(
AttendanceLeaveRecordService
.
class
);
this
.
attendanceRecordDetailService
=
SpringUtils
.
getBean
(
AttendanceRecordDetailService
.
class
);
}
@Override
...
...
@@ -90,11 +69,9 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
String
week
=
super
.
getWeek
(
DateUtil
.
parseDate
(
commonData
.
getDateStr
()));
//获取当前日期的详细班次
Long
weekClassId
=
this
.
getWeekClassId
(
attendanceGroupFixedworkEntity
,
week
);
//log.info("weekClassId:{}", weekClassId);
//weekClassId为-1 则不在考勤
Boolean
checkWorkByHoliday
=
checkWorkByHoliday
(
commonData
.
getDateStr
());
Boolean
checkHolidayByWorkDay
=
checkHolidayByWorkDay
(
commonData
.
getDateStr
());
if
(
weekClassId
==
-
1L
)
{
//跳过本次循环
if
(!
checkWorkByHoliday
)
{
...
...
@@ -165,7 +142,6 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
return
;
}
}
if
(
AddWayEnum
.
时间段
.
getValue
()
==
specialEntity
.
getAddWay
())
{
Date
specialStartTime
=
specialEntity
.
getSpecialStartTime
();
Date
specialEndTime
=
specialEntity
.
getSpecialEndTime
();
...
...
@@ -336,7 +312,6 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
if
(
ObjectUtils
.
isEmpty
(
goWorkDate
))
{
//goWorkDate为空 缺卡状态
Date
goWorkDate1
=
attendanceClassDetailEntity
.
getGoWorkDate
();
if
(
attendanceClassDetailEntity
.
getGoWorkDateAfter
()
>
0
)
{
goWorkDate1
=
DateUtil
.
offsetMinute
(
goWorkDate1
,
attendanceClassDetailEntity
.
getGoWorkDateAfter
());
}
...
...
@@ -346,7 +321,6 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
if
(
in
)
{
detail
.
setGoWorkResult
(
GoWorkResultEnum
.
请假
.
getValue
());
}
}
else
{
boolean
in
=
DateUtil
.
isIn
(
goWorkDate
,
startLeaveTime
,
endLeaveTime
);
if
(
in
)
{
...
...
@@ -486,36 +460,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
}
}
private
Boolean
checkWorkByHoliday
(
String
date
)
{
Boolean
bool
=
false
;
HolidayQuery
holidayQuery
=
new
HolidayQuery
();
holidayQuery
.
setStartTimeStart
(
date
);
holidayQuery
.
setStartTimeEnd
(
date
);
HolidayEntity
holidayEntity
=
holidayService
.
selectOne
(
holidayQuery
);
if
(!
ObjectUtils
.
isEmpty
(
holidayEntity
))
{
Integer
workorholiday
=
holidayEntity
.
getWorkorholiday
();
if
(
workorholiday
==
YesNoEnum
.
YES
.
getValue
())
{
bool
=
true
;
}
}
return
bool
;
}
private
Boolean
checkHolidayByWorkDay
(
String
date
)
{
Boolean
bool
=
false
;
HolidayQuery
holidayQuery
=
new
HolidayQuery
();
holidayQuery
.
setStartTimeStart
(
date
);
holidayQuery
.
setStartTimeEnd
(
date
);
HolidayEntity
holidayEntity
=
holidayService
.
selectOne
(
holidayQuery
);
if
(!
ObjectUtils
.
isEmpty
(
holidayEntity
))
{
Integer
workorholiday
=
holidayEntity
.
getWorkorholiday
();
if
(
workorholiday
==
YesNoEnum
.
NO
.
getValue
())
{
bool
=
true
;
}
}
return
bool
;
}
public
static
void
main
(
String
[]
args
)
{
...
...
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