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
e142d158
Commit
e142d158
authored
Jun 19, 2020
by
leialin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lal' into 'develop'
Lal See merge request 8timerv2/8timerapiv200!235
parents
8cb7adc9
ccf64fff
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
253 additions
and
27 deletions
+253
-27
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
+17
-17
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+24
-10
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
+212
-0
No files found.
src/main/java/cn/timer/api/controller/kqgl/ClockInController.java
View file @
e142d158
...
...
@@ -288,28 +288,28 @@ public class ClockInController {
//打卡时间 对比班次 接近哪个时间就打哪个时间的卡
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
//punchstart 应打卡开始时间 punchend:应打卡结束时间 time_:打卡时间
boolean
effectiveDate1
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime1ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime1js
),
"
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
(
"HH:mm"
).
format
(
starttime1js
),
"yyyy-MM-dd
HH:mm"
);
if
(
effectiveDate1
)
{
//在范围内就打卡
atttype
=
1
;
}
else
{
isRange
=
false
;
}
boolean
effectiveDate2
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime1ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime1js
),
"
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
)
{
//在范围内就打卡
atttype
=
2
;
}
else
{
isRange
=
false
;
}
boolean
effectiveDate3
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime2ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime2js
),
"
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
)
{
//在范围内就打卡
atttype
=
3
;
}
else
{
isRange
=
false
;
}
boolean
effectiveDate4
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime2ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime2js
),
"
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
)
{
//在范围内就打卡
atttype
=
4
;
}
else
{
...
...
@@ -317,14 +317,14 @@ public class ClockInController {
}
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
boolean
effectiveDate5
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime3ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime3js
),
"
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
)
{
//在范围内就打卡
atttype
=
5
;
}
else
{
isRange
=
false
;
}
boolean
effectiveDate6
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime3ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime3js
),
"
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
)
{
//在范围内就打卡
atttype
=
6
;
}
else
{
...
...
@@ -358,7 +358,7 @@ public class ClockInController {
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
boolean
effectiveDate1
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime1ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime1js
),
"
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
(
dkmc
.
getSbdk1
()
!=
null
)
{
sbdkkd
=
true
;
//
...
...
@@ -367,7 +367,7 @@ public class ClockInController {
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate2
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime1ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime1js
),
"
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
(
dkmc
.
getXbdk1
()
!=
null
)
{
kskd
=
true
;
...
...
@@ -377,7 +377,7 @@ public class ClockInController {
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate3
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime2ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime2js
),
"
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
(
dkmc
.
getSbdk2
()
!=
null
)
{
sbdkkd
=
true
;
//
...
...
@@ -386,7 +386,7 @@ public class ClockInController {
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate4
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime2ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime2js
),
"
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
(
dkmc
.
getXbdk2
()
!=
null
)
{
kskd
=
true
;
...
...
@@ -399,7 +399,7 @@ public class ClockInController {
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
boolean
effectiveDate5
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime3ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
starttime3js
),
"
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
(
dkmc
.
getSbdk2
()
!=
null
)
{
sbdkkd
=
true
;
//
...
...
@@ -408,7 +408,7 @@ public class ClockInController {
}
}
else
{
isRange
=
false
;
}
boolean
effectiveDate6
=
ClockInTool
.
hourMinuteBetween
(
new
SimpleDateFormat
(
"
HH:mm"
).
format
(
time_
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime3ks
),
new
SimpleDateFormat
(
"HH:mm"
).
format
(
endtime3js
),
"
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
(
dkmc
.
getXbdk2
()
!=
null
)
{
kskd
=
true
;
...
...
@@ -460,10 +460,10 @@ public class ClockInController {
// boolean isRange = true;
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
if
(
punchstart
>
0
&&
punchend
>
0
)
{
String
staputime
=
new
SimpleDateFormat
(
"HH:mm"
).
format
(
punchstart
);
//应打卡开始时间
String
entputime
=
new
SimpleDateFormat
(
"HH:mm"
).
format
(
punchend
);
//应打卡结束时间
String
DKputime
=
new
SimpleDateFormat
(
"HH:mm"
).
format
(
time_
);
//打卡时间
boolean
effectiveDate
=
ClockInTool
.
hourMinuteBetween
(
DKputime
,
staputime
,
entputime
,
"HH:mm"
);
String
staputime
=
new
SimpleDateFormat
(
"
yyyy-MM-dd
HH:mm"
).
format
(
punchstart
);
//应打卡开始时间
String
entputime
=
new
SimpleDateFormat
(
"
yyyy-MM-dd
HH:mm"
).
format
(
punchend
);
//应打卡结束时间
String
DKputime
=
new
SimpleDateFormat
(
"
yyyy-MM-dd
HH:mm"
).
format
(
time_
);
//打卡时间
boolean
effectiveDate
=
ClockInTool
.
hourMinuteBetween
(
DKputime
,
staputime
,
entputime
,
"
yyyy-MM-dd
HH:mm"
);
if
(!
effectiveDate
)
{
System
.
out
.
println
(
"当前打卡时间不在范围内"
);
// 手动抛出异常
...
...
@@ -533,7 +533,7 @@ public class ClockInController {
if
(
time
>
0
){
pcd
.
setXbdk1jg
(
0
);
// 打卡结果
}
else
{
pcd
.
setXbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
//上班1打卡结果
pcd
.
setXbdk1jg
(
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
())));
}
}
...
...
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
e142d158
...
...
@@ -53,6 +53,7 @@ import cn.timer.api.bean.kqmk.KqglAssoKqj;
import
cn.timer.api.bean.kqmk.KqglAssoKqzdkfs
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveBalance
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeRange
;
import
cn.timer.api.bean.kqmk.KqglAssoOvertimeRules
;
...
...
@@ -2248,7 +2249,7 @@ public class TimeCardController {
int
sbdk1jg
=
0
,
xbdk1jg
=
0
,
sbdk2jg
=
0
,
xbdk2jg
=
0
,
sbdk3jg
=
0
,
xbdk3jg
=
0
;
//kqgl_asso_dkmx 打卡明细是否存在打卡记录
KqglAssoDkmx
dkmx
=
kqglassodkmxmapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getData
,
chpunchr
.
getData
()).
eq
(
KqglAssoDkmx:
:
getUserid
,
chpunchr
.
getNum
()));
KqglAssoDkmx
dkmx
=
kqglassodkmxmapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getData
,
chpunchr
.
getData
()).
eq
(
KqglAssoDkmx:
:
getUserid
,
chpunchr
.
getNum
())
.
eq
(
KqglAssoDkmx:
:
getQyid
,
userBean
.
getOrgCode
())
);
if
(
dkmx
!=
null
)
{
if
(
chpunchr
.
getClocktype
()
==
1
)
{
sbdk1
=
changed_time
;
...
...
@@ -2393,7 +2394,7 @@ public class TimeCardController {
if
(
rul
!=
null
)
{
if
(
id
==
1
)
{
if
(
rul
.
getIsWorkovertime
()
==
1
&&
rul
.
getWorkSwitch
()
==
1
)
{
if
(
rul
.
getWorkOne
()
!=
"0"
)
{
if
(
!(
"0"
).
equals
(
rul
.
getWorkOne
())
)
{
CompensateDto
com
=
CompensateDto
.
builder
().
build
();
com
.
setId
(
1
);
com
.
setValue
(
"调休"
);
...
...
@@ -2405,7 +2406,7 @@ public class TimeCardController {
com2
.
setValue
(
"加班费"
);
coms
.
add
(
com2
);
}
if
(
rul
.
getWorkThree
()
!=
"0"
)
{
if
(
!(
"0"
).
equals
(
rul
.
getWorkThree
())
)
{
CompensateDto
com3
=
CompensateDto
.
builder
().
build
();
com3
.
setId
(
3
);
com3
.
setValue
(
"调休/加班费"
);
...
...
@@ -2414,7 +2415,7 @@ public class TimeCardController {
}
}
else
if
(
id
==
2
)
{
if
(
rul
.
getIsRestovertime
()
==
1
&&
rul
.
getRestSwitch
()
==
1
)
{
if
(
rul
.
getRestOne
()
!=
"0"
)
{
if
(
!(
"0"
).
equals
(
rul
.
getRestOne
())
)
{
CompensateDto
com
=
CompensateDto
.
builder
().
build
();
com
.
setId
(
1
);
com
.
setValue
(
"调休"
);
...
...
@@ -2426,7 +2427,7 @@ public class TimeCardController {
com2
.
setValue
(
"加班费"
);
coms
.
add
(
com2
);
}
if
(
rul
.
getRestThree
()
!=
"0"
)
{
if
(
!(
"0"
).
equals
(
rul
.
getRestThree
())
)
{
CompensateDto
com3
=
CompensateDto
.
builder
().
build
();
com3
.
setId
(
3
);
com3
.
setValue
(
"调休/加班费"
);
...
...
@@ -2435,7 +2436,7 @@ public class TimeCardController {
}
}
else
{
if
(
rul
.
getIsHolidays
()
==
1
&&
rul
.
getHolidaysSwitch
()
==
1
)
{
if
(
rul
.
getHolidaysOne
()
!=
"0"
)
{
if
(
!(
"0"
).
equals
(
rul
.
getHolidaysOne
())
)
{
CompensateDto
com
=
CompensateDto
.
builder
().
build
();
com
.
setId
(
1
);
com
.
setValue
(
"调休"
);
...
...
@@ -2447,7 +2448,7 @@ public class TimeCardController {
com2
.
setValue
(
"加班费"
);
coms
.
add
(
com2
);
}
if
(
rul
.
getHolidaysThree
()
!=
"0"
)
{
if
(
!(
"0"
).
equals
(
rul
.
getHolidaysThree
())
)
{
CompensateDto
com3
=
CompensateDto
.
builder
().
build
();
com3
.
setId
(
3
);
com3
.
setValue
(
"调休/加班费"
);
...
...
@@ -2785,7 +2786,7 @@ public class TimeCardController {
}
if
(
ashss
.
get
(
0
).
getId
()
!=
0
)
{
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
.
eq
(
KqglAssoDkmx:
:
getQyid
,
userBean
.
getOrgCode
())
.
ge
(
KqglAssoDkmx:
:
getDksj
,
start_time
).
le
(
KqglAssoDkmx:
:
getDksj
,
end_time
));
if
(
dkmc
!=
null
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
||
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
...
...
@@ -2840,7 +2841,7 @@ public class TimeCardController {
Long
starttime
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
current
,
"yyyy-MM-dd"
)).
getTime
();
Long
endtime
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
current
,
"yyyy-MM-dd"
)).
getTime
();
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
.
eq
(
KqglAssoDkmx:
:
getQyid
,
userBean
.
getOrgCode
())
.
ge
(
KqglAssoDkmx:
:
getDksj
,
starttime
).
le
(
KqglAssoDkmx:
:
getDksj
,
endtime
));
if
(
dkmc
!=
null
)
{
...
...
@@ -2913,7 +2914,7 @@ public class TimeCardController {
dets
.
setDate
(
date
);
Long
starttime
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
date
,
"yyyy-MM-dd"
)).
getTime
();
Long
endtime
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
date
,
"yyyy-MM-dd"
)).
getTime
();
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
userBean
.
getEmpNum
())
.
eq
(
KqglAssoDkmx:
:
getQyid
,
userBean
.
getOrgCode
())
.
ge
(
KqglAssoDkmx:
:
getDksj
,
starttime
).
le
(
KqglAssoDkmx:
:
getDksj
,
endtime
));
if
(
dkmc
!=
null
)
{
dets
.
setSbdksj1
(
dkmc
.
getSbdk1
()
==
null
?
""
:
ClockInTool
.
stampToDate3
(
String
.
valueOf
(
dkmc
.
getSbdk1
())));
...
...
@@ -3004,4 +3005,17 @@ public class TimeCardController {
return
ResultUtil
.
data
(
ils
,
"操作成功!"
);
}
@GetMapping
(
value
=
"/worktable_attendance_from"
)
@ApiOperation
(
value
=
"999:工作台考勤表格"
,
httpMethod
=
"GET"
,
notes
=
"查询数据"
)
public
Result
<
Object
>
worktable_attendance_from
(
@CurrentUser
UserBean
userBean
)
throws
ParseException
{
String
belongyear
=
new
SimpleDateFormat
(
"yyyy"
).
format
(
new
Date
());
String
belongmonth
=
new
SimpleDateFormat
(
"MM"
).
format
(
new
Date
());
KqglAssoMonthPunchSummary
punsum
=
KqglAssoMonthPunchSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoMonthPunchSummary
>().
lambda
().
eq
(
KqglAssoMonthPunchSummary:
:
getNum
,
userBean
.
getEmpNum
())
.
eq
(
KqglAssoMonthPunchSummary:
:
getOrgCode
,
userBean
.
getOrgCode
()).
eq
(
KqglAssoMonthPunchSummary:
:
getBelongYear
,
belongyear
).
eq
(
KqglAssoMonthPunchSummary:
:
getBelongMonth
,
belongmonth
));
return
ResultUtil
.
data
(
punsum
,
"操作成功!"
);
}
}
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
View file @
e142d158
package
cn
.
timer
.
api
.
controller
.
kqgl
.
service
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.timer.api.bean.kqmk.KqglAssoDkmx
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveBalance
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.kqmk.KqglAssoRelationSummary
;
import
cn.timer.api.bean.kqmk.KqglMainKqz
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.controller.kqgl.ClockInController
;
import
cn.timer.api.controller.kqgl.ClockInTool
;
import
cn.timer.api.controller.kqgl.EmptyUtil
;
import
cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper
;
import
cn.timer.api.dao.kqmk.KqglMainKqzMapper
;
import
cn.timer.api.dto.kqmk.AttEvectionApprovalDto
;
import
cn.timer.api.dto.kqmk.AttLeaveApprovalDto
;
import
cn.timer.api.dto.kqmk.AttOvertimeApprovalDto
;
import
cn.timer.api.dto.kqmk.AttRepairApprovalDto
;
import
cn.timer.api.dto.kqmk.AttSchedule
;
import
cn.timer.api.dto.kqmk.AttendanceCardListDto
;
import
cn.timer.api.utils.DateUtil
;
/**
* @author lal
...
...
@@ -122,20 +132,222 @@ public class KqglServiceImpl implements KqglService {
return
true
;
}
@Autowired
private
KqglMainKqzMapper
kqglmainkqzmapper
;
/**
* 考勤补卡审批
*/
@Override
public
boolean
attrepairapproval
(
AttRepairApprovalDto
repaappr
)
{
String
cardrepltime
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
repaappr
.
getCardrepltime
());
//补卡时间
boolean
isRange
=
true
;
Long
start_time
=
null
;
Long
end_time
=
null
;
try
{
start_time
=
DateUtil
.
getStartTime
(
0
,
DateUtil
.
getStringTime
(
cardrepltime
,
"yyyy-MM-dd"
)).
getTime
();
end_time
=
DateUtil
.
getnowEndTime
(
23
,
DateUtil
.
getStringTime
(
cardrepltime
,
"yyyy-MM-dd"
)).
getTime
();
}
catch
(
ParseException
e1
)
{
e1
.
printStackTrace
();
}
//记入打卡月汇总关联表
KqglAssoRelationSummary
.
builder
().
userId
(
repaappr
.
getUserid
()).
appTime
(
cardrepltime
).
approvalId
(
repaappr
.
getRepairid
()).
approvalType
(
5
).
startTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd' 'HH:mm:ss"
).
format
(
repaappr
.
getCardrepltime
())).
orgCode
(
repaappr
.
getOrgcode
()).
build
().
insert
();
ClockInController
clo
=
new
ClockInController
();
try
{
KqglMainKqz
attgro
=
kqglmainkqzmapper
.
getAttendanceGroupInformationByUserid
(
repaappr
.
getUserid
(),
repaappr
.
getOrgcode
());
//考勤组信息
if
(
attgro
!=
null
)
{
AttendanceCardListDto
attdate
=
clo
.
MethodCall
(
repaappr
.
getOrgcode
(),
repaappr
.
getUserid
(),
cardrepltime
);
//获取当天打卡班次信息
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
()))
{
//班次不为空
List
<
AttSchedule
>
ash
=
attdate
.
getAttsch
();
//获取当天应打卡时间
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
;
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
();
endtime1
=
ash
.
get
(
1
).
getTime
();
endtime1ks
=
ash
.
get
(
1
).
getStarttime
();
endtime1js
=
ash
.
get
(
1
).
getEndtime
();
}
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
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
();
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
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
();
}
if
(
ash
.
get
(
0
).
getId
()
!=
0
)
{
//有排班 非休息
KqglAssoDkmx
dkmc
=
KqglAssoDkmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoDkmx
>().
lambda
().
eq
(
KqglAssoDkmx:
:
getUserid
,
repaappr
.
getUserid
()).
eq
(
KqglAssoDkmx:
:
getQyid
,
repaappr
.
getOrgcode
())
.
ge
(
KqglAssoDkmx:
:
getDksj
,
start_time
).
le
(
KqglAssoDkmx:
:
getDksj
,
end_time
));
//获取补卡当天是否有打卡记录
if
(
dkmc
!=
null
)
{
if
(
attdate
.
getAttsch
().
size
()
==
2
)
{
//一套班次
if
(
repaappr
.
getCardreplperiod
()
==
1
&&
dkmc
.
getSbdk1
()
!=
null
)
{
//上班
if
(
starttime1ks
>
0
&&
starttime1js
>
0
)
{
// boolean sb1 = verification_range(starttime1ks,starttime1js,repaappr.getCardrepltime());
String
staputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime1ks
);
//应打卡开始时间
String
entputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
starttime1js
);
//应打卡结束时间
String
DKputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
repaappr
.
getCardrepltime
());
//打卡时间
boolean
effectiveDate
=
ClockInTool
.
hourMinuteBetween
(
DKputime
,
staputime
,
entputime
,
"yyyy-MM-dd HH:mm"
);
if
(!
effectiveDate
)
{
System
.
out
.
println
(
"当前打卡时间不在范围内"
);
isRange
=
false
;
}
}
if
(
isRange
)
{
int
sbdkjg
=
0
;
Long
time
=
(
repaappr
.
getCardrepltime
()
-
starttime1
)/
1000
/
60
;
if
(
time
>
0
){
//上班1打卡结果
sbdkjg
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
Double
gzsctime
=
null
;
//工作时长
if
(
dkmc
.
getXbdk1
()
!=
null
){
Long
time1
=
(
repaappr
.
getCardrepltime
()
-
dkmc
.
getXbdk1
())/
1000
/
60
;
gzsctime
=
Math
.
abs
(
Double
.
valueOf
(
time1
.
toString
()));
//只打一次卡时计算工作时长
}
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
sbdk1
(
repaappr
.
getCardrepltime
()).
sbdk1jg
(
sbdkjg
).
gzsc
(
gzsctime
).
build
().
updateById
();
}
}
else
if
(
repaappr
.
getCardreplperiod
()
==
2
&&
dkmc
.
getXbdk1
()
!=
null
)
{
//下班
if
(
endtime1ks
>
0
&&
endtime1js
>
0
)
{
String
staputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1ks
);
//应打卡开始时间
String
entputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
endtime1js
);
//应打卡结束时间
String
DKputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
repaappr
.
getCardrepltime
());
//打卡时间
boolean
effectiveDate
=
ClockInTool
.
hourMinuteBetween
(
DKputime
,
staputime
,
entputime
,
"yyyy-MM-dd HH:mm"
);
if
(!
effectiveDate
)
{
System
.
out
.
println
(
"当前打卡时间不在范围内"
);
isRange
=
false
;
}
}
if
(
isRange
)
{
int
xbdk1jg
=
0
;
Long
time
=
(
repaappr
.
getCardrepltime
()
-
endtime1
)/
1000
/
60
;
if
(
time
>
0
){}
else
{
xbdk1jg
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
Double
gzsctime
=
null
;
//工作时长
if
(
dkmc
.
getSbdk1
()
!=
null
)
{
Long
time1
=
(
repaappr
.
getCardrepltime
()
-
dkmc
.
getSbdk1
())/
1000
/
60
;
gzsctime
=
Math
.
abs
(
Double
.
valueOf
(
time1
.
toString
()));
}
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
xbdk1
(
repaappr
.
getCardrepltime
()).
xbdk1jg
(
xbdk1jg
).
gzsc
(
gzsctime
).
build
().
updateById
();
}
}
}
else
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
repaappr
.
getCardreplperiod
()
==
1
)
{
boolean
sb1
=
verification_range
(
starttime1ks
,
starttime1js
,
repaappr
.
getCardrepltime
());
if
(
sb1
&&
dkmc
.
getSbdk1
()
!=
null
)
{
int
sbdkjg
=
0
;
Long
time
=
(
repaappr
.
getCardrepltime
()
-
starttime1
)/
1000
/
60
;
if
(
time
>
0
){
//上班1打卡结果
sbdkjg
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
Double
gzsctime
=
null
;
//工作时长
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
sbdk1
(
repaappr
.
getCardrepltime
()).
sbdk1jg
(
sbdkjg
).
gzsc
(
gzsctime
).
build
().
updateById
();
}
boolean
sb2
=
verification_range
(
starttime2ks
,
starttime2js
,
repaappr
.
getCardrepltime
());
if
(
sb2
&&
dkmc
.
getSbdk2
()
!=
null
)
{
int
sbdkjg
=
0
;
Long
time
=
(
repaappr
.
getCardrepltime
()
-
starttime2
)/
1000
/
60
;
if
(
time
>
0
){
//上班1打卡结果
sbdkjg
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
Double
gzsctime
=
null
;
//工作时长
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
sbdk2
(
repaappr
.
getCardrepltime
()).
sbdk2jg
(
sbdkjg
).
gzsc
(
gzsctime
).
build
().
updateById
();
}
}
else
if
(
repaappr
.
getCardreplperiod
()
==
2
)
{
boolean
xb1
=
verification_range
(
endtime1ks
,
endtime1js
,
repaappr
.
getCardrepltime
());
if
(
xb1
&&
dkmc
.
getXbdk1
()
!=
null
)
{
int
xbdk1jg
=
0
;
Long
time
=
(
repaappr
.
getCardrepltime
()
-
endtime1
)/
1000
/
60
;
if
(
time
>
0
){}
else
{
xbdk1jg
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
Double
gzsctime
=
null
;
//工作时长
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
xbdk1
(
repaappr
.
getCardrepltime
()).
xbdk1jg
(
xbdk1jg
).
gzsc
(
gzsctime
).
build
().
updateById
();
}
boolean
xb2
=
verification_range
(
endtime2ks
,
endtime2js
,
repaappr
.
getCardrepltime
());
if
(
xb2
&&
dkmc
.
getXbdk2
()
!=
null
)
{
int
xbdk2jg
=
0
;
Long
time
=
(
repaappr
.
getCardrepltime
()
-
endtime2
)/
1000
/
60
;
if
(
time
>
0
){}
else
{
xbdk2jg
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
Double
gzsctime
=
null
;
//工作时长
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
xbdk2
(
repaappr
.
getCardrepltime
()).
xbdk2jg
(
xbdk2jg
).
gzsc
(
gzsctime
).
build
().
updateById
();
}
}
}
else
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
if
(
repaappr
.
getCardreplperiod
()
==
1
)
{
boolean
sb3
=
verification_range
(
starttime3ks
,
starttime3js
,
repaappr
.
getCardrepltime
());
if
(
sb3
&&
dkmc
.
getSbdk3
()
!=
null
)
{
int
sbdkjg
=
0
;
Long
time
=
(
repaappr
.
getCardrepltime
()
-
starttime3
)/
1000
/
60
;
if
(
time
>
0
){
//上班1打卡结果
sbdkjg
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
Double
gzsctime
=
null
;
//工作时长
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
sbdk3
(
repaappr
.
getCardrepltime
()).
sbdk3jg
(
sbdkjg
).
gzsc
(
gzsctime
).
build
().
updateById
();
}
}
else
if
(
repaappr
.
getCardreplperiod
()
==
2
)
{
boolean
xb3
=
verification_range
(
endtime3ks
,
endtime3js
,
repaappr
.
getCardrepltime
());
if
(
xb3
&&
dkmc
.
getXbdk3
()
!=
null
)
{
int
xbdk3jg
=
0
;
Long
time
=
(
repaappr
.
getCardrepltime
()
-
endtime3
)/
1000
/
60
;
if
(
time
>
0
){}
else
{
xbdk3jg
=
Math
.
abs
(
Integer
.
valueOf
(
time
.
toString
()));
}
Double
gzsctime
=
null
;
//工作时长
KqglAssoDkmx
.
builder
().
id
(
dkmc
.
getId
()).
xbdk3
(
repaappr
.
getCardrepltime
()).
xbdk3jg
(
xbdk3jg
).
gzsc
(
gzsctime
).
build
().
updateById
();
}
}
}
}
}
}
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
true
;
}
public
boolean
verification_range
(
long
punchstart
,
long
punchend
,
long
time_
)
{
boolean
isRange
=
true
;
String
staputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
punchstart
);
//应打卡开始时间
String
entputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
punchend
);
//应打卡结束时间
String
DKputime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
).
format
(
time_
);
//打卡时间
boolean
effectiveDate
=
ClockInTool
.
hourMinuteBetween
(
DKputime
,
staputime
,
entputime
,
"yyyy-MM-dd HH:mm"
);
if
(!
effectiveDate
)
{
System
.
out
.
println
(
"当前打卡时间不在范围内"
);
isRange
=
false
;
}
return
isRange
;
}
}
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