Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
46126e70
Commit
46126e70
authored
4 years ago
by
lal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
489e9109
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
959 additions
and
743 deletions
+959
-743
src/main/java/cn/timer/api/controller/kqgl/AttController.java
+413
-624
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
+546
-119
No files found.
src/main/java/cn/timer/api/controller/kqgl/AttController.java
View file @
46126e70
...
@@ -164,86 +164,7 @@ public class AttController {
...
@@ -164,86 +164,7 @@ public class AttController {
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"EEE"
);
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"EEE"
);
/*******班次管理--开始*********/
/**
* 获取班次数据
*/
@GetMapping
(
value
=
"/ShiftDataList"
)
@ApiOperation
(
value
=
"获取班次数据-根据 组织机构代码"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
1
)
public
Result
<
PageInfo
<
ShiftManagement
>>
getShiftDataList
(
@CurrentUser
UserBean
userBean
,
@ApiParam
(
"当前页"
)
@RequestParam
(
value
=
"pageNum"
,
required
=
false
,
defaultValue
=
"1"
)
Integer
pageNum
,
@ApiParam
(
"每页条数"
)
@RequestParam
(
value
=
"pageSize"
,
required
=
false
,
defaultValue
=
"9999"
)
Integer
pageSize
)
{
int
qyid
=
userBean
.
getOrgCode
();
//坏小孩【企业id】
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
ShiftManagement
>
shiftList
=
shiftmanagementservice
.
selectByPrimaryByQyid
(
qyid
);
PageInfo
<
ShiftManagement
>
pageInfo
=
new
PageInfo
<>(
shiftList
);
return
ResultUtil
.
data
(
pageInfo
);
}
/**
* 新增班次信息
*/
@PostMapping
(
value
=
"/Shif"
)
@ApiOperation
(
value
=
"新增班次信息"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
ShiftManagement
>
ShiftInformation
(
@CurrentUser
UserBean
userBean
,
@RequestBody
ShiftManagement
shif
)
{
int
qyid
=
userBean
.
getOrgCode
();
//坏小孩【企业id】
int
userid
=
userBean
.
getEmpNum
();
//用户id
shif
.
setQyid
(
qyid
);
shif
.
setLusjTime
(
new
Date
().
getTime
());
shif
.
setLuryid
(
userid
);
//录入人员
if
(
shiftmanagementservice
.
insertSelective
(
shif
)>
0
){
return
ResultUtil
.
data
(
shif
,
"新增班次成功"
);
}
else
{
return
ResultUtil
.
error
(
"新增班次失败"
);
}
}
/**
* 删除班次信息
*/
@DeleteMapping
(
value
=
"/Shif/{id}"
)
@ApiOperation
(
value
=
"删除班次信息"
,
httpMethod
=
"DELETE"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
3
)
public
Result
<
Integer
>
deleteShiftInformation
(
@PathVariable
(
"id"
)
Integer
id
)
{
if
(
shiftmanagementservice
.
deleteByPrimaryKey
(
id
)
>
0
)
{
return
ResultUtil
.
data
(
id
,
"删除成功"
);
}
return
ResultUtil
.
error
(
"删除失败"
);
}
/**
* 根据班次id获取班次信息
*/
@GetMapping
(
value
=
"/Shifts/{id}"
)
@ApiOperation
(
value
=
"获取班次信息-根据班次id"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
4
)
public
Result
<
ShiftManagement
>
getShiftCenter
(
@PathVariable
(
"id"
)
Integer
id
)
{
ShiftManagement
shifs
=
shiftmanagementservice
.
selectByPrimaryKey
(
id
);
return
ResultUtil
.
data
(
shifs
);
}
/**
* 修改班次信息
*/
@PutMapping
(
value
=
"/Shif"
)
@ApiOperation
(
value
=
"修改班次信息"
,
httpMethod
=
"PUT"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
5
)
public
Result
<
ShiftManagement
>
updateShiftInformation
(
@CurrentUser
UserBean
userBean
,
@RequestBody
ShiftManagement
shif
)
{
int
qyid
=
userBean
.
getOrgCode
();
//坏小孩【企业id】
int
userid
=
userBean
.
getEmpNum
();
//用户id
shif
.
setQyid
(
qyid
);
//企业id
shif
.
setLusjTime
(
new
Date
().
getTime
());
//录入时间
shif
.
setLuryid
(
userid
);
//录入人员
if
(
shiftmanagementservice
.
updateByPrimaryKeySelective
(
shif
)
>
0
)
{
return
ResultUtil
.
data
(
shif
,
"修改班次信息成功"
);
}
return
ResultUtil
.
error
(
"修改班次信息失败"
);
}
/*******班次管理 结束*********/
/*********考勤机***********/
/*********考勤机***********/
...
@@ -428,16 +349,16 @@ public class AttController {
...
@@ -428,16 +349,16 @@ public class AttController {
Long
xbdk3
=
0
l
;
Long
xbdk3
=
0
l
;
if
(
banci
!=
null
){
if
(
banci
!=
null
){
if
(
banci
.
getSxbcs
()==
1
||
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
if
(
banci
.
getSxbcs
()==
1
||
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
sbdk1
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getSbdk1
()+
":00"
));
sbdk1
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getSbdk1
()+
":00"
));
xbdk1
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getXbdk1
()+
":00"
));
xbdk1
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getXbdk1
()+
":00"
));
}
}
if
(
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
if
(
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
sbdk2
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getSbdk2
()+
":00"
));
sbdk2
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getSbdk2
()+
":00"
));
xbdk2
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getXbdk2
()+
":00"
));
xbdk2
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getXbdk2
()+
":00"
));
}
}
if
(
banci
.
getSxbcs
()==
3
){
if
(
banci
.
getSxbcs
()==
3
){
sbdk3
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getSbdk3
()+
":00"
));
sbdk3
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getSbdk3
()+
":00"
));
xbdk3
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getXbdk3
()+
":00"
));
xbdk3
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getXbdk3
()+
":00"
));
}
}
}
}
//之前打卡的班次
//之前打卡的班次
...
@@ -1673,10 +1594,10 @@ public class AttController {
...
@@ -1673,10 +1594,10 @@ public class AttController {
if
(!(
""
).
equals
(
attendancedetails
.
getStart
())){
if
(!(
""
).
equals
(
attendancedetails
.
getStart
())){
try
{
try
{
String
sdaet
=
getMinMonthDate
(
attendancedetails
.
getStart
());
String
sdaet
=
ClockInTool
.
getMinMonthDate
(
attendancedetails
.
getStart
());
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
String
edate
=
getMaxMonthDate
(
attendancedetails
.
getEnd
());
String
edate
=
ClockInTool
.
getMaxMonthDate
(
attendancedetails
.
getEnd
());
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -2087,10 +2008,10 @@ public class AttController {
...
@@ -2087,10 +2008,10 @@ public class AttController {
if
(!(
""
).
equals
(
atttions
.
getDate
())){
if
(!(
""
).
equals
(
atttions
.
getDate
())){
try
{
try
{
String
sdaet
=
getMinMonthDate
(
str
);
String
sdaet
=
ClockInTool
.
getMinMonthDate
(
str
);
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
String
edate
=
getMaxMonthDate
(
str
);
String
edate
=
ClockInTool
.
getMaxMonthDate
(
str
);
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -2338,10 +2259,10 @@ public class AttController {
...
@@ -2338,10 +2259,10 @@ public class AttController {
if
(!(
""
).
equals
(
attconditions
.
getDate
())){
if
(!(
""
).
equals
(
attconditions
.
getDate
())){
try
{
try
{
String
sdaet
=
getMinMonthDate
(
str
);
String
sdaet
=
ClockInTool
.
getMinMonthDate
(
str
);
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
String
edate
=
getMaxMonthDate
(
str
);
String
edate
=
ClockInTool
.
getMaxMonthDate
(
str
);
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -2452,7 +2373,7 @@ public class AttController {
...
@@ -2452,7 +2373,7 @@ public class AttController {
}
}
}
}
int
week
=
Integer
.
valueOf
(
dateToWeek
(
famt
.
format
(
da
)));
//2
int
week
=
Integer
.
valueOf
(
ClockInTool
.
dateToWeek
(
famt
.
format
(
da
)));
//2
AttendanceWeeklySch
atwek
=
attendanceweeklyschservice
.
selectZhouDetail
(
attgro
.
getId
(),
week
);
//固定周排班
AttendanceWeeklySch
atwek
=
attendanceweeklyschservice
.
selectZhouDetail
(
attgro
.
getId
(),
week
);
//固定周排班
if
(
atwek
!=
null
){
//有固定周排班
if
(
atwek
!=
null
){
//有固定周排班
...
@@ -2602,17 +2523,17 @@ public class AttController {
...
@@ -2602,17 +2523,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
1
);
as
.
setSort
(
1
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbdk1
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk1
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks1
())?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbqjks1
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks1
())?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks1
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbqjjs1
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs1
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
2
);
as
.
setSort
(
2
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbdk1
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk1
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbqjks1
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks1
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbqjjs1
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs1
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -2624,17 +2545,17 @@ public class AttController {
...
@@ -2624,17 +2545,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
3
);
as
.
setSort
(
3
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbdk2
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk2
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbqjks2
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks2
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbqjjs2
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs2
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
4
);
as
.
setSort
(
4
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbdk2
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk2
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbqjks2
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks2
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbqjjs2
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs2
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -2646,17 +2567,17 @@ public class AttController {
...
@@ -2646,17 +2567,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
5
);
as
.
setSort
(
5
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbdk3
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk3
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbqjks3
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks3
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getSbqjjs3
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs3
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
6
);
as
.
setSort
(
6
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbdk3
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk3
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbqjks3
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks3
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shifs
.
getXbqjjs3
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs3
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -2877,7 +2798,7 @@ public class AttController {
...
@@ -2877,7 +2798,7 @@ public class AttController {
}
}
}
}
int
week
=
Integer
.
valueOf
(
dateToWeek
(
famt
.
format
(
da
)));
//2
int
week
=
Integer
.
valueOf
(
ClockInTool
.
dateToWeek
(
famt
.
format
(
da
)));
//2
AttendanceWeeklySch
atwek
=
attendanceweeklyschservice
.
selectFreeWorkingHours
(
attgro
.
getId
(),
week
);
//自由工时
AttendanceWeeklySch
atwek
=
attendanceweeklyschservice
.
selectFreeWorkingHours
(
attgro
.
getId
(),
week
);
//自由工时
...
@@ -2951,345 +2872,335 @@ public class AttController {
...
@@ -2951,345 +2872,335 @@ public class AttController {
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
int
qyid
=
userBean
.
getOrgCode
();
//坏小孩【企业id】
int
userid
=
userBean
.
getEmpNum
();
//用户id
AttendanceGroup
attgro
=
attendancegroupservice
.
getAttendanceGroupInformationByUserid
(
userid
,
qyid
);
//考勤组信息
int
qyid
=
userBean
.
getOrgCode
();
//坏小孩【企业id】
int
userid
=
userBean
.
getEmpNum
();
//用户id
//pbfs:排班方式 1:固定排班;2:自由排班;3:自由工时
if
(
attgro
!=
null
){
//判断当前用户是否加入到考勤组
//排班制
Schedule
jrpb
=
scheduleservice
.
getScheduleSpecificAttendance
(
attgro
.
getId
(),
userid
,
str
);
//固定排班
int
week
=
Integer
.
valueOf
(
ClockInTool
.
dateToWeek
(
str
));
//4
AttendanceWeeklySch
atwek
=
attendanceweeklyschservice
.
selectZhouDetail
(
attgro
.
getId
(),
week
);
//固定周排班
// QueryWrapper<YgglAttaHtxxb> queryWrapper = new QueryWrapper<>();
if
(
attgro
.
getPbfs
()
==
1
){
//固定排班
// queryWrapper.eq("org_code",qyid).eq("emp_num", userid);
// int week = Integer.valueOf(ClockInTool.dateToWeek(str));//4
// AttendanceWeeklySch atwek = attendanceweeklyschservice.selectZhouDetail(attgro.getId(),week);
if
(
atwek
!=
null
){
//有固定周排班
SpecialDate
rest
=
specialdateservice
.
SpecialDateSpecialDayOff
(
attgro
.
getId
(),
str
);
//查询打卡当天是否在特殊休息日期里面存在
if
(
rest
!=
null
){
//今天休息 Sort返回0【特殊日期--休息】
AttendanceGroup
attgro
=
attendancegroupservice
.
getAttendanceGroupInformationByUserid
(
userid
,
qyid
);
//考勤组信息
List
<
AttSchedule
>
atts
=
new
ArrayList
<
AttSchedule
>();
AttSchedule
as
=
new
AttSchedule
();
//pbfs:排班方式 1:固定排班;2:自由排班;3:自由工时
as
.
setId
(
0
);
if
(
attgro
!=
null
){
//判断当前用户是否加入到考勤组
as
.
setSort
(
0
);
//0:表示今天为休息日
//排班制
as
.
setTime
(
0
l
);
Schedule
jrpb
=
scheduleservice
.
getScheduleSpecificAttendance
(
attgro
.
getId
(),
userid
,
str
);
as
.
setStarttime
(
0
l
);
//固定排班
as
.
setEndtime
(
0
l
);
int
week
=
Integer
.
valueOf
(
dateToWeek
(
str
));
//4
atts
.
add
(
as
);
AttendanceWeeklySch
atwek
=
attendanceweeklyschservice
.
selectZhouDetail
(
attgro
.
getId
(),
week
);
//固定周排班
attcar
.
setAttsch
(
atts
);
}
else
{
//今天上班
if
(
attgro
.
getPbfs
()
==
1
){
//固定排班
ShiftManagement
bcz
=
shiftmanagementservice
.
selectByPrimaryKey
(
atwek
.
getBcid
());
// int week = Integer.valueOf(dateToWeek(str));//4
if
(
bcz
!=
null
){
// AttendanceWeeklySch atwek = attendanceweeklyschservice.selectZhouDetail(attgro.getId(),week);
Getshiftinformationbatch
(
bcz
,
attcar
,
str
);
if
(
atwek
!=
null
){
//有固定周排班
SpecialDate
rest
=
specialdateservice
.
SpecialDateSpecialDayOff
(
attgro
.
getId
(),
str
);
//查询打卡当天是否在特殊休息日期里面存在
if
(
rest
!=
null
){
//今天休息 Sort返回0【特殊日期--休息】
List
<
AttSchedule
>
atts
=
new
ArrayList
<
AttSchedule
>();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
0
);
as
.
setSort
(
0
);
//0:表示今天为休息日
as
.
setTime
(
0
l
);
as
.
setStarttime
(
0
l
);
as
.
setEndtime
(
0
l
);
atts
.
add
(
as
);
attcar
.
setAttsch
(
atts
);
}
else
{
//今天上班
ShiftManagement
bcz
=
shiftmanagementservice
.
selectByPrimaryKey
(
atwek
.
getBcid
());
if
(
bcz
!=
null
){
Getshiftinformationbatch
(
bcz
,
attcar
,
str
);
}
}
}
else
{
//必须打卡
SpecialDate
tsri
=
specialdateservice
.
SpecialDateTroubleshooting
(
attgro
.
getId
(),
str
);
//判断特殊日期
if
(
tsri
!=
null
){
ShiftManagement
tsrq
=
shiftmanagementservice
.
selectByPrimaryKey
(
tsri
.
getBcid
());
if
(
tsrq
!=
null
){
Getshiftinformationbatch
(
tsrq
,
attcar
,
str
);
}
}
else
{
//休息
List
<
AttSchedule
>
atts
=
new
ArrayList
<
AttSchedule
>();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
0
);
as
.
setSort
(
0
);
//0:表示今天为休息日
as
.
setTime
(
0
l
);
as
.
setStarttime
(
0
l
);
as
.
setEndtime
(
0
l
);
atts
.
add
(
as
);
attcar
.
setAttsch
(
atts
);
}
}
}
}
}
else
{
}
else
if
(
attgro
.
getPbfs
()
==
2
){
//自由排班
//必须打卡
SpecialDate
tsri
=
specialdateservice
.
SpecialDateTroubleshooting
(
attgro
.
getId
(),
str
);
//判断特殊日期
//未排班时,员工可选择班次打卡
if
(
tsri
!=
null
){
if
(
attgro
.
getIsXzbcdk
()
==
1
){
ShiftManagement
tsrq
=
shiftmanagementservice
.
selectByPrimaryKey
(
tsri
.
getBcid
());
attcar
.
setOptscheduling
(
true
);
if
(
tsrq
!=
null
){
}
else
{
Getshiftinformationbatch
(
tsrq
,
attcar
,
str
);
attcar
.
setOptscheduling
(
false
);
}
}
}
else
{
//休息
// Schedule jrpb = scheduleservice.getScheduleSpecificAttendance(attgro.getId(),userid,str);
List
<
AttSchedule
>
atts
=
new
ArrayList
<
AttSchedule
>();
if
(
jrpb
!=
null
){
AttSchedule
as
=
new
AttSchedule
();
List
<
AttSchedule
>
atts
=
new
ArrayList
<
AttSchedule
>();
as
.
setId
(
0
);
if
(
jrpb
.
getBcid
()
!=
0
){
//有班次时("Bcid"不为0时)
as
.
setSort
(
0
);
//0:表示今天为休息日
if
(
jrpb
.
getSxbcs
()
==
1
||
jrpb
.
getSxbcs
()
==
2
||
jrpb
.
getSxbcs
()
==
3
){
//1次上下班
as
.
setTime
(
0
l
);
for
(
int
o
=
0
;
o
<
2
;
o
++){
as
.
setStarttime
(
0
l
);
if
(
o
==
0
){
as
.
setEndtime
(
0
l
);
AttSchedule
as
=
new
AttSchedule
();
atts
.
add
(
as
);
as
.
setId
(
jrpb
.
getBcid
());
attcar
.
setAttsch
(
atts
);
as
.
setSort
(
1
);
}
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbdk1
()+
":00"
)));
}
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getSbqjks1
())?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjks1
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjjs1
()+
":00"
)));
}
else
if
(
attgro
.
getPbfs
()
==
2
){
//自由排班
atts
.
add
(
as
);
}
else
{
//未排班时,员工可选择班次打卡
AttSchedule
as
=
new
AttSchedule
();
if
(
attgro
.
getIsXzbcdk
()
==
1
){
as
.
setId
(
jrpb
.
getBcid
());
attcar
.
setOptscheduling
(
true
);
as
.
setSort
(
2
);
}
else
{
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbdk1
()+
":00"
)));
attcar
.
setOptscheduling
(
false
);
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjks1
()+
":00"
)));
}
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjjs1
()+
":00"
)));
atts
.
add
(
as
);
// Schedule jrpb = scheduleservice.getScheduleSpecificAttendance(attgro.getId(),userid,str);
}
if
(
jrpb
!=
null
){
List
<
AttSchedule
>
atts
=
new
ArrayList
<
AttSchedule
>();
if
(
jrpb
.
getBcid
()
!=
0
){
//有班次时("Bcid"不为0时)
if
(
jrpb
.
getSxbcs
()
==
1
||
jrpb
.
getSxbcs
()
==
2
||
jrpb
.
getSxbcs
()
==
3
){
//1次上下班
for
(
int
o
=
0
;
o
<
2
;
o
++){
if
(
o
==
0
){
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
jrpb
.
getBcid
());
as
.
setSort
(
1
);
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbdk1
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getSbqjks1
())?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjks1
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjjs1
()+
":00"
)));
atts
.
add
(
as
);
}
else
{
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
jrpb
.
getBcid
());
as
.
setSort
(
2
);
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbdk1
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjks1
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjjs1
()+
":00"
)));
atts
.
add
(
as
);
}
}
attcar
.
setAttsch
(
atts
);
}
}
if
(
jrpb
.
getSxbcs
()
==
2
||
jrpb
.
getSxbcs
()
==
3
){
//2次上下班
attcar
.
setAttsch
(
atts
);
for
(
int
o
=
0
;
o
<
2
;
o
++){
}
if
(
o
==
0
){
if
(
jrpb
.
getSxbcs
()
==
2
||
jrpb
.
getSxbcs
()
==
3
){
//2次上下班
AttSchedule
as
=
new
AttSchedule
();
for
(
int
o
=
0
;
o
<
2
;
o
++){
as
.
setId
(
jrpb
.
getBcid
());
if
(
o
==
0
){
as
.
setSort
(
3
);
AttSchedule
as
=
new
AttSchedule
();
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbdk2
()+
":00"
)));
as
.
setId
(
jrpb
.
getBcid
());
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjks2
()+
":00"
)));
as
.
setSort
(
3
);
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjjs2
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbdk2
()+
":00"
)));
atts
.
add
(
as
);
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjks2
()+
":00"
)));
}
else
{
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjjs2
()+
":00"
)));
AttSchedule
as
=
new
AttSchedule
();
atts
.
add
(
as
);
as
.
setId
(
jrpb
.
getBcid
());
}
else
{
as
.
setSort
(
4
);
AttSchedule
as
=
new
AttSchedule
();
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbdk2
()+
":00"
)));
as
.
setId
(
jrpb
.
getBcid
());
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjks2
()+
":00"
)));
as
.
setSort
(
4
);
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjjs2
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbdk2
()+
":00"
)));
atts
.
add
(
as
);
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjks2
()+
":00"
)));
}
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjjs2
()+
":00"
)));
atts
.
add
(
as
);
}
}
attcar
.
setAttsch
(
atts
);
}
}
if
(
jrpb
.
getSxbcs
()
==
3
){
//3次上下班
attcar
.
setAttsch
(
atts
);
for
(
int
o
=
0
;
o
<
2
;
o
++){
}
if
(
o
==
0
){
if
(
jrpb
.
getSxbcs
()
==
3
){
//3次上下班
AttSchedule
as
=
new
AttSchedule
();
for
(
int
o
=
0
;
o
<
2
;
o
++){
as
.
setId
(
jrpb
.
getBcid
());
if
(
o
==
0
){
as
.
setSort
(
5
);
AttSchedule
as
=
new
AttSchedule
();
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbdk3
()+
":00"
)));
as
.
setId
(
jrpb
.
getBcid
());
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjks3
()+
":00"
)));
as
.
setSort
(
5
);
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjjs3
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbdk3
()+
":00"
)));
atts
.
add
(
as
);
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjks3
()+
":00"
)));
}
else
{
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getSbqjjs3
()+
":00"
)));
AttSchedule
as
=
new
AttSchedule
();
atts
.
add
(
as
);
as
.
setId
(
jrpb
.
getBcid
());
}
else
{
as
.
setSort
(
6
);
AttSchedule
as
=
new
AttSchedule
();
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbdk3
()+
":00"
)));
as
.
setId
(
jrpb
.
getBcid
());
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjks3
()+
":00"
)));
as
.
setSort
(
6
);
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjjs3
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbdk3
()+
":00"
)));
atts
.
add
(
as
);
as
.
setStarttime
((
""
).
equals
(
jrpb
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjks3
()+
":00"
)));
}
as
.
setEndtime
((
""
).
equals
(
jrpb
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
jrpb
.
getXbqjjs3
()+
":00"
)));
atts
.
add
(
as
);
}
}
attcar
.
setAttsch
(
atts
);
}
}
}
else
{
//当天排班为休息
attcar
.
setAttsch
(
atts
);
List
<
AttSchedule
>
atts1
=
new
ArrayList
<
AttSchedule
>();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
0
);
as
.
setSort
(
0
);
//0:表示今天为休息日
as
.
setTime
(
0
l
);
as
.
setStarttime
(
0
l
);
as
.
setEndtime
(
0
l
);
atts1
.
add
(
as
);
attcar
.
setAttsch
(
atts1
);
}
}
}
else
{
//当天考勤组为给排班
}
else
{
//当天排班为休息
List
<
ShiftManagement
>
shifs
=
shiftmanagementservice
.
selectByPrimaryByQyid
(
qyid
);
List
<
AttSchedule
>
atts1
=
new
ArrayList
<
AttSchedule
>();
List
<
SystemShift
>
akms
=
new
ArrayList
<
SystemShift
>();
AttSchedule
as
=
new
AttSchedule
();
for
(
ShiftManagement
ah:
shifs
){
as
.
setId
(
0
);
SystemShift
sys
=
new
SystemShift
();
as
.
setSort
(
0
);
//0:表示今天为休息日
sys
.
setId
(
ah
.
getId
());
as
.
setTime
(
0
l
);
as
.
setStarttime
(
0
l
);
String
name
=
ah
.
getName
();
as
.
setEndtime
(
0
l
);
String
context
=
""
;
atts1
.
add
(
as
);
if
(
ah
.
getSxbcs
()
==
1
||
ah
.
getSxbcs
()
==
2
||
ah
.
getSxbcs
()
==
3
){
attcar
.
setAttsch
(
atts1
);
context
=
ah
.
getSbdk1
()
+
"-"
+
ah
.
getXbdk1
();
}
if
(
ah
.
getSxbcs
()
==
2
||
ah
.
getSxbcs
()
==
3
){
context
=
context
+
" "
+
ah
.
getSbdk2
()
+
"-"
+
ah
.
getXbdk2
();
}
if
(
ah
.
getSxbcs
()
==
3
){
context
=
context
+
" "
+
ah
.
getSbdk3
()
+
"-"
+
ah
.
getXbdk3
();
}
sys
.
setContext
(
name
+
" "
+
context
);
akms
.
add
(
sys
);
}
attcar
.
setSsfh
(
akms
);
//无排班时 获取的系统班次
}
}
else
{
//自由工时
//int week = Integer.valueOf(dateToWeek(str));//4
AttendanceWeeklySch
wekz
=
attendanceweeklyschservice
.
WeeklyFreeRoster
(
attgro
.
getId
(),
week
);
if
(
wekz
!=
null
){
//
String
dada
=
str
+
" "
+
attgro
.
getKqkssjTime
()+
":00"
;
attcar
.
setStapclotime
(
Long
.
valueOf
(
dateToStamp
(
dada
)));
}
if
(!(
""
).
equals
(
attgro
.
getJbzdsc
())){
attcar
.
setCanpunchworkdate
(
Double
.
valueOf
(
attgro
.
getJbzdsc
()));
//上班打卡后多久大下班卡
}
}
}
else
{
//当天考勤组为给排班
List
<
ShiftManagement
>
shifs
=
shiftmanagementservice
.
selectByPrimaryByQyid
(
qyid
);
List
<
SystemShift
>
akms
=
new
ArrayList
<
SystemShift
>();
for
(
ShiftManagement
ah:
shifs
){
SystemShift
sys
=
new
SystemShift
();
sys
.
setId
(
ah
.
getId
());
String
name
=
ah
.
getName
();
String
context
=
""
;
if
(
ah
.
getSxbcs
()
==
1
||
ah
.
getSxbcs
()
==
2
||
ah
.
getSxbcs
()
==
3
){
context
=
ah
.
getSbdk1
()
+
"-"
+
ah
.
getXbdk1
();
}
if
(
ah
.
getSxbcs
()
==
2
||
ah
.
getSxbcs
()
==
3
){
context
=
context
+
" "
+
ah
.
getSbdk2
()
+
"-"
+
ah
.
getXbdk2
();
}
if
(
ah
.
getSxbcs
()
==
3
){
context
=
context
+
" "
+
ah
.
getSbdk3
()
+
"-"
+
ah
.
getXbdk3
();
}
sys
.
setContext
(
name
+
" "
+
context
);
akms
.
add
(
sys
);
}
attcar
.
setSsfh
(
akms
);
//无排班时 获取的系统班次
}
}
if
(
jrpb
!=
null
||
atwek
!=
null
){
ShiftManagement
shif
=
null
;
}
else
{
//自由工时
if
(
attgro
.
getPbfs
()
==
1
){
//int week = Integer.valueOf(ClockInTool.dateToWeek(str));//4
shif
=
shiftmanagementservice
.
selectByPrimaryKey
(
atwek
.
getBcid
());
}
else
if
(
attgro
.
getPbfs
()
==
2
){
AttendanceWeeklySch
wekz
=
attendanceweeklyschservice
.
WeeklyFreeRoster
(
attgro
.
getId
(),
week
);
shif
=
shiftmanagementservice
.
selectByPrimaryKey
(
jrpb
.
getBcid
());
if
(
wekz
!=
null
){
//
}
String
dada
=
str
+
" "
+
attgro
.
getKqkssjTime
()+
":00"
;
attcar
.
setStapclotime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
dada
)));
if
(
shif
!=
null
){
}
if
(
shif
.
getIsXbdk
()
==
1
){
attcar
.
setNoclockout
(
true
);
// 下班不用打卡
if
(!(
""
).
equals
(
attgro
.
getJbzdsc
())){
}
else
{
attcar
.
setCanpunchworkdate
(
Double
.
valueOf
(
attgro
.
getJbzdsc
()));
//上班打卡后多久大下班卡
attcar
.
setNoclockout
(
false
);
// 下班不用打卡
}
}
attcar
.
setAllowlate
(
shif
.
getYxcdfzs
());
// 允许迟到分钟数
attcar
.
setSeriouslate
(
shif
.
getYzcdfzs
());
// 严重迟到分钟数
}
attcar
.
setAbsenteeismlate
(
shif
.
getKgcdfzs
());
// 旷工迟到分钟数
if
(
jrpb
!=
null
||
atwek
!=
null
){
if
(
shif
.
getIsWzwd
()
==
1
){
ShiftManagement
shif
=
null
;
attcar
.
setIslatelate
(
true
);
// 晚走晚到
if
(
attgro
.
getPbfs
()
==
1
){
List
<
AttLateLate
>
atwzwd
=
new
ArrayList
<
AttLateLate
>();
shif
=
shiftmanagementservice
.
selectByPrimaryKey
(
atwek
.
getBcid
());
int
p
=
0
;
}
else
if
(
attgro
.
getPbfs
()
==
2
){
if
(!(
""
).
equals
(
shif
.
getXbwz1
())
&&
!(
""
).
equals
(
shif
.
getSbwd1
())){
p
=
2
;}
shif
=
shiftmanagementservice
.
selectByPrimaryKey
(
jrpb
.
getBcid
());
if
(!(
""
).
equals
(
shif
.
getXbwz1
())
&&
!(
""
).
equals
(
shif
.
getSbwd1
())
&&
!(
""
).
equals
(
shif
.
getXbwz2
())
&&
!(
""
).
equals
(
shif
.
getSbwd2
())){
p
=
4
;}
}
if
(!(
""
).
equals
(
shif
.
getXbwz1
())
&&
!(
""
).
equals
(
shif
.
getSbwd1
())
&&
!(
""
).
equals
(
shif
.
getXbwz2
())
&&
!(
""
).
equals
(
shif
.
getSbwd2
())
&&
!(
""
).
equals
(
shif
.
getXbwz3
())
&&
!(
""
).
equals
(
shif
.
getSbwd3
())){
p
=
6
;}
AttLateLate
ala
=
new
AttLateLate
();
if
(
shif
!=
null
){
ala
.
setLatewalk
(
shif
.
getXbwz1
());
if
(
shif
.
getIsXbdk
()
==
1
){
ala
.
setArrivelate
(
shif
.
getSbwd1
());
attcar
.
setNoclockout
(
true
);
// 下班不用打卡
atwzwd
.
add
(
ala
);
}
else
{
if
(
p
==
4
||
p
==
6
){
attcar
.
setNoclockout
(
false
);
// 下班不用打卡
AttLateLate
alat
=
new
AttLateLate
();
}
alat
.
setLatewalk
(
shif
.
getXbwz2
());
attcar
.
setAllowlate
(
shif
.
getYxcdfzs
());
// 允许迟到分钟数
alat
.
setArrivelate
(
shif
.
getSbwd2
());
attcar
.
setSeriouslate
(
shif
.
getYzcdfzs
());
// 严重迟到分钟数
atwzwd
.
add
(
alat
);
attcar
.
setAbsenteeismlate
(
shif
.
getKgcdfzs
());
// 旷工迟到分钟数
}
if
(
shif
.
getIsWzwd
()
==
1
){
if
(
p
==
6
){
attcar
.
setIslatelate
(
true
);
// 晚走晚到
AttLateLate
alas
=
new
AttLateLate
();
List
<
AttLateLate
>
atwzwd
=
new
ArrayList
<
AttLateLate
>();
alas
.
setLatewalk
(
shif
.
getXbwz3
());
int
p
=
0
;
alas
.
setArrivelate
(
shif
.
getSbwd3
());
if
(!(
""
).
equals
(
shif
.
getXbwz1
())
&&
!(
""
).
equals
(
shif
.
getSbwd1
())){
p
=
2
;}
atwzwd
.
add
(
alas
);
if
(!(
""
).
equals
(
shif
.
getXbwz1
())
&&
!(
""
).
equals
(
shif
.
getSbwd1
())
&&
!(
""
).
equals
(
shif
.
getXbwz2
())
&&
!(
""
).
equals
(
shif
.
getSbwd2
())){
p
=
4
;}
}
if
(!(
""
).
equals
(
shif
.
getXbwz1
())
&&
!(
""
).
equals
(
shif
.
getSbwd1
())
&&
!(
""
).
equals
(
shif
.
getXbwz2
())
&&
!(
""
).
equals
(
shif
.
getSbwd2
())
&&
!(
""
).
equals
(
shif
.
getXbwz3
())
&&
!(
""
).
equals
(
shif
.
getSbwd3
())){
p
=
6
;}
attcar
.
setAttlat
(
atwzwd
);
AttLateLate
ala
=
new
AttLateLate
();
}
else
{
ala
.
setLatewalk
(
shif
.
getXbwz1
());
attcar
.
setIslatelate
(
false
);
// 晚走晚到
ala
.
setArrivelate
(
shif
.
getSbwd1
());
}
atwzwd
.
add
(
ala
);
}
if
(
p
==
4
||
p
==
6
){
}
AttLateLate
alat
=
new
AttLateLate
();
alat
.
setLatewalk
(
shif
.
getXbwz2
());
attcar
.
setAttgrouptype
(
attgro
.
getPbfs
());
//1:固定排班;2:自由排班;3:自由工时
alat
.
setArrivelate
(
shif
.
getSbwd2
());
atwzwd
.
add
(
alat
);
//外勤 true:开 false:关
}
if
(
attgro
.
getIsWq
()
==
1
)
{
if
(
p
==
6
){
attcar
.
setFieldpersonnel
(
true
);
AttLateLate
alas
=
new
AttLateLate
();
}
else
{
alas
.
setLatewalk
(
shif
.
getXbwz3
());
attcar
.
setFieldpersonnel
(
false
);
alas
.
setArrivelate
(
shif
.
getSbwd3
());
}
atwzwd
.
add
(
alas
);
}
attcar
.
setAttlat
(
atwzwd
);
//打卡方式
}
else
{
List
<
AttGroupBinPunchMode
>
attmetlist
=
attgroupbinpunchmodeservice
.
selectByPrimaryByKqzId
(
attgro
.
getId
());
attcar
.
setIslatelate
(
false
);
// 晚走晚到
for
(
AttGroupBinPunchMode
agbp:
attmetlist
){
}
//类型(1:考勤机;2:地址;3:WIFI)
}
if
(
agbp
.
getType
()
==
1
){
}
attcar
.
setAttmachine
(
true
);
}
else
if
(
agbp
.
getType
()
==
2
){
attcar
.
setAttgrouptype
(
attgro
.
getPbfs
());
//1:固定排班;2:自由排班;3:自由工时
attcar
.
setAttaddress
(
true
);
}
else
{
//外勤 true:开 false:关
attcar
.
setAttwifi
(
true
);
if
(
attgro
.
getIsWq
()
==
1
)
{
}
attcar
.
setFieldpersonnel
(
true
);
}
}
else
{
attcar
.
setFieldpersonnel
(
false
);
//详细打卡方式
}
List
<
AttClockMethod
>
akms
=
new
ArrayList
<
AttClockMethod
>();
for
(
AttGroupBinPunchMode
abp:
attmetlist
){
//打卡方式
if
(
abp
.
getType
()
==
1
){
List
<
AttGroupBinPunchMode
>
attmetlist
=
attgroupbinpunchmodeservice
.
selectByPrimaryByKqzId
(
attgro
.
getId
());
AttendanceMachine
kqjs
=
attendancemachineservice
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
for
(
AttGroupBinPunchMode
agbp:
attmetlist
){
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
//类型(1:考勤机;2:地址;3:WIFI)
akm
.
setName
(
kqjs
.
getName
());
// 打卡名称
if
(
agbp
.
getType
()
==
1
){
akm
.
setMac
(
""
);
// wifi【wifi】
attcar
.
setAttmachine
(
true
);
akm
.
setAttrange
(
0
);
// 范围【地址】
}
else
if
(
agbp
.
getType
()
==
2
){
akm
.
setType
(
1
);
// 类型(1:考勤机;2:地址;3:WIFI)
attcar
.
setAttaddress
(
true
);
akm
.
setLongitude
(
0
);
// 经度【地址】
}
else
{
akm
.
setLatitude
(
0
);
// 纬度【地址】
attcar
.
setAttwifi
(
true
);
akms
.
add
(
akm
);
}
}
else
if
(
abp
.
getType
()
==
2
){
}
PunchCardAddress
kqdzs
=
punchcardaddressservice
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
//详细打卡方式
akm
.
setName
(
kqdzs
.
getName
());
// 打卡名称
List
<
AttClockMethod
>
akms
=
new
ArrayList
<
AttClockMethod
>();
akm
.
setMac
(
""
);
// wifi【wifi】
akm
.
setAttrange
(
kqdzs
.
getDkfw
());
// 范围【地址】
for
(
AttGroupBinPunchMode
abp:
attmetlist
){
akm
.
setType
(
2
);
// 类型(1:考勤机;2:地址;3:WIFI)
if
(
abp
.
getType
()
==
1
){
akm
.
setLongitude
(
kqdzs
.
getLon
());
// 经度【地址】
AttendanceMachine
kqjs
=
attendancemachineservice
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
akm
.
setLatitude
(
kqdzs
.
getLat
());
// 纬度【地址】
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
akms
.
add
(
akm
);
akm
.
setName
(
kqjs
.
getName
());
// 打卡名称
}
else
{
akm
.
setMac
(
""
);
// wifi【wifi】
PunchCardWiFi
kqwfs
=
punchcardwifiservice
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
akm
.
setAttrange
(
0
);
// 范围【地址】
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
akm
.
setType
(
1
);
// 类型(1:考勤机;2:地址;3:WIFI)
akm
.
setName
(
kqwfs
.
getName
());
// 打卡名称
akm
.
setLongitude
(
0
);
// 经度【地址】
akm
.
setMac
(
kqwfs
.
getMac
());
// wifi【wifi】
akm
.
setLatitude
(
0
);
// 纬度【地址】
akm
.
setAttrange
(
0
);
// 范围【地址】
akms
.
add
(
akm
);
akm
.
setType
(
3
);
// 类型(1:考勤机;2:地址;3:WIFI)
}
else
if
(
abp
.
getType
()
==
2
){
akm
.
setLongitude
(
0
);
// 经度【地址】
PunchCardAddress
kqdzs
=
punchcardaddressservice
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
akm
.
setLatitude
(
0
);
// 纬度【地址】
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
akms
.
add
(
akm
);
akm
.
setName
(
kqdzs
.
getName
());
// 打卡名称
}
akm
.
setMac
(
""
);
// wifi【wifi】
}
akm
.
setAttrange
(
kqdzs
.
getDkfw
());
// 范围【地址】
attcar
.
setMachine
(
akms
);
akm
.
setType
(
2
);
// 类型(1:考勤机;2:地址;3:WIFI)
akm
.
setLongitude
(
kqdzs
.
getLon
());
// 经度【地址】
akm
.
setLatitude
(
kqdzs
.
getLat
());
// 纬度【地址】
}
else
{
akms
.
add
(
akm
);
//无排班
}
else
{
//系统班次
PunchCardWiFi
kqwfs
=
punchcardwifiservice
.
selectByPrimaryKey
(
abp
.
getDkfsid
());
// List<ShiftManagement> shifs = shiftmanagementservice.selectByPrimaryByQyid(qyid);
AttClockMethod
akm
=
AttClockMethod
.
builder
().
build
();
// List<SystemShift> akms = new ArrayList<SystemShift>();
akm
.
setName
(
kqwfs
.
getName
());
// 打卡名称
// for(ShiftManagement ah:shifs){
akm
.
setMac
(
kqwfs
.
getMac
());
// wifi【wifi】
// SystemShift sys = new SystemShift();
akm
.
setAttrange
(
0
);
// 范围【地址】
// sys.setId(ah.getId());
akm
.
setType
(
3
);
// 类型(1:考勤机;2:地址;3:WIFI)
//
akm
.
setLongitude
(
0
);
// 经度【地址】
// String name = ah.getName();
akm
.
setLatitude
(
0
);
// 纬度【地址】
// String context = "";
akms
.
add
(
akm
);
// if(ah.getSxbcs() == 1 || ah.getSxbcs() == 2 || ah.getSxbcs() == 3){
}
// context = dealDateFormat(ah.getSbdk1(),2) + "-" + dealDateFormat(ah.getXbdk1(),2);
}
// }
attcar
.
setMachine
(
akms
);
// if(ah.getSxbcs() == 2 || ah.getSxbcs() == 3){
// context = context +" "+ dealDateFormat(ah.getSbdk2(),2) + "-" + dealDateFormat(ah.getXbdk2(),2);
// }
}
else
{
// if(ah.getSxbcs() == 3){
//无排班
// context = context +" "+ dealDateFormat(ah.getSbdk3(),2) + "-" + dealDateFormat(ah.getXbdk3(),2);
//系统班次
// }
// List<ShiftManagement> shifs = shiftmanagementservice.selectByPrimaryByQyid(qyid);
// sys.setContext(name+ " " + context);
// List<SystemShift> akms = new ArrayList<SystemShift>();
//
// for(ShiftManagement ah:shifs){
// akms.add(sys);
// SystemShift sys = new SystemShift();
// }
// sys.setId(ah.getId());
// attcar.setSsfh(akms);//无排班时 获取的系统班次
//
// String name = ah.getName();
attcar
.
setAttgrouptype
(
0
);
//1:固定排班;2:自由排班;3:自由工时
// String context = "";
}
// if(ah.getSxbcs() == 1 || ah.getSxbcs() == 2 || ah.getSxbcs() == 3){
// context = ClockInTool.dealDateFormat(ah.getSbdk1(),2) + "-" + ClockInTool.dealDateFormat(ah.getXbdk1(),2);
//打卡记录
// }
List
<
PunchRecord
>
dajllist
=
punchrecordservice
.
getDetailedRecordClock
(
startDate
,
endDate
,
userid
);
// if(ah.getSxbcs() == 2 || ah.getSxbcs() == 3){
attcar
.
setAttpr
(
dajllist
);
// context = context +" "+ ClockInTool.dealDateFormat(ah.getSbdk2(),2) + "-" + ClockInTool.dealDateFormat(ah.getXbdk2(),2);
// }
// if(ah.getSxbcs() == 3){
// context = context +" "+ ClockInTool.dealDateFormat(ah.getSbdk3(),2) + "-" + ClockInTool.dealDateFormat(ah.getXbdk3(),2);
// }
// sys.setContext(name+ " " + context);
//
// akms.add(sys);
// }
// attcar.setSsfh(akms);//无排班时 获取的系统班次
return
ResultUtil
.
data
(
attcar
);
attcar
.
setAttgrouptype
(
0
);
//1:固定排班;2:自由排班;3:自由工时
}
//打卡记录
List
<
PunchRecord
>
dajllist
=
punchrecordservice
.
getDetailedRecordClock
(
startDate
,
endDate
,
userid
);
attcar
.
setAttpr
(
dajllist
);
return
ResultUtil
.
data
(
attcar
);
}
}
...
@@ -3304,17 +3215,17 @@ public class AttController {
...
@@ -3304,17 +3215,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
1
);
as
.
setSort
(
1
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbdk1
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbdk1
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjks1
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjks1
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjjs1
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjjs1
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
2
);
as
.
setSort
(
2
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbdk1
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbdk1
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjks1
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjks1
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjjs1
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjjs1
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -3326,17 +3237,17 @@ public class AttController {
...
@@ -3326,17 +3237,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
3
);
as
.
setSort
(
3
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbdk2
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbdk2
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjks2
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjks2
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjjs2
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjjs2
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
4
);
as
.
setSort
(
4
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbdk2
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbdk2
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjks2
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjks2
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjjs2
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjjs2
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -3348,17 +3259,17 @@ public class AttController {
...
@@ -3348,17 +3259,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
5
);
as
.
setSort
(
5
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbdk3
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbdk3
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjks3
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjks3
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjjs3
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjjs3
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
6
);
as
.
setSort
(
6
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbdk3
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbdk3
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjks3
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjks3
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjjs3
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjjs3
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -3367,9 +3278,6 @@ public class AttController {
...
@@ -3367,9 +3278,6 @@ public class AttController {
}
}
/**
* ??????
*/
public
void
Getshiftinformationbatch
(
ShiftManagement
shiftm
,
AttendanceCardList
attcar
,
String
str
){
public
void
Getshiftinformationbatch
(
ShiftManagement
shiftm
,
AttendanceCardList
attcar
,
String
str
){
List
<
AttSchedule
>
atts
=
new
ArrayList
<
AttSchedule
>();
List
<
AttSchedule
>
atts
=
new
ArrayList
<
AttSchedule
>();
if
(
shiftm
.
getSxbcs
()
==
1
||
shiftm
.
getSxbcs
()
==
2
||
shiftm
.
getSxbcs
()
==
3
){
//1次上下班
if
(
shiftm
.
getSxbcs
()
==
1
||
shiftm
.
getSxbcs
()
==
2
||
shiftm
.
getSxbcs
()
==
3
){
//1次上下班
...
@@ -3378,17 +3286,17 @@ public class AttController {
...
@@ -3378,17 +3286,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
1
);
as
.
setSort
(
1
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbdk1
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbdk1
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjks1
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjks1
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjjs1
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjjs1
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
2
);
as
.
setSort
(
2
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbdk1
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbdk1
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjks1
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjks1
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjjs1
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjjs1
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -3400,17 +3308,17 @@ public class AttController {
...
@@ -3400,17 +3308,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
3
);
as
.
setSort
(
3
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbdk2
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbdk2
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjks2
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjks2
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjjs2
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjjs2
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
4
);
as
.
setSort
(
4
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbdk2
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbdk2
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjks2
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjks2
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjjs2
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjjs2
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -3422,17 +3330,17 @@ public class AttController {
...
@@ -3422,17 +3330,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
5
);
as
.
setSort
(
5
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbdk3
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbdk3
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjks3
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjks3
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getSbqjjs3
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getSbqjjs3
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shiftm
.
getId
());
as
.
setId
(
shiftm
.
getId
());
as
.
setSort
(
6
);
as
.
setSort
(
6
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbdk3
(),
2
)+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbdk3
(
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjks3
(),
2
)+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shiftm
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjks3
(
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
dealDateFormat
(
shiftm
.
getXbqjjs3
(),
2
)+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shiftm
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shiftm
.
getXbqjjs3
(
)+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -3503,16 +3411,16 @@ public class AttController {
...
@@ -3503,16 +3411,16 @@ public class AttController {
Long
xbdk3
=
0
l
;
Long
xbdk3
=
0
l
;
if
(
banci
!=
null
){
if
(
banci
!=
null
){
if
(
banci
.
getSxbcs
()==
1
||
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
if
(
banci
.
getSxbcs
()==
1
||
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
sbdk1
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getSbdk1
()+
":00"
));
sbdk1
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getSbdk1
()+
":00"
));
xbdk1
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getXbdk1
()+
":00"
));
xbdk1
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getXbdk1
()+
":00"
));
}
}
if
(
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
if
(
banci
.
getSxbcs
()==
2
||
banci
.
getSxbcs
()==
3
){
sbdk2
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getSbdk2
()+
":00"
));
sbdk2
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getSbdk2
()+
":00"
));
xbdk2
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getXbdk2
()+
":00"
));
xbdk2
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getXbdk2
()+
":00"
));
}
}
if
(
banci
.
getSxbcs
()==
3
){
if
(
banci
.
getSxbcs
()==
3
){
sbdk3
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getSbdk3
()+
":00"
));
sbdk3
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getSbdk3
()+
":00"
));
xbdk3
=
Long
.
valueOf
(
dateToStamp
(
data
+
" "
+
banci
.
getXbdk3
()+
":00"
));
xbdk3
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
data
+
" "
+
banci
.
getXbdk3
()+
":00"
));
}
}
}
}
//之前打卡的班次
//之前打卡的班次
...
@@ -4251,17 +4159,17 @@ public class AttController {
...
@@ -4251,17 +4159,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
1
);
as
.
setSort
(
1
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk1
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk1
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks1
())?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks1
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks1
())?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks1
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs1
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs1
()+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
2
);
as
.
setSort
(
2
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk1
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk1
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks1
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks1
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs1
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs1
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs1
()+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -4273,17 +4181,17 @@ public class AttController {
...
@@ -4273,17 +4181,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
3
);
as
.
setSort
(
3
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk2
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk2
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks2
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks2
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs2
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs2
()+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
4
);
as
.
setSort
(
4
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk2
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk2
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks2
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks2
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs2
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs2
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs2
()+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -4295,17 +4203,17 @@ public class AttController {
...
@@ -4295,17 +4203,17 @@ public class AttController {
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
5
);
as
.
setSort
(
5
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk3
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbdk3
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks3
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getSbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjks3
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs3
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getSbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getSbqjjs3
()+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
else
{
}
else
{
AttSchedule
as
=
new
AttSchedule
();
AttSchedule
as
=
new
AttSchedule
();
as
.
setId
(
shifs
.
getId
());
as
.
setId
(
shifs
.
getId
());
as
.
setSort
(
6
);
as
.
setSort
(
6
);
as
.
setTime
(
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk3
()+
":00"
)));
as
.
setTime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbdk3
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks3
()+
":00"
)));
as
.
setStarttime
((
""
).
equals
(
shifs
.
getXbqjks3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjks3
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs3
()+
":00"
)));
as
.
setEndtime
((
""
).
equals
(
shifs
.
getXbqjjs3
())
?
0
:
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
str
+
" "
+
shifs
.
getXbqjjs3
()+
":00"
)));
atts
.
add
(
as
);
atts
.
add
(
as
);
}
}
}
}
...
@@ -4817,7 +4725,7 @@ public class AttController {
...
@@ -4817,7 +4725,7 @@ public class AttController {
}
}
pre
.
setQyid
(
qyid
);
// 企业id
pre
.
setQyid
(
qyid
);
// 企业id
String
attdate_
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
startDate
));
//转换打卡时间格式
String
attdate_
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
startDate
));
//转换打卡时间格式
pre
.
setAttdate
(
attdate_
+
" "
+
dateToWeek2
(
putime
));
// 考勤日期
pre
.
setAttdate
(
attdate_
+
" "
+
ClockInTool
.
dateToWeek2
(
putime
));
// 考勤日期
long
date
=
new
Date
().
getTime
();
long
date
=
new
Date
().
getTime
();
if
((
"0"
).
equals
(
clock
.
getPunchcardtime
())){
if
((
"0"
).
equals
(
clock
.
getPunchcardtime
())){
...
@@ -4842,125 +4750,6 @@ public class AttController {
...
@@ -4842,125 +4750,6 @@ public class AttController {
/************************************************************************************************************************************/
/************************************************************************************************************************************/
/***************************************************工具方法区***************************************************************************/
/***************************************************工具方法区***************************************************************************/
/************************************************************************************************************************************/
/************************************************************************************************************************************/
/**
* 时间转换时间戳
*/
public
static
String
dateToStamp
(
String
s
){
String
res
;
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
date
=
null
;
try
{
date
=
simpleDateFormat
.
parse
(
s
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
long
ts
=
date
.
getTime
();
res
=
String
.
valueOf
(
ts
);
return
res
;
}
/**
* 2019-10-24T00:30:23.000Z 转化时间
*/
public
String
dealDateFormat
(
String
oldDateStr
,
int
num
)
{
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
);
// yyyy-MM-dd'T'HH:mm:ss.SSSZ
Date
date
=
null
;
try
{
date
=
df
.
parse
(
oldDateStr
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
SimpleDateFormat
df1
=
new
SimpleDateFormat
(
"EEE MMM dd HH:mm:ss Z yyyy"
,
Locale
.
UK
);
Date
date1
=
null
;
try
{
date1
=
df1
.
parse
(
date
.
toString
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
DateFormat
df2
=
null
;
if
(
num
==
1
){
df2
=
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
);
}
else
if
(
num
==
2
){
df2
=
new
SimpleDateFormat
(
"HH:mm"
);
}
return
df2
.
format
(
date1
);
}
/**
* 根据日期获取 星期 (2019-05-06 ——> 星期一)
* @param datetime
* @return
*/
public
static
String
dateToWeek
(
String
datetime
)
{
SimpleDateFormat
f
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
String
[]
weekDays
=
{
"7"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
Calendar
cal
=
Calendar
.
getInstance
();
Date
date
;
try
{
date
=
f
.
parse
(
datetime
);
cal
.
setTime
(
date
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
//一周的第几天
int
w
=
cal
.
get
(
Calendar
.
DAY_OF_WEEK
)
-
1
;
if
(
w
<
0
)
w
=
0
;
return
weekDays
[
w
];
}
public
static
String
dateToWeek2
(
String
datetime
)
{
SimpleDateFormat
f
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
[]
weekDays
=
{
"星期日"
,
"星期一"
,
"星期二"
,
"星期三"
,
"星期四"
,
"星期五"
,
"星期六"
};
// String[] weekDays = {"7", "1", "2", "3", "4", "5", "6"};
Calendar
cal
=
Calendar
.
getInstance
();
Date
date
;
try
{
date
=
f
.
parse
(
datetime
);
cal
.
setTime
(
date
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
//一周的第几天
int
w
=
cal
.
get
(
Calendar
.
DAY_OF_WEEK
)
-
1
;
if
(
w
<
0
)
w
=
0
;
return
weekDays
[
w
];
}
/**
* 获取月份起始日期
*
* @param date
* @return
* @throws ParseException
*/
public
String
getMinMonthDate
(
String
date
)
throws
ParseException
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
famt
.
parse
(
date
));
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
return
famt
.
format
(
calendar
.
getTime
());
}
/**
* 获取月份最后日期
*
* @param date
* @return
* @throws ParseException
*/
public
String
getMaxMonthDate
(
String
date
)
throws
ParseException
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
famt
.
parse
(
date
));
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
return
famt
.
format
(
calendar
.
getTime
());
}
/**
/**
* 对比两个字符串数组
* 对比两个字符串数组
...
@@ -5064,10 +4853,10 @@ public class AttController {
...
@@ -5064,10 +4853,10 @@ public class AttController {
if
(!(
""
).
equals
(
attendancedetails
.
getStart
())){
if
(!(
""
).
equals
(
attendancedetails
.
getStart
())){
try
{
try
{
String
sdaet
=
getMinMonthDate
(
attendancedetails
.
getStart
());
String
sdaet
=
ClockInTool
.
getMinMonthDate
(
attendancedetails
.
getStart
());
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
sdaet
,
"yyyy-MM-dd"
)).
getTime
();
String
edate
=
getMaxMonthDate
(
attendancedetails
.
getEnd
());
String
edate
=
ClockInTool
.
getMaxMonthDate
(
attendancedetails
.
getEnd
());
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
edate
,
"yyyy-MM-dd"
)).
getTime
();
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
View file @
46126e70
...
@@ -4,15 +4,13 @@ import java.math.BigDecimal;
...
@@ -4,15 +4,13 @@ import java.math.BigDecimal;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -21,6 +19,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -21,6 +19,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.bean.kqgl.AttendanceGroup
;
import
cn.timer.api.bean.kqgl.PunchCardDetails
;
import
cn.timer.api.bean.kqgl.PunchRecord
;
import
cn.timer.api.bean.kqgl.ShiftManagement
;
import
cn.timer.api.bean.kqmk.KqglAssoBcsz
;
import
cn.timer.api.bean.kqmk.KqglAssoBcsz
;
import
cn.timer.api.bean.kqmk.KqglAssoDkjl
;
import
cn.timer.api.bean.kqmk.KqglAssoDkjl
;
import
cn.timer.api.bean.kqmk.KqglAssoDkmx
;
import
cn.timer.api.bean.kqmk.KqglAssoDkmx
;
...
@@ -30,7 +32,13 @@ import cn.timer.api.bean.kqmk.KqglAssoTeshu;
...
@@ -30,7 +32,13 @@ import cn.timer.api.bean.kqmk.KqglAssoTeshu;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglAssoZhoupaiban
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.dao.kqgl.AttendanceGroupMapper
;
import
cn.timer.api.dao.kqgl.PunchCardDetailsMapper
;
import
cn.timer.api.dao.kqgl.PunchRecordMapper
;
import
cn.timer.api.dao.kqgl.ShiftManagementMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoBcszMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoBcszMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkjlMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkjlMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkmxMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkmxMapper
;
...
@@ -45,6 +53,7 @@ import cn.timer.api.utils.DateUtil;
...
@@ -45,6 +53,7 @@ import cn.timer.api.utils.DateUtil;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
cn.timer.api.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
=
"3.0[3]考勤打卡"
)
@Api
(
tags
=
"3.0[3]考勤打卡"
)
...
@@ -58,10 +67,8 @@ public class ClockInController {
...
@@ -58,10 +67,8 @@ public class ClockInController {
//打卡明细表
//打卡明细表
@Autowired
@Autowired
private
KqglAssoDkmxMapper
kqglassodkmxmapper
;
private
KqglAssoDkmxMapper
kqglassodkmxmapper
;
@Autowired
@Autowired
private
KqglAssoDkjlMapper
kqglassodkjlmapper
;
private
KqglAssoDkjlMapper
kqglassodkjlmapper
;
@Autowired
@Autowired
private
KqglAssoBcszMapper
kqglassobcszmapper
;
private
KqglAssoBcszMapper
kqglassobcszmapper
;
...
@@ -117,43 +124,28 @@ public class ClockInController {
...
@@ -117,43 +124,28 @@ public class ClockInController {
//打卡当天开始时间,打卡当天结束时间
//打卡当天开始时间,打卡当天结束时间
Long
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
putime
,
"yyyy-MM-dd"
)).
getTime
();
Long
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
putime
,
"yyyy-MM-dd"
)).
getTime
();
Long
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
putime
,
"yyyy-MM-dd"
)).
getTime
();
Long
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
putime
,
"yyyy-MM-dd"
)).
getTime
();
int
dkmx
=
0
;
int
dkmx
=
0
;
int
shifid
=
0
;
int
shifid
=
0
;
long
punchcardtime
=
0
,
punchstart
=
0
,
punchend
=
0
;
//应打卡时间,应打卡开始时间,应打卡结束时间
long
punchcardtime
=
0
,
punchstart
=
0
,
punchend
=
0
;
//应打卡时间,应打卡开始时间,应打卡结束时间
boolean
isRange
=
true
;
//是否在打卡时间范围内
boolean
isRange
=
true
;
//是否在打卡时间范围内
int
atttype
=
0
;
int
atttype
=
0
;
int
execution_status
=
0
;
//执行状态
int
execution_status
=
0
;
//执行状态
boolean
kskd
=
true
;
//识别是否更新最后一次打卡 针对于最后一次下班卡
boolean
kskd
=
true
;
//识别是否更新最后一次打卡 针对于最后一次下班卡
boolean
sbdkkd
=
false
;
//针对于上班 未超过上班卡打卡 视为无效打卡
boolean
sbdkkd
=
false
;
//针对于上班 未超过上班卡打卡 视为无效打卡
ClockCollectData
clockt
=
new
ClockCollectData
();
ClockCollectData
clockt
=
new
ClockCollectData
();
//putime: 根据日期 得到打卡所需的详细信息
//putime: 根据日期 得到打卡所需的详细信息
AttendanceCardListDto
attdate
=
MethodCall
(
qyid
,
userid
,
putime
);
AttendanceCardListDto
attdate
=
MethodCall
(
qyid
,
userid
,
putime
);
/*******/
/*******/
if
(
attgro
!=
null
)
{
//判断考勤组是否存在
if
(
attgro
!=
null
)
{
//判断考勤组是否存在
List
<
KqglAssoKqzdkfs
>
kqjs
=
KqglAssoKqzdkfs
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoKqzdkfs
>().
lambda
().
eq
(
KqglAssoKqzdkfs:
:
getKqzId
,
attgro
.
getId
()));
List
<
KqglAssoKqzdkfs
>
kqjs
=
KqglAssoKqzdkfs
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoKqzdkfs
>().
lambda
().
eq
(
KqglAssoKqzdkfs:
:
getKqzId
,
attgro
.
getId
()));
if
(
kqjs
.
size
()
>
0
)
{
if
(
kqjs
.
size
()
>
0
)
{
/**
/**
* 当考勤组为“固定排班”和“自定义排班”时 方可使用
* 当考勤组为“固定排班”和“自定义排班”时 方可使用
*/
*/
if
(
attdate
.
getAttgrouptype
()
!=
3
)
{
if
(
attdate
.
getAttgrouptype
()
!=
3
)
{
//查询打卡当天是否有记录**********************************
//查询打卡当天是否有记录**********************************
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
();
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
();
//putime: 根据日期 得到打卡所需的详细信息
// AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
String
dakariqi
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
startDateyesterday
))+
" "
+
ClockInTool
.
dateToWeek2
(
yesterday
);
String
dakariqi
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
startDateyesterday
))+
" "
+
ClockInTool
.
dateToWeek2
(
yesterday
);
//检查昨日的班次是否存在次日打卡
//检查昨日的班次是否存在次日打卡
KqglAssoDkjl
balan
=
kqglassodkjlmapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
eq
(
KqglAssoDkjl:
:
getUserId
,
userid
).
eq
(
KqglAssoDkjl:
:
getAttdate
,
dakariqi
).
ne
(
KqglAssoDkjl:
:
getBcid
,
0
).
orderByDesc
(
KqglAssoDkjl
::
getSort
).
last
(
"LIMIT 1"
));
KqglAssoDkjl
balan
=
kqglassodkjlmapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
eq
(
KqglAssoDkjl:
:
getUserId
,
userid
).
eq
(
KqglAssoDkjl:
:
getAttdate
,
dakariqi
).
ne
(
KqglAssoDkjl:
:
getBcid
,
0
).
orderByDesc
(
KqglAssoDkjl
::
getSort
).
last
(
"LIMIT 1"
));
boolean
dnck
=
false
;
boolean
dnck
=
false
;
...
@@ -162,9 +154,7 @@ public class ClockInController {
...
@@ -162,9 +154,7 @@ public class ClockInController {
//班次信息
//班次信息
KqglAssoBcsz
shif
=
kqglassobcszmapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
balan
.
getBcid
()));
KqglAssoBcsz
shif
=
kqglassobcszmapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
balan
.
getBcid
()));
int
dkcs
=
shif
.
getSxbcs
()*
2
;
int
dkcs
=
shif
.
getSxbcs
()*
2
;
List
<
AttSchedule
>
ashss
=
attdate
.
getAttsch
();
//获取今天应打卡时间
List
<
AttSchedule
>
ashss
=
attdate
.
getAttsch
();
//获取今天应打卡时间
// boolean dnck = false;
if
(
ashss
.
size
()
>
0
)
{
if
(
ashss
.
size
()
>
0
)
{
Date
sd1
=
df1
.
parse
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
ashss
.
get
(
0
).
getTime
())));
//当天应打的首次上班卡时间
Date
sd1
=
df1
.
parse
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
ashss
.
get
(
0
).
getTime
())));
//当天应打的首次上班卡时间
Date
sd2
=
df1
.
parse
(
current_time
);
//当前时间
Date
sd2
=
df1
.
parse
(
current_time
);
//当前时间
...
@@ -172,13 +162,11 @@ public class ClockInController {
...
@@ -172,13 +162,11 @@ public class ClockInController {
dnck
=
true
;
dnck
=
true
;
}
}
}
}
int
isXbdk1Cr
=
shif
.
getIsXbdk1Cr
();
//下班1是否次日(0:否;1:是)
int
isXbdk1Cr
=
shif
.
getIsXbdk1Cr
();
//下班1是否次日(0:否;1:是)
int
isSbdk2Cr
=
shif
.
getIsSbdk2Cr
();
//上班2是否次日(0:否;1:是)
int
isSbdk2Cr
=
shif
.
getIsSbdk2Cr
();
//上班2是否次日(0:否;1:是)
int
isXbdk2Cr
=
shif
.
getIsXbdk2Cr
();
//下班2是否次日(0:否;1:是)
int
isXbdk2Cr
=
shif
.
getIsXbdk2Cr
();
//下班2是否次日(0:否;1:是)
int
isSbdk3Cr
=
shif
.
getIsSbdk3Cr
();
//上班3是否次日(0:否;1:是)
int
isSbdk3Cr
=
shif
.
getIsSbdk3Cr
();
//上班3是否次日(0:否;1:是)
int
isXbdk3Cr
=
shif
.
getIsXbdk3Cr
();
//下班3是否次日(0:否;1:是)
int
isXbdk3Cr
=
shif
.
getIsXbdk3Cr
();
//下班3是否次日(0:否;1:是)
// boolean crdk = false;//当次打卡是否存在次日打卡
if
(
balan
.
getSort
()
<
dkcs
)
{
if
(
balan
.
getSort
()
<
dkcs
)
{
if
(
balan
.
getSort
()+
1
==
2
&&
dkcs
==
2
)
{
if
(
balan
.
getSort
()+
1
==
2
&&
dkcs
==
2
)
{
if
(
isXbdk1Cr
>
0
)
{
//次日
if
(
isXbdk1Cr
>
0
)
{
//次日
...
@@ -210,7 +198,6 @@ public class ClockInController {
...
@@ -210,7 +198,6 @@ public class ClockInController {
}
else
{
}
else
{
//无记录的话就找昨天的数据
//无记录的话就找昨天的数据
// AttendanceCardListDto attdate1 = MethodCall(qyid,userid,yesterday);
// AttendanceCardListDto attdate1 = MethodCall(qyid,userid,yesterday);
}
}
if
(
crdk
&&
dnck
)
{
if
(
crdk
&&
dnck
)
{
...
@@ -222,24 +209,15 @@ public class ClockInController {
...
@@ -222,24 +209,15 @@ public class ClockInController {
}
else
{
}
else
{
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userid
)
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userid
)
.
ge
(
KqglAssoDkmx:
:
getDksj
,
startDate
).
le
(
KqglAssoDkmx:
:
getDksj
,
endDate
));
.
ge
(
KqglAssoDkmx:
:
getDksj
,
startDate
).
le
(
KqglAssoDkmx:
:
getDksj
,
endDate
));
// attdate = MethodCall(qyid,userid,putime);
attendance_date
=
startDate
;
attendance_date
=
startDate
;
toweek
=
putime
;
toweek
=
putime
;
}
}
//putime: 根据日期 得到打卡所需的详细信息
// AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
// ClockCollectData clockt = new ClockCollectData();
if
(
EmptyUtil
.
isEmpty
(
attdate
.
getAttsch
()))
{
if
(
EmptyUtil
.
isEmpty
(
attdate
.
getAttsch
()))
{
msg
=
"当前未排班"
;
msg
=
"当前未排班"
;
sbyf
=
0
;
sbyf
=
0
;
}
else
{
}
else
{
long
iclock_time
=
time_
;
//
long
starttime1
=
0
,
starttime1ks
=
0
,
starttime1js
=
0
,
endtime1
=
0
,
endtime1ks
=
0
,
endtime1js
=
0
,
starttime2
=
0
,
starttime2ks
=
0
,
starttime2js
=
0
,
endtime2
=
0
,
endtime2ks
=
0
,
endtime2js
=
0
,
starttime3
=
0
,
starttime3ks
=
0
,
starttime3js
=
0
,
long
starttime1
=
0
,
starttime1ks
=
0
,
starttime1js
=
0
,
endtime1
=
0
,
endtime1ks
=
0
,
endtime1js
=
0
,
starttime2
=
0
,
starttime2ks
=
0
,
starttime2js
=
0
,
endtime2
=
0
,
endtime2ks
=
0
,
endtime2js
=
0
,
starttime3
=
0
,
starttime3ks
=
0
,
starttime3js
=
0
,
endtime3
=
0
,
endtime3ks
=
0
,
endtime3js
=
0
;
endtime3
=
0
,
endtime3ks
=
0
,
endtime3js
=
0
;
int
dakjg1
=
0
,
dakjg2
=
0
,
dakjg3
=
0
,
dakjg4
=
0
,
dakjg5
=
0
,
dakjg6
=
0
;
//打卡时间与应打卡时间的间隔分钟数
if
(
attdate
.
getAttsch
().
size
()
>
0
)
{
if
(
attdate
.
getAttsch
().
size
()
>
0
)
{
List
<
AttSchedule
>
ash
=
attdate
.
getAttsch
();
List
<
AttSchedule
>
ash
=
attdate
.
getAttsch
();
int
y
=
0
;
int
y
=
0
;
...
@@ -248,27 +226,16 @@ public class ClockInController {
...
@@ -248,27 +226,16 @@ public class ClockInController {
if
(
attdate
.
getAttsch
().
size
()
==
2
||
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
||
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
starttime1
=
ash
.
get
(
0
).
getTime
();
starttime1ks
=
ash
.
get
(
0
).
getStarttime
();
starttime1js
=
ash
.
get
(
0
).
getEndtime
();
starttime1
=
ash
.
get
(
0
).
getTime
();
starttime1ks
=
ash
.
get
(
0
).
getStarttime
();
starttime1js
=
ash
.
get
(
0
).
getEndtime
();
endtime1
=
ash
.
get
(
1
).
getTime
();
endtime1ks
=
ash
.
get
(
1
).
getStarttime
();
endtime1js
=
ash
.
get
(
1
).
getEndtime
();
endtime1
=
ash
.
get
(
1
).
getTime
();
endtime1ks
=
ash
.
get
(
1
).
getStarttime
();
endtime1js
=
ash
.
get
(
1
).
getEndtime
();
dakjg1
=
Math
.
abs
(
Integer
.
valueOf
(
String
.
valueOf
((
iclock_time
-
starttime1
)
/
(
1000
*
60
))));
dakjg2
=
Math
.
abs
(
Integer
.
valueOf
(
String
.
valueOf
((
iclock_time
-
endtime1
)
/
(
1000
*
60
))));
}
}
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
starttime2
=
ash
.
get
(
2
).
getTime
();
starttime2ks
=
ash
.
get
(
2
).
getStarttime
();
starttime2js
=
ash
.
get
(
2
).
getEndtime
();
starttime2
=
ash
.
get
(
2
).
getTime
();
starttime2ks
=
ash
.
get
(
2
).
getStarttime
();
starttime2js
=
ash
.
get
(
2
).
getEndtime
();
endtime2
=
ash
.
get
(
3
).
getTime
();
endtime2ks
=
ash
.
get
(
3
).
getStarttime
();
endtime2js
=
ash
.
get
(
3
).
getEndtime
();
endtime2
=
ash
.
get
(
3
).
getTime
();
endtime2ks
=
ash
.
get
(
3
).
getStarttime
();
endtime2js
=
ash
.
get
(
3
).
getEndtime
();
dakjg3
=
Math
.
abs
(
Integer
.
valueOf
(
String
.
valueOf
((
iclock_time
-
starttime2
)
/
(
1000
*
60
))));
dakjg4
=
Math
.
abs
(
Integer
.
valueOf
(
String
.
valueOf
((
iclock_time
-
endtime2
)
/
(
1000
*
60
))));
}
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
starttime3
=
ash
.
get
(
4
).
getTime
();
starttime3ks
=
ash
.
get
(
4
).
getStarttime
();
starttime3js
=
ash
.
get
(
4
).
getEndtime
();
starttime3
=
ash
.
get
(
4
).
getTime
();
starttime3ks
=
ash
.
get
(
4
).
getStarttime
();
starttime3js
=
ash
.
get
(
4
).
getEndtime
();
endtime3
=
ash
.
get
(
5
).
getTime
();
endtime3ks
=
ash
.
get
(
5
).
getStarttime
();
endtime3js
=
ash
.
get
(
5
).
getEndtime
();
endtime3
=
ash
.
get
(
5
).
getTime
();
endtime3ks
=
ash
.
get
(
5
).
getStarttime
();
endtime3js
=
ash
.
get
(
5
).
getEndtime
();
dakjg5
=
Math
.
abs
(
Integer
.
valueOf
(
String
.
valueOf
((
iclock_time
-
starttime3
)
/
(
1000
*
60
))));
dakjg6
=
Math
.
abs
(
Integer
.
valueOf
(
String
.
valueOf
((
iclock_time
-
endtime3
)
/
(
1000
*
60
))));
}
}
Map
<
String
,
Integer
>
comparemap
=
new
HashMap
();
if
(
dkmc
==
null
)
{
if
(
dkmc
==
null
)
{
kskd
=
false
;
kskd
=
false
;
...
@@ -298,7 +265,6 @@ public class ClockInController {
...
@@ -298,7 +265,6 @@ public class ClockInController {
isRange
=
false
;
isRange
=
false
;
}
}
}
}
boolean
effectiveDate2
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate2
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate2
)
{
//在范围内就打卡
if
(
effectiveDate2
)
{
//在范围内就打卡
atttype
=
2
;
atttype
=
2
;
...
@@ -310,7 +276,6 @@ public class ClockInController {
...
@@ -310,7 +276,6 @@ public class ClockInController {
isRange
=
false
;
isRange
=
false
;
}
}
}
}
boolean
effectiveDate3
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime2ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime2js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate3
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime2ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime2js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate3
)
{
//在范围内就打卡
if
(
effectiveDate3
)
{
//在范围内就打卡
atttype
=
3
;
atttype
=
3
;
...
@@ -322,7 +287,6 @@ public class ClockInController {
...
@@ -322,7 +287,6 @@ public class ClockInController {
isRange
=
false
;
isRange
=
false
;
}
}
}
}
boolean
effectiveDate4
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime2ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime2js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate4
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime2ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime2js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate4
)
{
//在范围内就打卡
if
(
effectiveDate4
)
{
//在范围内就打卡
atttype
=
4
;
atttype
=
4
;
...
@@ -347,7 +311,6 @@ public class ClockInController {
...
@@ -347,7 +311,6 @@ public class ClockInController {
isRange
=
false
;
isRange
=
false
;
}
}
}
}
boolean
effectiveDate6
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime3ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime3js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate6
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime3ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime3js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate6
)
{
//在范围内就打卡
if
(
effectiveDate6
)
{
//在范围内就打卡
atttype
=
6
;
atttype
=
6
;
...
@@ -361,7 +324,6 @@ public class ClockInController {
...
@@ -361,7 +324,6 @@ public class ClockInController {
}
}
}
}
}
}
execution_status
=
1
;
execution_status
=
1
;
}
else
{
}
else
{
execution_status
=
2
;
execution_status
=
2
;
...
@@ -383,10 +345,7 @@ public class ClockInController {
...
@@ -383,10 +345,7 @@ public class ClockInController {
atttype
=
2
;
atttype
=
2
;
}
}
}
}
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
boolean
effectiveDate1
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime1ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime1js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate1
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime1ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime1js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate1
)
{
//在范围内就打卡
if
(
effectiveDate1
)
{
//在范围内就打卡
if
(
dkmc
.
getSbdk1
()
!=
null
)
{
if
(
dkmc
.
getSbdk1
()
!=
null
)
{
...
@@ -398,7 +357,6 @@ public class ClockInController {
...
@@ -398,7 +357,6 @@ public class ClockInController {
}
else
{
}
else
{
isRange
=
false
;
isRange
=
false
;
}
}
boolean
effectiveDate2
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate2
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate2
)
{
//在范围内就打卡
if
(
effectiveDate2
)
{
//在范围内就打卡
if
(
dkmc
.
getXbdk1
()
!=
null
)
{
if
(
dkmc
.
getXbdk1
()
!=
null
)
{
...
@@ -410,7 +368,6 @@ public class ClockInController {
...
@@ -410,7 +368,6 @@ public class ClockInController {
}
else
{
}
else
{
isRange
=
false
;
isRange
=
false
;
}
}
boolean
effectiveDate3
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime2ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime2js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate3
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime2ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime2js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate3
)
{
//在范围内就打卡
if
(
effectiveDate3
)
{
//在范围内就打卡
if
(
dkmc
.
getSbdk2
()
!=
null
)
{
if
(
dkmc
.
getSbdk2
()
!=
null
)
{
...
@@ -422,7 +379,6 @@ public class ClockInController {
...
@@ -422,7 +379,6 @@ public class ClockInController {
}
else
{
}
else
{
isRange
=
false
;
isRange
=
false
;
}
}
boolean
effectiveDate4
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime2ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime2js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate4
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime2ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime2js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate4
)
{
//在范围内就打卡
if
(
effectiveDate4
)
{
//在范围内就打卡
if
(
dkmc
.
getXbdk2
()
!=
null
)
{
if
(
dkmc
.
getXbdk2
()
!=
null
)
{
...
@@ -434,10 +390,8 @@ public class ClockInController {
...
@@ -434,10 +390,8 @@ public class ClockInController {
}
else
{
}
else
{
isRange
=
false
;
isRange
=
false
;
}
}
}
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
boolean
effectiveDate5
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime3ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime3js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate5
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime3ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime3js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate5
)
{
//在范围内就打卡
if
(
effectiveDate5
)
{
//在范围内就打卡
if
(
dkmc
.
getSbdk2
()
!=
null
)
{
if
(
dkmc
.
getSbdk2
()
!=
null
)
{
...
@@ -447,7 +401,6 @@ public class ClockInController {
...
@@ -447,7 +401,6 @@ public class ClockInController {
atttype
=
5
;
atttype
=
5
;
}
}
}
else
{
isRange
=
false
;
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate6
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime3ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime3js
),
"yyyy-MM-dd HH:mm"
);
boolean
effectiveDate6
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime3ks
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime3js
),
"yyyy-MM-dd HH:mm"
);
if
(
effectiveDate6
)
{
//在范围内就打卡
if
(
effectiveDate6
)
{
//在范围内就打卡
if
(
dkmc
.
getXbdk2
()
!=
null
)
{
if
(
dkmc
.
getXbdk2
()
!=
null
)
{
...
@@ -460,8 +413,6 @@ public class ClockInController {
...
@@ -460,8 +413,6 @@ public class ClockInController {
}
}
}
}
}
}
if
(
atttype
==
1
)
{
if
(
atttype
==
1
)
{
punchcardtime
=
starttime1
;
punchcardtime
=
starttime1
;
punchstart
=
starttime1ks
;
punchstart
=
starttime1ks
;
...
@@ -487,17 +438,13 @@ public class ClockInController {
...
@@ -487,17 +438,13 @@ public class ClockInController {
punchstart
=
endtime3ks
;
punchstart
=
endtime3ks
;
punchend
=
endtime3js
;
punchend
=
endtime3js
;
}
}
if
(
clockt
.
getShifid
()
!=
0
)
{
if
(
clockt
.
getShifid
()
!=
0
)
{
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
();
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
();
if
(
attdate
.
getAttsch
().
size
()
>
0
&&
clockt
.
getShifid
()
>
0
){
//有无班次
if
(
attdate
.
getAttsch
().
size
()
>
0
&&
clockt
.
getShifid
()
>
0
){
//有无班次
shif
=
shif
.
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
clockt
.
getShifid
()));
shif
=
shif
.
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
clockt
.
getShifid
()));
}
}
//打卡记录录入 -- 打卡是否有时间范围限制
//打卡记录录入 -- 打卡是否有时间范围限制
// boolean isRange = true;
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
if
(
punchstart
>
0
&&
punchend
>
0
)
{
if
(
punchstart
>
0
&&
punchend
>
0
)
{
String
staputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
punchstart
);
//应打卡开始时间
String
staputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
punchstart
);
//应打卡开始时间
...
@@ -512,18 +459,51 @@ public class ClockInController {
...
@@ -512,18 +459,51 @@ public class ClockInController {
}
}
}
}
}
}
if
(
isRange
)
{
if
(
isRange
)
{
int
yzcd
=
shif
.
getYzcdfzs
();
//严重迟到分钟数
int
yzcd
=
shif
.
getYzcdfzs
();
//严重迟到分钟数
int
kgcdfzs
=
shif
.
getKgcdfzs
();
//旷工迟到分钟数
int
kgcdfzs
=
shif
.
getKgcdfzs
();
//旷工迟到分钟数
int
dkcs_
=
shif
.
getSxbcs
();
//上下班打卡次数
int
iswzwd
=
shif
.
getIsWzwd
();
//是否开启晚走晚到(0:否;1:是)
//统一分钟数
double
xbwz1
=
Double
.
valueOf
(
shif
.
getXbwz1
())
*
60
;
//下班晚走1
int
sbwd1
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd1
())
*
60
));
//上班晚到1
double
xbwz2
=
Double
.
valueOf
(
shif
.
getXbwz2
())
*
60
;
//下班晚走2
int
sbwd2
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd2
())
*
60
));
//上班晚到2
double
xbwz3
=
Double
.
valueOf
(
shif
.
getXbwz3
())
*
60
;
//下班晚走3
int
sbwd3
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd3
())
*
60
));
//上班晚到3
int
arrive_late
=
0
;
//晚到时间
String
clock_date
=
""
;
//应打卡时间
Long
latetime
=
0
l
;
//前天晚走时长(分钟)
KqglAssoDkmx
yesterdaymx
=
KqglAssoDkmx
.
builder
().
build
();
AttendanceCardListDto
attdateyesterday
;
long
yesendtime1
=
0
,
yesendtime2
=
0
,
yesendtime3
=
0
;
//存在晚走玩到
if
(
iswzwd
>
0
)
{
//获取前一天最后下班的时间
yesterdaymx
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userid
)
.
ge
(
KqglAssoDkmx:
:
getDksj
,
startDateyesterday
).
le
(
KqglAssoDkmx:
:
getDksj
,
endDateyesterday
));
attdateyesterday
=
MethodCall
(
qyid
,
userid
,
yesterday
);
List
<
AttSchedule
>
ash
=
attdateyesterday
.
getAttsch
();
if
(
attdateyesterday
.
getAttsch
().
size
()
==
2
||
attdateyesterday
.
getAttsch
().
size
()
==
4
||
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime1
=
ash
.
get
(
1
).
getTime
();
}
if
(
attdateyesterday
.
getAttsch
().
size
()
==
4
||
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime2
=
ash
.
get
(
3
).
getTime
();
}
if
(
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime3
=
ash
.
get
(
5
).
getTime
();
}
}
if
(
execution_status
==
1
)
{
//上班1 ****新增
if
(
execution_status
==
1
)
{
//上班1 ****新增
KqglAssoDkmx
pcd
=
KqglAssoDkmx
.
builder
().
userid
(
userid
).
data
(
putime
).
qyid
(
qyid
).
dksj
(
startDate
).
build
();
KqglAssoDkmx
pcd
=
KqglAssoDkmx
.
builder
().
userid
(
userid
).
data
(
putime
).
qyid
(
qyid
).
dksj
(
startDate
).
build
();
int
sbdkjg
=
0
,
yzcdsc
=
0
,
yzcdcs
=
0
,
kgcdcs
=
0
;
int
sbdkjg
=
0
,
yzcdsc
=
0
,
yzcdcs
=
0
,
kgcdcs
=
0
;
if
(
punchcardtime
!=
0
){
//有应打卡时间时
if
(
punchcardtime
!=
0
){
//有应打卡时间时
Long
time
=
(
time_
-
punchcardtime
)/
1000
/
60
;
Long
time
=
(
time_
-
punchcardtime
)/
1000
/
60
;
if
((
atttype
)%
2
>
0
){
//上班
if
((
atttype
)%
2
>
0
){
//上班
if
(
time
>
0
){
if
(
time
>
0
){
sbdkjg
=
Integer
.
valueOf
(
time
.
toString
());
sbdkjg
=
Integer
.
valueOf
(
time
.
toString
());
...
@@ -534,10 +514,49 @@ public class ClockInController {
...
@@ -534,10 +514,49 @@ public class ClockInController {
}
// 打卡结果
}
// 打卡结果
}
}
// if(time > 0){//上班1打卡结果
//存在晚走玩到
// sbdkjg = Math.abs(Integer.valueOf(time.toString()));
if
(
iswzwd
>
0
)
{
// }
if
(
dkcs_
==
1
)
{
if
(
yesterdaymx
.
getXbdk1
()
!=
null
&&
yesterdaymx
.
getXbdk1jg
()
==
0
)
{
latetime
=
(
yesterdaymx
.
getXbdk1
()
-
yesendtime1
)/
1000
/
60
;
}
}
else
if
(
dkcs_
==
2
){
if
(
yesterdaymx
.
getXbdk2
()
!=
null
&&
yesterdaymx
.
getXbdk2jg
()
==
0
)
{
latetime
=
(
yesterdaymx
.
getXbdk2
()
-
yesendtime2
)/
1000
/
60
;
}
}
else
{
if
(
yesterdaymx
.
getXbdk3
()
!=
null
&&
yesterdaymx
.
getXbdk3jg
()
==
0
)
{
latetime
=
(
yesterdaymx
.
getXbdk3
()
-
yesendtime3
)/
1000
/
60
;
}
}
if
(
latetime
!=
0
)
{
double
latetime_
=
Double
.
valueOf
(
String
.
valueOf
(
latetime
));
//前天晚走时长(分钟)
if
(
latetime_
>
xbwz1
&&
latetime_
<
xbwz2
)
{
arrive_late
=
sbwd1
;
}
else
if
(
latetime_
>
xbwz2
&&
latetime_
<
xbwz3
)
{
arrive_late
=
sbwd2
;
}
else
if
(
latetime_
>
xbwz3
)
{
arrive_late
=
sbwd3
;
}
clock_date
=
ClockInTool
.
stampToDate
(
String
.
valueOf
(
punchcardtime
));
Long
changed_time
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
ClockInTool
.
addtime
(
clock_date
,
"+"
+
arrive_late
)));
//晚到后应打卡时间
punchcardtime
=
changed_time
;
//更换当天打卡时间
Long
timeyes
=
(
time_
-
changed_time
)/
1000
/
60
;
//
if
((
atttype
)%
2
>
0
){
//上班
if
(
timeyes
>
0
){
sbdkjg
=
Integer
.
valueOf
(
timeyes
.
toString
());
}
}
else
{
//下班
if
(
timeyes
>
0
){}
else
{
sbdkjg
=
Math
.
abs
(
Integer
.
valueOf
(
timeyes
.
toString
()));
}
}
}
}
}
}
if
(
atttype
==
1
)
{
if
(
atttype
==
1
)
{
pcd
.
setSbdk1
(
time_
);
pcd
.
setSbdk1
(
time_
);
pcd
.
setSbdk1jg
(
sbdkjg
);
pcd
.
setSbdk1jg
(
sbdkjg
);
...
@@ -572,11 +591,9 @@ public class ClockInController {
...
@@ -572,11 +591,9 @@ public class ClockInController {
throw
new
CustomException
(
"打卡明细-新增异常-1"
);
throw
new
CustomException
(
"打卡明细-新增异常-1"
);
}
}
dkmx
=
pcd
.
getId
();
dkmx
=
pcd
.
getId
();
}
else
if
(
execution_status
==
2
){
//*****修改
}
else
if
(
execution_status
==
2
){
//*****修改
dkmx
=
dkmc
.
getId
();
dkmx
=
dkmc
.
getId
();
KqglAssoDkmx
pcd
=
KqglAssoDkmx
.
builder
().
build
();
KqglAssoDkmx
pcd
=
KqglAssoDkmx
.
builder
().
build
();
if
(
atttype
==
2
){
//下班1
if
(
atttype
==
2
){
//下班1
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setXbdk1
(
time_
);
//下班1打卡时间
pcd
.
setXbdk1
(
time_
);
//下班1打卡时间
...
@@ -588,7 +605,6 @@ public class ClockInController {
...
@@ -588,7 +605,6 @@ public class ClockInController {
pcd
.
setXbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
pcd
.
setXbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
}
}
}
}
if
(
dkmc
.
getSbdk1
()
!=
null
){
if
(
dkmc
.
getSbdk1
()
!=
null
){
Long
time
=
(
time_
-
dkmc
.
getSbdk1
())/
1000
/
60
;
Long
time
=
(
time_
-
dkmc
.
getSbdk1
())/
1000
/
60
;
pcd
.
setGzsc
(
Math
.
abs
(
Double
.
valueOf
(
time
.
toString
())));
//只打一次卡时计算工作时长
pcd
.
setGzsc
(
Math
.
abs
(
Double
.
valueOf
(
time
.
toString
())));
//只打一次卡时计算工作时长
...
@@ -614,11 +630,8 @@ public class ClockInController {
...
@@ -614,11 +630,8 @@ public class ClockInController {
pcd
.
setYzcdcs
(
yzcdcs
);
pcd
.
setYzcdcs
(
yzcdcs
);
pcd
.
setYzcdsc
(
Double
.
valueOf
(
yzcdsc
));
pcd
.
setYzcdsc
(
Double
.
valueOf
(
yzcdsc
));
pcd
.
setKgcdfzs
(
kgcdcs
);
pcd
.
setKgcdfzs
(
kgcdcs
);
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
else
if
(
atttype
==
4
){
//下班2
}
else
if
(
atttype
==
4
){
//下班2
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setXbdk2
(
time_
);
//下班1打卡时间
pcd
.
setXbdk2
(
time_
);
//下班1打卡时间
if
(
punchcardtime
!=
0
){
//有应打卡时间时
if
(
punchcardtime
!=
0
){
//有应打卡时间时
...
@@ -629,7 +642,6 @@ public class ClockInController {
...
@@ -629,7 +642,6 @@ public class ClockInController {
pcd
.
setXbdk2jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
pcd
.
setXbdk2jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
}
}
}
}
//班次为4次时,计算工作时长
//班次为4次时,计算工作时长
if
(
dkmc
.
getSbdk2
()
!=
null
){
if
(
dkmc
.
getSbdk2
()
!=
null
){
Long
time
=
(
time_
-
dkmc
.
getSbdk2
())/
1000
/
60
;
Long
time
=
(
time_
-
dkmc
.
getSbdk2
())/
1000
/
60
;
...
@@ -639,9 +651,7 @@ public class ClockInController {
...
@@ -639,9 +651,7 @@ public class ClockInController {
pcd
.
setGzsc
(
worktime
);
pcd
.
setGzsc
(
worktime
);
}
}
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
else
if
(
atttype
==
5
){
//上班3
}
else
if
(
atttype
==
5
){
//上班3
int
sbdk3jg
=
0
,
yzcdsc
=
0
,
yzcdcs
=
0
,
kgcdcs
=
0
;
int
sbdk3jg
=
0
,
yzcdsc
=
0
,
yzcdcs
=
0
,
kgcdcs
=
0
;
if
(
punchcardtime
!=
0
){
//有应打卡时间时
if
(
punchcardtime
!=
0
){
//有应打卡时间时
Long
time
=
(
time_
-
punchcardtime
)/
1000
/
60
;
Long
time
=
(
time_
-
punchcardtime
)/
1000
/
60
;
...
@@ -652,18 +662,14 @@ public class ClockInController {
...
@@ -652,18 +662,14 @@ public class ClockInController {
yzcdsc
=
sbdk3jg
-
yzcd
;
yzcdsc
=
sbdk3jg
-
yzcd
;
}
}
if
(
sbdk3jg
>
kgcdfzs
)
{
kgcdcs
++;}
if
(
sbdk3jg
>
kgcdfzs
)
{
kgcdcs
++;}
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setSbdk3
(
time_
);
//上班1打卡时间
pcd
.
setSbdk3
(
time_
);
//上班1打卡时间
pcd
.
setSbdk3jg
(
sbdk3jg
);
pcd
.
setSbdk3jg
(
sbdk3jg
);
pcd
.
setYzcdcs
(
yzcdcs
);
pcd
.
setYzcdcs
(
yzcdcs
);
pcd
.
setYzcdsc
(
Double
.
valueOf
(
yzcdsc
));
pcd
.
setYzcdsc
(
Double
.
valueOf
(
yzcdsc
));
pcd
.
setKgcdfzs
(
kgcdcs
);
pcd
.
setKgcdfzs
(
kgcdcs
);
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
else
if
(
atttype
==
6
){
//下班3
}
else
if
(
atttype
==
6
){
//下班3
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setXbdk3
(
time_
);
//下班1打卡时间
pcd
.
setXbdk3
(
time_
);
//下班1打卡时间
if
(
punchcardtime
!=
0
){
//有应打卡时间时
if
(
punchcardtime
!=
0
){
//有应打卡时间时
...
@@ -682,14 +688,12 @@ public class ClockInController {
...
@@ -682,14 +688,12 @@ public class ClockInController {
double
worktime
=
Math
.
abs
(
om
.
add
(
on
).
doubleValue
());
double
worktime
=
Math
.
abs
(
om
.
add
(
on
).
doubleValue
());
pcd
.
setGzsc
(
worktime
);
pcd
.
setGzsc
(
worktime
);
}
}
}
}
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setId
(
dkmc
.
getId
());
if
(
atttype
<=
6
&&
atttype
>
0
&&
!
sbdkkd
){
if
(
atttype
<=
6
&&
atttype
>
0
&&
!
sbdkkd
){
int
update
=
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
int
update
=
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
}
}
}
}
else
{
}
else
{
msg
=
"当前打卡时间不在范围内"
;
msg
=
"当前打卡时间不在范围内"
;
sbyf
=
0
;
sbyf
=
0
;
...
@@ -699,16 +703,11 @@ public class ClockInController {
...
@@ -699,16 +703,11 @@ public class ClockInController {
sbyf
=
0
;
sbyf
=
0
;
}
}
}
}
}
else
{
}
else
{
//自由工时打卡
//自由工时打卡
Long
stapclotime
=
attdate
.
getStapclotime
();
// 今天考勤 自由排班开始时间
Long
stapclotime
=
attdate
.
getStapclotime
();
// 今天考勤 自由排班开始时间
int
canpunchworkdate
=
Integer
.
valueOf
(
String
.
valueOf
(
attdate
.
getCanpunchworkdate
()).
replaceAll
(
"(\\d+)(?:(\\.\\d*[^0])|\\.)0*"
,
"$1$2"
));
// 上班打卡后多久大下班卡
int
canpunchworkdate
=
Integer
.
valueOf
(
String
.
valueOf
(
attdate
.
getCanpunchworkdate
()).
replaceAll
(
"(\\d+)(?:(\\.\\d*[^0])|\\.)0*"
,
"$1$2"
));
// 上班打卡后多久大下班卡
KqglAssoDkmx
zydkmc
=
KqglAssoDkmx
.
builder
().
build
();
KqglAssoDkmx
zydkmc
=
KqglAssoDkmx
.
builder
().
build
();
Date
sd1
=
df1
.
parse
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
stapclotime
)));
//应打卡时间 2020-06-10 18:30:00
Date
sd1
=
df1
.
parse
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
stapclotime
)));
//应打卡时间 2020-06-10 18:30:00
Date
sd2
=
df1
.
parse
(
current_time
);
//当前时间 2020-06-10 16:06:58
Date
sd2
=
df1
.
parse
(
current_time
);
//当前时间 2020-06-10 16:06:58
if
(
sd1
.
after
(
sd2
))
{
//为true时 打的是昨天的卡
if
(
sd1
.
after
(
sd2
))
{
//为true时 打的是昨天的卡
...
@@ -722,8 +721,6 @@ public class ClockInController {
...
@@ -722,8 +721,6 @@ public class ClockInController {
attendance_date
=
startDate
;
attendance_date
=
startDate
;
toweek
=
putime
;
toweek
=
putime
;
}
}
if
(
zydkmc
==
null
)
{
//新增
if
(
zydkmc
==
null
)
{
//新增
KqglAssoDkmx
pcd
=
KqglAssoDkmx
.
builder
().
build
();
KqglAssoDkmx
pcd
=
KqglAssoDkmx
.
builder
().
build
();
if
(
sd1
.
after
(
sd2
))
{
if
(
sd1
.
after
(
sd2
))
{
...
@@ -731,7 +728,6 @@ public class ClockInController {
...
@@ -731,7 +728,6 @@ public class ClockInController {
}
else
{
}
else
{
pcd
=
KqglAssoDkmx
.
builder
().
userid
(
userid
).
data
(
putime
).
sbdk1
(
time_
).
sbdk1jg
(
0
).
ydkcs
(
0
).
qyid
(
qyid
).
dksj
(
startDate
).
yzcdcs
(
0
).
yzcdsc
(
Double
.
valueOf
(
0
)).
kgcdfzs
(
0
).
build
();
pcd
=
KqglAssoDkmx
.
builder
().
userid
(
userid
).
data
(
putime
).
sbdk1
(
time_
).
sbdk1jg
(
0
).
ydkcs
(
0
).
qyid
(
qyid
).
dksj
(
startDate
).
yzcdcs
(
0
).
yzcdsc
(
Double
.
valueOf
(
0
)).
kgcdfzs
(
0
).
build
();
}
}
// KqglAssoDkmx pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
// KqglAssoDkmx pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
if
(!
pcd
.
insert
())
{
if
(!
pcd
.
insert
())
{
throw
new
CustomException
(
"打卡明细-新增异常-1"
);
throw
new
CustomException
(
"打卡明细-新增异常-1"
);
...
@@ -740,15 +736,11 @@ public class ClockInController {
...
@@ -740,15 +736,11 @@ public class ClockInController {
atttype
=
1
;
atttype
=
1
;
}
else
{
//修改
}
else
{
//修改
dkmx
=
zydkmc
.
getId
();
dkmx
=
zydkmc
.
getId
();
KqglAssoDkmx
zypcd
=
KqglAssoDkmx
.
builder
().
build
();
KqglAssoDkmx
zypcd
=
KqglAssoDkmx
.
builder
().
build
();
if
((!(
""
).
equals
(
zydkmc
.
getSbdk1
())
||
zydkmc
.
getSbdk1
()
!=
null
)
&&
((
""
).
equals
(
zydkmc
.
getXbdk1
())
||
zydkmc
.
getXbdk1
()
==
null
)){
//下班1
if
((!(
""
).
equals
(
zydkmc
.
getSbdk1
())
||
zydkmc
.
getSbdk1
()
!=
null
)
&&
((
""
).
equals
(
zydkmc
.
getXbdk1
())
||
zydkmc
.
getXbdk1
()
==
null
)){
//下班1
String
clock_time
=
ClockInTool
.
requires_extra_times
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
zydkmc
.
getSbdk1
())),
canpunchworkdate
,
5
,
2
);
String
clock_time
=
ClockInTool
.
requires_extra_times
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
zydkmc
.
getSbdk1
())),
canpunchworkdate
,
5
,
2
);
Date
zysd1
=
df1
.
parse
(
clock_time
);
//上班打卡后多久大下班卡的时间
Date
zysd1
=
df1
.
parse
(
clock_time
);
//上班打卡后多久大下班卡的时间
Date
zysd2
=
df1
.
parse
(
current_time
);
//当前时间
Date
zysd2
=
df1
.
parse
(
current_time
);
//当前时间
if
(
zysd1
.
after
(
zysd2
))
{
//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
if
(
zysd1
.
after
(
zysd2
))
{
//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
msg
=
"自由工时:上班打卡后"
+
canpunchworkdate
+
"小时后,才可打下班卡"
;
msg
=
"自由工时:上班打卡后"
+
canpunchworkdate
+
"小时后,才可打下班卡"
;
sbyf
=
0
;
sbyf
=
0
;
...
@@ -761,7 +753,6 @@ public class ClockInController {
...
@@ -761,7 +753,6 @@ public class ClockInController {
}
}
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
zypcd
);
//修改打卡记录
kqglassodkmxmapper
.
updateByPrimaryKeySelective
(
zypcd
);
//修改打卡记录
}
}
atttype
=
2
;
atttype
=
2
;
}
else
if
((!(
""
).
equals
(
zydkmc
.
getSbdk1
())
||
zydkmc
.
getSbdk1
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getXbdk1
())
||
zydkmc
.
getXbdk1
()
!=
null
)
}
else
if
((!(
""
).
equals
(
zydkmc
.
getSbdk1
())
||
zydkmc
.
getSbdk1
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getXbdk1
())
||
zydkmc
.
getXbdk1
()
!=
null
)
&&
((
""
).
equals
(
zydkmc
.
getSbdk2
())
||
zydkmc
.
getSbdk2
()
==
null
)){
//上班2
&&
((
""
).
equals
(
zydkmc
.
getSbdk2
())
||
zydkmc
.
getSbdk2
()
==
null
)){
//上班2
...
@@ -771,9 +762,7 @@ public class ClockInController {
...
@@ -771,9 +762,7 @@ public class ClockInController {
atttype
=
3
;
atttype
=
3
;
}
else
if
((!(
""
).
equals
(
zydkmc
.
getSbdk1
())
||
zydkmc
.
getSbdk1
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getXbdk1
())
||
zydkmc
.
getXbdk1
()
!=
null
)
}
else
if
((!(
""
).
equals
(
zydkmc
.
getSbdk1
())
||
zydkmc
.
getSbdk1
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getXbdk1
())
||
zydkmc
.
getXbdk1
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getSbdk2
())
||
zydkmc
.
getSbdk2
()
!=
null
)
&&
((
""
).
equals
(
zydkmc
.
getXbdk2
())
||
zydkmc
.
getXbdk2
()
==
null
)){
//下班2
&&
(!(
""
).
equals
(
zydkmc
.
getSbdk2
())
||
zydkmc
.
getSbdk2
()
!=
null
)
&&
((
""
).
equals
(
zydkmc
.
getXbdk2
())
||
zydkmc
.
getXbdk2
()
==
null
)){
//下班2
String
clock_time
=
ClockInTool
.
requires_extra_times
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
zydkmc
.
getSbdk2
())),
canpunchworkdate
,
5
,
2
);
String
clock_time
=
ClockInTool
.
requires_extra_times
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
zydkmc
.
getSbdk2
())),
canpunchworkdate
,
5
,
2
);
Date
zysd1
=
df1
.
parse
(
clock_time
);
//上班打卡后多久大下班卡的时间
Date
zysd1
=
df1
.
parse
(
clock_time
);
//上班打卡后多久大下班卡的时间
Date
zysd2
=
df1
.
parse
(
current_time
);
//当前时间
Date
zysd2
=
df1
.
parse
(
current_time
);
//当前时间
if
(
zysd1
.
after
(
zysd2
))
{
//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
if
(
zysd1
.
after
(
zysd2
))
{
//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
...
@@ -803,9 +792,7 @@ public class ClockInController {
...
@@ -803,9 +792,7 @@ public class ClockInController {
}
else
if
((!(
""
).
equals
(
zydkmc
.
getSbdk1
())
||
zydkmc
.
getSbdk1
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getXbdk1
())
||
zydkmc
.
getXbdk1
()
!=
null
)
}
else
if
((!(
""
).
equals
(
zydkmc
.
getSbdk1
())
||
zydkmc
.
getSbdk1
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getXbdk1
())
||
zydkmc
.
getXbdk1
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getSbdk2
())
||
zydkmc
.
getSbdk2
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getXbdk2
())
||
zydkmc
.
getXbdk2
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getSbdk2
())
||
zydkmc
.
getSbdk2
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getXbdk2
())
||
zydkmc
.
getXbdk2
()
!=
null
)
&&
(!(
""
).
equals
(
zydkmc
.
getSbdk3
())
||
zydkmc
.
getSbdk3
()
!=
null
)
&&
((
""
).
equals
(
zydkmc
.
getXbdk3
())
||
zydkmc
.
getXbdk3
()
==
null
)){
//下班3
&&
(!(
""
).
equals
(
zydkmc
.
getSbdk3
())
||
zydkmc
.
getSbdk3
()
!=
null
)
&&
((
""
).
equals
(
zydkmc
.
getXbdk3
())
||
zydkmc
.
getXbdk3
()
==
null
)){
//下班3
String
clock_time
=
ClockInTool
.
requires_extra_times
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
zydkmc
.
getSbdk3
())),
canpunchworkdate
,
5
,
2
);
String
clock_time
=
ClockInTool
.
requires_extra_times
(
ClockInTool
.
stampToDate
(
String
.
valueOf
(
zydkmc
.
getSbdk3
())),
canpunchworkdate
,
5
,
2
);
Date
zysd1
=
df1
.
parse
(
clock_time
);
//上班打卡后多久大下班卡的时间
Date
zysd1
=
df1
.
parse
(
clock_time
);
//上班打卡后多久大下班卡的时间
Date
zysd2
=
df1
.
parse
(
current_time
);
//当前时间
Date
zysd2
=
df1
.
parse
(
current_time
);
//当前时间
if
(
zysd1
.
after
(
zysd2
))
{
//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
if
(
zysd1
.
after
(
zysd2
))
{
//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
...
@@ -836,8 +823,10 @@ public class ClockInController {
...
@@ -836,8 +823,10 @@ public class ClockInController {
sbyf
=
0
;
sbyf
=
0
;
}
}
/*************************************************************************************************************************************************************************************/
/*****************************************************************************************************************************************************************************************************/
/*************************************************************************************************************************************************************************************/
/*******************************************************************原始打卡记录数据录入**************************************************************************************************************/
/*****************************************************************************************************************************************************************************************************/
String
attdate_
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
attendance_date
));
//转换打卡时间格式
String
attdate_
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
attendance_date
));
//转换打卡时间格式
//true:确认为最后一次打卡更新打卡时 之前打卡的一条数据变为“打卡更新数据”
//true:确认为最后一次打卡更新打卡时 之前打卡的一条数据变为“打卡更新数据”
...
@@ -847,8 +836,7 @@ public class ClockInController {
...
@@ -847,8 +836,7 @@ public class ClockInController {
KqglAssoDkjl
.
builder
().
id
(
dkjj
.
getId
()).
status
(
0
).
sort
(
0
).
build
().
updateById
();
KqglAssoDkjl
.
builder
().
id
(
dkjj
.
getId
()).
status
(
0
).
sort
(
0
).
build
().
updateById
();
}
}
// 原始打卡记录数据录入
int
results
=
0
;
int
results
=
0
;
Long
time
=
(
time_
-
punchcardtime
)/
1000
/
60
;
Long
time
=
(
time_
-
punchcardtime
)/
1000
/
60
;
if
(
punchcardtime
!=
0
){
if
(
punchcardtime
!=
0
){
...
@@ -864,8 +852,6 @@ public class ClockInController {
...
@@ -864,8 +852,6 @@ public class ClockInController {
}
}
}
}
}
}
int
type
,
status
=
0
;
int
type
,
status
=
0
;
if
((
atttype
)%
2
>
0
){
if
((
atttype
)%
2
>
0
){
type
=
1
;
// 类型(类型 0:无排班打卡 1:上班 2:下班) punchcardtime == 0:无班次打卡
type
=
1
;
// 类型(类型 0:无排班打卡 1:上班 2:下班) punchcardtime == 0:无班次打卡
...
@@ -935,7 +921,6 @@ public class ClockInController {
...
@@ -935,7 +921,6 @@ public class ClockInController {
}
}
long
attime
;
long
attime
;
// if(punchcardtime == 0 && !isRange){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间)
if
(
punchcardtime
==
0
){
// 考勤时间(应打卡时间)
if
(
punchcardtime
==
0
){
// 考勤时间(应打卡时间)
attime
=
new
Date
().
getTime
();
attime
=
new
Date
().
getTime
();
}
else
{
}
else
{
...
@@ -982,7 +967,13 @@ public class ClockInController {
...
@@ -982,7 +967,13 @@ public class ClockInController {
@Autowired
@Autowired
private
KqglAssoPbmxMapper
kqglassopbmxmapper
;
private
KqglAssoPbmxMapper
kqglassopbmxmapper
;
/**
* @param qyid
* @param userid
* @param date
* @return
* 获取当天打卡班次数据
*/
public
AttendanceCardListDto
MethodCall
(
int
qyid
,
int
userid
,
String
date
)
throws
ParseException
{
public
AttendanceCardListDto
MethodCall
(
int
qyid
,
int
userid
,
String
date
)
throws
ParseException
{
AttendanceCardListDto
attcar
=
new
AttendanceCardListDto
();
AttendanceCardListDto
attcar
=
new
AttendanceCardListDto
();
...
@@ -994,21 +985,15 @@ public class ClockInController {
...
@@ -994,21 +985,15 @@ public class ClockInController {
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
str
=
sdf
.
format
(
d
);
str
=
sdf
.
format
(
d
);
}
}
// Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
// Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userid
,
qyid
);
//考勤组信息
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
userid
,
qyid
);
//考勤组信息
//pbfs:排班方式 1:固定排班;2:自由排班;3:自由工时
//pbfs:排班方式 1:固定排班;2:自由排班;3:自由工时
if
(
attgro
!=
null
){
//判断当前用户是否加入到考勤组
if
(
attgro
!=
null
){
//判断当前用户是否加入到考勤组
//排班制
//排班制
KqglAssoPbmxDto
jrpb
=
kqglassopbmxmapper
.
getScheduleSpecificAttendance
(
attgro
.
getId
(),
userid
,
str
);
KqglAssoPbmxDto
jrpb
=
kqglassopbmxmapper
.
getScheduleSpecificAttendance
(
attgro
.
getId
(),
userid
,
str
);
//固定排班
//固定排班
int
week
=
Integer
.
valueOf
(
ClockInTool
.
dateToWeek
(
str
));
//4
int
week
=
Integer
.
valueOf
(
ClockInTool
.
dateToWeek
(
str
));
//4
KqglAssoZhoupaiban
atwek
=
KqglAssoZhoupaiban
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoZhoupaiban
>().
lambda
().
eq
(
KqglAssoZhoupaiban:
:
getKqzid
,
attgro
.
getId
())
KqglAssoZhoupaiban
atwek
=
KqglAssoZhoupaiban
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoZhoupaiban
>().
lambda
().
eq
(
KqglAssoZhoupaiban:
:
getKqzid
,
attgro
.
getId
())
.
eq
(
KqglAssoZhoupaiban:
:
getType
,
week
).
ne
(
KqglAssoZhoupaiban:
:
getBcid
,
0
));
.
eq
(
KqglAssoZhoupaiban:
:
getType
,
week
).
ne
(
KqglAssoZhoupaiban:
:
getBcid
,
0
));
if
(
attgro
.
getPbfs
()
==
1
){
//固定排班
if
(
attgro
.
getPbfs
()
==
1
){
//固定排班
if
(
atwek
!=
null
){
//有固定周排班
if
(
atwek
!=
null
){
//有固定周排班
KqglAssoTeshu
rest
=
KqglAssoTeshu
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoTeshu
>().
lambda
().
eq
(
KqglAssoTeshu:
:
getKqzid
,
attgro
.
getId
())
KqglAssoTeshu
rest
=
KqglAssoTeshu
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoTeshu
>().
lambda
().
eq
(
KqglAssoTeshu:
:
getKqzid
,
attgro
.
getId
())
...
@@ -1062,7 +1047,6 @@ public class ClockInController {
...
@@ -1062,7 +1047,6 @@ public class ClockInController {
}
else
{
//自由工时
}
else
{
//自由工时
KqglAssoZhoupaiban
wekz
=
KqglAssoZhoupaiban
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoZhoupaiban
>().
lambda
().
eq
(
KqglAssoZhoupaiban:
:
getKqzid
,
attgro
.
getId
())
KqglAssoZhoupaiban
wekz
=
KqglAssoZhoupaiban
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoZhoupaiban
>().
lambda
().
eq
(
KqglAssoZhoupaiban:
:
getKqzid
,
attgro
.
getId
())
.
eq
(
KqglAssoZhoupaiban:
:
getBcid
,
0
).
eq
(
KqglAssoZhoupaiban:
:
getType
,
week
));
.
eq
(
KqglAssoZhoupaiban:
:
getBcid
,
0
).
eq
(
KqglAssoZhoupaiban:
:
getType
,
week
));
if
(
wekz
!=
null
){
//
if
(
wekz
!=
null
){
//
String
dada
=
str
+
" "
+
attgro
.
getKqkssjTime
()+
":00"
;
String
dada
=
str
+
" "
+
attgro
.
getKqkssjTime
()+
":00"
;
attcar
.
setStapclotime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
dada
)));
attcar
.
setStapclotime
(
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
dada
)));
...
@@ -1125,7 +1109,11 @@ public class ClockInController {
...
@@ -1125,7 +1109,11 @@ public class ClockInController {
return
attcar
;
return
attcar
;
}
}
//
/**
* @param shiftm
* @param attcar
* @param str
*/
public
void
Getshiftinformationbatch
(
KqglAssoBcsz
shiftm
,
AttendanceCardListDto
attcar
,
String
str
){
public
void
Getshiftinformationbatch
(
KqglAssoBcsz
shiftm
,
AttendanceCardListDto
attcar
,
String
str
){
int
isXbdk1Cr
=
shiftm
.
getIsXbdk1Cr
();
//下班1是否次日(0:否;1:是)
int
isXbdk1Cr
=
shiftm
.
getIsXbdk1Cr
();
//下班1是否次日(0:否;1:是)
int
isSbdk2Cr
=
shiftm
.
getIsSbdk2Cr
();
//上班2是否次日(0:否;1:是)
int
isSbdk2Cr
=
shiftm
.
getIsSbdk2Cr
();
//上班2是否次日(0:否;1:是)
...
@@ -1239,4 +1227,443 @@ public class ClockInController {
...
@@ -1239,4 +1227,443 @@ public class ClockInController {
attcar
.
setAttsch
(
atts
);
attcar
.
setAttsch
(
atts
);
}
}
}
}
/************************************************************************************************************************************************************************************************/
/************************************************************************** APP打卡 *************************************************************************************************************/
/************************************************************************************************************************************************************************************************/
//考勤组
@Autowired
private
AttendanceGroupMapper
attendancegroupmapper
;
//班次
@Autowired
private
ShiftManagementMapper
shiftmanagementmapper
;
//打卡明细表
@Autowired
private
PunchCardDetailsMapper
punchcarddetailsmapper
;
//打卡记录
@Autowired
private
PunchRecordMapper
punchrecordmapper
;
/**
* 考勤打卡------APP打卡
*/
@PostMapping
(
value
=
"/AttendanceCard"
)
@ApiOperation
(
value
=
"考勤打卡------APP打卡"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
53
)
public
Result
<
Void
>
AttendanceCard
(
@CurrentUser
UserBean
userBean
,
@RequestBody
ClockCollectData
clock
)
{
int
qyid
=
userBean
.
getOrgCode
();
//坏小孩【企业id】
int
userid
=
userBean
.
getEmpNum
();
//用户id
AttendanceGroup
attgro
=
attendancegroupmapper
.
getAttendanceGroupInformationByUserid
(
userid
,
qyid
);
//考勤组信息
//pbfs;// 排班方式 1:固定排班;2:自由排班;3:自由工时
String
putime
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
Double
.
valueOf
(
clock
.
getPunchtime
()));
//转换打卡时间格式
Long
startDate
=
0
l
;
//打卡当天开始时间
Long
endDate
=
0
l
;
//打卡当天结束时间
try
{
startDate
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
putime
,
"yyyy-MM-dd"
)).
getTime
();
endDate
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
putime
,
"yyyy-MM-dd"
)).
getTime
();
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
ShiftManagement
shif
=
null
;
if
(
clock
.
getShifid
()
>
0
){
//有无班次
shif
=
shiftmanagementmapper
.
selectByPrimaryKey
(
clock
.
getShifid
());
}
int
dkmx
=
0
;
PunchCardDetails
dkmc
=
punchcarddetailsmapper
.
SingleAttendanceDays
(
userid
,
startDate
,
endDate
);
//查询打卡当天是否有记录
if
(
dkmc
!=
null
){
//有记录就修改之前的
//修改
dkmx
=
dkmc
.
getId
();
PunchCardDetails
pcd
=
new
PunchCardDetails
();
if
(
clock
.
getType
()
==
1
){
if
(
clock
.
getDiffer
()
==
1
){
//打卡
if
(!(
""
).
equals
(
dkmc
.
getXbdk1
())
||
dkmc
.
getXbdk1
()
!=
null
){
return
ResultUtil
.
error
(
"重复打卡"
);
}
}
else
{
//更新打卡
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setSbdk1
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//上班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setSbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班1打卡结果
}
else
{
pcd
.
setSbdk1jg
(
0
);
// 打卡结果
}
}
punchcarddetailsmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
}
else
if
(
clock
.
getType
()
==
2
){
if
((
""
).
equals
(
dkmc
.
getXbdk1
())
||
dkmc
.
getXbdk1
()
==
null
){
pcd
.
setXbdk1
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk1jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班1打卡结果
}
}
}
else
{
if
(
clock
.
getDiffer
()
==
1
){
//打卡
return
ResultUtil
.
error
(
"重复打卡"
);
}
else
{
//更新打卡
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setXbdk1
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk1jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班1打卡结果
}
}
//班次为2次时,计算工作时长
if
(
dkmc
.
getSbdk1
()
!=
null
){
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
dkmc
.
getSbdk1
())/
1000
/
60
;
pcd
.
setGzsc
(
Math
.
abs
(
Double
.
valueOf
(
time
.
toString
())));
//只打一次卡时计算工作时长
}
punchcarddetailsmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
}
//班次为2次时,计算工作时长
if
(
dkmc
.
getSbdk1
()
!=
null
){
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
dkmc
.
getSbdk1
())/
1000
/
60
;
pcd
.
setGzsc
(
Math
.
abs
(
Double
.
valueOf
(
time
.
toString
())));
//只打一次卡时计算工作时长
}
}
else
if
(
clock
.
getType
()
==
3
){
if
((
""
).
equals
(
dkmc
.
getSbdk2
())
||
dkmc
.
getSbdk2
()
==
null
){
pcd
.
setSbdk2
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//上班2打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setSbdk2jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班2打卡结果
}
else
{
pcd
.
setSbdk2jg
(
0
);
// 打卡结果
}
}
}
else
{
if
(
clock
.
getDiffer
()
==
1
){
//打卡
return
ResultUtil
.
error
(
"重复打卡"
);
}
else
{
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setSbdk2
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//上班2打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setSbdk2jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班2打卡结果
}
else
{
pcd
.
setSbdk2jg
(
0
);
// 打卡结果
}
}
punchcarddetailsmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
}
}
else
if
(
clock
.
getType
()
==
4
){
if
((
""
).
equals
(
dkmc
.
getXbdk2
())
||
dkmc
.
getXbdk2
()
==
null
){
pcd
.
setXbdk2
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班2打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk2jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk2jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//下班2打卡结果
}
}
}
else
{
if
(
clock
.
getDiffer
()
==
1
){
//打卡
return
ResultUtil
.
error
(
"重复打卡"
);
}
else
{
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setXbdk2
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班2打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk2jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk2jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//下班2打卡结果
}
}
//班次为4次时,计算工作时长
if
(
dkmc
.
getSbdk2
()
!=
null
){
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
dkmc
.
getSbdk2
())/
1000
/
60
;
BigDecimal
om
=
new
BigDecimal
(
dkmc
.
getGzsc
());
BigDecimal
on
=
new
BigDecimal
(
time
);
double
worktime
=
Math
.
abs
(
om
.
add
(
on
).
doubleValue
());
pcd
.
setGzsc
(
worktime
);
}
punchcarddetailsmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
}
//班次为4次时,计算工作时长
if
(
dkmc
.
getSbdk2
()
!=
null
){
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
dkmc
.
getSbdk2
())/
1000
/
60
;
BigDecimal
om
=
new
BigDecimal
(
dkmc
.
getGzsc
());
BigDecimal
on
=
new
BigDecimal
(
time
);
double
worktime
=
Math
.
abs
(
om
.
add
(
on
).
doubleValue
());
pcd
.
setGzsc
(
worktime
);
}
}
else
if
(
clock
.
getType
()
==
5
){
if
((
""
).
equals
(
dkmc
.
getSbdk3
())
||
dkmc
.
getSbdk3
()
==
null
){
pcd
.
setSbdk3
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//上班3打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setSbdk3jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班3打卡结果
}
else
{
pcd
.
setSbdk3jg
(
0
);
// 打卡结果
}
}
}
else
{
if
(
clock
.
getDiffer
()
==
1
){
//打卡
return
ResultUtil
.
error
(
"重复打卡"
);
}
else
{
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setSbdk3
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//上班3打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setSbdk3jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班3打卡结果
}
else
{
pcd
.
setSbdk3jg
(
0
);
// 打卡结果
}
}
punchcarddetailsmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
}
}
else
if
(
clock
.
getType
()
==
6
){
if
((
""
).
equals
(
dkmc
.
getXbdk3
())
||
dkmc
.
getXbdk3
()
==
null
){
pcd
.
setXbdk3
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班3打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk3jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk3jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//下班3打卡结果
}
}
}
else
{
if
(
clock
.
getDiffer
()
==
1
){
//打卡
return
ResultUtil
.
error
(
"重复打卡"
);
}
else
{
pcd
.
setId
(
dkmc
.
getId
());
pcd
.
setXbdk3
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班3打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时[有班次时]
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk3jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk3jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//下班3打卡结果
}
}
//班次为6次时,计算工作时长
if
(
dkmc
.
getSbdk3
()
!=
null
){
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
dkmc
.
getSbdk3
())/
1000
/
60
;
BigDecimal
om
=
new
BigDecimal
(
dkmc
.
getGzsc
());
//第二次
BigDecimal
on
=
new
BigDecimal
(
time
);
double
worktime
=
Math
.
abs
(
om
.
add
(
on
).
doubleValue
());
pcd
.
setGzsc
(
worktime
);
}
punchcarddetailsmapper
.
updateByPrimaryKeySelective
(
pcd
);
//修改打卡记录
}
}
//班次为6次时,计算工作时长
if
(
dkmc
.
getSbdk3
()
!=
null
){
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
dkmc
.
getSbdk3
())/
1000
/
60
;
BigDecimal
om
=
new
BigDecimal
(
dkmc
.
getGzsc
());
//第二次
BigDecimal
on
=
new
BigDecimal
(
time
);
double
worktime
=
Math
.
abs
(
om
.
add
(
on
).
doubleValue
());
pcd
.
setGzsc
(
worktime
);
}
}
pcd
.
setId
(
dkmc
.
getId
());
if
(
clock
.
getType
()
<=
6
){
int
update
=
punchcarddetailsmapper
.
updateByPrimaryKeySelective
(
pcd
);
}
}
else
{
//没有数据就新增一条数据
//新增
if
(
clock
.
getDiffer
()
==
1
){
//打卡
PunchCardDetails
pcd
=
new
PunchCardDetails
();
pcd
.
setUserid
(
userid
);
pcd
.
setData
(
putime
);
//打卡日期(yyyy-MM-dd)
if
(
clock
.
getType
()
==
1
){
pcd
.
setSbdk1
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//上班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setSbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班1打卡结果
}
else
{
pcd
.
setSbdk1jg
(
0
);
// 打卡结果
}
}
}
else
if
(
clock
.
getType
()
==
2
){
pcd
.
setXbdk1
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk1jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班1打卡结果
}
}
}
else
if
(
clock
.
getType
()
==
3
){
pcd
.
setSbdk2
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//上班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setSbdk2jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
}
else
{
pcd
.
setSbdk2jg
(
0
);
// 打卡结果
}
}
}
else
if
(
clock
.
getType
()
==
4
){
pcd
.
setXbdk2
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk2jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk2jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
}
}
}
else
if
(
clock
.
getType
()
==
5
){
pcd
.
setSbdk3
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//上班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setSbdk3jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
}
else
{
pcd
.
setSbdk3jg
(
0
);
// 打卡结果
}
}
}
else
if
(
clock
.
getType
()
==
6
){
pcd
.
setXbdk3
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
//下班1打卡时间
if
(!(
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//有应打卡时间时
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
(
time
>
0
){
pcd
.
setXbdk3jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk3jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
}
}
}
if
(
shif
!=
null
){
pcd
.
setYdkcs
(
shif
.
getSxbcs
()*
2
);
//应打卡次数
}
pcd
.
setQyid
(
qyid
);
//企业id
pcd
.
setDksj
(
startDate
);
//打卡时间
punchcarddetailsmapper
.
insertSelective
(
pcd
);
dkmx
=
pcd
.
getId
();
}
}
//打卡记录
if
(
clock
.
getDiffer
()
==
2
){
//更新打卡
PunchRecord
punch
=
punchrecordmapper
.
selectPunchResults
(
startDate
,
endDate
,
userid
,
clock
.
getType
());
if
(
punch
!=
null
){
PunchRecord
pr
=
new
PunchRecord
();
pr
.
setId
(
punch
.
getId
());
pr
.
setStatus
(
0
);
//状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:补卡 4:请假)
pr
.
setSort
(
0
);
//序号(0:打卡无效:此记录已被更新)
punchrecordmapper
.
updateByPrimaryKeySelective
(
pr
);
}
else
{
return
ResultUtil
.
error
(
"打卡失败"
);
}
}
PunchRecord
pre
=
new
PunchRecord
();
pre
.
setDktime
(
Long
.
valueOf
(
clock
.
getPunchtime
()));
// 打卡时间
if
(
clock
.
getPunchcardtype
()
==
1
){
pre
.
setLon
(
Double
.
valueOf
(
clock
.
getLon
()));
// 经度
pre
.
setLat
(
Double
.
valueOf
(
clock
.
getLat
()));
// 纬度
pre
.
setAddress
(
clock
.
getAddress
());
// 定位地址
}
Long
time
=
(
Long
.
valueOf
(
clock
.
getPunchtime
())
-
Long
.
valueOf
(
clock
.
getPunchcardtime
()))/
1000
/
60
;
if
((
"0"
).
equals
(
clock
.
getPunchcardtime
())){
pre
.
setResults
(
0
);
// 打卡结果
}
else
{
if
((
clock
.
getType
())%
2
>
0
){
//上班
if
(
time
>
0
){
pre
.
setResults
(
Integer
.
valueOf
(
time
.
toString
()));
// 打卡结果
}
else
{
pre
.
setResults
(
0
);
// 打卡结果
}
}
else
{
//下班
if
(
time
>
0
){
pre
.
setResults
(
0
);
// 打卡结果
}
else
{
pre
.
setResults
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
// 打卡结果
}
}
}
pre
.
setUserId
(
userid
);
// 用户id
if
((
clock
.
getType
())%
2
>
0
){
pre
.
setType
(
1
);
// 类型(类型 0:无排班打卡 1:上班 2:下班)
if
((
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//无班次打卡
pre
.
setStatus
(
1
);
}
else
{
//打卡
if
(
time
>
0
){
pre
.
setStatus
(
3
);
// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
}
else
if
(
pre
.
getResults
()
==
0
){
pre
.
setStatus
(
1
);
// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
}
}
}
else
{
pre
.
setType
(
2
);
// 类型(类型 0:无排班打卡 1:上班 2:下班)
if
((
"0"
).
equals
(
clock
.
getPunchcardtime
())){
//无班次打卡
pre
.
setStatus
(
1
);
}
else
{
//打卡
if
(
time
<
0
){
pre
.
setStatus
(
4
);
// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
}
else
if
(
pre
.
getResults
()
==
0
){
pre
.
setStatus
(
1
);
// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
}
}
}
pre
.
setSort
(
clock
.
getType
());
// 序号
pre
.
setCardType
(
clock
.
getPunchcardtype
());
// 打卡类型(1:GPS,2:WIFI,3:考勤机)
if
(
clock
.
getPunchcardtype
()
==
2
){
pre
.
setMac
(
clock
.
getMac
());
// mac地址
pre
.
setMacname
(
clock
.
getMacname
());
// WIFI名称
}
pre
.
setQyid
(
qyid
);
// 企业id
String
attdate_
=
new
SimpleDateFormat
(
"yy-MM-dd"
).
format
(
Double
.
valueOf
(
startDate
));
//转换打卡时间格式
pre
.
setAttdate
(
attdate_
+
" "
+
ClockInTool
.
dateToWeek2
(
putime
));
// 考勤日期
long
date
=
new
Date
().
getTime
();
if
((
"0"
).
equals
(
clock
.
getPunchcardtime
())){
pre
.
setAttime
(
date
);
// 考勤时间(应打卡时间)
}
else
{
pre
.
setAttime
(
Long
.
valueOf
(
clock
.
getPunchcardtime
()));
// 考勤时间(应打卡时间)
}
pre
.
setDkmxid
(
dkmx
);
// 打卡明细id
pre
.
setBcid
(
clock
.
getShifid
());
// 班次id
punchrecordmapper
.
insertSelective
(
pre
);
//新增打卡记录
return
ResultUtil
.
data
(
null
,
"打卡成功"
);
}
}
}
This diff is collapsed.
Click to expand it.
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