Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
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
reyun
manager
Commits
dded1b8a
Commit
dded1b8a
authored
Jun 03, 2020
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
15d5a916
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
ContractController.java
src/main/java/common/controller/ContractController.java
+9
-11
No files found.
src/main/java/common/controller/ContractController.java
View file @
dded1b8a
...
...
@@ -23,10 +23,7 @@ import util.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStreamWriter
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.net.URLEncoder
;
import
java.text.DecimalFormat
;
...
...
@@ -466,7 +463,7 @@ public class ContractController {
}
}
OutputStream
Writer
osw
=
null
;
OutputStream
os
=
null
;
String
fileName
=
"分摊收入报表("
+
new
DateTime
(
startDate
).
toString
(
"yyyyMMdd"
)
+
"_"
+
new
DateTime
(
endDate
).
toString
(
"yyyyMMdd"
)
+
").csv"
;
...
...
@@ -476,16 +473,17 @@ public class ContractController {
response
.
setHeader
(
"content-disposition"
,
"attachment; filename="
+
fileName
);
response
.
setHeader
(
"Content-Type"
,
"text/csv"
);
response
.
setContentType
(
"APPLICATION/OCTET-STREAM"
);
osw
=
new
OutputStreamWriter
(
response
.
getOutputStream
(),
"UTF-8"
);
// osw.write(new String(new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF})+"\n");
osw
.
write
(
sb
.
toString
());
osw
.
flush
();
response
.
setCharacterEncoding
(
"UTF-8"
);
os
=
response
.
getOutputStream
();
os
.
write
(
new
byte
[]{(
byte
)
0xEF
,
(
byte
)
0xBB
,
(
byte
)
0xBF
});
os
.
write
(
sb
.
toString
().
getBytes
(
"UTF-8"
));
os
.
flush
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"导出分摊收入报错"
,
e
);
}
finally
{
if
(
os
w
!=
null
)
{
if
(
os
!=
null
)
{
try
{
os
w
.
close
();
os
.
close
();
}
catch
(
IOException
e
)
{
logger
.
error
(
"导出分摊收入关闭流报错"
,
e
);
}
...
...
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