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
2e7d01f7
Commit
2e7d01f7
authored
Jul 10, 2020
by
lal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
8ec1ce59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
160 additions
and
124 deletions
+160
-124
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
+160
-124
No files found.
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
View file @
2e7d01f7
...
...
@@ -2148,75 +2148,108 @@ public class ClockInController {
//打卡记录
// List<KqglAssoDkjl> dajllist = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
// attdate.setAttpr(dajllist);
List
<
AttSchedule
>
attsch
=
attdate
.
getAttsch
();
int
r
=
1
;
for
(
AttSchedule
ash
:
attsch
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
//有范围
if
(
ash
.
getStarttime
()
!=
0
&&
ash
.
getEndtime
()
!=
0
)
{
boolean
ectivedate
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
nowdate
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getStarttime
()),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getEndtime
()),
"yyyy-MM-dd HH:mm"
);
if
(
ectivedate
)
{
ash
.
setIsdk
(
0
);
if
(
attdate
.
getAttgrouptype
()
!=
3
)
{
List
<
AttSchedule
>
attsch
=
attdate
.
getAttsch
();
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
()))
{
//班次不为空
int
bccs
=
attdate
.
getAttsch
().
size
();
int
r
=
1
,
bc
=
0
;
int
bsz
=
0
;
for
(
AttSchedule
ash
:
attsch
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
//有范围
if
(
ash
.
getStarttime
()
!=
0
&&
ash
.
getEndtime
()
!=
0
)
{
boolean
ectivedate
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
nowdate
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getStarttime
()),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getEndtime
()),
"yyyy-MM-dd HH:mm"
);
if
(
ectivedate
)
{
bsz
=
1
;
ash
.
setIsdk
(
0
);
}
else
{
bc
++;
ash
.
setIsdk
(
1
);
}
}
else
{
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ash
.
getId
()));
Timestamp
b
=
Timestamp
.
valueOf
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
()));
//
String
xbdk1
=
(
str
+
" "
+
shif
.
getXbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);
Timestamp
a
=
Timestamp
.
valueOf
(
xbdk1
);
String
sbdk1
=
(
str
+
" "
+
shif
.
getSbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);
Timestamp
c
=
Timestamp
.
valueOf
(
sbdk1
);
if
(
r
==
1
)
{
if
(
b
.
after
(
a
)
&&
b
.
after
(
c
))
{
// 当前时间大于下班打卡时间
bc
++;
ash
.
setIsdk
(
1
);
}
else
{
bsz
=
1
;
}
}
if
(
r
==
2
)
{
String
stampToDate
=
ClockInTool
.
stampToDate
(
String
.
valueOf
(
endDate
));
Timestamp
d
=
Timestamp
.
valueOf
(
stampToDate
);
// if (b.after(a) && b.after(c)) {
// ash.setIsdk(1);
// }
if
(
b
.
after
(
a
)
&&
b
.
before
(
d
))
{
bsz
=
1
;
ash
.
setIsdk
(
0
);
}
if
(
b
.
before
(
a
)
||
b
.
after
(
c
))
{
bc
++;
ash
.
setIsdk
(
1
);
}
}
r
++;
}
}
else
{
ash
.
setIsdk
(
1
);
}
}
else
{
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ash
.
getId
()));
Timestamp
b
=
Timestamp
.
valueOf
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
()));
//
String
xbdk1
=
(
str
+
" "
+
shif
.
getXbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);
Timestamp
a
=
Timestamp
.
valueOf
(
xbdk1
);
String
sbdk1
=
(
str
+
" "
+
shif
.
getSbdk1
()+
":00"
).
replaceAll
(
"\r|\n"
,
""
);
Timestamp
c
=
Timestamp
.
valueOf
(
sbdk1
);
if
(
r
==
1
)
{
if
(
b
.
after
(
a
))
{
// 当前时间大于下班打卡时间
ash
.
setIsdk
(
1
);
}
}
if
(
r
==
2
)
{
String
stampToDate
=
ClockInTool
.
stampToDate
(
String
.
valueOf
(
endDate
));
Timestamp
d
=
Timestamp
.
valueOf
(
stampToDate
);
if
(
b
.
after
(
a
)
&&
b
.
after
(
c
))
{
boolean
ectivedate
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
nowdate
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getStarttime
()),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getEndtime
()),
"yyyy-MM-dd HH:mm"
);
if
(
ectivedate
)
{
bsz
=
1
;
ash
.
setIsdk
(
0
);
}
else
{
bc
++;
ash
.
setIsdk
(
1
);
}
if
(
b
.
after
(
a
)
&&
b
.
before
(
d
))
{
ash
.
setIsdk
(
0
);
}
List
<
KqglAssoDkjl
>
dajllist_
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDate
,
endDate
,
userBean
.
getEmpNum
());
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
for
(
KqglAssoDkjl
daj
:
dajllist_
)
{
if
(
ash
.
getId
()
==
daj
.
getBcid
()
&&
ash
.
getSort
()
==
daj
.
getSort
())
{
//班次id和打卡顺序对应
BeanUtil
.
copyProperties
(
daj
,
dkjl
,
"attdate"
,
"bcid"
,
"remarks"
,
"userId"
,
"attime"
,
"dkmxid"
,
"commentary"
,
"punchequipment"
,
"punchmode"
);
if
(
bsz
==
1
)
{
bc
++;
ash
.
setIsdk
(
1
);
}
else
{
ash
.
setIsdk
(
1
);
}
}
}
r
++
;
ash
.
setDajl
(
dkjl
)
;
}
}
else
{
boolean
ectivedate
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
nowdate
),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getStarttime
()),
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
ash
.
getEndtime
()),
"yyyy-MM-dd HH:mm"
);
if
(
ectivedate
)
{
ash
.
setIsdk
(
0
);
}
else
{
ash
.
setIsdk
(
1
);
}
}
//自由工时
if
(
attdate
.
getAttgrouptype
()
==
3
)
{
}
else
{
List
<
KqglAssoDkjl
>
dajllist_
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDate
,
endDate
,
userBean
.
getEmpNum
());
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
for
(
KqglAssoDkjl
daj
:
dajllist_
)
{
if
(
ash
.
getId
()
==
daj
.
getBcid
()
&&
ash
.
getSort
()
==
daj
.
getSort
())
{
//班次id和打卡顺序对应
BeanUtil
.
copyProperties
(
daj
,
dkjl
,
"attdate"
,
"bcid"
,
"remarks"
,
"userId"
,
"attime"
,
"dkmxid"
,
"commentary"
,
"punchequipment"
,
"punchmode"
);
ash
.
setIsdk
(
1
);
//全部为 1 时
if
(
bccs
==
bc
)
{
KqglAssoDkjl
dk
=
KqglAssoDkjl
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkjl
>().
lambda
().
eq
(
KqglAssoDkjl:
:
getQyid
,
userBean
.
getOrgCode
())
.
eq
(
KqglAssoDkjl:
:
getUserId
,
userBean
.
getEmpNum
()).
ge
(
KqglAssoDkjl:
:
getDktime
,
startDate
).
le
(
KqglAssoDkjl:
:
getDktime
,
endDate
).
orderByDesc
(
KqglAssoDkjl:
:
getSort
).
last
(
"LIMIT 1"
));
if
(
dk
!=
null
&&
attdate
.
getAttsch
().
size
()
!=
dk
.
getSort
())
{
AttSchedule
att
=
attsch
.
get
(
dk
.
getSort
());
att
.
setIsdk
(
0
);
}
}
ash
.
setDajl
(
dkjl
);
}
}
else
{
//自由工时
List
<
AttSchedule
>
attsch
=
new
ArrayList
<
AttSchedule
>();
List
<
KqglAssoDkjl
>
dajllist_
=
kqglassodkjlmapper
.
getDetailedRecordClock
(
startDate
,
endDate
,
userBean
.
getEmpNum
());
KqglAssoDkjl
dkjl
=
KqglAssoDkjl
.
builder
().
build
();
}
//外勤 true:开 false:关
if
(
attgro
.
getIsWq
()
==
1
)
{
attdate
.
setFieldpersonnel
(
true
);
...
...
@@ -2280,80 +2313,83 @@ public class ClockInController {
double
latetime_
=
0
;
//前天晚走时长(分钟)
Long
changed_time
=
0
l
;
//晚到后应打卡时间
List
<
AttSchedule
>
ash
=
attdate
.
getAttsch
();
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ash
.
get
(
0
).
getId
()));
if
(
shif
!=
null
)
{
int
dkcs_
=
shif
.
getSxbcs
();
//上下班打卡次数
int
iswzwd
=
shif
.
getIsWzwd
();
//是否开启晚走晚到(0:否;1:是)
//统一分钟数
double
xbwz1
=
0
,
xbwz2
=
0
,
xbwz3
=
0
;
int
sbwd1
=
0
,
sbwd2
=
0
,
sbwd3
=
0
;
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
)
{
if
(
attdate
.
getAttgrouptype
()
!=
3
)
{
List
<
AttSchedule
>
ash
=
attdate
.
getAttsch
();
KqglAssoBcsz
shif
=
KqglAssoBcsz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoBcsz
>().
lambda
().
eq
(
KqglAssoBcsz:
:
getId
,
ash
.
get
(
0
).
getId
()));
if
(
shif
!=
null
)
{
int
dkcs_
=
shif
.
getSxbcs
();
//上下班打卡次数
int
iswzwd
=
shif
.
getIsWzwd
();
//是否开启晚走晚到(0:否;1:是)
//统一分钟数
xbwz1
=
Double
.
valueOf
(
shif
.
getXbwz1
())
*
60
;
//下班晚走1
sbwd1
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd1
())
*
60
));
//上班晚到1
xbwz2
=
Double
.
valueOf
(
shif
.
getXbwz2
())
*
60
;
//下班晚走2
sbwd2
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd2
())
*
60
));
//上班晚到2
xbwz3
=
Double
.
valueOf
(
shif
.
getXbwz3
())
*
60
;
//下班晚走3
sbwd3
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd3
())
*
60
));
//上班晚到3
//获取前一天最后下班的时间
yesterdaymx
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
.
ge
(
KqglAssoDkmx:
:
getDksj
,
startDateyesterday
).
le
(
KqglAssoDkmx:
:
getDksj
,
endDateyesterday
));
attdateyesterday
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
yesterday
);
List
<
AttSchedule
>
ashyes
=
attdateyesterday
.
getAttsch
();
if
(
attdateyesterday
.
getAttsch
().
size
()
==
2
||
attdateyesterday
.
getAttsch
().
size
()
==
4
||
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime1
=
ashyes
.
get
(
1
).
getTime
();
}
if
(
attdateyesterday
.
getAttsch
().
size
()
==
4
||
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime2
=
ashyes
.
get
(
3
).
getTime
();
}
if
(
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime3
=
ashyes
.
get
(
5
).
getTime
();
}
if
(
dkcs_
==
1
)
{
if
(
yesterdaymx
.
getXbdk1
()
!=
null
&&
yesterdaymx
.
getXbdk1jg
()
==
0
)
{
latetime
=
(
yesterdaymx
.
getXbdk1
()
-
yesendtime1
)/
1000
/
60
;
double
xbwz1
=
0
,
xbwz2
=
0
,
xbwz3
=
0
;
int
sbwd1
=
0
,
sbwd2
=
0
,
sbwd3
=
0
;
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
)
{
//统一分钟数
xbwz1
=
Double
.
valueOf
(
shif
.
getXbwz1
())
*
60
;
//下班晚走1
sbwd1
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd1
())
*
60
));
//上班晚到1
xbwz2
=
Double
.
valueOf
(
shif
.
getXbwz2
())
*
60
;
//下班晚走2
sbwd2
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd2
())
*
60
));
//上班晚到2
xbwz3
=
Double
.
valueOf
(
shif
.
getXbwz3
())
*
60
;
//下班晚走3
sbwd3
=
Integer
.
valueOf
(
String
.
valueOf
(
Double
.
valueOf
(
shif
.
getSbwd3
())
*
60
));
//上班晚到3
//获取前一天最后下班的时间
yesterdaymx
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
.
ge
(
KqglAssoDkmx:
:
getDksj
,
startDateyesterday
).
le
(
KqglAssoDkmx:
:
getDksj
,
endDateyesterday
));
attdateyesterday
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
yesterday
);
List
<
AttSchedule
>
ashyes
=
attdateyesterday
.
getAttsch
();
if
(
attdateyesterday
.
getAttsch
().
size
()
==
2
||
attdateyesterday
.
getAttsch
().
size
()
==
4
||
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime1
=
ashyes
.
get
(
1
).
getTime
();
}
}
else
if
(
dkcs_
==
2
){
if
(
yesterdaymx
.
getXbdk2
()
!=
null
&&
yesterdaymx
.
getXbdk2jg
()
==
0
)
{
latetime
=
(
yesterdaymx
.
getXbdk2
()
-
yesendtime2
)/
1000
/
60
;
if
(
attdateyesterday
.
getAttsch
().
size
()
==
4
||
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime2
=
ashyes
.
get
(
3
).
getTime
();
}
}
else
{
if
(
yesterdaymx
.
getXbdk3
()
!=
null
&&
yesterdaymx
.
getXbdk3jg
()
==
0
)
{
latetime
=
(
yesterdaymx
.
getXbdk3
()
-
yesendtime3
)/
1000
/
60
;
if
(
attdateyesterday
.
getAttsch
().
size
()
==
6
)
{
yesendtime3
=
ashyes
.
get
(
5
).
getTime
();
}
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
)
{
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
;
if
(
latetime
!=
0
)
{
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
;
}
//ash.get(0).getTime():当天第一次应打卡时间
clock_date
=
ClockInTool
.
stampToDate
(
String
.
valueOf
(
ash
.
get
(
0
).
getTime
()));
changed_time
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
ClockInTool
.
addtime
(
clock_date
,
"+"
+
arrive_late
)));
//晚到后应打卡时间
}
//ash.get(0).getTime():当天第一次应打卡时间
clock_date
=
ClockInTool
.
stampToDate
(
String
.
valueOf
(
ash
.
get
(
0
).
getTime
()));
changed_time
=
Long
.
valueOf
(
ClockInTool
.
dateToStamp
(
ClockInTool
.
addtime
(
clock_date
,
"+"
+
arrive_late
)));
//晚到后应打卡时间
}
}
attdate
.
setLatetime
(
latetime_
);
attdate
.
setChanged_time
(
changed_time
);
attdate
.
setLatetime
(
latetime_
);
attdate
.
setChanged_time
(
changed_time
);
}
}
return
ResultUtil
.
data
(
attdate
);
}
else
{
...
...
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