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
3033eb27
Commit
3033eb27
authored
Jun 30, 2020
by
yuquan.zhu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of develop-gitlab.youlingrc.com:8timerv2/8timerapiv200 into zyq_debug
parents
a4965f12
6ea9837e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
6 deletions
+90
-6
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/atttimer/AttendanceTaskTiming.java
+1
-1
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 @
3033eb27
...
@@ -657,6 +657,19 @@ public class ClockInTool {
...
@@ -657,6 +657,19 @@ public class ClockInTool {
res
=
simpleDateFormat
.
format
(
date
);
res
=
simpleDateFormat
.
format
(
date
);
return
res
;
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
);
}
}
}
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
3033eb27
...
@@ -3322,4 +3322,73 @@ public class TimeCardController {
...
@@ -3322,4 +3322,73 @@ public class TimeCardController {
return
ResultUtil
.
data
(
msg
,
"操作成功!"
);
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
,
"操作成功!"
);
}
}
}
src/main/java/cn/timer/api/controller/kqgl/atttimer/AttendanceTaskTiming.java
View file @
3033eb27
...
@@ -109,7 +109,7 @@ public class AttendanceTaskTiming{
...
@@ -109,7 +109,7 @@ public class AttendanceTaskTiming{
// @Scheduled(cron = "0 22 15 * * ?") // 测试:5秒执行一次 0 0 19 * * ?
// @Scheduled(cron = "0 22 15 * * ?") // 测试:5秒执行一次 0 0 19 * * ?
// @Scheduled(cron = "0 */5 * * * ?")
// @Scheduled(cron = "0 */5 * * * ?")
@Scheduled
(
cron
=
"0 0
19 * * ?"
)
// @Scheduled(cron = "0 3
19 * * ?")
public
void
AttendanceTask
()
throws
ParseException
{
public
void
AttendanceTask
()
throws
ParseException
{
// boolean implement = false;
// boolean implement = false;
...
...
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
View file @
3033eb27
...
@@ -213,11 +213,13 @@ public class KqglServiceImpl implements KqglService {
...
@@ -213,11 +213,13 @@ public class KqglServiceImpl implements KqglService {
BigDecimal
num4
=
new
BigDecimal
(
time3
);
BigDecimal
num4
=
new
BigDecimal
(
time3
);
double
shift_duration
=
ClockInTool
.
round
(
num3
.
add
(
num4
).
doubleValue
());
//班次时长
double
shift_duration
=
ClockInTool
.
round
(
num3
.
add
(
num4
).
doubleValue
());
//班次时长
BigDecimal
num5
=
new
BigDecimal
(
duration
);
if
(
shift_duration
>
0
)
{
BigDecimal
num6
=
new
BigDecimal
(
shift_duration
);
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
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
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