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
3b1e4853
Commit
3b1e4853
authored
Jun 29, 2020
by
lal
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
58103ff6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
+4
-0
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
+54
-0
No files found.
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
View file @
3b1e4853
...
...
@@ -23,6 +23,10 @@ public class ClockInTool {
static
SimpleDateFormat
famt
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
public
static
double
round
(
double
value
){
return
Math
.
round
(
value
*
100
)/
100.0
;
}
/**
* 判断某个字符串是否存在于数组中
* @param stringArray 原数组
...
...
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
View file @
3b1e4853
package
cn
.
timer
.
api
.
controller
.
kqgl
.
service
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
@@ -135,6 +136,7 @@ public class KqglServiceImpl implements KqglService {
modifynumber
=
balan
.
getModifyNumber
()+
1
;
}
KqglAssoYhkqz
yhd
=
KqglAssoYhkqz
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoYhkqz
>().
lambda
().
eq
(
KqglAssoYhkqz:
:
getUserid
,
overappr
.
getUserid
()).
eq
(
KqglAssoYhkqz:
:
getQyid
,
overappr
.
getOrgcode
()));
if
(
yhd
!=
null
)
{
KqglAssoOvertimeRange
timeran
=
KqglAssoOvertimeRange
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoOvertimeRange
>().
lambda
().
eq
(
KqglAssoOvertimeRange:
:
getAttgroupId
,
yhd
.
getKqzid
()));
...
...
@@ -171,6 +173,58 @@ public class KqglServiceImpl implements KqglService {
}
}
//调休单位是“天”时 按照=》加班时长/班次的工作时长=调休天数
if
(
learul
.
getCompany
()
==
1
)
{
try
{
AttendanceCardListDto
attdate
=
MethodCall
(
overappr
.
getOrgcode
(),
overappr
.
getUserid
(),
startdate
);
//获取当天打卡班次信息
long
starttime1
=
0
,
endtime1
=
0
,
starttime2
=
0
,
endtime2
=
0
,
starttime3
=
0
,
endtime3
=
0
;
double
time1
=
0
,
time2
=
0
,
time3
=
0
;
BigDecimal
num0
=
new
BigDecimal
(
60
);
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
()))
{
//班次不为空
List
<
AttSchedule
>
ash
=
attdate
.
getAttsch
();
//获取当天应打卡时间
if
(
attdate
.
getAttsch
().
size
()
==
2
||
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
starttime1
=
ash
.
get
(
0
).
getTime
();
endtime1
=
ash
.
get
(
1
).
getTime
();
BigDecimal
num
=
new
BigDecimal
((
endtime1
-
starttime1
)/
1000
/
60
);
time1
=
num
.
divide
(
num0
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
if
(
attdate
.
getAttsch
().
size
()
==
4
||
attdate
.
getAttsch
().
size
()
==
6
)
{
starttime2
=
ash
.
get
(
2
).
getTime
();
endtime2
=
ash
.
get
(
3
).
getTime
();
BigDecimal
num
=
new
BigDecimal
((
endtime2
-
starttime2
)/
1000
/
60
);
time2
=
num
.
divide
(
num0
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
if
(
attdate
.
getAttsch
().
size
()
==
6
)
{
starttime3
=
ash
.
get
(
4
).
getTime
();
endtime3
=
ash
.
get
(
5
).
getTime
();
BigDecimal
num
=
new
BigDecimal
((
endtime3
-
starttime3
)/
1000
/
60
);
time3
=
num
.
divide
(
num0
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
}
BigDecimal
num1
=
new
BigDecimal
(
time1
);
BigDecimal
num2
=
new
BigDecimal
(
time2
);
BigDecimal
num3
=
num1
.
add
(
num2
);
BigDecimal
num4
=
new
BigDecimal
(
time3
);
double
shift_duration
=
ClockInTool
.
round
(
num3
.
add
(
num4
).
doubleValue
());
//班次时长
BigDecimal
num5
=
new
BigDecimal
(
duration
);
BigDecimal
num6
=
new
BigDecimal
(
shift_duration
);
//加班时长/班次的工作时长=调休天数
duration
=
num5
.
divide
(
num6
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
KqglAssoLeaveBalance
.
builder
().
leaveRulesId
(
learul
.
getId
()).
userid
(
overappr
.
getUserid
()).
modifyAction
(
2
).
balanceDays
(
"+"
+
duration
)
.
reason
(
"考勤加班审批"
).
modifyUserid
(
emp
.
getEmpNum
()).
modifyTimer
(
overappr
.
getStarttime
()).
orgCode
(
emp
.
getOrgCode
()).
isAutomatic
(
1
).
modifyNumber
(
modifynumber
).
build
().
insert
();
//员工假期余额
...
...
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