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
9c5b0a8f
Commit
9c5b0a8f
authored
4 years ago
by
lal
Committed by
chenzg
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
4d8b4ec9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
5 deletions
+89
-5
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
+14
-1
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+69
-0
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
+6
-4
No files found.
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
View file @
9c5b0a8f
...
...
@@ -657,6 +657,19 @@ public class ClockInTool {
res
=
simpleDateFormat
.
format
(
date
);
return
res
;
}
public
static
String
Str_Time_formatting
(
String
str
,
String
Format
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
Format
);
// String str = "2020-06-30 12:30:35"; // 把带时分秒的 date 转为 yyyy-MM-dd 格式的字符串
Date
date2
=
null
;
try
{
date2
=
sdf
.
parse
(
str
);
// 把上面的字符串解析为日期类型
// System.out.println(sdf.format(date2));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
sdf
.
format
(
date2
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
9c5b0a8f
...
...
@@ -3322,4 +3322,73 @@ public class TimeCardController {
return
ResultUtil
.
data
(
msg
,
"操作成功!"
);
}
@GetMapping
(
value
=
"/overtime_verification/{workovertimetype}/{starttime}/{endtime}"
)
@ApiOperation
(
value
=
"加班验证"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
Overtime_verification
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
"workovertimetype"
)
Integer
workovertimetype
,
@PathVariable
(
"starttime"
)
String
starttime
,
@PathVariable
(
"endtime"
)
String
endtime
)
{
String
msg
=
""
;
//workovertimetype:1=工作日加班 2=休息日加班 3=节假日加班
Integer
ending
=
0
;
String
starttime_
=
ClockInTool
.
Str_Time_formatting
(
starttime
,
"yyyy-MM-dd"
);
String
endtime_
=
ClockInTool
.
Str_Time_formatting
(
endtime
,
"yyyy-MM-dd"
);
if
((
starttime_
).
equals
(
endtime_
))
{
try
{
AttendanceCardListDto
attdate
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
starttime_
);
//获取当天所打卡班次
List
<
AttSchedule
>
ashss
=
attdate
.
getAttsch
();
//获取今天应打卡时间
if
(
EmptyUtil
.
isNotEmpty
(
attdate
.
getAttsch
()))
{
//班次不为空
if
(
ashss
.
get
(
0
).
getId
()
!=
0
)
{
//工作日
ending
=
1
;
}
else
{
//休息
ending
=
2
;
}
}
else
{
//未排班
ending
=
99
;
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
else
{
//不同日期
try
{
AttendanceCardListDto
attdateone
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
starttime_
);
//获取当天所打卡班次
AttendanceCardListDto
attdatetwo
=
MethodCall
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
endtime_
);
//获取当天所打卡班次
List
<
AttSchedule
>
ashone
=
attdateone
.
getAttsch
();
//获取今天应打卡时间
List
<
AttSchedule
>
ashtwo
=
attdatetwo
.
getAttsch
();
//获取今天应打卡时间
if
(
EmptyUtil
.
isNotEmpty
(
attdateone
.
getAttsch
())
&&
EmptyUtil
.
isNotEmpty
(
attdatetwo
.
getAttsch
()))
{
//班次不为空
if
(
ashone
.
get
(
0
).
getId
()
!=
0
&&
ashtwo
.
get
(
0
).
getId
()
!=
0
)
{
//工作日
ending
=
1
;
}
else
{
//休息
ending
=
2
;
}
}
else
{
//未排班
ending
=
99
;
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
if
(
ending
!=
workovertimetype
)
{
//所选日期范围与加班类型不匹配,请重新选择
msg
=
"所选日期范围与加班类型不匹配,请重新选择"
;
}
if
(
ending
==
99
)
{
//所选日期范围暂无排班,请联系管理员
msg
=
"所选日期范围暂无排班,请联系管理员"
;
}
return
ResultUtil
.
data
(
msg
,
"操作成功!"
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
View file @
9c5b0a8f
...
...
@@ -213,11 +213,13 @@ public class KqglServiceImpl implements KqglService {
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
);
if
(
shift_duration
>
0
)
{
BigDecimal
num5
=
new
BigDecimal
(
duration
);
BigDecimal
num6
=
new
BigDecimal
(
shift_duration
);
//加班时长/班次的工作时长=调休天数
duration
=
num5
.
divide
(
num6
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
//加班时长/班次的工作时长=调休天数
duration
=
num5
.
divide
(
num6
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
...
...
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