Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
work2
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢春璐
work2
Commits
d4ad2bb3
Commit
d4ad2bb3
authored
Oct 10, 2018
by
谢春璐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
12a5c28b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
16 deletions
+43
-16
src/main/java/com/zanchina/check/domain/Staff.java
+5
-0
src/main/java/com/zanchina/check/domain/WorkCheck.java
+5
-0
src/main/java/com/zanchina/check/service/impl/FileServiceImpl.java
+25
-7
src/main/resources/static/css/bootstrap.min.css
+0
-0
src/main/resources/static/index.html
+8
-9
src/main/resources/static/js/bootstrap.min.js
+0
-0
No files found.
src/main/java/com/zanchina/check/domain/Staff.java
View file @
d4ad2bb3
...
...
@@ -21,6 +21,11 @@ public class Staff {
private
String
name
;
/**
* 部门
*/
private
String
department
;
/**
* 出勤列表
*/
private
List
<
WorkCheck
>
workCheckList
=
new
ArrayList
<>();
...
...
src/main/java/com/zanchina/check/domain/WorkCheck.java
View file @
d4ad2bb3
...
...
@@ -31,6 +31,11 @@ public class WorkCheck {
private
String
state
;
/**
* 审批
*/
private
String
approve
=
""
;
/**
* 出勤时长(小时为单位)
*/
private
Double
duration
;
...
...
src/main/java/com/zanchina/check/service/impl/FileServiceImpl.java
View file @
d4ad2bb3
...
...
@@ -48,6 +48,8 @@ public class FileServiceImpl implements FileService {
staff
.
setName
(
entry
.
getKey
());
entry
.
getValue
().
forEach
(
col
->
{
staff
.
setDepartment
(
col
[
3
]);
WorkCheck
workCheck
=
new
WorkCheck
();
workCheck
.
setDate
(
col
[
0
]);
workCheck
.
setOnTime
(
col
[
0
].
concat
(
" "
).
concat
(
col
[
4
]));
...
...
@@ -81,6 +83,8 @@ public class FileServiceImpl implements FileService {
staff
.
setName
(
entry
.
getKey
());
entry
.
getValue
().
forEach
(
col
->
{
staff
.
setDepartment
(
col
[
3
]);
WorkCheck
workCheck
=
new
WorkCheck
();
workCheck
.
setDate
(
col
[
0
]);
if
(
col
[
11
].
contains
(
"--"
))
{
...
...
@@ -95,6 +99,7 @@ public class FileServiceImpl implements FileService {
workCheck
.
setOffTime
(
col
[
0
].
concat
(
" "
).
concat
(
col
[
14
]));
}
workCheck
.
setState
(
caculateWorkState
(
workCheck
));
workCheck
.
setApprove
(
col
[
7
].
contains
(
"--"
)
?
""
:
col
[
7
]);
staff
.
getWorkCheckList
().
add
(
workCheck
);
});
...
...
@@ -186,7 +191,8 @@ public class FileServiceImpl implements FileService {
entry
.
getValue
().
entrySet
().
forEach
(
entry2
->
{
List
<
Date
>
dateList
=
entry2
.
getValue
().
stream
().
map
(
e
->
DateUtils
.
parseDate
(
e
[
4
].
concat
(
" "
).
concat
(
e
[
5
])))
List
<
Date
>
dateList
=
entry2
.
getValue
().
stream
()
.
map
(
e
->
DateUtils
.
parseDate
(
e
[
4
].
concat
(
" "
).
concat
(
e
[
5
])))
.
collect
(
Collectors
.
toList
());
WorkCheck
workCheck
=
new
WorkCheck
();
...
...
@@ -269,6 +275,7 @@ public class FileServiceImpl implements FileService {
List
<
WorkCheck
>
workChecks
=
new
ArrayList
<>();
value
.
forEach
(
s
->
{
staff
.
setDepartment
(
s
.
getDepartment
());
workChecks
.
addAll
(
s
.
getWorkCheckList
());
}
);
...
...
@@ -288,6 +295,11 @@ public class FileServiceImpl implements FileService {
w
.
setOffTime
(
offTime
);
w
.
setDate
(
entry
.
getKey
());
w
.
setState
(
caculateWorkState
(
w
));
List
<
WorkCheck
>
approveList
=
singleDateWorkCheck
.
stream
()
.
filter
(
wc
->
StringUtils
.
isNotBlank
(
wc
.
getApprove
()))
.
collect
(
Collectors
.
toList
());
w
.
setApprove
(
approveList
.
size
()
>
0
?
approveList
.
get
(
0
).
getApprove
()
:
""
);
newWorkCheckList
.
add
(
w
);
});
...
...
@@ -296,7 +308,7 @@ public class FileServiceImpl implements FileService {
newStaffList
.
add
(
staff
);
});
newStaffList
.
sort
(
Comparator
.
comparing
(
Staff:
:
get
Name
));
newStaffList
.
sort
(
Comparator
.
comparing
(
Staff:
:
get
Department
));
return
newStaffList
;
}
...
...
@@ -344,7 +356,7 @@ public class FileServiceImpl implements FileService {
for
(
String
title
:
titleList
)
{
if
(
"姓名"
.
equalsIgnoreCase
(
title
))
{
d
[
0
]
=
staff
.
getName
();
d
[
0
]
=
staff
.
getName
()
.
concat
(
"("
).
concat
(
staff
.
getDepartment
()).
concat
(
")"
)
;
}
else
{
int
index
=
titleList
.
indexOf
(
title
);
boolean
isExist
=
false
;
...
...
@@ -357,9 +369,14 @@ public class FileServiceImpl implements FileService {
if
(
title
.
substring
(
0
,
title
.
indexOf
(
"("
)).
equalsIgnoreCase
(
DateUtils
.
format
(
DateUtils
.
parseDate
(
check
.
getDate
()),
DateUtils
.
yyyyMMdd
)))
{
isExist
=
true
;
String
detail
=
""
;
if
(!
isWeekend
)
{
detail
=
check
.
getState
();
detail
=
check
.
getState
().
concat
(
","
).
concat
(
check
.
getApprove
());
}
if
(
isExist
&&
isWeekend
)
{
detail
=
"加班"
;
}
d
[
index
]
=
detail
.
concat
(
"("
)
...
...
@@ -370,15 +387,16 @@ public class FileServiceImpl implements FileService {
new
BigDecimal
(
check
.
getDuration
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
.
doubleValue
()))
.
concat
(
")"
));
isExist
=
true
;
}
}
if
(!
isExist
)
{
if
(!
isWeekend
)
{
d
[
index
]
=
"无
考勤
记录"
;
d
[
index
]
=
"无记录"
;
}
else
{
d
[
index
]
=
""
;
d
[
index
]
=
"
未加班
"
;
}
}
}
...
...
src/main/resources/static/css/bootstrap.min.css
0 → 100644
View file @
d4ad2bb3
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/main/resources/static/index.html
View file @
d4ad2bb3
<!DOCTYPE html>
<html
lang=
"zh-CN"
>
<head>
<link
rel=
"stylesheet"
href=
"https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity=
"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin=
"anonymous"
>
<link
rel=
"stylesheet"
href=
"css/bootstrap.min.css"
>
<script
src=
"js/bootstrap.min.js"
></script>
<meta
charset=
"UTF-8"
>
<title>
考勤
</title>
</head>
...
...
@@ -14,10 +13,10 @@
<div
class=
"row align-items-center"
>
<table
class=
"table table-bordered"
>
<tbody>
<tr>
<
!--<
tr>
<th scope="row">打卡机考勤记录:</th>
<td><input type="file" name="file"/></td>
</tr>
</tr>
-->
<tr>
<th
scope=
"row"
>
企业微信上下班打卡记录:
</th>
<td><input
type=
"file"
name=
"file"
/></td>
...
...
@@ -26,10 +25,10 @@
<th
scope=
"row"
>
企业微信外出打卡记录:
</th>
<td><input
type=
"file"
name=
"file"
/></td>
</tr>
<
tr
>
<th
scope=
"row"
>
钉钉打卡记录:
</th
>
<td><input
type=
"file"
name=
"file"
/></td
>
<
/tr
>
<
!--<tr>--
>
<!--<th scope="row">钉钉打卡记录:</th>--
>
<!--<td><input type="file" name="file"/></td>--
>
<
!--</tr>--
>
</tbody>
</table>
...
...
src/main/resources/static/js/bootstrap.min.js
0 → 100644
View file @
d4ad2bb3
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