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
2d6c5e36
Commit
2d6c5e36
authored
6 years ago
by
谢春璐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
436d473d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
src/main/java/com/zanchina/check/controller/FileController.java
+8
-2
src/main/java/com/zanchina/check/domain/Staff.java
+1
-1
src/main/java/com/zanchina/check/service/impl/FileServiceImpl.java
+1
-1
No files found.
src/main/java/com/zanchina/check/controller/FileController.java
View file @
2d6c5e36
...
@@ -9,8 +9,10 @@ import java.io.InputStream;
...
@@ -9,8 +9,10 @@ import java.io.InputStream;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
...
@@ -48,13 +50,14 @@ public class FileController {
...
@@ -48,13 +50,14 @@ public class FileController {
List
<
Staff
>
staffList
=
new
ArrayList
<>();
List
<
Staff
>
staffList
=
new
ArrayList
<>();
files
=
files
.
stream
().
filter
(
f
->
StringUtils
.
isNotBlank
(
f
.
getOriginalFilename
())).
collect
(
Collectors
.
toList
());
files
.
forEach
(
file
->
{
files
.
forEach
(
file
->
{
try
{
try
{
InputStream
inputStream
=
file
.
getInputStream
();
InputStream
inputStream
=
file
.
getInputStream
();
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
ExcelData
data
=
null
;
ExcelData
data
=
null
;
List
<
Staff
>
staffs
=
null
;
List
<
Staff
>
staffs
=
new
ArrayList
<>(
0
)
;
if
(
fileName
.
contains
(
"上下班打卡_日报"
))
{
if
(
fileName
.
contains
(
"上下班打卡_日报"
))
{
data
=
inst
.
parse
(
inputStream
,
fileName
,
false
,
2
);
data
=
inst
.
parse
(
inputStream
,
fileName
,
false
,
2
);
...
@@ -78,10 +81,13 @@ public class FileController {
...
@@ -78,10 +81,13 @@ public class FileController {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
try
{
try
{
e
.
printStackTrace
();
response
.
getWriter
().
print
(
e
.
getMessage
());
response
.
getWriter
().
print
(
e
.
getMessage
());
}
catch
(
IOException
e2
)
{
}
catch
(
IOException
e2
)
{
return
null
;
e2
.
printStackTrace
()
;
}
}
e
.
printStackTrace
();
}
}
return
null
;
return
null
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/zanchina/check/domain/Staff.java
View file @
2d6c5e36
...
@@ -13,7 +13,7 @@ public class Staff {
...
@@ -13,7 +13,7 @@ public class Staff {
/**
/**
* 考勤号
* 考勤号
*/
*/
private
Integer
id
;
private
String
id
;
/**
/**
* 员工名
* 员工名
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/zanchina/check/service/impl/FileServiceImpl.java
View file @
2d6c5e36
...
@@ -133,7 +133,7 @@ public class FileServiceImpl implements FileService {
...
@@ -133,7 +133,7 @@ public class FileServiceImpl implements FileService {
map
.
entrySet
().
forEach
(
entry
->
{
map
.
entrySet
().
forEach
(
entry
->
{
Staff
staff
=
new
Staff
();
Staff
staff
=
new
Staff
();
staff
.
setId
(
Integer
.
valueOf
(
entry
.
getKey
()
));
staff
.
setId
(
entry
.
getKey
(
));
entry
.
getValue
().
entrySet
().
forEach
(
entry2
->
{
entry
.
getValue
().
entrySet
().
forEach
(
entry2
->
{
...
...
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