Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
faba45d9
Commit
faba45d9
authored
Oct 10, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改导出
parent
b09390cd
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
25 deletions
+80
-25
ExcelUtil.java
.../java/com/yeejoin/equipmanage/common/utils/ExcelUtil.java
+25
-9
FileHelper.java
...java/com/yeejoin/equipmanage/common/utils/FileHelper.java
+6
-3
FileHelper.java
...m/yeejoin/amos/latentdanger/business/util/FileHelper.java
+6
-3
FileHelper.java
...om/yeejoin/amos/maintenance/business/util/FileHelper.java
+9
-2
PlanTaskController.java
...n/amos/patrol/business/controller/PlanTaskController.java
+22
-2
FileHelper.java
...ava/com/yeejoin/amos/patrol/business/util/FileHelper.java
+6
-3
FileHelper.java
...om/yeejoin/amos/supervision/business/util/FileHelper.java
+6
-3
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/ExcelUtil.java
View file @
faba45d9
...
...
@@ -6,6 +6,7 @@ import java.io.FileNotFoundException;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -185,12 +186,19 @@ public class ExcelUtil
{
try
{
String
name
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859_1"
);
//
String name = new String(fileName.getBytes("UTF-8"), "ISO8859_1");
OutputStream
output
=
response
.
getOutputStream
();
// response.reset();
response
.
setHeader
(
"Content-disposition"
,
"attachment; filename="
+
name
);
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
// response.setHeader("Content-disposition",
// "attachment; filename=" + name);
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
workbook
.
write
(
output
);
output
.
flush
();
output
.
close
();
...
...
@@ -219,11 +227,19 @@ public class ExcelUtil
{
try
{
String
name
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859_1"
);
//
String name = new String(fileName.getBytes("UTF-8"), "ISO8859_1");
OutputStream
output
=
response
.
getOutputStream
();
response
.
setHeader
(
"Content-disposition"
,
"attachment; filename="
+
name
);
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
// response.setHeader("Content-disposition",
// "attachment; filename=" + name);
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
FileInputStream
inputStream
=
new
FileInputStream
(
file
);
int
b
=
0
;
byte
[]
buffer
=
new
byte
[
1024
*
10
];
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/FileHelper.java
View file @
faba45d9
...
...
@@ -865,11 +865,14 @@ public class FileHelper {
private
static
void
downLoadExcel
(
String
fileName
,
HttpServletResponse
response
,
Workbook
workbook
)
{
try
{
String
name
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859_1"
);
// String name = new String(fileName.getBytes("UTF-8"), "ISO8859_1");
// response.setHeader("content-Type", "application/vnd.ms-excel");
// response.setHeader("Content-Disposition",
// "attachment;filename=" + name);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
name
);
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
workbook
.
write
(
response
.
getOutputStream
());
}
catch
(
IOException
e
)
{
throw
new
BaseException
(
e
.
getMessage
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/util/FileHelper.java
View file @
faba45d9
...
...
@@ -893,11 +893,14 @@ public static void exportExcel(List<Map<String, Object>> list, String fileName,
private
static
void
downLoadExcel
(
String
fileName
,
HttpServletResponse
response
,
Workbook
workbook
)
{
try
{
String
name
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859_1"
);
// String name = new String(fileName.getBytes("UTF-8"), "ISO8859_1");
// response.setHeader("content-Type", "application/vnd.ms-excel");
// response.setHeader("Content-Disposition",
// "attachment;filename=" + name);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
name
);
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
workbook
.
write
(
response
.
getOutputStream
());
}
catch
(
IOException
e
)
{
throw
new
YeeException
(
e
.
getMessage
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/util/FileHelper.java
View file @
faba45d9
...
...
@@ -869,10 +869,17 @@ public static void exportExcel(List<Map<String, Object>> list, String fileName,
private
static
void
downLoadExcel
(
String
fileName
,
HttpServletResponse
response
,
Workbook
workbook
)
{
try
{
String
name
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859_1"
);
// String name = new String(fileName.getBytes("UTF-8"), "ISO8859_1");
// response.setHeader("content-Type", "application/vnd.ms-excel");
// response.setHeader("Content-Disposition",
// "attachment;filename=" + name);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
name
);
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
workbook
.
write
(
response
.
getOutputStream
());
}
catch
(
IOException
e
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/PlanTaskController.java
View file @
faba45d9
...
...
@@ -236,13 +236,33 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation
(
value
=
"执行计划导出"
,
notes
=
"执行计划导出"
)
@GetMapping
(
value
=
"/reportPlanTaskNew"
,
produces
=
"application/vnd.ms-excel;charset=UTF-8"
)
public
void
planTaskReportNew
(
@ApiParam
(
value
=
"导出参数"
,
required
=
false
)
@RequestBody
(
required
=
false
)
PlanTaskPageParam
params
,
@ApiParam
(
value
=
"导出参数"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
pointNo
,
@RequestParam
(
required
=
false
)
String
pointName
,
@RequestParam
(
required
=
false
)
String
beginDate
,
@RequestParam
(
required
=
false
)
String
endDate
,
@RequestParam
(
required
=
false
)
String
status
,
@RequestParam
(
required
=
false
)
String
planId
,
@RequestParam
(
required
=
false
)
String
routeId
,
@RequestParam
(
required
=
false
)
List
<
String
>
ids
,
HttpServletResponse
response
)
{
try
{
PlanTaskPageParam
paramsk
=
new
PlanTaskPageParam
();
PlanTaskPageParam
params
=
new
PlanTaskPageParam
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
params
.
setBizOrgCode
(
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
());
params
.
setPointNo
(
pointNo
);
params
.
setPointName
(
pointName
);
params
.
setBeginDate
(
beginDate
);
params
.
setEndDate
(
endDate
);
params
.
setStatus
(
status
);
params
.
setPlanId
(
planId
);
params
.
setRouteId
(
routeId
);
params
.
setIds
(
ids
);
List
<
PlanTaskVo
>
list
=
planTaskService
.
planTaskReportNew
(
params
);
String
fileName
=
"计划执行"
+
new
Date
().
getTime
();
FileHelper
.
exportExcel
(
list
,
"计划执行"
,
"计划执行"
,
PlanTaskVo
.
class
,
fileName
+
".xls"
,
response
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/util/FileHelper.java
View file @
faba45d9
...
...
@@ -870,11 +870,14 @@ public static void exportExcel(List<Map<String, Object>> list, String fileName,
private
static
void
downLoadExcel
(
String
fileName
,
HttpServletResponse
response
,
Workbook
workbook
)
{
try
{
String
name
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859_1"
);
// String name = new String(fileName.getBytes("UTF-8"), "ISO8859_1");
// response.setHeader("content-Type", "application/vnd.ms-excel");
// response.setHeader("Content-Disposition",
// "attachment;filename=" + name);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
name
);
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
workbook
.
write
(
response
.
getOutputStream
());
}
catch
(
IOException
e
)
{
throw
new
YeeException
(
e
.
getMessage
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/util/FileHelper.java
View file @
faba45d9
...
...
@@ -868,11 +868,14 @@ public static void exportExcel(List<Map<String, Object>> list, String fileName,
private
static
void
downLoadExcel
(
String
fileName
,
HttpServletResponse
response
,
Workbook
workbook
)
{
try
{
String
name
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859_1"
);
// String name = new String(fileName.getBytes("UTF-8"), "ISO8859_1");
// response.setHeader("content-Type", "application/vnd.ms-excel");
// response.setHeader("Content-Disposition",
// "attachment;filename=" + name);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
name
);
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
workbook
.
write
(
response
.
getOutputStream
());
}
catch
(
IOException
e
)
{
throw
new
YeeException
(
e
.
getMessage
());
...
...
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